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
63
// Gauges are used to incentivize pools, they emit reward tokens over 7 days for staked LP tokens
contract Gauge { address public immutable stake; // the asset token that needs to be staked for rewards address public immutable _ve; // the ve token used for gauges address public immutable bribe; address public immutable voter; bool internal depositsOpen; uint public derivedSupply; mappi...
contract Gauge { address public immutable stake; // the asset token that needs to be staked for rewards address public immutable _ve; // the ve token used for gauges address public immutable bribe; address public immutable voter; bool internal depositsOpen; uint public derivedSupply; mappi...
49,240
269
// Set revealed to true. /
function reveal(bool state) external onlyOwner { revealed = state; }
function reveal(bool state) external onlyOwner { revealed = state; }
8,546
502
// The HDCORE TOKEN!
INBUNIERC20 public hdcore;
INBUNIERC20 public hdcore;
53,985
2
// @description deletes the education for the given index and addressuint _index index of the education to be deletedaddress _user address of the user whose education is to be deleted
function deleteEducation(uint _index, address _user) public isOwner(msg.sender) { require(!db.getUserEducation(_user, msg.sender)[_index].isDeleted); db.deleteUserEducation(_index, _user, msg.sender); }
function deleteEducation(uint _index, address _user) public isOwner(msg.sender) { require(!db.getUserEducation(_user, msg.sender)[_index].isDeleted); db.deleteUserEducation(_index, _user, msg.sender); }
18,132
187
// Block number when bonus GRIFFIN period ends. Dev fund (10%, initially)
uint256 public devFundDivRate = 10; uint256 public bonusEndBlock;
uint256 public devFundDivRate = 10; uint256 public bonusEndBlock;
13,780
115
// Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which isforwarded in {IERC721Receiver-onERC721Received} to contract recipients. /
function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual { _mint(to, tokenId); require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); }
function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual { _mint(to, tokenId); require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); }
326
91
// This round is settled, shift settlement record.
tmp_entropy = tmp_entropy >> 4;
tmp_entropy = tmp_entropy >> 4;
21,871
10
// //Submit proposal to Baal `members` for approval within voting period - proposer must be registered member./to Account that receives low-level call `data` & ETH `value` - if `membership` flag (2), the account that will receive `value` votes - if `removal` (3), the account that will lose `value` votes./value ETH sent...
function submitProposal(address[] calldata to, uint[] calldata value, uint votingLength, uint8 flag, bytes[] calldata data, bytes32 details) external lock returns (uint proposal) { require(to.length == value.length && value.length == data.length,'arrays must match'); require(votingLength >= minVotin...
function submitProposal(address[] calldata to, uint[] calldata value, uint votingLength, uint8 flag, bytes[] calldata data, bytes32 details) external lock returns (uint proposal) { require(to.length == value.length && value.length == data.length,'arrays must match'); require(votingLength >= minVotin...
31,185
81
// Now it's possible to verify the proof.
try updateVerifier.verifyProof(ar, bs, krs, proofInput) returns (bool verifierResult) {
try updateVerifier.verifyProof(ar, bs, krs, proofInput) returns (bool verifierResult) {
31,135
96
// Recover signer address from a message by using their signaturehash bytes32 message, the hash is the signed message. What is recovered is the signer address.sig bytes signature, the signature is generated using web3.eth.sign(). Inclusive "0x..."/
function recoverSigner(bytes32 hash, bytes memory sig) internal pure returns (address) { require(sig.length == 65, "Require correct length"); bytes32 r; bytes32 s; uint8 v; // Divide the signature in r, s and v variables assembly { r := mload(add(sig, 32...
function recoverSigner(bytes32 hash, bytes memory sig) internal pure returns (address) { require(sig.length == 65, "Require correct length"); bytes32 r; bytes32 s; uint8 v; // Divide the signature in r, s and v variables assembly { r := mload(add(sig, 32...
16,196
184
// USDC token contract address
IERC20 internal constant USDC_ADDRESS = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
IERC20 internal constant USDC_ADDRESS = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
1,252
26
// These functions deal with verification of Merkle Tree proofs. The proofs can be generated using the JavaScript libraryNote: the hashing algorithm should be keccak256 and pair sorting should be enabled. See `test/utils/cryptography/MerkleProof.test.js` for some examples. WARNING: You should avoid using leaf values th...
library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are ...
library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are ...
27,861
42
// 声明合约 AirDrop 继承 Ownable
contract AirDrop is Ownable { // block.timestamp // 定义一个用户结构体 struct User { address userAddress; // 用户地址 // uint256 timestamp; // 时间戳 uint256 amount; // 数量 } // 储存已领取的用户信息 // mapping(uint256 => User) users; // 定义一个user_id 递增 // uint256 user_id; // 是否有权限领取 ...
contract AirDrop is Ownable { // block.timestamp // 定义一个用户结构体 struct User { address userAddress; // 用户地址 // uint256 timestamp; // 时间戳 uint256 amount; // 数量 } // 储存已领取的用户信息 // mapping(uint256 => User) users; // 定义一个user_id 递增 // uint256 user_id; // 是否有权限领取 ...
29,712
575
// majority: true if the poll ended in a majority, false otherwise
bool majority = polls.updateUpgradePoll(_proposal);
bool majority = polls.updateUpgradePoll(_proposal);
52,886
19
// 512-bit multiply [prod1 prod0] = xy. Compute the product mod 2^256 and mod 2^256 - 1, then use use the Chinese Remainder Theorem to reconstruct the 512-bit result. The result is stored in two 256 variables such that product = prod12^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product
uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product
27,619
2
// Mapping: Token address => Whether minting with token is paused
mapping(address => bool) public mintPaused;
mapping(address => bool) public mintPaused;
80,597
328
// Function that registers new synth as they are isseud. Calculate delta to append to synthetixState. Only internal calls from synthetix address. currencyKey The currency to register synths in, for example sUSD or sAUD amount The amount of synths to register with a base of UNIT /
function _addToDebtRegister(bytes4 currencyKey, uint amount) internal optionalProxy
function _addToDebtRegister(bytes4 currencyKey, uint amount) internal optionalProxy
6,198
17
// this mapping keeps track of the index of a tail within the tails array of a particular head headId => tailAddress => tailId => index
mapping(uint256 => mapping(address => mapping(uint256 => uint256))) private tailIndex_721;
mapping(uint256 => mapping(address => mapping(uint256 => uint256))) private tailIndex_721;
8,693
29
// Enable/Disable support for ERC20 tokens to be used as lendable tokens for new bank nodes (does not effect existing nodes)// - PRIVILEGES REQUIRED:/ Admins with the role "CONFIGURE_NODE_MANAGER_ROLE"//tokenContract lendable token contract address/enabled `0` or `1`, Whether to enable (cannot be used to create bank no...
function setLendableTokenStatus(address tokenContract, uint8 enabled) external;
function setLendableTokenStatus(address tokenContract, uint8 enabled) external;
43,105
829
// Time that this contract expires. Should not change post-construction unless an emergency shutdown occurs.
uint256 public expirationTimestamp;
uint256 public expirationTimestamp;
9,376
85
// for _bs, first word store _bs.length, second word store _bs.value load 32 bytes from mem[_bs+20], convert it into Uint160, meaning we take last 20 bytes as addr (address).
addr := mload(add(_bs, 0x14))
addr := mload(add(_bs, 0x14))
20,898
39
// Internal function to perform a Token Withdrawal tokenAddress address of the token to transfer to where the funds will be sent amount address of the token withdraw (0x0 in case of Ether) /
function _tokenWithdrawal( address tokenAddress, address to, uint256 amount
function _tokenWithdrawal( address tokenAddress, address to, uint256 amount
25,833
181
// return { "registered" : "Return if the authority is registered" } /
function isRegisteredAuthority(Data storage self, address authorityAddress) internal view returns (bool registered) { bytes32 id = keccak256(abi.encodePacked('registered.authority', getFirmFromAuthority(self, getForwardedAccount(self, authorityAddress)), getForwardedAccount(self, authorityAddress))); return s...
function isRegisteredAuthority(Data storage self, address authorityAddress) internal view returns (bool registered) { bytes32 id = keccak256(abi.encodePacked('registered.authority', getFirmFromAuthority(self, getForwardedAccount(self, authorityAddress)), getForwardedAccount(self, authorityAddress))); return s...
12,454
168
// try bind a refer
if(_plyr[pID].laff == 0){ bytes memory tempCode = bytes(affCode); bytes32 affName = 0x0; if (tempCode.length >= 0) { assembly { affName := mload(add(tempCode, 32)) }
if(_plyr[pID].laff == 0){ bytes memory tempCode = bytes(affCode); bytes32 affName = 0x0; if (tempCode.length >= 0) { assembly { affName := mload(add(tempCode, 32)) }
44,018
96
// no point in continuing execution if OP is a poorfag russian hacker prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world (or hackers) and yes we know that the safemath function automatically rules out the "greater then" equasion.
require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_));
require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_));
6,572
29
// 记录发布
products.push(g); userPool[msg.sender].publishedProducts.push(id); emit publishSuccess(id, name, style, intro, rules, price, g.date, cover, file);
products.push(g); userPool[msg.sender].publishedProducts.push(id); emit publishSuccess(id, name, style, intro, rules, price, g.date, cover, file);
22,798
11
// Checks if a hash has been signed by the whitelistAdmin/_rawHash The hash that was used to generate the signature/_sig The EC signature generated by the whitelistAdmin/ return Was the signature generated by the admin for the hash?
function checkWhitelisted( bytes32 _rawHash, bytes memory _sig ) public view returns(bool)
function checkWhitelisted( bytes32 _rawHash, bytes memory _sig ) public view returns(bool)
43,488
250
// Send all available CVX to the Vault/you can do this so you can earn again (re-lock), or just to add to the redemption pool
function manualSendCVXToVault() external whenNotPaused { _onlyGovernance(); uint256 cvxAmount = IERC20Upgradeable(want).balanceOf(address(this)); _transferToVault(cvxAmount); }
function manualSendCVXToVault() external whenNotPaused { _onlyGovernance(); uint256 cvxAmount = IERC20Upgradeable(want).balanceOf(address(this)); _transferToVault(cvxAmount); }
15,909
130
// Return the old rate if fetching wasn't successful
rate = exchangeRate;
rate = exchangeRate;
9,185
126
// Allow only direct calls from EOA (Externally owner wallets - flashloan prevention)
require(msg.sender == tx.origin);
require(msg.sender == tx.origin);
35,693
323
// Initate Interfaces
newt = INewt(_newt); MAX_TOKENS = _maxTokens; PAID_TOKENS = _maxTokens / 5;
newt = INewt(_newt); MAX_TOKENS = _maxTokens; PAID_TOKENS = _maxTokens / 5;
19,753
128
// Sets the address for the NFT Contract_nftAddressThe nft address /
function setNFTContractAddress(address _nftAddress) public onlyGameManager { require (_nftAddress != address(0)); nonFungibleContract = MLBNFT(_nftAddress); }
function setNFTContractAddress(address _nftAddress) public onlyGameManager { require (_nftAddress != address(0)); nonFungibleContract = MLBNFT(_nftAddress); }
48,104
126
// easy checks
require(paused == 0, "Sale is not available"); require(tokenCount > 0 && tokenCount <= MAX_BATCH_SIZE, "You must purchase between 1 and 20 tkens"); require(msg.sender == tx.origin, "No buying on behalf of others");
require(paused == 0, "Sale is not available"); require(tokenCount > 0 && tokenCount <= MAX_BATCH_SIZE, "You must purchase between 1 and 20 tkens"); require(msg.sender == tx.origin, "No buying on behalf of others");
32,057
161
// Create bid
bytes32 bidId = keccak256(abi.encodePacked(block.timestamp, msg.sender, order.id, _priceInWei, _expiresAt));
bytes32 bidId = keccak256(abi.encodePacked(block.timestamp, msg.sender, order.id, _priceInWei, _expiresAt));
22,296
5
// 伤害
uint8 damage;
uint8 damage;
38,999
56
// send the balance to the Vesting contract
SafeTransferLib.safeTransferETH(address(vestingContract), address(this).balance);
SafeTransferLib.safeTransferETH(address(vestingContract), address(this).balance);
3,422
49
// Puts on sale existing market item. /
function putItemOnSale( uint256 itemId, uint256 amount, uint256 price
function putItemOnSale( uint256 itemId, uint256 amount, uint256 price
17,945
150
// Set the allowed auction drop percentage before reset
setAuctionPermittedDrop(co.ilk, co.permittedDrop);
setAuctionPermittedDrop(co.ilk, co.permittedDrop);
11,561
51
// The wallet to receive asset tokens here before initiating crowdsalewill overwrite old wallet address
function setPlatformAssetsWallet(address _walletAddress) external
function setPlatformAssetsWallet(address _walletAddress) external
23,141
61
// Function to allocate tokens for normal contributor _to Address of a contributor _value Value that represents tokens amount allocated for a contributor /
function allocNormalUser(address _to, uint _value) public onlyOwner isAllowed { token.mint(_to, _value); emit TokenMinted(_to, _value, "Allocated Tokens To User"); }
function allocNormalUser(address _to, uint _value) public onlyOwner isAllowed { token.mint(_to, _value); emit TokenMinted(_to, _value, "Allocated Tokens To User"); }
35,569
35
// Mint ROOT token using silo deposit(s) with silo deposit tokens and values permit/depositTransfers silo deposit(s) to mint ROOT token/mode Transfer ROOT token to/minRootsOut Minimum number of ROOT token to receive/tokens a list of silo deposit token address/values a list of silo deposit amount/deadline permit expirat...
function mintWithTokensPermit( DepositTransfer[] calldata depositTransfers, To mode, uint256 minRootsOut, address[] calldata tokens, uint256[] calldata values, uint256 deadline, uint8 v, bytes32 r, bytes32 s
function mintWithTokensPermit( DepositTransfer[] calldata depositTransfers, To mode, uint256 minRootsOut, address[] calldata tokens, uint256[] calldata values, uint256 deadline, uint8 v, bytes32 r, bytes32 s
17,144
6
// Revert with an error when providing a criteria resolver that refers to an order with an item that does not expect a criteria to be resolved. /
error CriteriaNotEnabledForItem();
error CriteriaNotEnabledForItem();
19,940
129
// Withdraw collateral based on given shares and the current share price. Modifier updatedReward is being used to update reward earning of caller.Transfer earned rewards to caller. Withdraw fee, if any, will be deduced fromgiven shares and transferred to feeCollector. Burn remaining shares and return collateral. shares...
function withdraw(uint256 shares) external virtual nonReentrant whenNotShutdown { _withdraw(shares); }
function withdraw(uint256 shares) external virtual nonReentrant whenNotShutdown { _withdraw(shares); }
8,036
46
// returns the number of knights in the gamereturn the number of knights/
function getNumKnights() constant public returns(uint16 numKnights) { for (uint8 i = numDragonTypes; i < costs.length; i++) numKnights += numCharactersXType[i]; }
function getNumKnights() constant public returns(uint16 numKnights) { for (uint8 i = numDragonTypes; i < costs.length; i++) numKnights += numCharactersXType[i]; }
33,638
31
// bleach
function bleachAppearance(uint128 appearance, uint128 attributes) public pure returns (uint128);
function bleachAppearance(uint128 appearance, uint128 attributes) public pure returns (uint128);
56,156
27
// reset, so it can be added again
smartContractsAdded[_contractAddress] = false;
smartContractsAdded[_contractAddress] = false;
4,238
65
// function to allow admin to claim any ERC20 tokens sent to this contract
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { if (_tokenAddr == tokenAddress) { totalClaimedRewards = totalClaimedRewards.add(_amount); } Token(_tokenAddr).transfer(_to, _amount); }
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { if (_tokenAddr == tokenAddress) { totalClaimedRewards = totalClaimedRewards.add(_amount); } Token(_tokenAddr).transfer(_to, _amount); }
80,074
1
// Model a Candidate
struct Candidate{ uint id; string name; uint voteCount; }
struct Candidate{ uint id; string name; uint voteCount; }
10,780
42
// Generic function to determine winner. Aim to be called any number of times
function drawTicket (uint randomiserNumber, bytes32 randomHash) internal view returns(uint pickedTicket, bytes32 newGeneratedRandomHash) { bytes32 newRandomHash; uint pickTicket; for (int i = 0; i < 10; i++) { newRandomHash = keccak256(abi.encodePacked(randomHash, block....
function drawTicket (uint randomiserNumber, bytes32 randomHash) internal view returns(uint pickedTicket, bytes32 newGeneratedRandomHash) { bytes32 newRandomHash; uint pickTicket; for (int i = 0; i < 10; i++) { newRandomHash = keccak256(abi.encodePacked(randomHash, block....
15,897
319
// Upgrade Paused
bool public upgradePaused = false;
bool public upgradePaused = false;
43,996
4,352
// 2177
entry "beturtlenecked" : ENG_ADJECTIVE
entry "beturtlenecked" : ENG_ADJECTIVE
18,789
1
// _parent The parent smart contract/
constructor(OwnerERC20 _parent) internal { require(_parent.isValidOwner(msg.sender)); parent = _parent; }
constructor(OwnerERC20 _parent) internal { require(_parent.isValidOwner(msg.sender)); parent = _parent; }
45,190
58
// Returns whether the ownership slot at `index` is initialized.An uninitialized slot does not necessarily mean that the slot has no owner. /
function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) { return _packedOwnerships[index] != 0; }
function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) { return _packedOwnerships[index] != 0; }
28,055
8
// notify reward amount for an individual staking token. this is a fallback in case the notifyRewardAmounts costs too much gas to call for all contracts
function notifyRewardAmount(uint256 index) public { require(index < stakingTokens.length, 'index ouf of range'); FarmingRewardsInfo storage info = stakingTokens[index]; require(info.stakingRewards != address(0), 'AbicFarmingRewardsFactory::notifyRewardAmount: not deployed'); if (inf...
function notifyRewardAmount(uint256 index) public { require(index < stakingTokens.length, 'index ouf of range'); FarmingRewardsInfo storage info = stakingTokens[index]; require(info.stakingRewards != address(0), 'AbicFarmingRewardsFactory::notifyRewardAmount: not deployed'); if (inf...
23,040
20
// Portion of the interests from lending that goes to SLPs (the rest goes to surplus)
uint64 interestsForSLPs;
uint64 interestsForSLPs;
31,545
70
// Я живу в 33-й квартире этого дома
recognition О_ТридцатыхПредл1 language=Russian
recognition О_ТридцатыхПредл1 language=Russian
29,072
185
// duration for the minting deactivation after crowdsale
uint256 private constant mintLockTimeframe = 365 days;
uint256 private constant mintLockTimeframe = 365 days;
54,203
265
// Curve-style [Curve, Convex, NOT StakeDAO] In 1e18
function get_virtual_price() external view returns (uint256);
function get_virtual_price() external view returns (uint256);
26,594
95
// {IERC777} Token holders can be notified of operations performed on theirSee {IERC1820Registry} and {ERC1820Implementer}./ Called by an {IERC777} token contract whenever a registered holder's(`from`) tokens are about to be moved or destroyed. The type of operationis conveyed by `to` being the zero address or not. Thi...
function tokensToSend( address operator, address from, address to, uint256 amount, bytes calldata userData, bytes calldata operatorData ) external;
function tokensToSend( address operator, address from, address to, uint256 amount, bytes calldata userData, bytes calldata operatorData ) external;
2,823
134
// SAFE TRANSFER FUNCTION | ACCOUNTS FOR ROUNDING ERRORS | ENSURES SUFFICIENT GDAO IN POOLS.
function safeGDAOTransfer(address _to, uint256 _amount) internal { uint256 GDAOBal = gdao.balanceOf(address(this)); if (_amount > GDAOBal) { gdao.transfer(_to, GDAOBal); } else { gdao.transfer(_to, _amount); } }
function safeGDAOTransfer(address _to, uint256 _amount) internal { uint256 GDAOBal = gdao.balanceOf(address(this)); if (_amount > GDAOBal) { gdao.transfer(_to, GDAOBal); } else { gdao.transfer(_to, _amount); } }
52,687
88
// return escrow to canceled bidder
acceptedToken.safeTransfer( _bidder, _escrowAmount ); emit BidCancelled(_bidId);
acceptedToken.safeTransfer( _bidder, _escrowAmount ); emit BidCancelled(_bidId);
1,840
10
// @veronicaLC (Veronica Coutts) & @RyRy79261 (Ryan Nobel)Market/
interface IMarket { // Emitted when a spender is approved event Approval( address indexed owner, address indexed spender, uint256 value ); // Emitted when a transfer, mint or burn occurs event Transfer(address indexed from, address indexed to, uint value); // Emitted when tokens a...
interface IMarket { // Emitted when a spender is approved event Approval( address indexed owner, address indexed spender, uint256 value ); // Emitted when a transfer, mint or burn occurs event Transfer(address indexed from, address indexed to, uint value); // Emitted when tokens a...
4,907
47
// Allow migrate contract
function migrate(uint256 _value) external { require(saleFinalized); require(migrationAgent != 0x0); require(_value > 0); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); t...
function migrate(uint256 _value) external { require(saleFinalized); require(migrationAgent != 0x0); require(_value > 0); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); t...
27,696
30
// Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],but performing a static call. _Available since v3.3._ /
function functionStaticCall(address target, bytes memory data) internal view returns(bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); }
function functionStaticCall(address target, bytes memory data) internal view returns(bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); }
11,014
342
// Internal function to ensure that a relative condition has not beenspecified as the first item in the search space. firstNibble uint8 The first nibble from the search space designatingthe condition to check against. /
function _requireNoInitialRelativeCondition(uint8 firstNibble) internal pure { if ( firstNibble == uint8(Condition.MatchAgainstPriorCaseInsensitive) || firstNibble == uint8(Condition.MatchAgainstInitialCaseInsensitive) || firstNibble == uint8(Condition.MatchAgainstPriorCaseSensitive) || fi...
function _requireNoInitialRelativeCondition(uint8 firstNibble) internal pure { if ( firstNibble == uint8(Condition.MatchAgainstPriorCaseInsensitive) || firstNibble == uint8(Condition.MatchAgainstInitialCaseInsensitive) || firstNibble == uint8(Condition.MatchAgainstPriorCaseSensitive) || fi...
11,714
196
// Mint several tokens at once/Caller needs to be contract owner/recipient is recipient of all tokens/tokenURIs an array of uris for each token
function safeMintBatchToOne( address recipient, string[] memory tokenURIs
function safeMintBatchToOne( address recipient, string[] memory tokenURIs
35,007
86
// getGelatoPools gets all the G-UNI pools deployed by Gelato's/ default deployer address (since anyone can deploy and manage G-UNI pools)/ return list of Gelato managed G-UNI pool addresses
function getGelatoPools() external view returns (address[] memory) { return getPools(gelatoDeployer); }
function getGelatoPools() external view returns (address[] memory) { return getPools(gelatoDeployer); }
43,300
2
// roll the dice to reveal winners only the croupier can roll before reveal window ends anyone can roll after reveal window ends request randomness from Chainlink VRF /
function roll() external { require(!isRevealed, "ETHRum: already revealed"); require(block.timestamp >= revealWindowStart, "ETHRum: reveal window has not started yet"); require(msg.sender == croupier || block.timestamp >= revealWindowEnd, "ETHRum: only croupier can roll before reveal window ...
function roll() external { require(!isRevealed, "ETHRum: already revealed"); require(block.timestamp >= revealWindowStart, "ETHRum: reveal window has not started yet"); require(msg.sender == croupier || block.timestamp >= revealWindowEnd, "ETHRum: only croupier can roll before reveal window ...
38,771
0
// Mapping from hash of RequestPacket to the latest ResponsePacket.
mapping(bytes32 => ResponsePacket) public requestsCache;
mapping(bytes32 => ResponsePacket) public requestsCache;
36,144
323
// Creates a synthesis auction./
function createSynthesizingAuction( uint256 _kydyId, uint256 _price ) external whenNotPaused
function createSynthesizingAuction( uint256 _kydyId, uint256 _price ) external whenNotPaused
17,439
13
// use globalLastTradeTimestamps to prevent multiple rebalances being called with different exchanges during the epoch rebalance
_validateNormalRebalance(leverageInfo, methodology.rebalanceInterval, globalLastTradeTimestamp); _validateNonTWAP(); uint256 newLeverageRatio = _calculateNewLeverageRatio(leverageInfo.currentLeverageRatio); ( uint256 chunkRebalanceNotional, uint256 totalRebalanc...
_validateNormalRebalance(leverageInfo, methodology.rebalanceInterval, globalLastTradeTimestamp); _validateNonTWAP(); uint256 newLeverageRatio = _calculateNewLeverageRatio(leverageInfo.currentLeverageRatio); ( uint256 chunkRebalanceNotional, uint256 totalRebalanc...
29,148
176
// Do swap using supplied Ether amount, minimum Dai, target, and data.
uint256 daiReceived = _TRADE_HELPER.tradeEthForDai.value(ethToSupply)( minimumDaiReceived, target, data );
uint256 daiReceived = _TRADE_HELPER.tradeEthForDai.value(ethToSupply)( minimumDaiReceived, target, data );
82,597
615
// Get setting Id given an associatedTAOId and settingName _associatedTAOId The ID of the AssociatedTAO _settingName The name of the settingreturn the ID of the setting /
function getSettingIdByTAOName(address _associatedTAOId, string _settingName) public view returns (uint256) { return nameSettingLookup[_associatedTAOId][keccak256(abi.encodePacked(this, _settingName))]; }
function getSettingIdByTAOName(address _associatedTAOId, string _settingName) public view returns (uint256) { return nameSettingLookup[_associatedTAOId][keccak256(abi.encodePacked(this, _settingName))]; }
32,714
91
// Transfer tokens from one address to another and then call `onTransferReceived` on receiver from address The address which you want to send tokens from to address The address which you want to transfer to value uint256 The amount of tokens to be transferred data bytes Additional data with no specified format, sent in...
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
2,025
1
// Important if algorithmic redemption gets implemented
mapping (address => uint256) public tokenBalances; uint256 public overallAmount;
mapping (address => uint256) public tokenBalances; uint256 public overallAmount;
16,279
270
// if there's no new round, then the previous roundId was the latest
if (nextTimestamp == 0 || nextTimestamp > startingTimestamp + timediff) { return roundId; }
if (nextTimestamp == 0 || nextTimestamp > startingTimestamp + timediff) { return roundId; }
34,158
1
// : Modifier to restrict access to the operator. /
modifier onlyOperator() { uint256 _amount ); event LogProphecyCompleted(uint256 _prophecyID, ClaimType _claimType); require(msg.sender == operator, "Must be the operator."); _; }
modifier onlyOperator() { uint256 _amount ); event LogProphecyCompleted(uint256 _prophecyID, ClaimType _claimType); require(msg.sender == operator, "Must be the operator."); _; }
29,060
80
// Marks token as released (transferable) /
event Released();
event Released();
50,781
63
// overflow, but not return now. It counts as an overflow to reset model parameters, but later on we can get overflow worse.
overflow = true;
overflow = true;
14,676
1
// Determines whether the contract is paused or not /
bool public paused;
bool public paused;
38,558
1
// Approve `amount` stablecoin to lendingPool
if (stablecoin.allowance(address(this), address(lendingPool)) > 0) { stablecoin.safeApprove(address(lendingPool), 0); }
if (stablecoin.allowance(address(this), address(lendingPool)) > 0) { stablecoin.safeApprove(address(lendingPool), 0); }
30,793
22
// Check if msg.sender is admin or owner. /
modifier isAdmin() { require( msg.sender == getAddress("admin") || msg.sender == getAddress("owner"), "permission-denied" ); _; }
modifier isAdmin() { require( msg.sender == getAddress("admin") || msg.sender == getAddress("owner"), "permission-denied" ); _; }
2,242
101
// Called by a Token Registry whenever the module is Enabled/ return if the enabling worked
function onEnable() external returns (bool);
function onEnable() external returns (bool);
20,825
84
// First delegate gets to initialize the delegator (i.e. storage contract)
delegateTo(implementation_, abi.encodeWithSignature("initialize(address,address,address,uint256,string,string,uint8,address,address,address)", underlying_, comptroller_, ...
delegateTo(implementation_, abi.encodeWithSignature("initialize(address,address,address,uint256,string,string,uint8,address,address,address)", underlying_, comptroller_, ...
13,566
63
// extract the required permission + a descriptive string, based on the `_operationType`being run via ERC725Account.execute(...) _operationType 0 = CALL, 1 = CREATE, 2 = CREATE2, etc... See ERC725X docs for more infos.return permissionsRequired_ (bytes32) the permission associated with the `_operationType`return operat...
function _extractPermissionFromOperation(uint256 _operationType) internal pure returns (bytes32 permissionsRequired_, string memory operationName_)
function _extractPermissionFromOperation(uint256 _operationType) internal pure returns (bytes32 permissionsRequired_, string memory operationName_)
46,502
9
// Since the Pool hooks always work with upscaled balances, we manually upscale here for consistency
_upscaleArray(balances, _scalingFactors()); uint256[] memory normalizedWeights = _normalizedWeights(); return WeightedMath._calculateInvariant(normalizedWeights, balances);
_upscaleArray(balances, _scalingFactors()); uint256[] memory normalizedWeights = _normalizedWeights(); return WeightedMath._calculateInvariant(normalizedWeights, balances);
18,075
63
// The corresponding Pynthetix contract. // Lists of (timestamp, quantity) pairs per account, sorted in ascending time order.These are the times at which each given quantity of PERI vests. // An account's total escrowed pynthetix balance to save recomputing this for fee extraction purposes. // An account's total vested...
) public Owned(_owner) { pynthetix = _pynthetix; feePool = _feePool; }
) public Owned(_owner) { pynthetix = _pynthetix; feePool = _feePool; }
3,917
38
// Withdraw LP tokens from HoneyFarm along with reward
function closeDeposit(uint256 _depositId) external { require(ownerOf(_depositId) == msg.sender, 'HF: Must be owner to withdraw'); DepositInfo storage deposit = depositInfo[_depositId]; require( deposit.unlockTime == 0 || deposit.unlockTime <= block.timestamp || ...
function closeDeposit(uint256 _depositId) external { require(ownerOf(_depositId) == msg.sender, 'HF: Must be owner to withdraw'); DepositInfo storage deposit = depositInfo[_depositId]; require( deposit.unlockTime == 0 || deposit.unlockTime <= block.timestamp || ...
2,399
14
// receiver should not fund their own cause
modifier checkIfReceiver(uint256 _id) { require(fundingArr[_id].receiver != msg.sender, "You can't fund your own cause !!"); _; }
modifier checkIfReceiver(uint256 _id) { require(fundingArr[_id].receiver != msg.sender, "You can't fund your own cause !!"); _; }
16,141
18
// updateAbility(_msgSender(), itemId, 1, 1);
}else if (contractAddress[Contracts.ETH] == dropTable.contractAddress) {
}else if (contractAddress[Contracts.ETH] == dropTable.contractAddress) {
7,451
112
// Now call the strategy to deposit
_underlyingAsset.safeTransfer(address(currentStrategy), amount); // Transfer again into the strategy currentStrategy.deposit(_msgSender()); // Activate strategy deposit require(currentStrategy.balance() > _strategyBalance, "No change in strategy balance"); // Balance should increase uint...
_underlyingAsset.safeTransfer(address(currentStrategy), amount); // Transfer again into the strategy currentStrategy.deposit(_msgSender()); // Activate strategy deposit require(currentStrategy.balance() > _strategyBalance, "No change in strategy balance"); // Balance should increase uint...
58,935
108
// Static call into ERC20.allowance(). Reverts if the call fails for some reason (should never fail)./
function staticAllowance(ERC20 _token, address _owner, address _spender) internal view returns (uint256) { bytes memory allowanceCallData = abi.encodeWithSelector( _token.allowance.selector, _owner, _spender ); (bool success, uint256 allowance) = staticIn...
function staticAllowance(ERC20 _token, address _owner, address _spender) internal view returns (uint256) { bytes memory allowanceCallData = abi.encodeWithSelector( _token.allowance.selector, _owner, _spender ); (bool success, uint256 allowance) = staticIn...
31,647
2
// ERC173 standard functions /
function owner() view external returns (address); function transferOwnership(address _newOwner) external;
function owner() view external returns (address); function transferOwnership(address _newOwner) external;
19,765
22
// Call the specified target and supply the specified amount and data.
(ok, returnData) = target.call{value: amount}(data);
(ok, returnData) = target.call{value: amount}(data);
56,067
68
// transfer amount (75%) to the seller.
(bool sent, ) = raffle.seller.call{value: amountForSeller}("");
(bool sent, ) = raffle.seller.call{value: amountForSeller}("");
1,954
29
// In order to provide transparency over whether `controllerTransfer` / `controllerRedeem` are useableor not `isControllable` function will be used. If `isControllable` returns `false` then it always return `false` and`controllerTransfer` / `controllerRedeem` will always revert.return bool `true` when controller addres...
function isControllable() external view returns (bool controlled);
function isControllable() external view returns (bool controlled);
25,108
26
// function called whenever tokens are created on a wallet this function can update state variables in the compliance contract these state variables being used by `canTransfer` to decide if a transfer is compliant or not depending on the values stored in these state variables and on the parameters of the compliance sma...
function created(address _to, uint256 _amount) external;
function created(address _to, uint256 _amount) external;
11,984
209
// KeysKeys for values in the DataStore
library Keys { // @dev key for the address of the wrapped native token bytes32 public constant WNT = keccak256(abi.encode("WNT")); // @dev key for the nonce value used in NonceUtils bytes32 public constant NONCE = keccak256(abi.encode("NONCE")); // @dev for sending received fees bytes32 public ...
library Keys { // @dev key for the address of the wrapped native token bytes32 public constant WNT = keccak256(abi.encode("WNT")); // @dev key for the nonce value used in NonceUtils bytes32 public constant NONCE = keccak256(abi.encode("NONCE")); // @dev for sending received fees bytes32 public ...
30,911
27
// Returns the downcasted uint64 from uint256, reverting onoverflow (when the input is greater than largest uint64). Counterpart to Solidity's `uint64` operator. Requirements: - input must fit into 64 bits /
function toUint64(uint256 value) internal pure returns (uint64) { if (value > type(uint64).max) { revert SafeCastOverflowedUintDowncast(64, value); } return uint64(value); }
function toUint64(uint256 value) internal pure returns (uint64) { if (value > type(uint64).max) { revert SafeCastOverflowedUintDowncast(64, value); } return uint64(value); }
1,336
1
// Document Management
function getDocument(bytes32 _name) external view returns (string memory, bytes32, uint256); function setDocument(bytes32 _name, string memory _uri, bytes32 _documentHash) external; function removeDocument(bytes32 _name) external; function getAllDocuments() external view returns (bytes32[] memory);
function getDocument(bytes32 _name) external view returns (string memory, bytes32, uint256); function setDocument(bytes32 _name, string memory _uri, bytes32 _documentHash) external; function removeDocument(bytes32 _name) external; function getAllDocuments() external view returns (bytes32[] memory);
19,608