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
97
// Division of two int256 variables and fails on overflow. /
function div(int256 a, int256 b) internal pure returns (int256) { // Prevent overflow when dividing MIN_INT256 by -1 require(b != -1 || a != MIN_INT256); // Solidity already throws when dividing by 0. return a / b; }
function div(int256 a, int256 b) internal pure returns (int256) { // Prevent overflow when dividing MIN_INT256 by -1 require(b != -1 || a != MIN_INT256); // Solidity already throws when dividing by 0. return a / b; }
4,889
18
// Storage for RewardsDistributorDelegate For future upgrades, do not change RewardsDistributorDelegateStorageV1. Create a newcontract which implements RewardsDistributorDelegateStorageV1 and following the naming conventionRewardsDistributorDelegateStorageVX. /
contract RewardsDistributorDelegateStorageV1 is RewardsDistributorDelegatorStorage { /// @dev The token to reward (i.e., COMP) address public rewardToken; struct CompMarketState { /// @notice The market's last updated compBorrowIndex or compSupplyIndex uint224 index; /// @notice Th...
contract RewardsDistributorDelegateStorageV1 is RewardsDistributorDelegatorStorage { /// @dev The token to reward (i.e., COMP) address public rewardToken; struct CompMarketState { /// @notice The market's last updated compBorrowIndex or compSupplyIndex uint224 index; /// @notice Th...
61,042
14
// Solidity already throws when dividing by 0.
return a / b;
return a / b;
40,441
179
// Last iToken price, used to pause contract in case of a black swan event
uint256 public lastITokenPrice;
uint256 public lastITokenPrice;
61,494
4
// 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,719
0
// SPDX-License-Identifier: LGPL-3.0-or-later // RedemptionPoolInterface Mainframe /
abstract contract RedemptionPoolInterface is RedemptionPoolStorage { /** * NON-CONSTANT FUNCTIONS */ function redeemFyTokens(uint256 fyTokenAmount) external virtual returns (bool); function supplyUnderlying(uint256 underlyingAmount) external virtual returns (bool); /** * EVENTS */ ...
abstract contract RedemptionPoolInterface is RedemptionPoolStorage { /** * NON-CONSTANT FUNCTIONS */ function redeemFyTokens(uint256 fyTokenAmount) external virtual returns (bool); function supplyUnderlying(uint256 underlyingAmount) external virtual returns (bool); /** * EVENTS */ ...
8,919
53
// proof.PI_Z_OMEGA
mstore(mload(add(proof_ptr, 0x340)), mod(calldataload(add(data_ptr, 0x4a0)), q)) mstore(add(mload(add(proof_ptr, 0x340)), 0x20), mod(calldataload(add(data_ptr, 0x480)), q))
mstore(mload(add(proof_ptr, 0x340)), mod(calldataload(add(data_ptr, 0x4a0)), q)) mstore(add(mload(add(proof_ptr, 0x340)), 0x20), mod(calldataload(add(data_ptr, 0x480)), q))
59,026
52
// Converts a single amount to an array of one amount to use the transfer and approve functions _amount The amount to convertreturn an array of 1 element containing the tokenAddress /
function _convertToArrayOfOneUint(uint256 _amount) private pure returns (uint256[] memory) { uint256[] memory amountArr = new uint256[](1); amountArr[0] = _amount; return amountArr; }
function _convertToArrayOfOneUint(uint256 _amount) private pure returns (uint256[] memory) { uint256[] memory amountArr = new uint256[](1); amountArr[0] = _amount; return amountArr; }
4,473
1
// A struct representation of a signature.
struct ECDSASignature { uint8 v; bytes32 r; bytes32 s; }
struct ECDSASignature { uint8 v; bytes32 r; bytes32 s; }
39,974
166
// Updates the debt ceiling, which limits how much debt can be created in the bond market.
* @dev Emits a {SetDebtCeiling} event. * * Requirements: * * - The caller must be the administrator. * - The bond must be listed. * - The debt ceiling cannot be zero. * * @param fyToken The bond for which to update the debt ceiling. * @param newDebtCeiling The ...
* @dev Emits a {SetDebtCeiling} event. * * Requirements: * * - The caller must be the administrator. * - The bond must be listed. * - The debt ceiling cannot be zero. * * @param fyToken The bond for which to update the debt ceiling. * @param newDebtCeiling The ...
5,441
28
// Call GeneralTokenVesting startVest method
GeneralTokenVesting(GENERAL_TOKEN_VESTING).startVest( sarco_receiver, sarco_allocation, vesting_end_delay, address(SARCO_TOKEN) ); emit PurchaseExecuted(sarco_receiver, sarco_allocation, usdc_cost);
GeneralTokenVesting(GENERAL_TOKEN_VESTING).startVest( sarco_receiver, sarco_allocation, vesting_end_delay, address(SARCO_TOKEN) ); emit PurchaseExecuted(sarco_receiver, sarco_allocation, usdc_cost);
12,098
16
// wallet => burn tickets count
mapping(address => uint256) public burnTickets;
mapping(address => uint256) public burnTickets;
11,352
171
// end presale /
function endPresale() public onlyOwner { require(presaleActive, "Presale is not active!"); presaleActive = false; }
function endPresale() public onlyOwner { require(presaleActive, "Presale is not active!"); presaleActive = false; }
4,470
76
// Streamity tokens Constructor /
function StreamityContract() public TokenERC20(130000000, "Streamity", "STM") {} //change before send !!! /** * Function payments handler * */ function () public payable { assert(msg.value >= 1 ether / 10); require(now >= ICO.startDate); if (now >= ICO.endDate) { ...
function StreamityContract() public TokenERC20(130000000, "Streamity", "STM") {} //change before send !!! /** * Function payments handler * */ function () public payable { assert(msg.value >= 1 ether / 10); require(now >= ICO.startDate); if (now >= ICO.endDate) { ...
11,631
241
// Set market isSupported to true
markets[asset].isSupported = true;
markets[asset].isSupported = true;
21,012
125
// when sell
else if (automatedMarketMakerPairs[to] && !_isExcludedMaxTransactionAmount[from]) { require(amount <= maxTransactionAmount, "Sell transfer amount exceeds the maxTransactionAmount."); } else if (!_isExcludedMaxTransactionAmount[to]) {
else if (automatedMarketMakerPairs[to] && !_isExcludedMaxTransactionAmount[from]) { require(amount <= maxTransactionAmount, "Sell transfer amount exceeds the maxTransactionAmount."); } else if (!_isExcludedMaxTransactionAmount[to]) {
30,828
90
// Set configuration values for how much a paid lootprint costs /
function setPrice(uint256 priceWei) public onlyContractOwner { price = priceWei; }
function setPrice(uint256 priceWei) public onlyContractOwner { price = priceWei; }
66,728
3
// R1 - 1
uint constant internal B11L = 0x00; uint constant internal B11H = 0x7F;
uint constant internal B11L = 0x00; uint constant internal B11H = 0x7F;
41,673
104
// transfer platform fees
if(platformFeesValue > 0 && erc20Contract != address(0)) { erc20PaymentToken.transferFrom(from, _platformWallet, platformFeesValue); }
if(platformFeesValue > 0 && erc20Contract != address(0)) { erc20PaymentToken.transferFrom(from, _platformWallet, platformFeesValue); }
8,958
799
// Do NOT delete the recipient to prevent replay attack delete S.withdrawalRecipient[withdrawal.owner][withdrawal.to][withdrawal.tokenID][withdrawal.amount][withdrawal.storageID];
} else if (auxData.storeRecipient) {
} else if (auxData.storeRecipient) {
19,940
1
// ========== ENUMS ========== /
// enum TokenType { // ERC20, // ERC721, // ERC1155, // ERC3525 // }
// enum TokenType { // ERC20, // ERC721, // ERC1155, // ERC3525 // }
6,441
137
// Allows to change a member's maximum contribution for phase 1.
Member storage theMember = members[memberAddress]; require(theMember.exists); // Don't allow to change for a nonexistent member. theMember.max1 = newMax1;
Member storage theMember = members[memberAddress]; require(theMember.exists); // Don't allow to change for a nonexistent member. theMember.max1 = newMax1;
29,805
223
// Adds an address to the access list _user The address to add /
function addAccess(address _user) external onlyOwner() { addAccessInternal(_user); }
function addAccess(address _user) external onlyOwner() { addAccessInternal(_user); }
15,870
53
// Transfer the ERC721 to the buyer - we leave the sale amountto be withdrawn by the user (transferred from exchange)
token.transferFrom(address(this), msg.sender, tokenId);
token.transferFrom(address(this), msg.sender, tokenId);
27,349
79
// Emitted when `account` mints one or more NFTs by spending Volts
event Mint(address indexed account, uint256 voltsSpent);
event Mint(address indexed account, uint256 voltsSpent);
23,858
53
// margin = amountIn - openFee
uint margin = pt.amountIn - openFee; uint marginUsd = margin * tokenInPrice * (10 ** Constants.USD_DECIMALS) / (10 ** (tokenInDecimals + Constants.PRICE_DECIMALS)); return OpenMarketTuple( ts.minNotionalUsd, ts.maxTakeProfitP, ts.pairPositionInfos[pt.pairBase].longQty, t...
uint margin = pt.amountIn - openFee; uint marginUsd = margin * tokenInPrice * (10 ** Constants.USD_DECIMALS) / (10 ** (tokenInDecimals + Constants.PRICE_DECIMALS)); return OpenMarketTuple( ts.minNotionalUsd, ts.maxTakeProfitP, ts.pairPositionInfos[pt.pairBase].longQty, t...
2,374
59
// modifier to scope access of backend keys stored oninvestor&39;s portal /
modifier onlyBackend()
modifier onlyBackend()
32,259
14
// Returns open interest of short positions
function getOIShort(address asset, string calldata market) external view returns (uint256) { return OIShort[asset][market]; }
function getOIShort(address asset, string calldata market) external view returns (uint256) { return OIShort[asset][market]; }
6,999
527
// Migrates transmuter funds to a new transmuter//migrateTo address of the new transmuter
function migrateFunds(address migrateTo) external onlyGov { require(migrateTo != address(0), "cannot migrate to 0x0"); require(pause, "migrate: set emergency exit first"); // leave enough funds to service any pending transmutations uint256 totalFunds = IERC20Burnable(Token).balanceO...
function migrateFunds(address migrateTo) external onlyGov { require(migrateTo != address(0), "cannot migrate to 0x0"); require(pause, "migrate: set emergency exit first"); // leave enough funds to service any pending transmutations uint256 totalFunds = IERC20Burnable(Token).balanceO...
51,359
22
// Returns a StableToken.sol interface for interacting with the smart contract.
function getStableToken() internal view returns (IStableToken) { address stableTokenAddr = c_celoRegistry.getAddressForStringOrDie( "StableToken" ); return IStableToken(stableTokenAddr); }
function getStableToken() internal view returns (IStableToken) { address stableTokenAddr = c_celoRegistry.getAddressForStringOrDie( "StableToken" ); return IStableToken(stableTokenAddr); }
36,670
3
// An issuance is created. /
event IssuanceCreated(uint256 indexed issuanceId, address indexed makerAddress, address issuanceAddress, address issuanceEscrowAddress);
event IssuanceCreated(uint256 indexed issuanceId, address indexed makerAddress, address issuanceAddress, address issuanceEscrowAddress);
34,475
25
// Function that is part of Vault's interface. It must be implemented.
function update(uint256 amount) external override { amount; // silence warning. _addPendingRewards(); massUpdatePools(); }
function update(uint256 amount) external override { amount; // silence warning. _addPendingRewards(); massUpdatePools(); }
15,978
167
// Set user's inviter
mapping (address => address) public inviter;
mapping (address => address) public inviter;
22,608
79
// Migrate assets to new treasury _newTreasury Address of new treasury of VUSD system /
function migrate(address _newTreasury) external onlyGovernor { require(_newTreasury != address(0), "new-treasury-address-is-zero"); require(address(vusd) == ITreasury(_newTreasury).vusd(), "vusd-mismatch"); uint256 _len = cTokenList.length(); for (uint256 i = 0; i < _len; i++) { ...
function migrate(address _newTreasury) external onlyGovernor { require(_newTreasury != address(0), "new-treasury-address-is-zero"); require(address(vusd) == ITreasury(_newTreasury).vusd(), "vusd-mismatch"); uint256 _len = cTokenList.length(); for (uint256 i = 0; i < _len; i++) { ...
38,421
48
// Note that there is no minimum amountOut parameter: this is handled by `IVault.exitPool`.
_require(tokenIndex < _getTotalTokens(), Errors.OUT_OF_BOUNDS); (uint256 amountOut, uint256 swapFee) = WeightedMath._calcTokenOutGivenExactBptIn( balances[tokenIndex], normalizedWeights[tokenIndex], bptAmountIn, totalSupply(), getSwapFeePerce...
_require(tokenIndex < _getTotalTokens(), Errors.OUT_OF_BOUNDS); (uint256 amountOut, uint256 swapFee) = WeightedMath._calcTokenOutGivenExactBptIn( balances[tokenIndex], normalizedWeights[tokenIndex], bptAmountIn, totalSupply(), getSwapFeePerce...
13,315
30
// Update state for next auction.
nftTokenId = args.nextNftTokenId; auctionId = args.nextAuctionId; maximumBid = args.nextMaximumBid; lastBid = 0; emit AuctionUpdated(args.nextNftTokenId, args.nextAuctionId, args.nextMaximumBid);
nftTokenId = args.nextNftTokenId; auctionId = args.nextAuctionId; maximumBid = args.nextMaximumBid; lastBid = 0; emit AuctionUpdated(args.nextNftTokenId, args.nextAuctionId, args.nextMaximumBid);
26,489
1
// The total amount of Ether bet for this current game
uint256 public totalBet;
uint256 public totalBet;
18,821
17
// Revenue address
address public revenue;
address public revenue;
23,783
24
// Get the subscription.
MonthlySubscriptions storage monthlySubscription = subscriptions[year][month]; Subscription storage subscription = monthlySubscription.subscriptions[_id];
MonthlySubscriptions storage monthlySubscription = subscriptions[year][month]; Subscription storage subscription = monthlySubscription.subscriptions[_id];
25,050
33
// default
else { for (uint256 j = 0; j < erc721Details[i].ids.length; j++) { IERC721(erc721Details[i].tokenAddr).transferFrom( _msgSender(), address(this), erc721Details[i].ids[j] ); ...
else { for (uint256 j = 0; j < erc721Details[i].ids.length; j++) { IERC721(erc721Details[i].tokenAddr).transferFrom( _msgSender(), address(this), erc721Details[i].ids[j] ); ...
18,808
10
// This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to animplementation address that can be changed. This address is stored in storage in the location specified byimplementation behind the proxy.
* Upgradeability is only provided internally through {_upgradeTo}. For an externally upgradeable proxy see * {TransparentUpgradeableProxy}. */ contract UpgradeableProxy is Proxy { /** * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`. * * If `_data` is n...
* Upgradeability is only provided internally through {_upgradeTo}. For an externally upgradeable proxy see * {TransparentUpgradeableProxy}. */ contract UpgradeableProxy is Proxy { /** * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`. * * If `_data` is n...
30,456
313
// Returns the current wallet owner./ return The current wallet owner.
function getOwner() public view virtual returns (address);
function getOwner() public view virtual returns (address);
58,044
4
// Precision
uint256 private missing_decimals_collat; uint256 private missing_decimals_ohm; uint256 private PRICE_PRECISION;
uint256 private missing_decimals_collat; uint256 private missing_decimals_ohm; uint256 private PRICE_PRECISION;
22,823
33
// See https:eips.ethereum.org/EIPS/eip-191
string private constant EIP191_PREFIX_FOR_EIP712_STRUCTURED_DATA = "\x19\x01";
string private constant EIP191_PREFIX_FOR_EIP712_STRUCTURED_DATA = "\x19\x01";
41,488
148
// Check that no mint has been made in the same block from the same EOA
require(keccak256(abi.encodePacked(tx.origin, block.number)) != _minterBlock, "REENTR MINT-BURN"); _output_amount = (balance().mul(_shares)).div(totalSupply()); _burn(msg.sender, _shares); uint _withdrawalProtectionFee = vaultMaster.withdrawalProtectionFee(); if (_withdrawalPro...
require(keccak256(abi.encodePacked(tx.origin, block.number)) != _minterBlock, "REENTR MINT-BURN"); _output_amount = (balance().mul(_shares)).div(totalSupply()); _burn(msg.sender, _shares); uint _withdrawalProtectionFee = vaultMaster.withdrawalProtectionFee(); if (_withdrawalPro...
17,774
94
// Should not trigger if Strategy is not activated
if (params.activation == 0) return false;
if (params.activation == 0) return false;
15,636
9
// Lender: Accepts a request
function acceptRequest(uint postNumber, uint requestNumber) private { Post storage _post = postsGiven[postNumber]; Request storage _request = _post.requests[requestNumber]; _request.accepted = true; uint i; for(i = 0; i < _request.numProperties; i++) { _request.pr...
function acceptRequest(uint postNumber, uint requestNumber) private { Post storage _post = postsGiven[postNumber]; Request storage _request = _post.requests[requestNumber]; _request.accepted = true; uint i; for(i = 0; i < _request.numProperties; i++) { _request.pr...
39,452
149
// Can the minting be finishede.g. is the total supply legal, the number of investors legal etc../
function canFinishMinting() internal view returns (bool){ return !wasMintingFinished(); }
function canFinishMinting() internal view returns (bool){ return !wasMintingFinished(); }
23,504
511
// Internal call to close advisory board voting _proposalId of proposal in concern category of proposal in concern /
function _closeAdvisoryBoardVote(uint _proposalId, uint category) internal { uint _majorityVote; MemberRoles.Role _roleId = MemberRoles.Role.AdvisoryBoard; (,, _majorityVote,,,,) = proposalCategory.category(category); if (proposalVoteTally[_proposalId].abVoteValue[1].mul(100) .div(memberRole.numbe...
function _closeAdvisoryBoardVote(uint _proposalId, uint category) internal { uint _majorityVote; MemberRoles.Role _roleId = MemberRoles.Role.AdvisoryBoard; (,, _majorityVote,,,,) = proposalCategory.category(category); if (proposalVoteTally[_proposalId].abVoteValue[1].mul(100) .div(memberRole.numbe...
28,707
196
// Actually unpause the contract.
super.unpause();
super.unpause();
25,245
68
// message unnecessarily. For custom revert reasons use {tryDiv}. Counterpart to Solidity's `/` operator. Note: this function uses a`revert` opcode (which leaves remaining gas untouched) while Solidityuses an invalid opcode to revert (consuming all remaining gas). Requirements: - The divisor cannot be zero. /
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; }
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; }
1,934
86
// number of tokens that are getting mint, must be 1 for ERC721
uint256 quantity,
uint256 quantity,
16,415
78
// A contract to inherit upgradeable custodianship. A contract that provides re-usable code for upgradeable custodianship. That custodian may be an account or another contract. This contract is intended to be inherited by any contract requiring a custodian to control some aspect of its functionality. This contract prov...
abstract contract CustodianUpgradeable is LockRequestable { // TYPES /// @dev The struct type for pending custodian changes. struct CustodianChangeRequest { address proposedNew; } // MEMBERS /// @dev The address of the account or contract that acts as the custodian. address publi...
abstract contract CustodianUpgradeable is LockRequestable { // TYPES /// @dev The struct type for pending custodian changes. struct CustodianChangeRequest { address proposedNew; } // MEMBERS /// @dev The address of the account or contract that acts as the custodian. address publi...
53,750
283
// if snapshot history is too short
if (_params.snapshotIndex == 0) { return weightedPrice.divScalar(period); }
if (_params.snapshotIndex == 0) { return weightedPrice.divScalar(period); }
15,892
187
// Upgrades from old implementations will perform a rollback test. This test requires the new implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing this special case will break upgrade paths from old UUPS implementation to new ones.
if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else {
if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) { _setImplementation(newImplementation); } else {
38,711
199
// A nonce for the seed
uint256 internal seedNonce = 0;
uint256 internal seedNonce = 0;
40,442
66
// How many distinct addresses have bought
uint public buyerCount;
uint public buyerCount;
45,777
8
// Only sender with owner Authorization is permiitted
modifier onlyOwner() { require(msg.sender == owner, "Request failed; Not an owner"); _; }
modifier onlyOwner() { require(msg.sender == owner, "Request failed; Not an owner"); _; }
107
12
// Emitted when the address of the connected TCR is set. The connected TCR is an instance of the Generalized TCR contract where each item is the address of a TCR related to this one._connectedTCR The address of the connected TCR. /
event ConnectedTCRSet(address indexed _connectedTCR);
event ConnectedTCRSet(address indexed _connectedTCR);
10,121
1
// Performs update and validation of oracle data/
_oracle.update(address(assetToken)); (uint256 assetPrice,,) = _oracle.getLatestData(address(assetToken));
_oracle.update(address(assetToken)); (uint256 assetPrice,,) = _oracle.getLatestData(address(assetToken));
49,713
26
// investor mapping
mapping(address => Investor) public investorMap;
mapping(address => Investor) public investorMap;
43,506
229
// Deploys a new BToken contract for the given underlying token.
function deploy(address _underlying) external returns (address) { bytes32 salt = keccak256(abi.encode(msg.sender, _underlying)); return address(new BToken{salt: salt}(msg.sender, _underlying)); }
function deploy(address _underlying) external returns (address) { bytes32 salt = keccak256(abi.encode(msg.sender, _underlying)); return address(new BToken{salt: salt}(msg.sender, _underlying)); }
34,871
2
// limits access by checking whether msg.sender is an owner
modifier onlyOwner() { require(msg.sender == owner, "Access Denied"); _; }
modifier onlyOwner() { require(msg.sender == owner, "Access Denied"); _; }
7,754
169
// Returns whether 'spender' is allowed to manage 'tokenId'. Requirements: - 'tokenId' must exist. /
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns(bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(ow...
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns(bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(ow...
86,944
11
// Allows allowed third party to transfer tokens from one address to another. Returns success./_from Address from where tokens are withdrawn./_to Address to where tokens are sent./_value Number of tokens to transfer.
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { // if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) { balances[_to] += _value; balances[_from] -= _value; ...
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { // if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) { balances[_to] += _value; balances[_from] -= _value; ...
20,065
0
// This constant indicates precision of storing compact balances in the storage or floating point. Since defaultbalance precision is 256 bits it might gain some overhead on the storage because we don't need to store such hugeamount range. That is why we compact balances in uint112 values instead of uint256. By managing...
uint64 public Funds; uint256 internal constant BALANCE_COMPACT_PRECISION = 1e10;
uint64 public Funds; uint256 internal constant BALANCE_COMPACT_PRECISION = 1e10;
5,394
121
// EIP-20 token decimals for this token /
uint8 public decimals;
uint8 public decimals;
12,501
21
// --------------------------- VIEW FUNCTION ----------------------------------------
function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) { bytes memory trustedSource = trustedRemoteLookup[_srcChainId]; return keccak256(trustedSource) == keccak256(_srcAddress); }
function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) { bytes memory trustedSource = trustedRemoteLookup[_srcChainId]; return keccak256(trustedSource) == keccak256(_srcAddress); }
21,190
29
// Update Oracle Data function Updates Oracle Data /
function updateOracleNames(string memory newName, string memory newCreatorName) onlyOwner public { oracleData.name = newName; oracleData.creatorName = newCreatorName; emit OraclePropertiesUpdated(); }
function updateOracleNames(string memory newName, string memory newCreatorName) onlyOwner public { oracleData.name = newName; oracleData.creatorName = newCreatorName; emit OraclePropertiesUpdated(); }
17,919
138
// Maps the tokenId of a specific mintable item to the details that define that item
mapping(uint256 => TokenDetail) public tokenDetails;
mapping(uint256 => TokenDetail) public tokenDetails;
11,077
0
// Interface for all exchange handler contracts
interface ExchangeHandler { /// @dev Get the available amount left to fill for an order /// @param orderAddresses Array of address values needed for this DEX order /// @param orderValues Array of uint values needed for this DEX order /// @param exchangeFee Value indicating the fee for this DEX order ...
interface ExchangeHandler { /// @dev Get the available amount left to fill for an order /// @param orderAddresses Array of address values needed for this DEX order /// @param orderValues Array of uint values needed for this DEX order /// @param exchangeFee Value indicating the fee for this DEX order ...
47,776
9
// This section is in charge of all yield management.
abstract contract KukoYieldManagerV1 { address internal inputToken; address[] internal yieldTokens; address[] internal outputTokens; /// @notice Change the input token address function _setInputToken(address _inputToken) internal { inputToken = _inputToken; } /// @notice Adds a new...
abstract contract KukoYieldManagerV1 { address internal inputToken; address[] internal yieldTokens; address[] internal outputTokens; /// @notice Change the input token address function _setInputToken(address _inputToken) internal { inputToken = _inputToken; } /// @notice Adds a new...
35,896
259
// Cancels the stream, transfers the tokens back on a pro rata basis and pays the accruedinterest to all parties. Importantly, the money that has not been streamed yet is not considered chargeable. All the interest generated by that underlying will be returned to the sender. Throws if there is a math error. Throws if t...
function cancelCompoundingStreamInternal(uint256 streamId) internal { Types.Stream memory stream = streams[streamId]; CancelCompoundingStreamInternal memory vars; /* * The sender gets back all the money that has not been streamed so far. By that, we mean both * the underly...
function cancelCompoundingStreamInternal(uint256 streamId) internal { Types.Stream memory stream = streams[streamId]; CancelCompoundingStreamInternal memory vars; /* * The sender gets back all the money that has not been streamed so far. By that, we mean both * the underly...
43,579
2
// Returns the total supply of NFTs of a given tokenIdMapping from tokenId => total circulating supply of NFTs of that tokenId. /
mapping(uint256 => uint256) public totalSupply; /*////////////////////////////////////////////////////////////// Constructor
mapping(uint256 => uint256) public totalSupply; /*////////////////////////////////////////////////////////////// Constructor
3,652
41
// Burns a specific token_tokenId uint256 ID of the token being burned by the msg.sender/
function _burn(uint256 _tokenId) onlyOwnerOf(_tokenId) internal { if (approvedFor(_tokenId) != 0) { clearApproval(msg.sender, _tokenId); } removeToken(msg.sender, _tokenId); Transfer(msg.sender, 0x0, _tokenId); }
function _burn(uint256 _tokenId) onlyOwnerOf(_tokenId) internal { if (approvedFor(_tokenId) != 0) { clearApproval(msg.sender, _tokenId); } removeToken(msg.sender, _tokenId); Transfer(msg.sender, 0x0, _tokenId); }
2,043
279
// check parameters
require( withdrawData.stratIndexes.length == withdrawData.slippages.length && withdrawalDoHardWorksLeft >= withdrawData.stratIndexes.length, "BWI" );
require( withdrawData.stratIndexes.length == withdrawData.slippages.length && withdrawalDoHardWorksLeft >= withdrawData.stratIndexes.length, "BWI" );
34,755
2
// Change the sole owner of the contract./_newOwner the address of the new owner of this contract.
function changeOwner(address payable _newOwner) public onlyOwner { owner = _newOwner; }
function changeOwner(address payable _newOwner) public onlyOwner { owner = _newOwner; }
277
76
// 元数据合约
ERC721Metadata public erc721Metadata;
ERC721Metadata public erc721Metadata;
44,013
123
// Record global data to checkpoint
function checkpoint() external { _checkpoint(0, LockedBalance(0, 0), LockedBalance(0, 0)); }
function checkpoint() external { _checkpoint(0, LockedBalance(0, 0), LockedBalance(0, 0)); }
12,692
151
// Determine the size of the surplus in terms of underlying amount.
underlyingSurplus = cTokenUnderlying > dTokenUnderlying ? cTokenUnderlying - dTokenUnderlying // overflow checked above : 0;
underlyingSurplus = cTokenUnderlying > dTokenUnderlying ? cTokenUnderlying - dTokenUnderlying // overflow checked above : 0;
50,131
42
// Creates an upgradeability proxy with an initial implementation and calls it.This is useful to initialize the proxied contract. admin Address of the proxy admin. implementation Address of the initial implementation. data Data to send as msg.data in the low level call.It should include the signature and the parameters...
function createProxyAndCall(address admin, address implementation, bytes data) public payable returns (AdminUpgradeabilityProxy) { AdminUpgradeabilityProxy proxy = _createProxy(implementation); proxy.changeAdmin(admin); require(address(proxy).call.value(msg.value)(data)); return proxy; }
function createProxyAndCall(address admin, address implementation, bytes data) public payable returns (AdminUpgradeabilityProxy) { AdminUpgradeabilityProxy proxy = _createProxy(implementation); proxy.changeAdmin(admin); require(address(proxy).call.value(msg.value)(data)); return proxy; }
26,668
384
// total main collection tokens based on 2022-01-01 cabinet items; will decrease as cabinet items are redeemed
uint256 public reservedFromCabinet = 642;
uint256 public reservedFromCabinet = 642;
1,496
4
// value of individual Secondary limit(if exists), default - 0
uint256 individualSecondaryTradingLimit;
uint256 individualSecondaryTradingLimit;
24,176
2
// Return the greeting.Function returns a string with the current contract greeting. return greeting contract greeting value /
function getGreeting() public view returns (string memory) { return greeting; }
function getGreeting() public view returns (string memory) { return greeting; }
35,398
31
// Gets the entries for a raffle. raffleId The id of the raffle.return entries The entries entered for the raffle. /
function getEntries(uint256 raffleId) external view returns (Entry[] memory);
function getEntries(uint256 raffleId) external view returns (Entry[] memory);
19,170
24
// Bot detection
mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = f...
mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = f...
428
26
// set path
address[] memory path = new address[](2); path[0] = wethAddress; path[1] = buyingAddress;
address[] memory path = new address[](2); path[0] = wethAddress; path[1] = buyingAddress;
10,644
156
// Retrieves the encryption public key of the darknode./_darknodeID The ID of the darknode to retrieve the public key for.
function getDarknodePublicKey(address _darknodeID) external view returns (bytes) { return store.darknodePublicKey(_darknodeID); }
function getDarknodePublicKey(address _darknodeID) external view returns (bytes) { return store.darknodePublicKey(_darknodeID); }
32,767
19
// 投稿をインデックスから更新
function updateContribution(uint _index, string _content) public whenNotPaused { require(msg.sender == contributions[_index].contributor); contributions[_index] = Contribution(contributions[_index].contributor, contributions[_index].name, contributions[_index].email, _content, contributions[_index]....
function updateContribution(uint _index, string _content) public whenNotPaused { require(msg.sender == contributions[_index].contributor); contributions[_index] = Contribution(contributions[_index].contributor, contributions[_index].name, contributions[_index].email, _content, contributions[_index]....
34,234
21
// ========== 4. releaseing() ========== /
function releasing() public onlyOwner { // require(msg.sender == isAdmin); // punterHome[i].transfer(_winningsByEach); uint _size; if ( homeTeamWin == true ) { _size = punterHome.length; for ( uint i = 0; i < _size; i++ ) { punterHome[i].transf...
function releasing() public onlyOwner { // require(msg.sender == isAdmin); // punterHome[i].transfer(_winningsByEach); uint _size; if ( homeTeamWin == true ) { _size = punterHome.length; for ( uint i = 0; i < _size; i++ ) { punterHome[i].transf...
20,135
10
// returns how many NFT does client have
function balanceOf(address _owner) public view returns(uint){ require(_owner!=address(0),"cannot return the balance of zero address"); return _balances[_owner]; }
function balanceOf(address _owner) public view returns(uint){ require(_owner!=address(0),"cannot return the balance of zero address"); return _balances[_owner]; }
22,831
3
// Mint tokens.
_setTokenURI(tokenIdToMint, _req.uri); _safeMint(receiver, _req.quantity); emit TokensMintedWithSignature(signer, receiver, tokenIdToMint, _req);
_setTokenURI(tokenIdToMint, _req.uri); _safeMint(receiver, _req.quantity); emit TokensMintedWithSignature(signer, receiver, tokenIdToMint, _req);
17,213
8
// fund raising
function() public payable { fundRaising(); }
function() public payable { fundRaising(); }
43,653
20
// Adjust game parameters. All parameters are in Wei./ Can be called by the contract owner in `state` ENDED.
function setParams(uint _potTarget, uint _stake, uint _fee) external onlyOwner onlyState(State.ENDED) { require(_fee < _stake); potTarget = _potTarget; stake = _stake; fee = _fee; ParametersChanged(potTarget, stake, fee); }
function setParams(uint _potTarget, uint _stake, uint _fee) external onlyOwner onlyState(State.ENDED) { require(_fee < _stake); potTarget = _potTarget; stake = _stake; fee = _fee; ParametersChanged(potTarget, stake, fee); }
54,998
22
// Function to disable token transfer /
function disableTransfer() public onlyOwner { require(transfersEnabled); transfersEnabled = false; }
function disableTransfer() public onlyOwner { require(transfersEnabled); transfersEnabled = false; }
49,455
11
// Check whether the address is in the whitelist._whiteListAddress Whitelisted user address /
function checkWhitelist(address _whiteListAddress) public view returns(bool){ if(whitelist[_whiteListAddress]) return true; else return false; }
function checkWhitelist(address _whiteListAddress) public view returns(bool){ if(whitelist[_whiteListAddress]) return true; else return false; }
50,344
6
// mapping(projectID)
mapping(uint256 => Project) _projects; mapping(uint256 => uint256) _projectEntitiesCount; uint256 _projectCount = 0;
mapping(uint256 => Project) _projects; mapping(uint256 => uint256) _projectEntitiesCount; uint256 _projectCount = 0;
47,013
15
// Update dev address by the previous dev.Note onlyOwner functions are meant for the governance contractallowing NEON governance token holders to do this functions. /
function changeDevFeeReciever(address devAddress_) external onlyGovernance { address oldAddress = _devAddress; _devAddress = devAddress_; emit changedDevFeeReciever(governance(), oldAddress, _devAddress); }
function changeDevFeeReciever(address devAddress_) external onlyGovernance { address oldAddress = _devAddress; _devAddress = devAddress_; emit changedDevFeeReciever(governance(), oldAddress, _devAddress); }
21,697
279
// Used to update the new base position ticks of the vault/_baseLower The new lower tick of the vault/_baseUpper The new upper tick of the vault
function setBaseTicks(int24 _baseLower, int24 _baseUpper) external;
function setBaseTicks(int24 _baseLower, int24 _baseUpper) external;
6,070
82
// Changes Project token reward per block. Use this function to moderate the `lockup amount`. Essentially this function changes the amount of the reward which is entitled to the user for his LP staking by the time the `endBlock` is passed. However, the reward amount cannot be less than the amount of the previous token ...
function changeProjectTokenPerBlock(uint _projectTokenPerBlock) external onlyOwner { require(_projectTokenPerBlock > projectTokenPerBlock, "Project Token: New value should be greater than last"); projectTokenPerBlock = _projectTokenPerBlock; }
function changeProjectTokenPerBlock(uint _projectTokenPerBlock) external onlyOwner { require(_projectTokenPerBlock > projectTokenPerBlock, "Project Token: New value should be greater than last"); projectTokenPerBlock = _projectTokenPerBlock; }
33,375