Unnamed: 0
int64
0
7.36k
comments
stringlengths
3
35.2k
code_string
stringlengths
1
527k
code
stringlengths
1
527k
__index_level_0__
int64
0
88.6k
236
// Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. Tokens start existing when they are minted (`_mint`),and stop existing when they are burned (`_burn`). /
function _exists(uint256 tokenId) internal view virtual returns (bool) { return _tokenOwners.contains(tokenId); }
function _exists(uint256 tokenId) internal view virtual returns (bool) { return _tokenOwners.contains(tokenId); }
417
7
// brews tokens created per block.
uint256 public rewardPerBlock;
uint256 public rewardPerBlock;
7,814
1
// The `sellTokenAddress` field from the API response.
IERC20 sellToken,
IERC20 sellToken,
45,097
21
// Because of the previous require, we know that if msg.sender != withdrawer then currentAllowance >= shares
_setAllowance(withdrawer, msg.sender, currentAllowance - shares);
_setAllowance(withdrawer, msg.sender, currentAllowance - shares);
52,289
249
// CurveGaugeV2RewardsHandlerBase Contract/Enzyme Council <[email protected]>/Base contract for handling claiming and reinvesting rewards for a Curve pool/ that uses the LiquidityGaugeV2 contract
abstract contract CurveGaugeV2RewardsHandlerBase is CurveGaugeV2ActionsMixin { using AddressArrayLib for address[]; address private immutable CURVE_GAUGE_V2_REWARDS_HANDLER_CRV_TOKEN; address private immutable CURVE_GAUGE_V2_REWARDS_HANDLER_MINTER; constructor(address _minter, address _crvToken) publi...
abstract contract CurveGaugeV2RewardsHandlerBase is CurveGaugeV2ActionsMixin { using AddressArrayLib for address[]; address private immutable CURVE_GAUGE_V2_REWARDS_HANDLER_CRV_TOKEN; address private immutable CURVE_GAUGE_V2_REWARDS_HANDLER_MINTER; constructor(address _minter, address _crvToken) publi...
83,848
12
// Value (subprotocol NFT ID) for primary type
uint256 primary;
uint256 primary;
12,985
62
// TokenMintERC20MintableTokenMintable ERC20 token with burning and optional functions implemented.Any address with minter role can mint new tokens.For full specification of ERC-20 standard see: /
contract TokenMintERC20MintableToken is ERC20Mintable { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Constructor. * @param name name of the token * @param symbol symbol of the token, 3-4 chars is recommended * @param decimals number of decimal p...
contract TokenMintERC20MintableToken is ERC20Mintable { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Constructor. * @param name name of the token * @param symbol symbol of the token, 3-4 chars is recommended * @param decimals number of decimal p...
11,966
336
// Emitted when an attester is disabled attester newly disabled attester /
event AttesterDisabled(address indexed attester);
event AttesterDisabled(address indexed attester);
2,081
63
// 거리 계산 (재전투 시 중복 계산을 방지하기 위해 여기서 계산합니다.)
uint distance = (params1[i] < params3[i] ? params3[i] - params1[i] : params1[i] - params3[i]) + (params2[i] < params4[i] ? params4[i] - params2[i] : params2[i] - params4[i]); record.enemy = armyManager.getPositionOwner(params3[i], params4[i]); moveAndAttack(params1[i], params2[i], params3[i], para...
uint distance = (params1[i] < params3[i] ? params3[i] - params1[i] : params1[i] - params3[i]) + (params2[i] < params4[i] ? params4[i] - params2[i] : params2[i] - params4[i]); record.enemy = armyManager.getPositionOwner(params3[i], params4[i]); moveAndAttack(params1[i], params2[i], params3[i], para...
3,591
6
// Initializer that marks the contract as initialized.It is important to run this if you had deployed a previous version of a Migratable contract. /
function initialize() isInitializer("Migratable", "1.2.1") public { }
function initialize() isInitializer("Migratable", "1.2.1") public { }
19,364
133
// See {AbstractBridgeAgent} documentation for some core concepts description./ Initializes the agent /
constructor(address _bridgeSigner, address payable _treasurer) AbstractBridgeAgent(_bridgeSigner, _treasurer)
constructor(address _bridgeSigner, address payable _treasurer) AbstractBridgeAgent(_bridgeSigner, _treasurer)
52,354
1
// prevent anyone else.
return 99;
return 99;
12,524
171
// Total number of tokens used as collateral in circulation. /
uint256 public totalCollateralTokens;
uint256 public totalCollateralTokens;
22,916
89
// Pauses transactions./Callable only by the founder./Callable only when the contract is not paused./ return success
function pause() public onlyFounder whenNotPaused returns (bool success) { // Set pause paused = true; // See {event Pause} emit Pause(); // Returns true on success. return true; }
function pause() public onlyFounder whenNotPaused returns (bool success) { // Set pause paused = true; // See {event Pause} emit Pause(); // Returns true on success. return true; }
4,792
12
// send won Dogs to tresury
function transferDog(uint256 dogId) external { dogs.transferFrom(address(this), treasury, dogId); }
function transferDog(uint256 dogId) external { dogs.transferFrom(address(this), treasury, dogId); }
48,370
37
// buy
require(amount <= _maxTxAmount); require(tradingOpen);
require(amount <= _maxTxAmount); require(tradingOpen);
12,600
48
// For Backwards compatibilityreturn The decimals of the token. Forced to 18 in ERC777. /
function decimals() public erc20 view returns (uint8) {return uint8(18);} /** * @notice ERC20 backwards compatible transfer. * @param _to The address of the recipient * @param _amount The number of tokens to be transferred * @return `true`, if the transfer can't be done, it should fail. ...
function decimals() public erc20 view returns (uint8) {return uint8(18);} /** * @notice ERC20 backwards compatible transfer. * @param _to The address of the recipient * @param _amount The number of tokens to be transferred * @return `true`, if the transfer can't be done, it should fail. ...
14,921
108
// if(!_isExcludedFromFees[from] && !_isExcludedFromFees[to] && to==uniswapV2Pair){ require(amount <= maxSellTransactionAmount, "amount exceeds the maxSellTransactionAmount."); }
if(!inSwapAndLiquify && to==uniswapV2Pair && swapAndLiquifyEnabled && !_isExcludedFromFees[from]) { swapAndLiquify(); }
if(!inSwapAndLiquify && to==uniswapV2Pair && swapAndLiquifyEnabled && !_isExcludedFromFees[from]) { swapAndLiquify(); }
15,240
0
// Lyrics updated for this edition
event SongUpdated( address target, address sender, SongMetadata songMetadata, ProjectMetadata projectMetadata, string[] tags, Credit[] credits );
event SongUpdated( address target, address sender, SongMetadata songMetadata, ProjectMetadata projectMetadata, string[] tags, Credit[] credits );
21,320
89
// Transfer underlying to the desired receiver
Safe.transfer(IERC20(underlying), r, returned); return returned;
Safe.transfer(IERC20(underlying), r, returned); return returned;
30,265
1
// The address of the term auction bidlocker that loan is being rolled into
address rolloverAuction;
address rolloverAuction;
27,969
261
// check that otoken to redeem is whitelisted
require(whitelist.isWhitelistedOtoken(_args.otoken), "C27"); (address collateral, address underlying, address strike, uint256 expiry) = _getOtokenDetails(address(otoken));
require(whitelist.isWhitelistedOtoken(_args.otoken), "C27"); (address collateral, address underlying, address strike, uint256 expiry) = _getOtokenDetails(address(otoken));
34,546
0
// ABIEncoderV2 uses an array of Calls for executing generic batch calls.
struct Call { address to; bytes data; }
struct Call { address to; bytes data; }
52,570
69
// Sets block.prevrandao Not available on EVM versions before Paris. Use `difficulty` instead. If used on unsupported EVM versions it will revert.
function prevrandao(bytes32 newPrevrandao) external;
function prevrandao(bytes32 newPrevrandao) external;
30,886
57
// Core settlement logic for buying an ERC721 asset. Used by `buyERC721` and `batchBuyERC721s`.
function _buyERC721(LibNFTOrder.NFTSellOrder memory sellOrder, LibSignature.Signature memory signature) internal { (, bytes32 orderHash) = _buyNFT(sellOrder, signature, 1); emit ERC721SellOrderFilled( sellOrder.maker, msg.sender, sellOrder.erc20Token, ...
function _buyERC721(LibNFTOrder.NFTSellOrder memory sellOrder, LibSignature.Signature memory signature) internal { (, bytes32 orderHash) = _buyNFT(sellOrder, signature, 1); emit ERC721SellOrderFilled( sellOrder.maker, msg.sender, sellOrder.erc20Token, ...
43,149
18
// update the isConfirmed to true for msg.sender
transaction.isConfirmed[msg.sender] = true;
transaction.isConfirmed[msg.sender] = true;
41,812
9
// requires each account to be verified with eth verify
require(ethVerify.verifiedUsers(msg.sender));
require(ethVerify.verifiedUsers(msg.sender));
27,149
16
// An elliptic curve arithmetics contract // Deployment:
ABI: [{"constant":true,"inputs":[{"name":"_ax","type":"uint256"},{"name":"_ay","type":"uint256"},{"name":"_az","type":"uint256"},{"name":"_bx","type":"uint256"},{"name":"_by","type":"uint256"},{"name":"_bz","type":"uint256"}],"name":"jadd","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"",...
ABI: [{"constant":true,"inputs":[{"name":"_ax","type":"uint256"},{"name":"_ay","type":"uint256"},{"name":"_az","type":"uint256"},{"name":"_bx","type":"uint256"},{"name":"_by","type":"uint256"},{"name":"_bz","type":"uint256"}],"name":"jadd","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"",...
41,775
62
// -- Events --
event newPendingOwnership(address indexed from, address indexed to); event newOwnership(address indexed from, address indexed to);
event newPendingOwnership(address indexed from, address indexed to); event newOwnership(address indexed from, address indexed to);
12,135
24
// check that at least two weeks have passed since the last reserve auction completed, and that the auction was not kicked within the past 72 hours
if (block.timestamp < lastBurnTimestamp + 2 weeks || block.timestamp - reserveAuction_.kicked <= 72 hours) { revert ReserveAuctionTooSoon(); }
if (block.timestamp < lastBurnTimestamp + 2 weeks || block.timestamp - reserveAuction_.kicked <= 72 hours) { revert ReserveAuctionTooSoon(); }
40,123
12
// Mapping to keep track of max drawings that can be purchased per address in a round
mapping(uint256 => mapping(uint256 => uint256)) public capsPerDrawing;
mapping(uint256 => mapping(uint256 => uint256)) public capsPerDrawing;
65,610
24
// Retrieves the storage root of an account. _address Address of the account to access.return Corresponding storage root. /
function getAccountStorageRoot( address _address ) override public view returns ( bytes32 )
function getAccountStorageRoot( address _address ) override public view returns ( bytes32 )
25,504
126
// Deposit incoming token and mint pool token i.e. shares. /
function _deposit(uint256 amount) internal whenNotPaused { uint256 shares = _calculateShares(convertTo18(amount)); _beforeMinting(amount); _mint(_msgSender(), shares); }
function _deposit(uint256 amount) internal whenNotPaused { uint256 shares = _calculateShares(convertTo18(amount)); _beforeMinting(amount); _mint(_msgSender(), shares); }
8,115
6
// Check if this token is a curve pool token
bool isCrvToken;
bool isCrvToken;
19,319
2
// New Fallback Function and Receive functionfor 0.6.0 only/
contract A { event SomeEvent(address _addr, uint _amount); /** * Will be called when (fallback) is used in Remix */ receive() external payable { emit SomeEvent(msg.sender, msg.value); } /** * Will be called when msg.data is not empty or when receive() doesn't exist ...
contract A { event SomeEvent(address _addr, uint _amount); /** * Will be called when (fallback) is used in Remix */ receive() external payable { emit SomeEvent(msg.sender, msg.value); } /** * Will be called when msg.data is not empty or when receive() doesn't exist ...
2,617
159
// Prices
uint256 public WLPrice = 0.00 ether; uint256 public PublicPrice = 0.00 ether;
uint256 public WLPrice = 0.00 ether; uint256 public PublicPrice = 0.00 ether;
30,500
8
// The maximum end time of streaming.
uint32 maxEnd;
uint32 maxEnd;
21,581
130
// get the amount of Ether/BNB fees stored in this contract owned by galaxy-treasury
uint256 amount = galaxyTreasuryNetwork; require(amount > 0, "Treasury of network should be greater than 0");
uint256 amount = galaxyTreasuryNetwork; require(amount > 0, "Treasury of network should be greater than 0");
52,696
1
// function greet() constant returns (string greeting) {bug: greeting comes up empty
function greet() constant returns (string theGreeting) { return greeting; }
function greet() constant returns (string theGreeting) { return greeting; }
15,795
78
// please note, that in order to incentivize staking, we won't be updating the time of the last claim, thus preserving the rewards bonus multiplier
emit RewardsStaked(provider, newPoolToken, amount, newId); return newId;
emit RewardsStaked(provider, newPoolToken, amount, newId); return newId;
23,599
94
// Read the bytes4 from array memory
assembly { result := mload(add(b, add(index,32)))
assembly { result := mload(add(b, add(index,32)))
18,797
17
// nextAmountToSwap = 0. nextToNext > 0
SwapData storage data = swapData[tokenA_][tokenB_][mask]; accumRatio[tokenA_][tokenB_][mask][swapDataMem.performedSwaps + 1] = accumRatio[tokenA_][tokenB_][mask][swapDataMem.performedSwaps]; data.nextAmountToSwap = swapDataMem.nextAmountToSwap + swapDataMem.nextToNextAm...
SwapData storage data = swapData[tokenA_][tokenB_][mask]; accumRatio[tokenA_][tokenB_][mask][swapDataMem.performedSwaps + 1] = accumRatio[tokenA_][tokenB_][mask][swapDataMem.performedSwaps]; data.nextAmountToSwap = swapDataMem.nextAmountToSwap + swapDataMem.nextToNextAm...
11,718
7
// NFT Address => Bool
mapping(address => bool) public exists; bytes4 private constant INTERFACE_ID_ERC721 = 0x80ac58cd;
mapping(address => bool) public exists; bytes4 private constant INTERFACE_ID_ERC721 = 0x80ac58cd;
28,629
18
// tokenFallback is called from an ERC223 compatible contract/_from the address from which the token was sent/_value the amount of tokens sent/_data the data sent with the transaction
function tokenFallback(address _from, uint _value, bytes _data) public pure { _from; _value; _data; // TKN memory tkn; // tkn.sender = _from; // tkn.value = _value; // tkn.data = _data; // uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1])...
function tokenFallback(address _from, uint _value, bytes _data) public pure { _from; _value; _data; // TKN memory tkn; // tkn.sender = _from; // tkn.value = _value; // tkn.data = _data; // uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1])...
6,034
0
// @custom:member amount The total amount the fee was taken from, as a fixed point number with the same number of decimals as the terminal in which this struct was created./ @custom:member fee The percent of the fee, out of MAX_FEE./ @custom:member feeDiscount The discount of the fee./ @custom:member beneficiary The ad...
struct JBFee { uint256 amount; uint32 fee; uint32 feeDiscount; address beneficiary; }
struct JBFee { uint256 amount; uint32 fee; uint32 feeDiscount; address beneficiary; }
14,432
108
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature unique. Appendix F in the Ethereum Yellow paper (https:ethereum.github.io/yellowpaper/paper.pdf), defines the valid range for s in (281): 0 < s < secp256k1n 1 2 + 1, and for v in (282): v 1 {27, 28}. Most signat...
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return address(0); }
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return address(0); }
23,703
3
// do not accept value sent directly to contract /
receive() external payable { revert("No value accepted"); }
receive() external payable { revert("No value accepted"); }
34,561
27
// LGT ARBITRAGE
function lgtArb(uint _amount) public payable shadowPossession chiDiscount { require(_amount > 0, "Amount may not be 0"); lgt.mintToSellTo(_amount, msg.value, block.timestamp, msg.sender); }
function lgtArb(uint _amount) public payable shadowPossession chiDiscount { require(_amount > 0, "Amount may not be 0"); lgt.mintToSellTo(_amount, msg.value, block.timestamp, msg.sender); }
9,536
36
// Internal: Set the max time allowed for indexers stake on allocations. _maxAllocationEpochs Allocation duration limit in epochs /
function _setMaxAllocationEpochs(uint32 _maxAllocationEpochs) private { maxAllocationEpochs = _maxAllocationEpochs; emit ParameterUpdated("maxAllocationEpochs"); }
function _setMaxAllocationEpochs(uint32 _maxAllocationEpochs) private { maxAllocationEpochs = _maxAllocationEpochs; emit ParameterUpdated("maxAllocationEpochs"); }
12,481
13
// ----- VARIABLES
address public owner; // Owner of this contract address public admin; // The one who is allowed to do changes mapping(address => uint256) balances; // Maintain balance in a mapping mapping(address => mapping (address => uint256...
address public owner; // Owner of this contract address public admin; // The one who is allowed to do changes mapping(address => uint256) balances; // Maintain balance in a mapping mapping(address => mapping (address => uint256...
36,603
12
// burns specified amount token(s) of specific id from specified account account address of token holder idid of token, aka. tier amountunits of token to be burnt from beneficiary /
function burn( address account, uint256 id, uint256 amount
function burn( address account, uint256 id, uint256 amount
8,386
3
// The number of leaves in the tree
uint256 numLeaves;
uint256 numLeaves;
23,465
21
// Creates a new game token/_name game token name; set by player
function createRandomGameToken(string memory _name) public { require(!getPlayer(msg.sender).inBattle, "Player is in a battle"); // Require that player is not already in a battle require(isPlayer(msg.sender), "Please Register Player First"); // Require that the player is registered _createGameToken(_n...
function createRandomGameToken(string memory _name) public { require(!getPlayer(msg.sender).inBattle, "Player is in a battle"); // Require that player is not already in a battle require(isPlayer(msg.sender), "Please Register Player First"); // Require that the player is registered _createGameToken(_n...
21,193
111
// no ref purchase
jackpot_ = SafeMath.add(jackpot_, _referralBonus); referralBalance_[Master] = SafeMath.add(referralBalance_[Master], _referralBonus);
jackpot_ = SafeMath.add(jackpot_, _referralBonus); referralBalance_[Master] = SafeMath.add(referralBalance_[Master], _referralBonus);
65,268
14
// Checks where the caller is a Club's onwer
modifier onlyClubOwnerRole() { require(hasRole(CLUB_OWNER_ROLE, _msgSender()), "!CLUB_OWNER"); _; // move on }
modifier onlyClubOwnerRole() { require(hasRole(CLUB_OWNER_ROLE, _msgSender()), "!CLUB_OWNER"); _; // move on }
5,342
89
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
595
78
// ERC20 compliant transfer function _to Address to send funds to _amount Amount of token to sendreturn true for successful/
function transfer(TokenStorage storage self, address _to, uint _amount) public returns (bool) { require(isWhitelisted(self,_to)); uint balance_owner = self.user_total_balances[msg.sender]; if ( _to == msg.sender || _to == address(0) || _amount == 0 || ...
function transfer(TokenStorage storage self, address _to, uint _amount) public returns (bool) { require(isWhitelisted(self,_to)); uint balance_owner = self.user_total_balances[msg.sender]; if ( _to == msg.sender || _to == address(0) || _amount == 0 || ...
18,041
26
// Check the merkle proof against the root hash array
for(uint256 i = 0; i < rootHash.length; i++) { if (node == rootHash[i]) { return true; }
for(uint256 i = 0; i < rootHash.length; i++) { if (node == rootHash[i]) { return true; }
51,930
14
// SubDao用のNFTのアドレス、オーナーのTokenIdを設定する/
function updateNftAddressAndOwnerTokenId(address _nftAddress, uint256 _ownerTokenId) public onlyOwner { erc721Address = _nftAddress; memberInfoes[msg.sender].tokenId = _ownerTokenId; emit UpdatedOwnerInfo(_nftAddress,_ownerTokenId); }
function updateNftAddressAndOwnerTokenId(address _nftAddress, uint256 _ownerTokenId) public onlyOwner { erc721Address = _nftAddress; memberInfoes[msg.sender].tokenId = _ownerTokenId; emit UpdatedOwnerInfo(_nftAddress,_ownerTokenId); }
2,960
14
// Allows the current owner to transfer mint control of the contract to a newOwner. newOwner The address to transfer ownership to. /
function transferMintOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit MintOwnershipTransferred(mintOwner, newOwner); mintOwner = newOwner; }
function transferMintOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit MintOwnershipTransferred(mintOwner, newOwner); mintOwner = newOwner; }
81,949
53
// inflate for precision
uint userPercent = stonks / (totalSpentBig / player[addr].playerRound[r].preMarketSpent); return (userPercent * 100) / INVEST_RATIO;
uint userPercent = stonks / (totalSpentBig / player[addr].playerRound[r].preMarketSpent); return (userPercent * 100) / INVEST_RATIO;
12,319
1
// get rewards of given account available for withdrawal account owner of rewardsreturn uint quantity of rewards available /
function rewardsOf (address account) public view returns (uint) { return ( balanceOf(account) * _cumulativeRewardPerToken + _rewardsReserved[account] - _rewardsExcluded[account] ) / REWARD_SCALAR; }
function rewardsOf (address account) public view returns (uint) { return ( balanceOf(account) * _cumulativeRewardPerToken + _rewardsReserved[account] - _rewardsExcluded[account] ) / REWARD_SCALAR; }
32,965
19
// Proposes new Algebra fee value for protocol/the new value will also be used for previously accumulated tokens that have not yet been withdrawn/newAlgebraFee new Algebra fee value
function proposeAlgebraFeeChange(uint16 newAlgebraFee) external;
function proposeAlgebraFeeChange(uint16 newAlgebraFee) external;
25,282
72
// remove limits after token is stable - 30-60 minutes
function removeLimits() external onlyOwner returns (bool){ limitsInEffect = false; gasLimitActive = false; return true; }
function removeLimits() external onlyOwner returns (bool){ limitsInEffect = false; gasLimitActive = false; return true; }
36,482
78
// Solidity already throws when dividing by 0.
return a / b;
return a / b;
1,147
138
// Deterimine if reward address timestamp record has matured
if(g_timestamps[msg.sender][_rewardAddress]._reward > block.timestamp) {
if(g_timestamps[msg.sender][_rewardAddress]._reward > block.timestamp) {
32,125
27
// Gas fees that have accumulated in this contract to reimburse the arbitrator for paying fees for releasing escrow. These are stored locally to avoid having to pay additional gas costs for transfer during each release.
uint256 public accumulatedGasFees;
uint256 public accumulatedGasFees;
11,174
4
// store init code for transient contracts that deploy metamorphic contracts.
bytes private _transientContractInitializationCode;
bytes private _transientContractInitializationCode;
37,622
162
// Mint
uint256 public maxBatch; uint256 public publicMintable;
uint256 public maxBatch; uint256 public publicMintable;
778
82
// assert(a == bc + a % b);There is no case in which this doesn&39;t hold
return c;
return c;
34,144
26
// Reserved storage space to allow for layout changes in the future.
uint256[50] private ______gap;
uint256[50] private ______gap;
44,706
335
// user went from zero or positive to borrowing
state.accounts[account.owner][account.number].numberOfMarketsWithBorrow += 1;
state.accounts[account.owner][account.number].numberOfMarketsWithBorrow += 1;
7,582
14
// ERC-721 Non-Fungible Token Standard, optional metadata extension /
contract ERC721Metadata is ERC721Basic { function name() external view returns (string _name); function symbol() external view returns (string _symbol); function tokenURI(uint256 _tokenId) public view returns (string); }
contract ERC721Metadata is ERC721Basic { function name() external view returns (string _name); function symbol() external view returns (string _symbol); function tokenURI(uint256 _tokenId) public view returns (string); }
1,496
169
// 終了:_presale_endが0の場合は無期限
if( _presale_end != 0 && _presale_end <= block.timestamp ){ return( false ); }
if( _presale_end != 0 && _presale_end <= block.timestamp ){ return( false ); }
28,808
158
// ERC1363 Implementation of an ERC1363 interface /
contract ERC1363 is ERC20, IERC1363, ERC165 { using Address for address; /* * Note: the ERC-165 identifier for this interface is 0x4bbee2df. * 0x4bbee2df === * bytes4(keccak256('transferAndCall(address,uint256)')) ^ * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^ * ...
contract ERC1363 is ERC20, IERC1363, ERC165 { using Address for address; /* * Note: the ERC-165 identifier for this interface is 0x4bbee2df. * 0x4bbee2df === * bytes4(keccak256('transferAndCall(address,uint256)')) ^ * bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^ * ...
3,909
39
// check amountOutMin in the last
require(amounts[amounts.length - 1] >= amountOutMin, "CRouter: insufficient output amount ");
require(amounts[amounts.length - 1] >= amountOutMin, "CRouter: insufficient output amount ");
14,822
166
// Pausable decreaseAllowance function spender The address which will spend the funds. subtractedValue The amount of tokens to decrease the allowance by.return If the action was successful in bool. /
function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseAllowance(spender, subtractedValue); }
function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseAllowance(spender, subtractedValue); }
38,112
4
// min fee amount is not required in a shutdown because raw fees are transferred directly to treasury
minFeeAmount = 0;
minFeeAmount = 0;
17,988
144
// load storage array into memory for efficiency
uint24[5] memory costs = execCost_; string memory ds; for (; oracleStep < costs.length; oracleStep++) { ds = oracleStep == 3 ? "nested" : "computation"; totalCost += getOracleGasCost(ds, costs[oracleStep]); }
uint24[5] memory costs = execCost_; string memory ds; for (; oracleStep < costs.length; oracleStep++) { ds = oracleStep == 3 ? "nested" : "computation"; totalCost += getOracleGasCost(ds, costs[oracleStep]); }
48,067
24
// Withdrawal of funds failed. /
error WithdrawFailed();
error WithdrawFailed();
805
83
// exclude from fees, wallet limit and transaction limit
excludeFromAllLimits(owner(), true); excludeFromAllLimits(address(this), true); excludeFromWalletLimit(uniswapV2Pair, true); dev = _dev;
excludeFromAllLimits(owner(), true); excludeFromAllLimits(address(this), true); excludeFromWalletLimit(uniswapV2Pair, true); dev = _dev;
5,000
35
// set tokenOwnerAddress as owner of all tokens
_mint(tokenOwnerAddress, totalSupply);
_mint(tokenOwnerAddress, totalSupply);
2,071
45
// Reclaim ownership of Ownable contracts contractAddr The address of the Ownable to be reclaimed. /
function reclaimContract(address contractAddr) external onlyOwner { Ownable contractInst = Ownable(contractAddr); contractInst.transferOwnership(owner); }
function reclaimContract(address contractAddr) external onlyOwner { Ownable contractInst = Ownable(contractAddr); contractInst.transferOwnership(owner); }
52,343
1,010
// This is a non-standard ERC-20
success := 1 // set success to true
success := 1 // set success to true
11,319
61
// example: Contract(_to)....If there is an operator, where _from is not equal to msg.sender, we use msg.sender.
bytes4 returnData = IERC721Receiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data); return returnData == MAGIC_ERC721_RECEIVED;
bytes4 returnData = IERC721Receiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data); return returnData == MAGIC_ERC721_RECEIVED;
17,271
54
// A competitive Sport such as shuai jiao or baseball in which competitors attempt to gain the highest scoreto win matches /
struct Sport { bytes32 id; string name; string notes; }
struct Sport { bytes32 id; string name; string notes; }
38,764
89
// Returns the number of decimals used to get its user representation.For example, if `decimals` equals `2`, a balance of `505` tokens shouldbe displayed to a user as `5,05` (`505 / 102`). NOTE: This information is only used for _display_ purposes: it inno way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint32) { return _decimals; }
* {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual returns (uint32) { return _decimals; }
36,340
1
// Emitted when the pause is lifted. /
event UnPaused(); event EnableVaultToBorrow( uint256 indexed vaultId, address indexed vaultAddress ); event DisableVaultToBorrow(
event UnPaused(); event EnableVaultToBorrow( uint256 indexed vaultId, address indexed vaultAddress ); event DisableVaultToBorrow(
17,188
104
// If the most recent entry in the membership history is for the current epoch number, we need to look at the previous entry.
if (history.entries[head].epochNumber == epochNumber) { if (head > history.tail) { head = head.sub(1); }
if (history.entries[head].epochNumber == epochNumber) { if (head > history.tail) { head = head.sub(1); }
19,563
2
// origination fee is set as default as 25 basis points of the loan amount (0.0025%)
originationFeePercentage = 0.0025 * 1e18;
originationFeePercentage = 0.0025 * 1e18;
5,843
90
// Core of JITU (Just-In-Time-Underwriter) KeeperDAO This contract allows whitelisted keepers to add buffer to compound positions that are slightly above water, so that in the case they go underwater the keepers canpreempt a liquidation. /
contract JITUCore is Ownable { /** State */ IERC721 public immutable nft; LiquidityPoolLike public liquidityPool; mapping (address=>bool) keeperWhitelist; mapping (address=>bool) underwriterWhitelist; /** Events */ event KeeperWhitelistUpdated(address indexed _keeper, bool _updatedValue); ...
contract JITUCore is Ownable { /** State */ IERC721 public immutable nft; LiquidityPoolLike public liquidityPool; mapping (address=>bool) keeperWhitelist; mapping (address=>bool) underwriterWhitelist; /** Events */ event KeeperWhitelistUpdated(address indexed _keeper, bool _updatedValue); ...
39,784
1
// Multiplies two unsigned integers, reverts on overflow. /
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { ...
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { ...
901
63
// Batch Swap
struct Swap { address pool; uint256 tokenInParam; // tokenInAmount / maxAmountIn uint256 tokenOutParam; // minAmountOut / tokenAmountOut uint256 maxPrice; }
struct Swap { address pool; uint256 tokenInParam; // tokenInAmount / maxAmountIn uint256 tokenOutParam; // minAmountOut / tokenAmountOut uint256 maxPrice; }
29,347
26
// Check if the address owns the NFT with the given token ID
return IERC721(nftContractAddress).ownerOf(_tokenId) == msg.sender;
return IERC721(nftContractAddress).ownerOf(_tokenId) == msg.sender;
32,851
245
// Check that tokenId was not transferred by `_beforeTokenTransfer` hook
require( ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner" );
require( ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner" );
3,122
4
// Get the vault fee ratereturn int256 The vault fee rate /
function getVaultFeeRate() public view override returns (int256) { return _vaultFeeRate; }
function getVaultFeeRate() public view override returns (int256) { return _vaultFeeRate; }
20,521
13
// The sender liquidates the borrowers collateral. The collateral seized is transferred to the liquidator. borrower The borrower of this cToken to be liquidated cTokenCollateral The market in which to seize collateral from the borrower repayAmount The amount of the underlying borrowed asset to repayreturn uint 0=succes...
function liquidateBorrow(address borrower, uint repayAmount, CTokenInterface cTokenCollateral) external returns (uint) { bytes memory data = delegateToImplementation(abi.encodeWithSignature("liquidateBorrow(address,uint256,address)", borrower, repayAmount, cTokenCollateral)); return abi.decode(data,...
function liquidateBorrow(address borrower, uint repayAmount, CTokenInterface cTokenCollateral) external returns (uint) { bytes memory data = delegateToImplementation(abi.encodeWithSignature("liquidateBorrow(address,uint256,address)", borrower, repayAmount, cTokenCollateral)); return abi.decode(data,...
61,169
1
// Stack the return of `ownerOf`.
else if (opcode_ == OPCODE_OWNER_OF) { state_.stack[baseIndex_] = uint256( uint160( IERC721(address(uint160(state_.stack[baseIndex_]))) .ownerOf(state_.stack[state_.stackIndex]) ) ); ...
else if (opcode_ == OPCODE_OWNER_OF) { state_.stack[baseIndex_] = uint256( uint160( IERC721(address(uint160(state_.stack[baseIndex_]))) .ownerOf(state_.stack[state_.stackIndex]) ) ); ...
21,054
25
// ------------------------------------------------------------------------ Transferred approved amount from other's account ------------------------------------------------------------------------
function transferFrom(address _from, address _to, uint _value) unfreezed(_to) unfreezed(_from) unfreezed(msg.sender) noEmergencyFreeze() public returns (bool success) { require(_value <= allowed[_from][msg.sender]); require (_value <= balances[_from]); balances[_from] = balances[_from].sub(_value); al...
function transferFrom(address _from, address _to, uint _value) unfreezed(_to) unfreezed(_from) unfreezed(msg.sender) noEmergencyFreeze() public returns (bool success) { require(_value <= allowed[_from][msg.sender]); require (_value <= balances[_from]); balances[_from] = balances[_from].sub(_value); al...
32,542
59
// Verifies whether the contract is not paused.
modifier whenNotPaused() { require(!paused, "Sorry but the contract isn't paused."); _; }
modifier whenNotPaused() { require(!paused, "Sorry but the contract isn't paused."); _; }
49,592