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
19
// can later be changed with {transferOwnership}./ Initializes the contract setting the deployer as the initial owner. /
constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); }
constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); }
2,296
111
// Address points to a boolean indicating if the address has participated in the pool./ Even if they have been refunded and balance is zero/ This mapping internally helps us prevent duplicates from being pushed into swimmersList/ instead of iterating and popping from the list each time a users balance reaches 0.
mapping(address => bool) public invested;
mapping(address => bool) public invested;
30,510
120
// Repay an amount of underlying tokens to the CERC20./underlyingAmount Amount of underlying tokens to repay./ return An error code or zero if there was no error in the repay.
function repayBorrow(uint256 underlyingAmount) external virtual returns (uint256);
function repayBorrow(uint256 underlyingAmount) external virtual returns (uint256);
10,938
14
// Fundraising parameters
enum ContractState { Fundraising } ContractState public state; // Current state of the contract uint256 public constant decimals = 18; //start date: 08/07/2017 @ 12:00am (UTC) uint public startDate = 1506521932; //start date: 09/21/2017 @ 11:59pm (UTC) uint public endDate = 151076...
enum ContractState { Fundraising } ContractState public state; // Current state of the contract uint256 public constant decimals = 18; //start date: 08/07/2017 @ 12:00am (UTC) uint public startDate = 1506521932; //start date: 09/21/2017 @ 11:59pm (UTC) uint public endDate = 151076...
7,120
5
// TCAP Token Address
TCAP public immutable TCAPToken;
TCAP public immutable TCAPToken;
6,963
185
// Withdraw collateral based on given shares and the current share price. Burn shares and return collateral. No withdraw fee will be assessedwhen this function is called. Only some white listed address can call this function. _shares Pool shares. It will be in 18 decimals. /
function whitelistedWithdraw(uint256 _shares) external virtual nonReentrant whenNotShutdown { require(IAddressList(feeWhitelist).contains(_msgSender()), Errors.NOT_WHITELISTED_ADDRESS); _withdrawWithoutFee(_shares); }
function whitelistedWithdraw(uint256 _shares) external virtual nonReentrant whenNotShutdown { require(IAddressList(feeWhitelist).contains(_msgSender()), Errors.NOT_WHITELISTED_ADDRESS); _withdrawWithoutFee(_shares); }
56,665
61
// increment current stage
currentStage = currentStage + 1;
currentStage = currentStage + 1;
37,364
25
// Transfers ownership to msg.sender
ICreditManager(creditManager).transferAccountOwnership(msg.sender); // M:[LA-8]
ICreditManager(creditManager).transferAccountOwnership(msg.sender); // M:[LA-8]
28,634
9
// If the caller is player1 and they placed a bet
if (msg.sender == player1 && player1Bet > 0) { uint bet = player1Bet; player1Bet = 0; // Reset player1's bet pot -= bet; // Reduce the pot player1.transfer(bet); // Transfer the bet back to player1 }
if (msg.sender == player1 && player1Bet > 0) { uint bet = player1Bet; player1Bet = 0; // Reset player1's bet pot -= bet; // Reduce the pot player1.transfer(bet); // Transfer the bet back to player1 }
35,862
6
// fonction qui change le montant du bonus a modifierpour que se soit automatique en fonction du temps pour que ca colle au white paper
function setBonus(uint256 _bonus_Percent) onlyOwner{ bonus_Percent=_bonus_Percent; }
function setBonus(uint256 _bonus_Percent) onlyOwner{ bonus_Percent=_bonus_Percent; }
18,026
84
// Safe math library for the TANSO token. This library takes care of the bit tricky cases that OpenZeppelin's SafeMathUpgradeable.sol doesn't coversuch as "AB / C". /
library TANSOSafeMath_v1 { using SafeMathUpgradeable for uint256; /** * Tries to calculate "A * B / C". * * This function prevents overflow in the 1st operator, which is "A * B", by switching the order of the operator. * i.e., if "(A * B) / C" fails, then tries "(A / C) * B". * * @param A The 1st...
library TANSOSafeMath_v1 { using SafeMathUpgradeable for uint256; /** * Tries to calculate "A * B / C". * * This function prevents overflow in the 1st operator, which is "A * B", by switching the order of the operator. * i.e., if "(A * B) / C" fails, then tries "(A / C) * B". * * @param A The 1st...
58,720
10
// owner only functions Emergency Recovery and kill code in case contract becomes useless (to recover gass)
function withdraw() external onlyOwner { owner.transfer(address(this).balance); }
function withdraw() external onlyOwner { owner.transfer(address(this).balance); }
23,008
214
// Emitted when asset tokens are supplied to sponsor the yield source
event Sponsored( address indexed from, uint256 amount );
event Sponsored( address indexed from, uint256 amount );
3,203
167
// IptToken with Governance.
contract IptToken is ERC20("IptToken", "IPT"), Ownable { /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef). function mint(address _to, uint256 _amount) public onlyOwner { _mint(_to, _amount); _moveDelegates(address(0), _delegates[_to], _amount); } ...
contract IptToken is ERC20("IptToken", "IPT"), Ownable { /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef). function mint(address _to, uint256 _amount) public onlyOwner { _mint(_to, _amount); _moveDelegates(address(0), _delegates[_to], _amount); } ...
16,199
497
// withdraw from weth then transfer withdrawn native token to recipient
IWETH(_nativeTokenWrapper).withdraw(_amount); safeTransferNativeTokenWithWrapper( _to, _amount, _nativeTokenWrapper );
IWETH(_nativeTokenWrapper).withdraw(_amount); safeTransferNativeTokenWithWrapper( _to, _amount, _nativeTokenWrapper );
39,544
73
// haha funny number fuck you snipoooors
} else if (block.number <= launchedAt + 20) {
} else if (block.number <= launchedAt + 20) {
33,236
4
// token -> maxAmount for swap
mapping(address => uint256) public maxTokenAmount;
mapping(address => uint256) public maxTokenAmount;
26,897
17
// - owner can update the sales time - salesStartTime - only whitelisted user, salesEndTime, blackListStartTime /
function updateTime( uint256 salesStartTime, uint256 salesEndTime, uint256 blackListStartTime
function updateTime( uint256 salesStartTime, uint256 salesEndTime, uint256 blackListStartTime
12,490
92
// The address for the Liquidity Providers
AddressParam public liquidityProviderAddressParam;
AddressParam public liquidityProviderAddressParam;
80,028
53
// If not in TEST mode: Check the PoW solution matches the target specified in the block headerSince header cannot be changed due to later tblock check,this should be sufficient for blocks mined according to tblock template
require(rb.blockHash <= bytes32(target), "Difficulty of block to low");
require(rb.blockHash <= bytes32(target), "Difficulty of block to low");
958
151
// balance of pool
uint public NetfBalance;
uint public NetfBalance;
17,190
51
// rates for when someone is selling tokensreturns array of variables to be used in _rawTransfer
function _getSellTaxAmounts(uint256 amount) internal view returns ( uint256 send, uint256 reflect, uint256 rebalancing )
function _getSellTaxAmounts(uint256 amount) internal view returns ( uint256 send, uint256 reflect, uint256 rebalancing )
32,000
196
// Define is stable based fund
isStableCoinBasedFund = permittedAddresses.isMatchTypes(_coinAddress, 4);
isStableCoinBasedFund = permittedAddresses.isMatchTypes(_coinAddress, 4);
9,146
48
// verify there is enough items available to buy the amount verifies sale is in active state under the hood
require(itemsAvailable() >= _amount, "inactive sale or not enough items available");
require(itemsAvailable() >= _amount, "inactive sale or not enough items available");
45,058
35
// sale params
bool public started; uint256 public price; uint256 public ends; uint256 public maxEnds; bool public paused; uint256 public minimum; uint256 public maximum;
bool public started; uint256 public price; uint256 public ends; uint256 public maxEnds; bool public paused; uint256 public minimum; uint256 public maximum;
40,265
8
// send the output of the trade to the message sender
msg.sender, deadline );
msg.sender, deadline );
27,878
56
// Core logic of the ERC20 `balanceOf` function.
function balanceOf(address _owner) external view returns (uint256 balance) { return erc20Store.balances(_owner); }
function balanceOf(address _owner) external view returns (uint256 balance) { return erc20Store.balances(_owner); }
53,739
220
// Performs a Solidity function call using a low level `call`. Aplain `call` is an unsafe replacement for a function call: use thisfunction instead. If `target` reverts with a revert reason, it is bubbled up by thisfunction (like regular Solidity function calls). Returns the raw returned data. To convert to the expecte...
function functionCall(address target, bytes memory data) internal returns (bytes memory)
function functionCall(address target, bytes memory data) internal returns (bytes memory)
15,405
314
// Withdraws entire balance of contract (ETH) to owner account (owner-only)
function withdraw() public onlyOwner { uint256 balance = address(this).balance; msg.sender.transfer(balance); }
function withdraw() public onlyOwner { uint256 balance = address(this).balance; msg.sender.transfer(balance); }
16,958
23
// Return the buy price of 1 individual token.
function buyPrice() public view returns (uint256);
function buyPrice() public view returns (uint256);
22,461
48
// returns the index of a character of the given id characterId the character idreturn the character id/
function getCharacterIndex(uint32 characterId) constant public returns(uint16) { for (uint16 i = 0; i < ids.length; i++) { if (ids[i] == characterId) { return i; } } revert(); }
function getCharacterIndex(uint32 characterId) constant public returns(uint16) { for (uint16 i = 0; i < ids.length; i++) { if (ids[i] == characterId) { return i; } } revert(); }
49,540
18
// Roles contract
contract Roles { /// Address of owner - All privileges address public owner; /// Global operator address address public globalOperator; /// Crowdsale address address public crowdsale; function Roles() public { owner = msg.sender; /// Initially set to 0x0 globalOperator = address(0); ...
contract Roles { /// Address of owner - All privileges address public owner; /// Global operator address address public globalOperator; /// Crowdsale address address public crowdsale; function Roles() public { owner = msg.sender; /// Initially set to 0x0 globalOperator = address(0); ...
14,567
288
// handle the transfer of reward tokens via `transferFrom` to reduce the number of transactions required and ensure correctness of the reward amount
ERC20Upgradeable(_rewardsToken).safeTransferFrom(msg.sender, address(this), reward); if (block.timestamp >= rewardData[_rewardsToken].periodFinish) { rewardData[_rewardsToken].rewardRate = reward / rewardData[_rewardsToken].rewardsDuration; } else {
ERC20Upgradeable(_rewardsToken).safeTransferFrom(msg.sender, address(this), reward); if (block.timestamp >= rewardData[_rewardsToken].periodFinish) { rewardData[_rewardsToken].rewardRate = reward / rewardData[_rewardsToken].rewardsDuration; } else {
47,541
17
// Whether user(to) can receive a reward amount(_amount)/_toa staking contract./_amount the total reward amount of stakeContract/ return true
function canClaim(address _to, uint256 _amount) external view override returns (bool)
function canClaim(address _to, uint256 _amount) external view override returns (bool)
599
7
// How many publicWL have been minted
uint16 public PUBLIC_WL_MINTED; bool public INITIAL_FUNDS_WITHDRAWN; bool public REMAINING_FUNDS_WITHDRAWN; address public TEAM_USA_ADDRESS = 0x0E861ddDA17f7C20996dC0868cAcc200bc1985c0; address public TEAM_JAPAN_ADDRESS = 0xBC77EDd603bEf4004c47A831fDDa437cD906442E; address publ...
uint16 public PUBLIC_WL_MINTED; bool public INITIAL_FUNDS_WITHDRAWN; bool public REMAINING_FUNDS_WITHDRAWN; address public TEAM_USA_ADDRESS = 0x0E861ddDA17f7C20996dC0868cAcc200bc1985c0; address public TEAM_JAPAN_ADDRESS = 0xBC77EDd603bEf4004c47A831fDDa437cD906442E; address publ...
21,402
121
// Admin Functions //Sets a new price oracle for the bControllerAdmin function to set a new price oracle return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)/
function _setPriceOracle(PriceOracle newOracle) public returns (uint) { // Check caller is admin if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.SET_PRICE_ORACLE_OWNER_CHECK); } // Track the old oracle for the bController PriceOracle oldOra...
function _setPriceOracle(PriceOracle newOracle) public returns (uint) { // Check caller is admin if (msg.sender != admin) { return fail(Error.UNAUTHORIZED, FailureInfo.SET_PRICE_ORACLE_OWNER_CHECK); } // Track the old oracle for the bController PriceOracle oldOra...
36,129
523
// helper function to store and validate new chainlink data/_cpiData latest CPI data from BLS/ update will fail if new values exceed deviation threshold of 20% monthly
function _updateCPIData(uint256 _cpiData) internal { require( MAXORACLEDEVIATION.isWithinDeviationThreshold( currentMonth.toInt256(), _cpiData.toInt256() ), "ScalingPriceOracle: Chainlink data outside of deviation threshold" ); ...
function _updateCPIData(uint256 _cpiData) internal { require( MAXORACLEDEVIATION.isWithinDeviationThreshold( currentMonth.toInt256(), _cpiData.toInt256() ), "ScalingPriceOracle: Chainlink data outside of deviation threshold" ); ...
14,084
134
// Price changes must be enabled.
require(allowChangePrice);
require(allowChangePrice);
39,003
121
// A checkpoint storing some data effective from a given block
struct Checkpoint { uint32 fromBlock; uint192 data; // uint32 __reserved; }
struct Checkpoint { uint32 fromBlock; uint192 data; // uint32 __reserved; }
29,199
19
// ---------------------------------------------------------------------------- MintableToken Interface = ERC20 + symbol + name + decimals + mint + burn + approveAndCall ----------------------------------------------------------------------------
contract MintableTokenInterface is ERC20Interface { function symbol() public view returns (string memory); function name() public view returns (string memory); function decimals() public view returns (uint8); function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool s...
contract MintableTokenInterface is ERC20Interface { function symbol() public view returns (string memory); function name() public view returns (string memory); function decimals() public view returns (uint8); function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool s...
48,274
15
// Writes a rate observation to the rates array given the current rate cardinality, rate index and rate cardinality next/ Write oracle entry is called whenever a new position is minted via the vamm or when a swap is initiated via the vamm/ That way the gas costs of Rate Oracle updates can be distributed across organic ...
function writeOracleEntry() external;
function writeOracleEntry() external;
3,581
2
// Checks if a Vault is in the Whitelist./_vault is the Vault address.
function isVaultWhitelisted(address _vault) external view returns (bool);
function isVaultWhitelisted(address _vault) external view returns (bool);
11,128
36
// Shut SAI CDP and gets WETH back
tub.shut(cup); // CDP is closed using the SAI just exited and the MKR previously sent by the user (via the proxy call) tub.exit(pethAmt); // Converts PETH to WETH
tub.shut(cup); // CDP is closed using the SAI just exited and the MKR previously sent by the user (via the proxy call) tub.exit(pethAmt); // Converts PETH to WETH
8,581
8
// View function to return the router path.return The router path. /
function getPath() external view returns (address[] memory) { return _path; }
function getPath() external view returns (address[] memory) { return _path; }
53,263
253
// If there is a vesting period after reward claim Escrow rewards for vesting period in "RewardEscrow" contract
if (rewardsAreEscrowed) { IERC20(token).safeTransfer(address(rewardEscrow), rewardAmount); rewardEscrow.appendVestingEntry( token, msg.sender, address(this), rewardAmount );
if (rewardsAreEscrowed) { IERC20(token).safeTransfer(address(rewardEscrow), rewardAmount); rewardEscrow.appendVestingEntry( token, msg.sender, address(this), rewardAmount );
77,984
17
// unwrap avax from this address
wavax.withdraw(amountX);
wavax.withdraw(amountX);
9,869
24
// EIP191 header for EIP712 prefix
string constant internal EIP191_HEADER = "\x19\x01";
string constant internal EIP191_HEADER = "\x19\x01";
17,809
123
// To check if it actually properly created hermes address, we need to check if he has operator and if with that operator we'll get proper hermes address which has code deployed there.
address _hermesOperator = hermeses[_hermesId].operator; uint256 _implVer = hermeses[_hermesId].implVer; address _addr = getHermesAddress(_hermesOperator, _implVer); if (_addr != _hermesId) return false; // hermesId should be same as generated address return isSmartCo...
address _hermesOperator = hermeses[_hermesId].operator; uint256 _implVer = hermeses[_hermesId].implVer; address _addr = getHermesAddress(_hermesOperator, _implVer); if (_addr != _hermesId) return false; // hermesId should be same as generated address return isSmartCo...
12,080
396
// Sets the beneficiary fee fraction for subsequent Draws.Fires the NextFeeFractionChanged event.Can only be called by an admin. _feeFraction The fee fraction to use.Must be between 0 and 1 and formatted as a fixed point number with 18 decimals (as in Ether). /
function setNextFeeFraction(uint256 _feeFraction) public onlyAdmin { _setNextFeeFraction(_feeFraction); }
function setNextFeeFraction(uint256 _feeFraction) public onlyAdmin { _setNextFeeFraction(_feeFraction); }
41,523
22
// View the amount of dividend in wei that an address has earned in total./accumulativeDividendOf(_owner) = withdrawableDividendOf(_owner) + withdrawnDividendOf(_owner)/_owner The address of a token holder./ return The amount of dividend in wei that `_owner` has earned in total.
function accumulativeDividendOf(address _owner, address _token) external returns (uint256);
function accumulativeDividendOf(address _owner, address _token) external returns (uint256);
29,240
704
// return the number of BUCKET_TIME periods elapsed since the position start, rounded-up
uint256 startTimestamp = margin.getPositionStartTimestamp(positionId); return block.timestamp.sub(startTimestamp).div(bucketTime).add(1);
uint256 startTimestamp = margin.getPositionStartTimestamp(positionId); return block.timestamp.sub(startTimestamp).div(bucketTime).add(1);
72,480
2
// Emitted when an account enters a market
event MarketEntered(address hToken, address account);
event MarketEntered(address hToken, address account);
34,018
35
// destruct function is not necessary for mainnet release
// function destruct() external onlyOwner { // selfdestruct(msg.sender); // }
// function destruct() external onlyOwner { // selfdestruct(msg.sender); // }
9,350
256
// for frontend
function setWhitelistEnable(bool enable) public onlyOwner { whitelistEnable = enable; }
function setWhitelistEnable(bool enable) public onlyOwner { whitelistEnable = enable; }
43,287
146
// distribution of per second
uint256 public rewardRate = 0; uint256 public rewardPerLPToken = 0; mapping(address => uint256) private rewards; mapping(address => uint256) private userRewardPerTokenPaid;
uint256 public rewardRate = 0; uint256 public rewardPerLPToken = 0; mapping(address => uint256) private rewards; mapping(address => uint256) private userRewardPerTokenPaid;
71,249
42
// record inviter reward
address inviter = userInvite[msg.sender]; uint256 reward = availablePending.div(10); balanceInvite[inviter] = balanceInvite[inviter].add(reward); emit InviteReward(inviter, msg.sender, reward);
address inviter = userInvite[msg.sender]; uint256 reward = availablePending.div(10); balanceInvite[inviter] = balanceInvite[inviter].add(reward); emit InviteReward(inviter, msg.sender, reward);
42,034
2
// Base token decimals
uint256 private _bDecimals;
uint256 private _bDecimals;
59,666
52
// called only by linked IRBPreCrowdsale contract to end precrowdsale. /
function endPreTokensale() onlyPreCrowdsaleContract external { require(!isPreFinished); uint256 preCrowdsaleLeftovers = balanceOf(preCrowdsaleTokensWallet); if (preCrowdsaleLeftovers > 0) { balances[preCrowdsaleTokensWallet] = 0; balances[crowdsaleTokensWallet] = bal...
function endPreTokensale() onlyPreCrowdsaleContract external { require(!isPreFinished); uint256 preCrowdsaleLeftovers = balanceOf(preCrowdsaleTokensWallet); if (preCrowdsaleLeftovers > 0) { balances[preCrowdsaleTokensWallet] = 0; balances[crowdsaleTokensWallet] = bal...
1,330
87
// 查询:单个玩家本轮信息 (前端查询用户钱包也是这个方法) 返回:玩家ID,地址,名字,gen,aff,本轮投资额,本轮预计收益,未提现收益
function getPlayerInfoByAddress(address _addr) public view returns(uint256, address, bytes32, uint256, uint256, uint256, uint256, uint256)
function getPlayerInfoByAddress(address _addr) public view returns(uint256, address, bytes32, uint256, uint256, uint256, uint256, uint256)
7,903
6
// If item got a new owner, transfer ownership
if (newOwner != ownerOfItem[_id]) { transferOwnership(ownerOfItem[_id], newOwner, _id); }
if (newOwner != ownerOfItem[_id]) { transferOwnership(ownerOfItem[_id], newOwner, _id); }
30,832
309
// Wrapper around the decodeProof from VRF library./Decode VRF proof from bytes./_proof The VRF proof as an array composed of `[gamma-x, gamma-y, c, s]`./ return The VRF proof as an array composed of `[gamma-x, gamma-y, c, s]`.
function decodeProof(bytes calldata _proof) external pure returns (uint[4] memory) { return VRF.decodeProof(_proof); }
function decodeProof(bytes calldata _proof) external pure returns (uint[4] memory) { return VRF.decodeProof(_proof); }
12,723
2
// LPT
tokens.push(IERC20(0x289ba1701C2F088cf0faf8B3705246331cB8A839)); amounts.push(0.001 ether);
tokens.push(IERC20(0x289ba1701C2F088cf0faf8B3705246331cB8A839)); amounts.push(0.001 ether);
20,003
2
// Validates if a user can call: target.call(data) in the FunWalletreturn sigTimeRange Valid Time Range of the signature. /
function isValidAction(address target, uint256 value, bytes memory data, bytes memory signature, bytes32 _hash) external view returns (uint256);
function isValidAction(address target, uint256 value, bytes memory data, bytes memory signature, bytes32 _hash) external view returns (uint256);
23,714
3
// The royalty percent
uint96 public royaltyPercent;
uint96 public royaltyPercent;
38,414
910
// Accessor method to compute a transformed price using the finanicalProductLibrary specified at contractdeployment. If no library was provided then no modification to the price is done. price input price to be transformed. requestTime timestamp the oraclePrice was requested at.return transformedPrice price with the tr...
function transformPrice(FixedPoint.Unsigned memory price, uint256 requestTime) public view nonReentrantView() returns (FixedPoint.Unsigned memory)
function transformPrice(FixedPoint.Unsigned memory price, uint256 requestTime) public view nonReentrantView() returns (FixedPoint.Unsigned memory)
51,953
112
// reset taxes after 5 blocks
if (block.number >= (dragonBlock + 5) && buyTotalFees > 50) { buyMarketingFee = 2; buyLiquidityFee = 2; buyDevFee = 1; buyTotalFees = buyMarketingFee + buyLiquidityFee + buyDevFee; }
if (block.number >= (dragonBlock + 5) && buyTotalFees > 50) { buyMarketingFee = 2; buyLiquidityFee = 2; buyDevFee = 1; buyTotalFees = buyMarketingFee + buyLiquidityFee + buyDevFee; }
12,404
28
// Lets you deposit ETH in the SC
function depositEth() external payable
function depositEth() external payable
3,508
182
// if player is new to round
if (plyrRnds_[_pID][_rID].keys == 0) _eventData_ = managePlayer(_pID, _eventData_);
if (plyrRnds_[_pID][_rID].keys == 0) _eventData_ = managePlayer(_pID, _eventData_);
33,359
147
// no minting is required, the contract already has token balance pre-allocated accumulated HOLY per share is stored multiplied by 10^12 to allow small 'fractional' values
pool.accHolyPerShare = pool.accHolyPerShare.add(tokenRewardAccumulated.mul(1e12).div(lpSupply)); pool.lastRewardCalcBlock = block.number;
pool.accHolyPerShare = pool.accHolyPerShare.add(tokenRewardAccumulated.mul(1e12).div(lpSupply)); pool.lastRewardCalcBlock = block.number;
29,870
29
// Transfers a given amount tokens to the address specified.to The address to transfer to.value The amount to be transferred. return Returns true in case of success./
function transfer(address to, uint256 value) public override returns (bool) { require (executeErc20Transfer(msg.sender, to, value), "Failed to execute ERC20 transfer"); return true; }
function transfer(address to, uint256 value) public override returns (bool) { require (executeErc20Transfer(msg.sender, to, value), "Failed to execute ERC20 transfer"); return true; }
14,979
158
// set BbonusEndBlock
function setEndParam(uint256 _amount) public onlyOwner { bonusEndBlock = _amount; }
function setEndParam(uint256 _amount) public onlyOwner { bonusEndBlock = _amount; }
33,364
36
// UKTTokenBasic UKTTokenBasic interface /
contract UKTTokenBasic is ERC223, BurnableToken { bool public isControlled = false; bool public isConfigured = false; bool public isAllocated = false; // mapping of string labels to initial allocated addresses mapping(bytes32 => address) public allocationAddressesTypes; // mapping of addresses to time lock pe...
contract UKTTokenBasic is ERC223, BurnableToken { bool public isControlled = false; bool public isConfigured = false; bool public isAllocated = false; // mapping of string labels to initial allocated addresses mapping(bytes32 => address) public allocationAddressesTypes; // mapping of addresses to time lock pe...
13,950
8
// Returns option details _optionId Option ID /
function options(uint256 _optionId)
function options(uint256 _optionId)
40,542
8
// booleans
bool isOffer = false; bool isApproved = false;
bool isOffer = false; bool isApproved = false;
34,742
8
// Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing/ Returns the downcasted uint248 from uint256, reverting onoverflow (when the input is greater than largest uint248). Counterpart to Solidity's `uint248` operator. Requirements: - input must fit into 248 bits _Available ...
function toUint248(uint256 value) internal pure returns (uint248) { require(value <= type(uint248).max, "SafeCast: value doesn't fit in 248 bits"); return uint248(value); }
function toUint248(uint256 value) internal pure returns (uint248) { require(value <= type(uint248).max, "SafeCast: value doesn't fit in 248 bits"); return uint248(value); }
25,753
23
// Announce that funding has been closed.
emit FundingClosed(address(this).balance, operatorTokens); _withdraw();
emit FundingClosed(address(this).balance, operatorTokens); _withdraw();
39,422
0
// Throws if interest is bearing not enabled. token address, for which interest should be enabled. /
modifier interestEnabled(address token) { require(isInterestEnabled(token)); /* solcov ignore next */ _; }
modifier interestEnabled(address token) { require(isInterestEnabled(token)); /* solcov ignore next */ _; }
2,671
0
// mapoing for files
mapping(uint => File) public files;
mapping(uint => File) public files;
13,263
168
// ========== OLD ESCROW LOOKUP ========== // ========== MIGRATION OLD ESCROW ========== //Import function for owner to import vesting scheduleAddresses with totalEscrowedAccountBalance == 0 will not be migrated as they have all vested /
function importVestingSchedule( address[] calldata accounts, uint256[] calldata vestingTimestamps, uint256[] calldata escrowAmounts
function importVestingSchedule( address[] calldata accounts, uint256[] calldata vestingTimestamps, uint256[] calldata escrowAmounts
33,439
2
// event EMAUpdated(uint256 newEMA);
modifier updatesEMA(uint256 value)
modifier updatesEMA(uint256 value)
39,697
100
// Checks if the msg.sender is a contract or a proxy /
modifier notContract() { require(!_isContract(msg.sender), "contract not allowed"); require(msg.sender == tx.origin, "proxy contract not allowed"); _; }
modifier notContract() { require(!_isContract(msg.sender), "contract not allowed"); require(msg.sender == tx.origin, "proxy contract not allowed"); _; }
289
8
// Emitted when a wallet claim count is updated.
event WalletClaimCountUpdated(uint256 tokenId, address indexed wallet, uint256 count);
event WalletClaimCountUpdated(uint256 tokenId, address indexed wallet, uint256 count);
36,124
1
// typeName as index, dynamic array as getAt function and mapping as search
bytes32 typeName; address[] fellow; mapping (address => bool) isFellow; bytes32[8] extra;
bytes32 typeName; address[] fellow; mapping (address => bool) isFellow; bytes32[8] extra;
32,925
10
// Maximum supply of tokens that can be minted for each token id. If zero, this token is open edition and has no mint limit
mapping(uint256 => uint256) public tokenMaxSupply;
mapping(uint256 => uint256) public tokenMaxSupply;
17,088
17
// Couple Image Hash
string public coupleImageIPFShash;
string public coupleImageIPFShash;
13,726
34
// Using this function a spender transfers tokens and make an owner of funds a participatants of the operating JackpotUser set the net value of transfer without the Jackpot reserving deposit amount
function transferFromWithReservingNet(address _from, address _to, uint _netTransfer) public returns (bool success) { uint totalTransfer = _netTransfer * (10000 + reservingPercentage) / 10000; require(balances[_from] >= totalTransfer && (totalTransfer > _netTransfer)); if (transferFrom(_fro...
function transferFromWithReservingNet(address _from, address _to, uint _netTransfer) public returns (bool success) { uint totalTransfer = _netTransfer * (10000 + reservingPercentage) / 10000; require(balances[_from] >= totalTransfer && (totalTransfer > _netTransfer)); if (transferFrom(_fro...
13,640
10
// modifiers for restricting access to methods
modifier onlyOwner { require(owner == msg.sender); _; }
modifier onlyOwner { require(owner == msg.sender); _; }
14,084
128
// flag for each address and erc165 interface to indicate if it is cached.
mapping(address => mapping(bytes4 => bool)) internal erc165Cached;
mapping(address => mapping(bytes4 => bool)) internal erc165Cached;
60,862
152
// Teams' leaders info
uint256[] memory _idList = new uint256[](_tID); uint256[] memory _leaderIDList = new uint256[](_tID); bytes32[] memory _leaderNameList = new bytes32[](_tID); address[] memory _leaderAddrList = new address[](_tID);
uint256[] memory _idList = new uint256[](_tID); uint256[] memory _leaderIDList = new uint256[](_tID); bytes32[] memory _leaderNameList = new bytes32[](_tID); address[] memory _leaderAddrList = new address[](_tID);
2,031
6
// Tarot variables{usedPools} - A set of pool addresses which are the authorized lending pools that can be used{maxPools} - Sets the maximum amount of pools that can be added{depositPool} - Address of the pool that regular deposits will go to{sharePriceSnapshot} - Saves the pricePerFullShare to be compared between harv...
EnumerableSetUpgradeable.AddressSet private usedPools; uint256 public maxPools;
EnumerableSetUpgradeable.AddressSet private usedPools; uint256 public maxPools;
20,671
0
// Pool state that can change/These methods compose the pool's state, and can change with any frequency including multiple times/ per transaction
interface IPancakeV3PoolState { /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas /// when accessed externally. /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value /// tick The current tick of the pool,...
interface IPancakeV3PoolState { /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas /// when accessed externally. /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value /// tick The current tick of the pool,...
30,530
197
// Return the debt share of the given bank token for the given position id./positionId position id to get debt of/token ERC20 debt token to query
function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { return positions[positionId].debtShareOf[token]; }
function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { return positions[positionId].debtShareOf[token]; }
15,187
4
// Reschedule call the contract.Returns a boolean value indicating whether the operation succeeded. /
function rescheduleCall( uint256 min_delay, bytes memory task_id
function rescheduleCall( uint256 min_delay, bytes memory task_id
49,728
4
// Convert unsigned 256-bit integer number into signed 64.64-bit fixed pointnumber.Revert on overflow.x unsigned 256-bit integer numberreturn signed 64.64-bit fixed point number /
function fromUInt (uint256 x) internal pure returns (int128) { unchecked { require (x <= 0x7FFFFFFFFFFFFFFF); return int128 (int256 (x << 64)); } }
function fromUInt (uint256 x) internal pure returns (int128) { unchecked { require (x <= 0x7FFFFFFFFFFFFFFF); return int128 (int256 (x << 64)); } }
51,852
71
// adding this animal as a child to the parents who mated to produce this offspring
childrenIdAgainstAnimalId[parent1Id].push(uniqueAnimalId); childrenIdAgainstAnimalId[parent2Id].push(uniqueAnimalId);
childrenIdAgainstAnimalId[parent1Id].push(uniqueAnimalId); childrenIdAgainstAnimalId[parent2Id].push(uniqueAnimalId);
1,260
5
// Withdraw the given amount of LP tokens from the given pool
function withdraw(uint256 _pid, uint256 _amount) external;
function withdraw(uint256 _pid, uint256 _amount) external;
40,483
4
// Check if offer still valid
require( block.timestamp <= offer.expiredAt, "Cover Gateway: Offer expired" ); require( _buyCover.coverMonths >= offer.minCoverMonths, "Cover Gateway: Requested Cover month smaller than minimal cover month" );
require( block.timestamp <= offer.expiredAt, "Cover Gateway: Offer expired" ); require( _buyCover.coverMonths >= offer.minCoverMonths, "Cover Gateway: Requested Cover month smaller than minimal cover month" );
19,227
18
// currency events
event ExchangeRatesUpdated(uint timestamp, uint dataInUsd);
event ExchangeRatesUpdated(uint timestamp, uint dataInUsd);
20,784
90
// asyncDefiInteractionHashes[asyncArrayLen] = defiInteractionHash
mstore(0x00, asyncArrayLen) mstore(0x20, asyncDefiInteractionHashes.slot) sstore(keccak256(0x00, 0x40), defiInteractionHash)
mstore(0x00, asyncArrayLen) mstore(0x20, asyncDefiInteractionHashes.slot) sstore(keccak256(0x00, 0x40), defiInteractionHash)
14,665
52
// Execution
function swapCurve(address[] memory pools,address[] memory tokens, uint8[] memory metas, uint amount,uint out, uint i, address to) internal{ (int128 fromIndex, int128 toIndex, bool isUnderlying) = decodeCurveMetaData(metas[i]); IERC20(tokens[i]).approve(pools[i], amount); if(isUnderlying){ ...
function swapCurve(address[] memory pools,address[] memory tokens, uint8[] memory metas, uint amount,uint out, uint i, address to) internal{ (int128 fromIndex, int128 toIndex, bool isUnderlying) = decodeCurveMetaData(metas[i]); IERC20(tokens[i]).approve(pools[i], amount); if(isUnderlying){ ...
18,647