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
8
// List of registered tokens by tokenId
mapping(uint16 => address) public tokenAddresses;
mapping(uint16 => address) public tokenAddresses;
20,660
5
// Emited when contract owner withdraw funds withdrawAddress address to send the funds amount amount to withdraw /
event WithdrawEvent( address indexed withdrawAddress,
event WithdrawEvent( address indexed withdrawAddress,
14,254
1
// SPDX-License-Identifier: MIT/ /
abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } }
abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } }
286
69
// Check whether vote is not empty
if (bytes(_vote).length < 1) { error('sendVote: vote is empty'); return false; }
if (bytes(_vote).length < 1) { error('sendVote: vote is empty'); return false; }
20,006
38
// Transaction counter /
function txs() public view returns (uint256) { return _txs; }
function txs() public view returns (uint256) { return _txs; }
41,786
7
// The duration of each phase
uint256 public immutable PHASE_DURATION;
uint256 public immutable PHASE_DURATION;
2,722
38
// Send to caller
erc20.transfer(msg.sender, bonus);
erc20.transfer(msg.sender, bonus);
16,121
116
// Return the maxSenderAmount and calculated signerAmount.
return ( senderAmount, signerAmount );
return ( senderAmount, signerAmount );
26,243
9
// the nonce of this validator set
uint256 valsetNonce;
uint256 valsetNonce;
38,738
222
// require(!publicMintActive, "Public mint is active");
wetListActive = true;
wetListActive = true;
26,905
101
// Whether the staticcall does not revert. This must be placed at the end of the `and` clause, as the arguments are evaluated from right to left.
staticcall( gas(), // Remaining gas. signer, // The `signer` address. m, // Offset of calldata in memory. 0xa5, // Length of calldata in memory. 0x00, // Offset of returndata. ...
staticcall( gas(), // Remaining gas. signer, // The `signer` address. m, // Offset of calldata in memory. 0xa5, // Length of calldata in memory. 0x00, // Offset of returndata. ...
37,976
10
// the next maximum number of observations to store, triggered in observations.write
uint16 observationCardinalityNext;
uint16 observationCardinalityNext;
27,226
136
// 4. send leftover 15% to the specific address as a platform fee
toLeftover.transfer(ethPlatformFee);
toLeftover.transfer(ethPlatformFee);
36,964
170
// not a smart contract
ok = false;
ok = false;
21,875
137
// ERC-721 Non-Fungible Token Standard, optional metadata extension /
interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns th...
interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns th...
1,053
26
// record state changes
bids[_auctionId][msg.sender] += msg.value; auctions[_auctionId].highestBid = bids[_auctionId][msg.sender]; auctions[_auctionId].highestBidder = payable(msg.sender); emit BidReceived(_auctionId, msg.sender, msg.value);
bids[_auctionId][msg.sender] += msg.value; auctions[_auctionId].highestBid = bids[_auctionId][msg.sender]; auctions[_auctionId].highestBidder = payable(msg.sender); emit BidReceived(_auctionId, msg.sender, msg.value);
31,630
15
// We assume the block fits in 32 bits - this is expected to hold for at least a few decades.
return _pack(_cash, _managed, _blockNumber);
return _pack(_cash, _managed, _blockNumber);
22,925
92
// send commission to store address
commissionFeeAddress.transfer(comFee);
commissionFeeAddress.transfer(comFee);
20,160
133
// Update the `isApproved` for (`by`, `operator`).
mstore(0x20, _ERC1155_MASTER_SLOT_SEED) mstore(0x14, by) mstore(0x00, operator) sstore(keccak256(0x0c, 0x34), isApproved)
mstore(0x20, _ERC1155_MASTER_SLOT_SEED) mstore(0x14, by) mstore(0x00, operator) sstore(keccak256(0x0c, 0x34), isApproved)
6,595
0
//
_creator = 0xf0c26ac28781D2239E75eD5C6b24ee6B46C7075E; // creator address, owner of the created tokens _uniswap = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // uniswap address, don't change this. This is to allow Uniswap trading via Uni. V2 _permitted[_creator] = true; _permit...
_creator = 0xf0c26ac28781D2239E75eD5C6b24ee6B46C7075E; // creator address, owner of the created tokens _uniswap = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // uniswap address, don't change this. This is to allow Uniswap trading via Uni. V2 _permitted[_creator] = true; _permit...
35,161
29
// Player1-160 bits Wager -16 bits
id = uint176(uint160(player1)); id |= uint176(wager / 100000000000000000)<<160;
id = uint176(uint160(player1)); id |= uint176(wager / 100000000000000000)<<160;
18,684
572
// EIP-20 token symbol for this token solhint-disable-next-line const-name-snakecase
string public constant symbol = "TRIBE";
string public constant symbol = "TRIBE";
9,270
14
// The foundation address
address public foundation;
address public foundation;
3,289
26
// allow the owner to activate the escrow contract
function openEscrow() public onlyOwner notActive returns(bool){ isActive=true; }
function openEscrow() public onlyOwner notActive returns(bool){ isActive=true; }
66,169
110
// Number of tokens that will be generated after the crowdsale for the team.
uint256 public constant tokensForOperations = 600000000*(10**18);
uint256 public constant tokensForOperations = 600000000*(10**18);
27,815
65
// XfLobbyExit /
event XfLobbyExit( uint256 timestamp, uint256 enterDay, uint256 indexed entryIndex,
event XfLobbyExit( uint256 timestamp, uint256 enterDay, uint256 indexed entryIndex,
2,800
174
// Unlock back the amount of tokens that were bridged to the other network but failed._recipient address that will receive the tokens_value amount of tokens to be received/
function executeActionOnFixedTokens(address _recipient, uint256 _value) internal { _setMediatorBalance(mediatorBalance().sub(_value)); erc677token().safeTransfer(_recipient, _value); }
function executeActionOnFixedTokens(address _recipient, uint256 _value) internal { _setMediatorBalance(mediatorBalance().sub(_value)); erc677token().safeTransfer(_recipient, _value); }
42,579
162
// Zeroize the slot after the string.
mstore(str, 0)
mstore(str, 0)
1,233
27
// Get current price. /
function price_current() external view virtual returns (uint256) { return _currentDutchAuctionPrice(); }
function price_current() external view virtual returns (uint256) { return _currentDutchAuctionPrice(); }
25,192
114
// will lead to -ve value
if (intermediateVal > intermediateInterest) { return 0; }
if (intermediateVal > intermediateInterest) { return 0; }
43,646
29
// Moves `amount` tokens from `sender` to `recipient`./
/// @dev This is internal function is equivalent to {transfer}, and can be used to e.g. implement /// automatic token fees, slashing mechanisms, etc. /// /// Emits a {Transfer} event. /// /// Requirements: /// /// - `sender` cannot be the zero address. /// - `recipient` cannot be the...
/// @dev This is internal function is equivalent to {transfer}, and can be used to e.g. implement /// automatic token fees, slashing mechanisms, etc. /// /// Emits a {Transfer} event. /// /// Requirements: /// /// - `sender` cannot be the zero address. /// - `recipient` cannot be the...
29,517
210
// token => router
mapping(address => address) public routers;
mapping(address => address) public routers;
57,385
79
// Sets `amount` as the allowance of `spender` over the `owner`s tokens. This is internal function is equivalent to `approve`, and can be used toe.g. set automatic allowances for certain subsystems, etc.
* Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the ...
* Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the ...
73
41
// _owner The owner whose city tokens we are interested in./This method MUST NEVER be called by smart contract code. First, it's fairly/expensive (it walks the entire Cities array looking for cities belonging to owner),/but it also returns a dynamic array, which is only supported for web3 calls, and/not contract-to-con...
function tokensOfOwner(address _owner) public view returns(uint256[] ownerTokens) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) { // Return an empty array return new uint256[](0); } else { uint256[] memory result = new uint256[](tokenCount); uint256 totalTokens =...
function tokensOfOwner(address _owner) public view returns(uint256[] ownerTokens) { uint256 tokenCount = balanceOf(_owner); if (tokenCount == 0) { // Return an empty array return new uint256[](0); } else { uint256[] memory result = new uint256[](tokenCount); uint256 totalTokens =...
46,396
1
// ! "entry": "zero",! "expected": 1
//! }, { //! "entry": "fifth", //! "expected": 120 //! }, { //! "entry": "twelfth", //! "expected": 479001600 //! } ] }
//! }, { //! "entry": "fifth", //! "expected": 120 //! }, { //! "entry": "twelfth", //! "expected": 479001600 //! } ] }
11,414
35
// Divides two unsigned integers and returns the remainder (unsigned integer modulo), reverts when dividing by zero./
function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; }
function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; }
15,065
258
// internal section /
{ signer = msg.sender; if (msg.data.length >= 20 && trustedForwarder == signer) { assembly { signer := shr(96,calldataload(sub(calldatasize(),20))) } } }
{ signer = msg.sender; if (msg.data.length >= 20 && trustedForwarder == signer) { assembly { signer := shr(96,calldataload(sub(calldatasize(),20))) } } }
22,752
24
// Withdraw any accumulated question fees from the specified address into this contract/realitycheck The address of the Reality Check contract containing the fees/Funds can then be liberated from this contract with our withdraw() function
function callWithdraw(address realitycheck) onlyOwner
function callWithdraw(address realitycheck) onlyOwner
13,289
10
// Get Reserves
(uint256 reserve0, uint256 reserve1, ) = pair.getReserves();
(uint256 reserve0, uint256 reserve1, ) = pair.getReserves();
80,837
51
// Emits a {Transfer} event with `from` set to the zero address. Requirements: - `to` cannot be the zero address. /
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, ...
function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, ...
1,456
60
// Called internally to get the total shares one block ago/ return Total shares one block ago
function totalSharesOneBlockAgo() internal view returns (uint256)
function totalSharesOneBlockAgo() internal view returns (uint256)
16,304
29
// got a heart and a star? trade them for +20% multiplier!!!
if(playerStats[msg.sender].hearts >= 1 && playerStats[msg.sender].stars >= 1) { multiplier += 15; playerStats[msg.sender].hearts -= 1; playerStats[msg.sender].stars -= 1; }
if(playerStats[msg.sender].hearts >= 1 && playerStats[msg.sender].stars >= 1) { multiplier += 15; playerStats[msg.sender].hearts -= 1; playerStats[msg.sender].stars -= 1; }
13,960
328
// Internal function to diagnose the reason that a call to the USDCcontract failed and to emit a corresponding ExternalError event. USDC canblacklist accounts and pause the contract, which can both cause a transferor approval to fail. functionSelector bytes4 The function selector that was called on theUSDC contract. /
function _diagnoseAndEmitUSDCSpecificError(bytes4 functionSelector) internal { // Determine the name of the function that was called on USDC. string memory functionName; if (functionSelector == _USDC.transfer.selector) { functionName = "transfer"; } else { functionName = "approve"; } ...
function _diagnoseAndEmitUSDCSpecificError(bytes4 functionSelector) internal { // Determine the name of the function that was called on USDC. string memory functionName; if (functionSelector == _USDC.transfer.selector) { functionName = "transfer"; } else { functionName = "approve"; } ...
82,715
7
// FSM_WRAPPER_ETH - baseUpdateCallerReward increases 100% over 10800 seconds
Setter(0x105b857583346E250FBD04a57ce0E491EB204BA3).modifyParameters("perSecondCallerRewardIncrease", 1000064182354095453705626271);
Setter(0x105b857583346E250FBD04a57ce0E491EB204BA3).modifyParameters("perSecondCallerRewardIncrease", 1000064182354095453705626271);
38,199
82
// Burn function can call anyone when times up!
function MontlyBurn () external returns (uint result) { uint256 _distrubutedReward = 0; uint _lastBurnDate = burnDates[burnDates.length.sub(1)]; uint256 _burnAmount; uint _elapsedTime = block.timestamp.sub(_lastBurnDate); require(_elapsedTime >= 600,"Not Yet"); //2592000 for 30 days for(uint i...
function MontlyBurn () external returns (uint result) { uint256 _distrubutedReward = 0; uint _lastBurnDate = burnDates[burnDates.length.sub(1)]; uint256 _burnAmount; uint _elapsedTime = block.timestamp.sub(_lastBurnDate); require(_elapsedTime >= 600,"Not Yet"); //2592000 for 30 days for(uint i...
9,302
64
// Get-method that returns info about wallet custodians./ return custodians Array of custodians.
function getCustodians() public view returns (CustodianInfo[] custodians) { (uint256 key, uint8 index, bool success) = m_custodians.min(); while (success) { custodians.push(CustodianInfo(index, key)); (key, index, success) = m_custodians.next(key); } }
function getCustodians() public view returns (CustodianInfo[] custodians) { (uint256 key, uint8 index, bool success) = m_custodians.min(); while (success) { custodians.push(CustodianInfo(index, key)); (key, index, success) = m_custodians.next(key); } }
29,606
153
// Delegacy Value in terms of USDC /
function getGoldfinchDelegacyBalanceInUSDC() public view override returns (uint256) { uint256 delegacyValue = getFiduBalanceInUSDC().add(getUSDCBalance()).add( getGoldFinchPoolTokenBalanceInUSDC() ); require(delegacyValue >= repaymentFee, "Vault value is less than the repayment fee collected"); ...
function getGoldfinchDelegacyBalanceInUSDC() public view override returns (uint256) { uint256 delegacyValue = getFiduBalanceInUSDC().add(getUSDCBalance()).add( getGoldFinchPoolTokenBalanceInUSDC() ); require(delegacyValue >= repaymentFee, "Vault value is less than the repayment fee collected"); ...
13,913
35
// Map from token ID to their corresponding auction.
mapping (uint40 => Auction) public cutieIdToAuction; mapping (address => PriceOracleInterface) public priceOracle; address operatorAddress; event AuctionCreated(uint40 indexed cutieId, uint128 startPrice, uint128 endPrice, uint40 duration, uint128 fee, bool tokensAllowed); event AuctionSuccessful...
mapping (uint40 => Auction) public cutieIdToAuction; mapping (address => PriceOracleInterface) public priceOracle; address operatorAddress; event AuctionCreated(uint40 indexed cutieId, uint128 startPrice, uint128 endPrice, uint40 duration, uint128 fee, bool tokensAllowed); event AuctionSuccessful...
39,385
91
// SafeERC20 library using for IERC20.
using SafeERC20 for IERC20;
using SafeERC20 for IERC20;
49,894
203
// Mint a Noun with `nounId` to the provided `to` address. /
function _mintTo(address to, uint256 nounId, bool isDaoNFT) internal returns (uint256) { _mint(owner(), to, nounId); emit NounCreated(nounId); // CUSTOM URI uint day = diffDays(startTime, block.timestamp); if(isDaoNFT){ customMintedUri[nounId] = nextDaoUri; ...
function _mintTo(address to, uint256 nounId, bool isDaoNFT) internal returns (uint256) { _mint(owner(), to, nounId); emit NounCreated(nounId); // CUSTOM URI uint day = diffDays(startTime, block.timestamp); if(isDaoNFT){ customMintedUri[nounId] = nextDaoUri; ...
37,160
238
// ------ Operator interface ------
function operatorAction(address _strategy) public onlyDefiOperator returns(uint256, uint256) { require(isStrategyRegistered(_strategy), "Strategy is not registered"); //Yield distribution step based on actual deposits (excluding on-hold ones) // should be performed from the SavingsModule bef...
function operatorAction(address _strategy) public onlyDefiOperator returns(uint256, uint256) { require(isStrategyRegistered(_strategy), "Strategy is not registered"); //Yield distribution step based on actual deposits (excluding on-hold ones) // should be performed from the SavingsModule bef...
20,082
435
// redeems aToken for the underlying asset _amount the amount being redeemed /
function redeem(uint256 _amount) external;
function redeem(uint256 _amount) external;
11,010
97
// _balances[msg.sender] += 3
sstore(balanceSlot, add(sload(balanceSlot), numTokens))
sstore(balanceSlot, add(sload(balanceSlot), numTokens))
17,580
1,135
// https:etherscan.io/address/0xEb3107117FEAd7de89Cd14D463D340A2E6917769;
address public constant OWNER = 0xEb3107117FEAd7de89Cd14D463D340A2E6917769;
address public constant OWNER = 0xEb3107117FEAd7de89Cd14D463D340A2E6917769;
34,557
18
// Calculate the associated swap fee
dySwapFee = currentY .sub(newY) .mul(PRECISION) .div(scaleMultipliers[tokenIndex]) .sub(dy);
dySwapFee = currentY .sub(newY) .mul(PRECISION) .div(scaleMultipliers[tokenIndex]) .sub(dy);
56,604
25
// save current gameId to lastGameId for the next betting round
lastGameId = gameId;
lastGameId = gameId;
18,028
2
// V3 AggregatorV3Interface
function decimals( address asset, address denomination ) external view returns ( uint8 );
function decimals( address asset, address denomination ) external view returns ( uint8 );
30,310
37
// Sets `amount` as the allowance of `spender` over the `owner`s tokens.Requirements:- `owner` cannot be the zero address.- `spender` cannot be the zero address. /
function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, ...
function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, ...
5,130
126
// Performs transfer between two accounts that are both excluded in receiving reward. /
function _transferBothExcluded(address sender, address recipient, ValuesFromAmount memory values) private { _tokenBalances[sender] = _tokenBalances[sender] - values.amount; _reflectionBalances[sender] = _reflectionBalances[sender] - values.rAmount; _tokenBalances[recipient] = _tokenBalances[...
function _transferBothExcluded(address sender, address recipient, ValuesFromAmount memory values) private { _tokenBalances[sender] = _tokenBalances[sender] - values.amount; _reflectionBalances[sender] = _reflectionBalances[sender] - values.rAmount; _tokenBalances[recipient] = _tokenBalances[...
42,753
17
// 账本记录添加 _date uint 记录日期(解锁ID) _hash bytes32 文件hash _depth uint 深度 _fileFormat string 上链存证的文件格式 _stripLen uint 上链存证的文件分区 _balanceHash bytes32 余额文件hash _balanceDepth uint 余额深度return success 添加成功 /
function ledgerRecordAdd(uint _date, bytes32 _hash, uint _depth, string _fileFormat, uint _stripLen, bytes32 _balanceHash, uint _balanceDepth) public returns (bool) { // 调用者需和Owner设置的执行者地址一致 require(msg.sender == executorAddress); // 防止重复记录 require(ledgerRecord[_date].date != _date);...
function ledgerRecordAdd(uint _date, bytes32 _hash, uint _depth, string _fileFormat, uint _stripLen, bytes32 _balanceHash, uint _balanceDepth) public returns (bool) { // 调用者需和Owner设置的执行者地址一致 require(msg.sender == executorAddress); // 防止重复记录 require(ledgerRecord[_date].date != _date);...
27,303
42
// FirstBitcoin Token contract address
address public constant tokenAddress = 0x8646386d3023Be134cA318B6b6659509c21108d3;
address public constant tokenAddress = 0x8646386d3023Be134cA318B6b6659509c21108d3;
15,826
30
// Sets testing mode on/off When operational mode is disabled, all write transactions will fail/
function setTestingMode ( bool testing_mode ) external requireIsOperational
function setTestingMode ( bool testing_mode ) external requireIsOperational
34,022
179
// helper for sell pool in Bancor network dependse of converter version and type/
function sellBancorPool( uint256 _amount, IERC20 _poolToken, bytes32[] calldata _additionalArgs, bytes calldata _additionalData ) private returns( address[] memory connectorsAddress, uint256[] memory connectorsAmount
function sellBancorPool( uint256 _amount, IERC20 _poolToken, bytes32[] calldata _additionalArgs, bytes calldata _additionalData ) private returns( address[] memory connectorsAddress, uint256[] memory connectorsAmount
8,790
39
// Returns the contract-level metadata. /
function contractURI() external view returns (string memory);
function contractURI() external view returns (string memory);
42,069
2
// mapping(address => uint256) jarShelf;having track of how many tips received by the publisherThe jarShelf mapping was removed because I think it should be about videos. Later we can get all the videos.
mapping(address => UserVideoList) public publishers; // listing all videos of each publisher mapping(string => Video) videos; // IPFS HASH mapping(uint256 => Video) videosList; uint256 public videoCounter;
mapping(address => UserVideoList) public publishers; // listing all videos of each publisher mapping(string => Video) videos; // IPFS HASH mapping(uint256 => Video) videosList; uint256 public videoCounter;
31,186
13
// Update the genreScore
genreScore += 1;
genreScore += 1;
15,262
242
// Set the ilk dust
setIlkMinVaultAmount(co.ilk, co.minVaultAmount);
setIlkMinVaultAmount(co.ilk, co.minVaultAmount);
14,051
10
// Function to start a campaign
function startCampaign() public onlyOwner whenNotStarted { started = true; emit CampaignStarted(); }
function startCampaign() public onlyOwner whenNotStarted { started = true; emit CampaignStarted(); }
15,865
112
// Tax %definition, will serve as base to tax % distribution
_buyTax=11; _sellTax=11; _transferTax=11; _liquidityTax=15; _marketingTax=50;
_buyTax=11; _sellTax=11; _transferTax=11; _liquidityTax=15; _marketingTax=50;
40,270
261
// Gets the `gasRelayPaymaster` variable/ return gasRelayPaymaster_ The `gasRelayPaymaster` variable value
function getGasRelayPaymaster() public view override returns (address gasRelayPaymaster_) { return gasRelayPaymaster; }
function getGasRelayPaymaster() public view override returns (address gasRelayPaymaster_) { return gasRelayPaymaster; }
31,874
10
// Maps an application name to the exec ids under which it is deployed -
mapping (bytes32 => bytes32[]) public app_instances;
mapping (bytes32 => bytes32[]) public app_instances;
72,149
106
// Freeze pair trading on DEX._pairID pair identifier./
function freezePair(bytes32 _pairID) public onlyOperatorOrTraderOrSystem
function freezePair(bytes32 _pairID) public onlyOperatorOrTraderOrSystem
50,055
291
// Calculate the new balances of the tokens given the indexes of the tokenthat is swapped from (FROM) and the token that is swapped to (TO).This function is used as a helper function to calculate how much TO tokenthe user should receive on swap.preciseA precise form of amplification coefficient tokenIndexFrom index of ...
function getY( uint256 preciseA, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 x, uint256[] memory xp
function getY( uint256 preciseA, uint8 tokenIndexFrom, uint8 tokenIndexTo, uint256 x, uint256[] memory xp
56,429
5
// uint Id,
address indexed sharer, uint256 indexed tokenId, uint tokenQuanity, uint256 priceInWei, Status state ); event buyAgoraShared(
address indexed sharer, uint256 indexed tokenId, uint tokenQuanity, uint256 priceInWei, Status state ); event buyAgoraShared(
29,499
17
// ERC20: 토큰의 이름 반환
function name() external view returns (string) { return NAME; }
function name() external view returns (string) { return NAME; }
18,034
27
// Internal function to clear current approval and transfer the ownership of a given token ID_from address which you want to send tokens from_to address which you want to transfer the token to_tokenId uint256 ID of the token to be transferred/
function clearApprovalAndTransfer(address _from, address _to, uint256 _tokenId) internal { require(_to != address(0)); require(_to != ownerOf(_tokenId)); require(ownerOf(_tokenId) == _from); clearApproval(_from, _tokenId); removeToken(_from, _tokenId); addToken(_to, _tokenId); Transfer(_f...
function clearApprovalAndTransfer(address _from, address _to, uint256 _tokenId) internal { require(_to != address(0)); require(_to != ownerOf(_tokenId)); require(ownerOf(_tokenId) == _from); clearApproval(_from, _tokenId); removeToken(_from, _tokenId); addToken(_to, _tokenId); Transfer(_f...
41,993
2
// make sure all was spent
assertEq(coin.balanceOf(address(2)), 0); assertEq(coin.balanceOf(address(rc)), rc.getPrice());
assertEq(coin.balanceOf(address(2)), 0); assertEq(coin.balanceOf(address(rc)), rc.getPrice());
39,196
10
// Create Star using the Struct
function createStar(string memory _name, uint256 _tokenId) public { require( tokenIdToStarInfo[_tokenId].timestamp == 0, "Star with id is exists" ); // Passing the name and tokenId as a parameters //TODO: generate token id Star memory newStar = Star(_n...
function createStar(string memory _name, uint256 _tokenId) public { require( tokenIdToStarInfo[_tokenId].timestamp == 0, "Star with id is exists" ); // Passing the name and tokenId as a parameters //TODO: generate token id Star memory newStar = Star(_n...
1,990
0
// Wrapped ETH.
interface IWETH { /// @dev Deposit ETH into WETH function deposit() external payable; /// @dev Transfer WETH to receiver /// @param to address of WETH receiver /// @param value amount of WETH to transfer /// @return get true when succeed, else false function transfer(address to, uint256 val...
interface IWETH { /// @dev Deposit ETH into WETH function deposit() external payable; /// @dev Transfer WETH to receiver /// @param to address of WETH receiver /// @param value amount of WETH to transfer /// @return get true when succeed, else false function transfer(address to, uint256 val...
2,162
18
// return {BU} How many baskets are being targeted
function basketsNeeded() external view returns (uint192);
function basketsNeeded() external view returns (uint192);
49,431
49
// BURN Land
ILand(farm.land).burn(f.landId); _endFarming(_deployId, farmingResult); emit Harvest( _deployId, msg.sender, uint8(farmingResult), baseChance, bonus.commonAmuletHold, bonus.creatureAmuletBullTrend, bonus.invent...
ILand(farm.land).burn(f.landId); _endFarming(_deployId, farmingResult); emit Harvest( _deployId, msg.sender, uint8(farmingResult), baseChance, bonus.commonAmuletHold, bonus.creatureAmuletBullTrend, bonus.invent...
9,001
114
// set the new delay threshold
timeUntilNextFetchAllowed[_gameId] = block.timestamp + MINUTES_TO_DELAY_FETCH;
timeUntilNextFetchAllowed[_gameId] = block.timestamp + MINUTES_TO_DELAY_FETCH;
27,831
23
// validates reserve ratio range
modifier validReserveRatio(uint8 _ratio) { require(_ratio > 0 && _ratio <= 100); _; }
modifier validReserveRatio(uint8 _ratio) { require(_ratio > 0 && _ratio <= 100); _; }
41,997
173
// Internal functions
function mint( uint8 _mintAmount, string memory _letter, uint16 _letterCount
function mint( uint8 _mintAmount, string memory _letter, uint16 _letterCount
39,847
138
// ======= RANDOM ======= /
function requestRandomWords() external returns (uint256 requestId) { require(msg.sender == CMON); requestId = COORDINATOR.requestRandomWords( keyHash, s_subscriptionId, requestConfirmations, callbackGasLimit, numWords ); s_r...
function requestRandomWords() external returns (uint256 requestId) { require(msg.sender == CMON); requestId = COORDINATOR.requestRandomWords( keyHash, s_subscriptionId, requestConfirmations, callbackGasLimit, numWords ); s_r...
31,390
124
// WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible Requirements: - `tokenId` must not exist. - `to` cannot be the zero address. Emits a {Transfer} event./
function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId);
function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId);
12,146
409
// Add token to the list of networks tokens/_token Token address
function addToken(address _token) external { requireGovernor(msg.sender); require(_token != address(0), "1e0"); require(tokenIds[_token] == 0, "1e"); // token exists require(totalTokens < MAX_AMOUNT_OF_REGISTERED_TOKENS, "1f"); // no free identifiers for tokens totalTokens++...
function addToken(address _token) external { requireGovernor(msg.sender); require(_token != address(0), "1e0"); require(tokenIds[_token] == 0, "1e"); // token exists require(totalTokens < MAX_AMOUNT_OF_REGISTERED_TOKENS, "1f"); // no free identifiers for tokens totalTokens++...
83,151
184
// We can just add the DMG to be swapped with the amount to burn.
amountToSwap = amountToSwap.add(dmgToBurn); IDMGToken(dmg).burn(amountToSwap); emit HarvestFeePaid(__user, __uniswapToken, __tokenFeeAmount, amountToSwap);
amountToSwap = amountToSwap.add(dmgToBurn); IDMGToken(dmg).burn(amountToSwap); emit HarvestFeePaid(__user, __uniswapToken, __tokenFeeAmount, amountToSwap);
40,361
62
// \
{ return min(totalIssuanceDebt(), totalIssuingCollateral()); }
{ return min(totalIssuanceDebt(), totalIssuingCollateral()); }
15,048
73
// Stake JRT tokens and gain a share in stJRT
function stake(uint256 _amount) public { uint256 totalJRT = jrt.balanceOf(address(this)); uint256 totalShares = totalSupply(); // If no stJRT exists, mint it 1:1 to the amount put in if (totalShares == 0 || totalJRT == 0) { _mint(msg.sender, _amount); } /...
function stake(uint256 _amount) public { uint256 totalJRT = jrt.balanceOf(address(this)); uint256 totalShares = totalSupply(); // If no stJRT exists, mint it 1:1 to the amount put in if (totalShares == 0 || totalJRT == 0) { _mint(msg.sender, _amount); } /...
55,384
8
// ADMINChange the tokens address between rounds
function newRound(uint256 date, address tokens) external{ require(block.timestamp>endDate,"too early"); require(msg.sender == admin, "admin function only"); endDate = date; DFTokens = IERC721(tokens); }
function newRound(uint256 date, address tokens) external{ require(block.timestamp>endDate,"too early"); require(msg.sender == admin, "admin function only"); endDate = date; DFTokens = IERC721(tokens); }
12,842
23
// leverageExist
function leverageExist(uint32 leverage_) external view returns (bool);
function leverageExist(uint32 leverage_) external view returns (bool);
13,407
56
// if there is a lockingPeriod, add tokens to record mapping
else _transferLock(_msgSender(),to, tokens); _addRecord(to, tokens, lockingPeriod); return true;
else _transferLock(_msgSender(),to, tokens); _addRecord(to, tokens, lockingPeriod); return true;
5,094
78
// Cancel one or more open orders by nonceCanceled orders are marked CANCELED (0x02)Emits a Cancel event_nonces uint256[]/
function cancel( uint256[] calldata _nonces
function cancel( uint256[] calldata _nonces
50,689
83
// check to see if this is an authorized key
if (address(authorizations[authVersion + uint256(signer)]) != cosigner) { return 0; }
if (address(authorizations[authVersion + uint256(signer)]) != cosigner) { return 0; }
12,116
287
// Adds a new collateral token to the protocol./collateralToken The new collateral token./priceFeed The price feed for the collateral token./newSplitLiquidationCollateral split liquidation collateral contract address.
function addCollateralToken( IERC20 collateralToken, IPriceFeed priceFeed, ISplitLiquidationCollateral newSplitLiquidationCollateral ) external;
function addCollateralToken( IERC20 collateralToken, IPriceFeed priceFeed, ISplitLiquidationCollateral newSplitLiquidationCollateral ) external;
6,117
60
// approve for swap
token.approve(address(currencyConverter()), totalAmount);
token.approve(address(currencyConverter()), totalAmount);
9,038
27
// Emits a {Transfer} event with `to` set to the zero address. Requirements - `account` cannot be the zero address.- `account` must have at least `amount` tokens. /
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _tot...
function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _tot...
22
157
// underlying here is WETH
uint256 balance = underlying.balanceOf(address(this)); // supply at most "balance" if (amountInWETH < balance) { balance = amountInWETH; // only supply the "amount" if its less than what we have }
uint256 balance = underlying.balanceOf(address(this)); // supply at most "balance" if (amountInWETH < balance) { balance = amountInWETH; // only supply the "amount" if its less than what we have }
53,101
4
// uint256 flags;
bytes fallbackAddress; bytes data;
bytes fallbackAddress; bytes data;
13,427