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
2
// DynamicOwnership public origin;
constructor() ERC20("Informations", "Extension")
constructor() ERC20("Informations", "Extension")
27,729
10
// More than this much time must pass between rebase operations.
uint256 public minRebaseTimeIntervalSec;
uint256 public minRebaseTimeIntervalSec;
23,033
39
// Stops collecting onchain transactions
function stopBroadcast() external;
function stopBroadcast() external;
25,573
536
// updates the state of the user as a consequence of a stable rate rebalance_reserve the address of the principal reserve where the user borrowed_user the address of the borrower_balanceIncrease the accrued interest on the borrowed amount_amountBorrowed the accrued interest on the borrowed amount/
) internal { CoreLibrary.InterestRateMode previousRateMode = getUserCurrentBorrowRateMode( _reserve, _user ); CoreLibrary.ReserveData storage reserve = reserves[_reserve]; if (previousRateMode == CoreLibrary.InterestRateMode.STABLE) { CoreLibrary....
) internal { CoreLibrary.InterestRateMode previousRateMode = getUserCurrentBorrowRateMode( _reserve, _user ); CoreLibrary.ReserveData storage reserve = reserves[_reserve]; if (previousRateMode == CoreLibrary.InterestRateMode.STABLE) { CoreLibrary....
16,404
96
// 1 ETH = 750 ASTC
uint256 private _rate = 750;
uint256 private _rate = 750;
51,353
123
// Amount of time--in seconds--a user must wait to withdraw an NFT.
uint256 withdrawalDelay;
uint256 withdrawalDelay;
53,861
195
// Duplicated signatures
require(!messagesSigned(hashSender));
require(!messagesSigned(hashSender));
29,888
184
// Returns averge fees in this epoch
function averageFeesPerBlockEpoch(uint256 _pid) external view returns (uint256 averagePerBlock)
function averageFeesPerBlockEpoch(uint256 _pid) external view returns (uint256 averagePerBlock)
2,481
11
// Indicates that tokens were minted by permitted user/assetType 0-native, 1-ERC20, 2-ERC721, 3-ERC1155/sender The sender of the minting transaction/receiver The receiver of tokens/amount The amount of tokens to mint/token The address of token to mint/tokenId The ID of token to mint (0 if fungible tokens)/targetChain T...
event Mint( Assets assetType, address indexed sender, address receiver, uint256 amount, address indexed token, uint256 indexed tokenId, string targetChain );
event Mint( Assets assetType, address indexed sender, address receiver, uint256 amount, address indexed token, uint256 indexed tokenId, string targetChain );
31,120
144
// reset reserve so it doesnt interfere anywhere else
setReserve(0);
setReserve(0);
25,042
28
// Admin function for setting the proposal thresholdnewProposalThreshold must be greater than the hardcoded minnewProposalThreshold new proposal threshold/
function _setProposalThreshold(uint newProposalThreshold) external { require(msg.sender == admin, "GovernorBravo::_setProposalThreshold: admin only"); require(newProposalThreshold >= MIN_PROPOSAL_THRESHOLD && newProposalThreshold <= MAX_PROPOSAL_THRESHOLD, "GovernorBravo::_setProposalThreshold: inva...
function _setProposalThreshold(uint newProposalThreshold) external { require(msg.sender == admin, "GovernorBravo::_setProposalThreshold: admin only"); require(newProposalThreshold >= MIN_PROPOSAL_THRESHOLD && newProposalThreshold <= MAX_PROPOSAL_THRESHOLD, "GovernorBravo::_setProposalThreshold: inva...
25,556
79
// If y is `UNIT`, the result is always x.
else if (yUint == uUNIT) { return x; }
else if (yUint == uUNIT) { return x; }
31,498
75
// Set the current action being executed (STORES) -
mstore(0xe0, action_req)
mstore(0xe0, action_req)
74,502
13
// Initializes the contract setting the deployer as the initial owner. /
function initialize(address sender) public initializer { _owner = sender; emit OwnershipTransferred(address(0), _owner); }
function initialize(address sender) public initializer { _owner = sender; emit OwnershipTransferred(address(0), _owner); }
457
110
// Returns true if the gauntlet has expired. Otherwise, false.
function isGauntletExpired(address holder) internal view returns(bool) { if (gauntletType[holder] != 0) { if (gauntletType[holder] == 1) { return (block.timestamp >= gauntletEnd[holder]); } else if (gauntletType[holder] == 2) { return (hourglass.totalSupply() >= gauntletEnd[holder]); } else if (gaun...
function isGauntletExpired(address holder) internal view returns(bool) { if (gauntletType[holder] != 0) { if (gauntletType[holder] == 1) { return (block.timestamp >= gauntletEnd[holder]); } else if (gauntletType[holder] == 2) { return (hourglass.totalSupply() >= gauntletEnd[holder]); } else if (gaun...
16,391
88
// cooldown on buys
if(from == uniswapV2Pair && !_isExcludedFromFee[to]) { if(_cooldownEnabled) { require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (30 seconds); }
if(from == uniswapV2Pair && !_isExcludedFromFee[to]) { if(_cooldownEnabled) { require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (30 seconds); }
38,279
10
// Returns the last Wtinet epoch known to the block relay instance./ return The last epoch is used in the WRB to avoid reusage of PoI in a data request.
function getLastEpoch() external view returns(uint256) { return blockRelayInstance.getLastEpoch(); }
function getLastEpoch() external view returns(uint256) { return blockRelayInstance.getLastEpoch(); }
15,974
1
// compare: Delaware resource: https:icis.corp.delaware.gov/Ecorp/FieldDesc.aspxENTITY%20TYPE
enum Kind { CORP, LP, LLC, TRUST, PARTNERSHIP, UNPA }
enum Kind { CORP, LP, LLC, TRUST, PARTNERSHIP, UNPA }
8,065
264
// BeaconProxy Contract/Enzyme Council <[email protected]>/A proxy contract that uses the beacon pattern for instant upgrades
contract BeaconProxy { address private immutable BEACON; constructor(bytes memory _constructData, address _beacon) public { BEACON = _beacon; (bool success, bytes memory returnData) = IBeacon(_beacon).getCanonicalLib().delegatecall( _constructData ); require(success...
contract BeaconProxy { address private immutable BEACON; constructor(bytes memory _constructData, address _beacon) public { BEACON = _beacon; (bool success, bytes memory returnData) = IBeacon(_beacon).getCanonicalLib().delegatecall( _constructData ); require(success...
9,525
2
// @inheritdoc IRMRKERC721WrapperDeployer /
function wrapCollection( address originalCollection, uint256 maxSupply, address royaltiesRecipient, uint256 royaltyPercentageBps, string memory collectionMetadataURI
function wrapCollection( address originalCollection, uint256 maxSupply, address royaltiesRecipient, uint256 royaltyPercentageBps, string memory collectionMetadataURI
41,383
29
// split a lock into two seperate locks, useful when a lock is about to expire and youd like to relock a portionand withdraw a smaller portion /
function splitLock (address _lpToken, uint256 _index, uint256 _lockID, uint256 _amount) external payable nonReentrant { require(_amount > 0, 'ZERO AMOUNT'); uint256 lockID = users[msg.sender].locksForToken[_lpToken][_index]; TokenLock storage userLock = tokenLocks[_lpToken][lockID]; ...
function splitLock (address _lpToken, uint256 _index, uint256 _lockID, uint256 _amount) external payable nonReentrant { require(_amount > 0, 'ZERO AMOUNT'); uint256 lockID = users[msg.sender].locksForToken[_lpToken][_index]; TokenLock storage userLock = tokenLocks[_lpToken][lockID]; ...
31,113
87
// Validates liquidateBorrow and reverts on rejection. May emit logs. cTokenBorrowed Asset which was borrowed by the borrower cTokenCollateral Asset which was used as collateral and will be seized liquidator The address repaying the borrow and seizing the collateral borrower The address of the borrower actualRepayAmoun...
function liquidateBorrowVerify( address cTokenBorrowed, address cTokenCollateral, address liquidator, address borrower, uint256 actualRepayAmount, uint256 seizeTokens
function liquidateBorrowVerify( address cTokenBorrowed, address cTokenCollateral, address liquidator, address borrower, uint256 actualRepayAmount, uint256 seizeTokens
14,058
146
// At the end of the AM programme there might be a case where the artist mining amount is actually less than what has been already withdrawn, because we have a global cap on the total AM amount
uint128 nilToMint = artistMining > withdrawal.artistMiningWithdrawn ? artistMining - withdrawal.artistMiningWithdrawn : 0; if (nilToMint > 0) { totalNilMinted += nilToMint; withdrawals[mintId].artistMiningWithdrawn += nilToMint; ...
uint128 nilToMint = artistMining > withdrawal.artistMiningWithdrawn ? artistMining - withdrawal.artistMiningWithdrawn : 0; if (nilToMint > 0) { totalNilMinted += nilToMint; withdrawals[mintId].artistMiningWithdrawn += nilToMint; ...
3,444
4
// Returns the configuration singleton. /
function load() internal pure returns (Data storage systemPoolConfiguration) { bytes32 s = _SLOT_SYSTEM_POOL_CONFIGURATION; assembly { systemPoolConfiguration.slot := s } }
function load() internal pure returns (Data storage systemPoolConfiguration) { bytes32 s = _SLOT_SYSTEM_POOL_CONFIGURATION; assembly { systemPoolConfiguration.slot := s } }
25,788
246
// ALLOW crvIBPool Gauge
address _crvIBGauge = 0xF5194c3325202F456c95c1Cf0cA36f8475C1949F; address _crvIBToken = 0x5282a4eF67D9C33135340fB3289cc1711c13638C; _approveMax(_crvIBToken, _crvIBGauge); _addWhitelist(_crvIBGauge, deposit_gauge, false); _addWhitelist(_crvIBGauge, withdraw_gauge, false);
address _crvIBGauge = 0xF5194c3325202F456c95c1Cf0cA36f8475C1949F; address _crvIBToken = 0x5282a4eF67D9C33135340fB3289cc1711c13638C; _approveMax(_crvIBToken, _crvIBGauge); _addWhitelist(_crvIBGauge, deposit_gauge, false); _addWhitelist(_crvIBGauge, withdraw_gauge, false);
69,655
161
// Upgrade the WRB
currentWitnetRequestBoard = WitnetRequestBoardInterface(_newAddress);
currentWitnetRequestBoard = WitnetRequestBoardInterface(_newAddress);
59,831
0
// maps of addresses unlock amounts and multipliers
mapping(address => uint256) public bonusMultipliers; mapping(address => uint256) public bonusAmountCaps; event UnlockOracleUpdate(uint256 weightedPrice, uint256 weightedMarketCap, uint256 bonusPortionUnlocked, uint256 bonusTotalUnlocked); bytes32 public constant BONUSORACLE_ROLE = keccak256("BONUSORA...
mapping(address => uint256) public bonusMultipliers; mapping(address => uint256) public bonusAmountCaps; event UnlockOracleUpdate(uint256 weightedPrice, uint256 weightedMarketCap, uint256 bonusPortionUnlocked, uint256 bonusTotalUnlocked); bytes32 public constant BONUSORACLE_ROLE = keccak256("BONUSORA...
41,919
170
// Perform initial distribution
uint256 tokenCap = CappedToken(token).cap();
uint256 tokenCap = CappedToken(token).cap();
41,140
81
// Enable or disable the ability of `superOperator` to transfer tokens of all (superOperator rights)./superOperator address that will be given/removed superOperator right./enabled set whether the superOperator is enabled or disabled.
function setSuperOperator(address superOperator, bool enabled) external { require( msg.sender == _admin, "only admin is allowed to add super operators" ); _superOperators[superOperator] = enabled; emit SuperOperator(superOperator, enabled); }
function setSuperOperator(address superOperator, bool enabled) external { require( msg.sender == _admin, "only admin is allowed to add super operators" ); _superOperators[superOperator] = enabled; emit SuperOperator(superOperator, enabled); }
19,983
184
// sqrt(Pold/Pnew) = sqrt((232)M_oldPnewDenominator / (S_oldPnewNumerator)) / (216) sell, stock-into-pool, Pold > Pnew
uint numerator = reserveMoney/*112bits*/ * price.denominator/*76+64bits*/; uint denominator = reserveStock/*112bits*/ * price.numerator/*54+64bits*/; if(isBuy) { // buy, money-into-pool, Pold < Pnew
uint numerator = reserveMoney/*112bits*/ * price.denominator/*76+64bits*/; uint denominator = reserveStock/*112bits*/ * price.numerator/*54+64bits*/; if(isBuy) { // buy, money-into-pool, Pold < Pnew
28,065
46
// Set the TOKEN-LETTER stability fee (e.g. 1% = 1000000000315522921573372069)
JugAbstract(MCD_JUG).file(ilk, "duty", SIX_PCT_RATE);
JugAbstract(MCD_JUG).file(ilk, "duty", SIX_PCT_RATE);
80,606
11
// Presale is inactive
error Presale_Inactive();
error Presale_Inactive();
5,753
110
// it calculates (1 - fee)amountApplies the fee by subtracting fees from the amount and returnsthe amount after deducting the fee. /
function applyFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { return _amount.mul(FEE_BASE.sub(_feeInBips)).div(FEE_BASE); }
function applyFee(uint256 _feeInBips, uint256 _amount) internal pure returns (uint256) { return _amount.mul(FEE_BASE.sub(_feeInBips)).div(FEE_BASE); }
30,193
49
// Emitted whenever a user's stake is increased or decreased.
event ChangeStake(uint week, uint indexed game, address indexed staker, uint prevStake, uint newStake, uint accountStake, uint gameStake, uint totalStake);
event ChangeStake(uint week, uint indexed game, address indexed staker, uint prevStake, uint newStake, uint accountStake, uint gameStake, uint totalStake);
64,550
99
// Checks if provided address has operator or owner permissions. /
function isOperator(address _addr) public view returns (bool) { return operatorAddress[_addr] || ownerAddress[_addr]; }
function isOperator(address _addr) public view returns (bool) { return operatorAddress[_addr] || ownerAddress[_addr]; }
35,822
41
// ESG payout
pending = user.amount.mul(pool.accEsgPerShare).div(1e12).sub( user.esgRewardDebt ); safeEsxTransfer(esg, msg.sender, pending); user.amount = user.amount.sub(_amount); user.esmRewardDebt = user.amount.mul(pool.accEsmPerShare).div(1e12); use...
pending = user.amount.mul(pool.accEsgPerShare).div(1e12).sub( user.esgRewardDebt ); safeEsxTransfer(esg, msg.sender, pending); user.amount = user.amount.sub(_amount); user.esmRewardDebt = user.amount.mul(pool.accEsmPerShare).div(1e12); use...
31,236
142
// Gets the balance of the specified address. _account Address to query the balance of.return A uint256 representing the amount of base units owned by thespecified address. /
function balanceOf(address _account) public view override returns (uint256)
function balanceOf(address _account) public view override returns (uint256)
25,947
90
// =======FeeManagement=======
function excludeFromFees(address account) external onlyOwner { require(!_isExcludedFromFees[account], "Account is already the value of true"); _isExcludedFromFees[account] = true; emit ExcludeFromFees(account); }
function excludeFromFees(address account) external onlyOwner { require(!_isExcludedFromFees[account], "Account is already the value of true"); _isExcludedFromFees[account] = true; emit ExcludeFromFees(account); }
1,584
275
// Returns the ongoing normalized variable debt for the reserveA value of 1e27 means there is no debt. As time passes, the income is accruedA value of 21e27 means that for each unit of debt, one unit worth of interest has been accumulated reserve The reserve objectreturn The normalized variable debt. expressed in ray /
{ uint40 timestamp = reserve.lastUpdateTimestamp; //solium-disable-next-line if (timestamp == uint40(block.timestamp)) { //if the index was updated in the same block, no need to perform any calculation return reserve.variableBorrowIndex; } uint256 cumulated = MathUtils.calculat...
{ uint40 timestamp = reserve.lastUpdateTimestamp; //solium-disable-next-line if (timestamp == uint40(block.timestamp)) { //if the index was updated in the same block, no need to perform any calculation return reserve.variableBorrowIndex; } uint256 cumulated = MathUtils.calculat...
18,872
9
// Transfer the old OpenSea Shared Storefront token to this contract (with ability for owner to retrieve in case of error)
Opensea(openseaSharedAddress).safeTransferFrom(msg.sender, burnAddress, oldId, 1, "");
Opensea(openseaSharedAddress).safeTransferFrom(msg.sender, burnAddress, oldId, 1, "");
4,039
14
// deploying minimal proxy contracts, also known as "clones". > To simply and cheaply clone contract functionality in an immutable way, this standard specifies> a minimal bytecode implementation that delegates all calls to a known, fixed address. The library includes functions to deploy a proxy using either `create` (t...
library Clones { /** * @dev A clone instance deployment failed. */ error ERC1167FailedCreateClone(); /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ ...
library Clones { /** * @dev A clone instance deployment failed. */ error ERC1167FailedCreateClone(); /** * @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`. * * This function uses the create opcode, which should never revert. */ ...
28,324
31
// Buy ejected fyToken in the strategy at face value/fyTokenTo Address to send the purchased fyToken to./baseTo Address to send any remaining base to./ return soldFYToken Amount of fyToken sold./ return returnedBase Amount of base unused and returned.
function buyFYToken(address fyTokenTo, address baseTo) external isState(State.EJECTED) returns (uint256 soldFYToken, uint256 returnedBase)
function buyFYToken(address fyTokenTo, address baseTo) external isState(State.EJECTED) returns (uint256 soldFYToken, uint256 returnedBase)
42,199
158
// Cancels all motions with given ids/_motionIds Ids of motions to cancel
function cancelMotions(uint256[] memory _motionIds) external onlyRole(CANCEL_ROLE) { for (uint256 i = 0; i < _motionIds.length; ++i) { if (motionIndicesByMotionId[_motionIds[i]] > 0) { _deleteMotion(_motionIds[i]); emit MotionCanceled(_motionIds[i]); }...
function cancelMotions(uint256[] memory _motionIds) external onlyRole(CANCEL_ROLE) { for (uint256 i = 0; i < _motionIds.length; ++i) { if (motionIndicesByMotionId[_motionIds[i]] > 0) { _deleteMotion(_motionIds[i]); emit MotionCanceled(_motionIds[i]); }...
25,230
77
// mapping to store authorization for DeveloperTransfer
mapping(address => mapping(address => bool)) isAuthorizedDeveloper;
mapping(address => mapping(address => bool)) isAuthorizedDeveloper;
1,355
27
// calculate a purchase purchaseHash
_purchaseHash = bytes32(keccak256(abi.encodePacked(_purchaseHash, block.difficulty, block.timestamp, msg.sender)));
_purchaseHash = bytes32(keccak256(abi.encodePacked(_purchaseHash, block.difficulty, block.timestamp, msg.sender)));
14,585
55
// claim advisors tokens from the contract balance.Can be used only by an owner or from advisorsAddress.Tokens will be send to sender address. /
function claimAdvisorsTokens() public { require(msg.sender == advisorsAddress || msg.sender == owner(), "Unauthorised sender"); require(TGE > 0, "TGE must be set"); //6 months of vestiong period require(now >= TGE + 6*month, "Vesting period"); uint amount = 0; ...
function claimAdvisorsTokens() public { require(msg.sender == advisorsAddress || msg.sender == owner(), "Unauthorised sender"); require(TGE > 0, "TGE must be set"); //6 months of vestiong period require(now >= TGE + 6*month, "Vesting period"); uint amount = 0; ...
40,593
0
// ------------------------------------------------------------------------ Token conf slotsfunction GetTokenConf(uint ID)internal view returns (TypeGate memory Data)
// { // uint PosHeader=(0xABCD<<240) | (ID<<192); // // solhint-disable-next-line no-inline-assembly // assembly // { // //Data := sload(PosHeader) - низзя так // } // }
// { // uint PosHeader=(0xABCD<<240) | (ID<<192); // // solhint-disable-next-line no-inline-assembly // assembly // { // //Data := sload(PosHeader) - низзя так // } // }
34,461
38
// update token and fee by ID
users[user].userPositionData[shortID].tokenShortedByPositionID = tokenToShort; users[user].userPositionData[shortID].tokenAmountByPositionID = tokenTradeSize; users[user].userPositionData[shortID].poolFeeByPositionID = poolFee;
users[user].userPositionData[shortID].tokenShortedByPositionID = tokenToShort; users[user].userPositionData[shortID].tokenAmountByPositionID = tokenTradeSize; users[user].userPositionData[shortID].poolFeeByPositionID = poolFee;
51,080
0
// Synthetix Depot interface /
contract IDepot { function exchangeEtherForSynths() public payable returns (uint); function exchangeEtherForSynthsAtRate(uint guaranteedRate) external payable returns (uint); function depositSynths(uint amount) external; function withdrawMyDepositedSynths() external; // Deprecated ABI for MAINNE...
contract IDepot { function exchangeEtherForSynths() public payable returns (uint); function exchangeEtherForSynthsAtRate(uint guaranteedRate) external payable returns (uint); function depositSynths(uint amount) external; function withdrawMyDepositedSynths() external; // Deprecated ABI for MAINNE...
40,813
114
// Sets the data for the buffer without encoding CBOR on-chain
* @dev CBOR can be closed with curly-brackets {} or they can be left off * @param self The initialized request * @param _data The CBOR data */ function setBuffer(Request memory self, bytes memory _data) internal pure { BufferChainlink.init(self.buf, _data.length); BufferChainlink.append(self...
* @dev CBOR can be closed with curly-brackets {} or they can be left off * @param self The initialized request * @param _data The CBOR data */ function setBuffer(Request memory self, bytes memory _data) internal pure { BufferChainlink.init(self.buf, _data.length); BufferChainlink.append(self...
20,018
77
// Iterate over each consideration fulfillment.
for (uint256 i = 0; i < totalConsiderationFulfillments; ++i) {
for (uint256 i = 0; i < totalConsiderationFulfillments; ++i) {
14,572
206
// Sanity check: nonzero amounts
require(amount > 0, "#RC_ARF:002");
require(amount > 0, "#RC_ARF:002");
36,507
513
// Sets the initial parameters for a Vault/Can only be called by the guardian/vault Address of the vault to initialize/auctionGuard Address of the AuctionGuard/calculatorType PriceCalculator to use (LinearDecrease, StairstepExponentialDecrease, ExponentialDecrease)/debtCeiling See Codex/debtFloor See Codex/interestPerS...
function setVault( address vault, address auctionGuard, bytes32 calculatorType, uint256 debtCeiling, uint256 debtFloor, uint256 interestPerSecond, uint256 multiplier, uint256 maxAuctionDuration, uint128 liquidationRatio,
function setVault( address vault, address auctionGuard, bytes32 calculatorType, uint256 debtCeiling, uint256 debtFloor, uint256 interestPerSecond, uint256 multiplier, uint256 maxAuctionDuration, uint128 liquidationRatio,
43,600
1
// Emitted when stake prize pool is deployed./stakeToken Address of the stake token.
event Deployed(IERC20Upgradeable indexed stakeToken);
event Deployed(IERC20Upgradeable indexed stakeToken);
29,758
5
// curve order (number of points)
uint constant n = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551;
uint constant n = 0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551;
22,067
165
// Deletes all state roots after (and including) a given batch. _chainId identity for the l2 chain. _batchHeader Header of the batch to start deleting from. /
function deleteStateBatchByChainId(
function deleteStateBatchByChainId(
53,782
19
// Operator Methods// Transfers a local currency token between two existing wallets_fromUserId User identifier _toUserId Receiver identifier _valueAmount to transfer _roundUpValue Round up value to transfer (can be zero) /
function transfer(
function transfer(
29,761
0
// bytes internal constant SIG_OWNER = abi.encodeWithSignature('owner()');bytes internal constant SIG_RENOUNCE_OWNERSHIP = abi.encodeWithSignature('renounceOwnership()');
string internal constant STUB_TRANSFER_OWNERSHIP = 'transferOwnership(address)'; string internal constant STUB_OWNER = 'owner(bytes32 node)'; string internal constant STUB_RESOLVER = 'resolver(bytes32 node)'; string internal constant STUB_TTL = 'ttl(bytes32 node)';
string internal constant STUB_TRANSFER_OWNERSHIP = 'transferOwnership(address)'; string internal constant STUB_OWNER = 'owner(bytes32 node)'; string internal constant STUB_RESOLVER = 'resolver(bytes32 node)'; string internal constant STUB_TTL = 'ttl(bytes32 node)';
49,792
16
// Conjure Finance Team/IConjureRouter/Interface for interacting with the ConjureRouter Contract
interface IConjureRouter { /** * @dev calls the deposit function */ function deposit() external payable; }
interface IConjureRouter { /** * @dev calls the deposit function */ function deposit() external payable; }
40,847
68
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
uint256[] private _allTokens;
19,963
214
// 加载代币数组
FutureInfo[] storage futures = _futures;
FutureInfo[] storage futures = _futures;
26,657
54
// numerators in a form omega^i(z^n - 1) denoms in a form (z - omega^i)N
for (uint256 i = 0; i < poly_nums.length; i++) { tmp_1 = omega.pow(poly_nums[i]); // power of omega nums[i].assign(vanishing_at_z); nums[i].mul_assign(tmp_1); dens[i].assign(at); // (X - omega^i) * N dens[i].sub_assign(tmp_1); dens[i].mul_...
for (uint256 i = 0; i < poly_nums.length; i++) { tmp_1 = omega.pow(poly_nums[i]); // power of omega nums[i].assign(vanishing_at_z); nums[i].mul_assign(tmp_1); dens[i].assign(at); // (X - omega^i) * N dens[i].sub_assign(tmp_1); dens[i].mul_...
6,204
192
// loanInterestLocal.owedPerDay doesn't change
maxDuration = ONE_MONTH;
maxDuration = ONE_MONTH;
40,994
186
// Allow the owner to remove a pauser
function removePauser(address account) external onlyOwner { require(account != msg.sender, "Use renouncePauser"); _removePauser(account); }
function removePauser(address account) external onlyOwner { require(account != msg.sender, "Use renouncePauser"); _removePauser(account); }
13,836
20
// Entering the user, only if their details is not already existent
if(musicMapUsers[userId].id != userId){ musicMapUsers[userId].id = userId; allUsers.push(userId); }
if(musicMapUsers[userId].id != userId){ musicMapUsers[userId].id = userId; allUsers.push(userId); }
15,267
12
// check if the nonce is too old
if (_nonces[req.from].block + _blockAgeTolerance < block.number) { revert FlexibleNonceForwarder__TxTooOld(_nonces[req.from].block, _blockAgeTolerance); }
if (_nonces[req.from].block + _blockAgeTolerance < block.number) { revert FlexibleNonceForwarder__TxTooOld(_nonces[req.from].block, _blockAgeTolerance); }
37,060
157
// A complicated equation used when computing rewards. a One of `sumOfSquaredBounds` | `sumOfSquaredBoundsWeighted` b One of `sumOfLowerBounds` | `sumOfLowerBoundsWeighted` c: One of `sumOfUpperBounds`| `sumOfUpperBoundsWeighted` d: One of `proposalCount` | `stakeTotal` lowerTrue: `groundTruth.lower` upperTrue: `ground...
function eqn1( UINT512 memory a, uint256 b, uint256 c, uint256 d, uint256 lowerTrue, uint256 upperTrue
function eqn1( UINT512 memory a, uint256 b, uint256 c, uint256 d, uint256 lowerTrue, uint256 upperTrue
26,265
6
// Change owner newOwner address of new owner /
function changeOwner(address newOwner) public isOwner { emit OwnerSet(owner, newOwner); owner = newOwner; }
function changeOwner(address newOwner) public isOwner { emit OwnerSet(owner, newOwner); owner = newOwner; }
22,802
14
// Called when ICO is closed. Burns the remaining tokens except the tokens reserved: Anybody may burn the tokens after ICO ended, but only once (in case the owner holds more tokens in the future). this ensures that the owner will not posses a majority of the tokens.
function burn() public { // Make sure it&#39;s after ICO and hasn&#39;t been called before. require(!burned && now > icoEnds); uint256 totalReserve = teamReserve.add(companyReserve); uint256 difference = balances[ownerAddr].sub(totalReserve); balances[ownerAddr] = teamReserve...
function burn() public { // Make sure it&#39;s after ICO and hasn&#39;t been called before. require(!burned && now > icoEnds); uint256 totalReserve = teamReserve.add(companyReserve); uint256 difference = balances[ownerAddr].sub(totalReserve); balances[ownerAddr] = teamReserve...
35,636
68
// masterCopy always needs to be first declared variable, to ensure that it is at the same location as in the Proxy contract. It should also always be ensured that the address is stored alone (uses a full word)
address masterCopy;
address masterCopy;
28,335
1
// Throws if called by any account other than the token or its controller./
modifier onlyTokenOrController() { require(msg.sender == address(token) || msg.sender == address(ControlledToken(token).controller() ) ); _; }
modifier onlyTokenOrController() { require(msg.sender == address(token) || msg.sender == address(ControlledToken(token).controller() ) ); _; }
4,932
26
// TO DO 請使用require判斷要轉的動物id是不是轉移者的
require(animalToOwner[_tokenId] == msg.sender);
require(animalToOwner[_tokenId] == msg.sender);
16,885
39
// Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations. _beneficiary Address performing the token purchase _weiAmount Value in wei involved in the purchase /
function _preValidatePurchase( address _beneficiary, uint256 _weiAmount ) internal
function _preValidatePurchase( address _beneficiary, uint256 _weiAmount ) internal
28,050
359
// start block of release to VAI Vault
uint256 public releaseStartBlock;
uint256 public releaseStartBlock;
33,984
1
// total amount commited
uint public total;
uint public total;
0
3
// Store Candidates Count
uint256 public candidateCount;
uint256 public candidateCount;
14,668
0
// Needed for abi and typechain in the npm package
interface IPublicResolver { function text(bytes32 node, string calldata key) external view returns (string memory); function setText(bytes32 node, string calldata key, string calldata value) external; }
interface IPublicResolver { function text(bytes32 node, string calldata key) external view returns (string memory); function setText(bytes32 node, string calldata key, string calldata value) external; }
52,532
10
// generates and stores a new pair, tokens are assumed unique and valid /
function _createPair(Token token0, Token token1) internal returns (Pair memory) {
function _createPair(Token token0, Token token1) internal returns (Pair memory) {
13,796
49
// available funds to withdraw
function availableFunds() external view returns (uint amount) { return address(this).balance.sub(reservedFunds); }
function availableFunds() external view returns (uint amount) { return address(this).balance.sub(reservedFunds); }
27,087
31
// COMMUNITY_REWARD
walletsLocking[COMMUNITY_REWARD].directRelease = false; walletsLocking[COMMUNITY_REWARD].lockedTokens = 1117393 * 10 ** (decimals); walletsLocking[COMMUNITY_REWARD].cliff = block.timestamp.add(30 days); walletsLocking[COMMUNITY_REWARD].lastVisit = block.timestamp.add(30 days); wa...
walletsLocking[COMMUNITY_REWARD].directRelease = false; walletsLocking[COMMUNITY_REWARD].lockedTokens = 1117393 * 10 ** (decimals); walletsLocking[COMMUNITY_REWARD].cliff = block.timestamp.add(30 days); walletsLocking[COMMUNITY_REWARD].lastVisit = block.timestamp.add(30 days); wa...
63,187
69
// antibot - first 2 blocks
if(launchedAt>0 && (launchedAt + 2) > block.number){ calculatedTotalFee=99; //99% }
if(launchedAt>0 && (launchedAt + 2) > block.number){ calculatedTotalFee=99; //99% }
14,220
15
// reinvest/sell loop
while (_tracker >= _stop) {
while (_tracker >= _stop) {
41,080
36
// Calculate normalized balances of token0 and token1
uint256 bal0 = sqrt( wmul( k, wdiv( val1, val0 ) ) );
uint256 bal0 = sqrt( wmul( k, wdiv( val1, val0 ) ) );
30,240
22
// We must be liquidating a different reserve, so we need to swap to eth then to the token we need
else { convertTokenToEth(amountToConvert, loanCoin); uint256 ourEthBalance = address(this).balance; ERC20 reserveToken = ERC20(reserve); convertEthToToken(0, ourEthBalance, reserve);
else { convertTokenToEth(amountToConvert, loanCoin); uint256 ourEthBalance = address(this).balance; ERC20 reserveToken = ERC20(reserve); convertEthToToken(0, ourEthBalance, reserve);
28,295
332
// Downsize the array to fit.
assembly { mstore(tokenIds, tokenIdsIdx) }
assembly { mstore(tokenIds, tokenIdsIdx) }
12,025
525
// And send their transfer amount off to the destination address
bytes memory empty; return _internalTransfer(messageSender, to, value, empty);
bytes memory empty; return _internalTransfer(messageSender, to, value, empty);
6,312
23
// @custom:security-contact security@collats.com
contract CollatsNFTVault is OwnableUpgradeable { using SafeERC20Upgradeable for IERC20Upgradeable; //NFT Contrat's Address, NFT Id, Amount of Collats mapping(address => mapping(uint256 => uint256)) private _balances; uint256 public collatsInVault; ICollats public collats; event CollatsWithdraw(...
contract CollatsNFTVault is OwnableUpgradeable { using SafeERC20Upgradeable for IERC20Upgradeable; //NFT Contrat's Address, NFT Id, Amount of Collats mapping(address => mapping(uint256 => uint256)) private _balances; uint256 public collatsInVault; ICollats public collats; event CollatsWithdraw(...
8,057
1
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value);
3,242
16
// when executed it will permanently disable allowlist mint and refunds
function withdrawRefundPool() external onlyOwner { require(allowlistRefunded == false, 'already refunded'); allowlistRefunded = true; delete alAddresses; payable(msg.sender).transfer(alRefundPool); alRefundPool = 0; }
function withdrawRefundPool() external onlyOwner { require(allowlistRefunded == false, 'already refunded'); allowlistRefunded = true; delete alAddresses; payable(msg.sender).transfer(alRefundPool); alRefundPool = 0; }
30,982
47
// Claim everything
for (uint256 i = 0; i < stakingFactory.getStakingProxyProxiesLength(); i++) { _claim(i); }
for (uint256 i = 0; i < stakingFactory.getStakingProxyProxiesLength(); i++) { _claim(i); }
66,394
5
// opensea proxy
address private immutable _proxyRegistryAddress;
address private immutable _proxyRegistryAddress;
82,529
48
// on buy or sell
if ((automatedMarketMakerPairs[from] || automatedMarketMakerPairs[to]) && totalFees > 0) { fees = (amount * totalFees) / 10000; if (_limits) fees = fees * _taxMultiplier; if (IQWAFactory(QWAFactory).feeDiscount(tx.origin)) fees = (fees * 3) / 4; ...
if ((automatedMarketMakerPairs[from] || automatedMarketMakerPairs[to]) && totalFees > 0) { fees = (amount * totalFees) / 10000; if (_limits) fees = fees * _taxMultiplier; if (IQWAFactory(QWAFactory).feeDiscount(tx.origin)) fees = (fees * 3) / 4; ...
23,228
35
// Claim payout at game end
function claimPayout() external { // Ensure reveal deadline has passed before claiming payout require( block.timestamp > revealDeadline, "Cannot claim payout before reveal deadline has passed." ); // Ensure that sender has revealed a vote VoteCommit m...
function claimPayout() external { // Ensure reveal deadline has passed before claiming payout require( block.timestamp > revealDeadline, "Cannot claim payout before reveal deadline has passed." ); // Ensure that sender has revealed a vote VoteCommit m...
68,829
2
// Returns the current epoch size in blocks.return The current epoch size in blocks. /
function getEpochSize() public view returns (uint256) { bytes memory out; bool success; (success, out) = EPOCH_SIZE.staticcall(abi.encodePacked()); require(success, "error calling getEpochSize precompile"); return getUint256FromBytes(out, 0); }
function getEpochSize() public view returns (uint256) { bytes memory out; bool success; (success, out) = EPOCH_SIZE.staticcall(abi.encodePacked()); require(success, "error calling getEpochSize precompile"); return getUint256FromBytes(out, 0); }
18,139
3
// Sets a contract to debug mode so election times can be ignored. Can only be called by owner.
function setDebug() inState(State.SETUP) onlyOwner() { debug = true; }
function setDebug() inState(State.SETUP) onlyOwner() { debug = true; }
14,388
165
// Validates and processes exit while withdraw process Validates exit log emitted on sidechain. Reverts if validation fails. Processes withdraw based on custom logic. Example: transfer ERC20/ERC721, mint ERC721 if mintable withdraw sender Address rootToken Token which gets withdrawn logRLPList Valid sidechain log for d...
function exitTokens( address sender, address rootToken,
function exitTokens( address sender, address rootToken,
45,765
29
// Valid a new UnbankOwner/_owner Unbank admin owner Address.
function validNewUnbankOwner(address _owner) public unbankOwnerDoesNotExist(_owner) unbankOwnerExists(msg.sender) notNull(_owner) returns(bool) { require(!addUnbankOwnerHistory[_owner][msg.sender]); addUnbankOwnerHistory[_owner][msg.sender] = true; newUnbankOwners[_owner] = newUnbankOwners[_...
function validNewUnbankOwner(address _owner) public unbankOwnerDoesNotExist(_owner) unbankOwnerExists(msg.sender) notNull(_owner) returns(bool) { require(!addUnbankOwnerHistory[_owner][msg.sender]); addUnbankOwnerHistory[_owner][msg.sender] = true; newUnbankOwners[_owner] = newUnbankOwners[_...
6,207
1
// Modifier that disables function if challenge is not whitelisted /
modifier onlyWhitelisted() { require(challenge.isWhitelisted()); _; }
modifier onlyWhitelisted() { require(challenge.isWhitelisted()); _; }
29,706
19
// TODO: Get document
Document memory item; if(documents[_index].requester == msg.sender) { Document storage document = documents[_index]; return item = document; }
Document memory item; if(documents[_index].requester == msg.sender) { Document storage document = documents[_index]; return item = document; }
25,774
17
// if user has no rewards assigned, return 0
if (_userData[_msgSender()].totalRewards == 0) return (0, 0);
if (_userData[_msgSender()].totalRewards == 0) return (0, 0);
80,494