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
42
// Returns the most significant bit of a given uint256
function mostSignificantBit(uint256 x) internal pure returns (uint256) { uint8 o = 0; uint8 h = 255; while (h > o) { uint8 m = uint8 ((uint16 (o) + uint16 (h)) >> 1); uint256 t = x >> m; if (t == 0) h = m - 1; else if (t > 1) o...
function mostSignificantBit(uint256 x) internal pure returns (uint256) { uint8 o = 0; uint8 h = 255; while (h > o) { uint8 m = uint8 ((uint16 (o) + uint16 (h)) >> 1); uint256 t = x >> m; if (t == 0) h = m - 1; else if (t > 1) o...
17,386
175
// Returns collection's premint list capacity and current count collectionId_ collection ID /
function collectionPremintListDetails(uint256 collectionId_) public view returns (uint16, uint16)
function collectionPremintListDetails(uint256 collectionId_) public view returns (uint16, uint16)
34,462
18
// Derive expected offset as start of recipients + len64.
add( BasicOrder_signature_ptr, mul(
add( BasicOrder_signature_ptr, mul(
14,745
39
// Composite plus token. A composite plus token is backed by a basket of plus token. The composite plus token,along with its underlying tokens in the basket, should have the same peg. /
contract CompositePlus is ICompositePlus, Plus, ReentrancyGuardUpgradeable { using SafeERC20Upgradeable for IERC20Upgradeable; using SafeMathUpgradeable for uint256; event Minted(address indexed user, address[] tokens, uint256[] amounts, uint256 mintShare, uint256 mintAmount); event Redeemed(address in...
contract CompositePlus is ICompositePlus, Plus, ReentrancyGuardUpgradeable { using SafeERC20Upgradeable for IERC20Upgradeable; using SafeMathUpgradeable for uint256; event Minted(address indexed user, address[] tokens, uint256[] amounts, uint256 mintShare, uint256 mintAmount); event Redeemed(address in...
76,767
127
// Queries the approval status of an operator for a given owner./owner The owner of the Tokens/operatorAddress of authorized operator/ return True if the operator is approved, false if not
function isApprovedForAll(address owner, address operator) public override view returns (bool) { bool approved = operatorApproval[owner][operator]; if (!approved && exchangesRegistry != address(0)) { return WhitelistExchangesProxy(exchangesRegistry).isAddressWhitelisted(operator) == true...
function isApprovedForAll(address owner, address operator) public override view returns (bool) { bool approved = operatorApproval[owner][operator]; if (!approved && exchangesRegistry != address(0)) { return WhitelistExchangesProxy(exchangesRegistry).isAddressWhitelisted(operator) == true...
16,444
16
// ----- EVENTS
event Transfer(address indexed fromAddr, address indexed toAddr, uint256 amount); event Approval(address indexed _owner, address indexed _spender, uint256 amount);
event Transfer(address indexed fromAddr, address indexed toAddr, uint256 amount); event Approval(address indexed _owner, address indexed _spender, uint256 amount);
29,213
2
// count to track number of games own by user
mapping(address=>uint) public ownerGameCount;
mapping(address=>uint) public ownerGameCount;
36,309
19
// ------------------------------------------------------------------------ Account can add itself as an App account ------------------------------------------------------------------------
function addApp(string appName, address _feeAccount, uint _fee) public { App storage e = apps[msg.sender]; require(e.appAccount == address(0)); apps[msg.sender] = App({ appAccount: msg.sender, appName: appName, feeAccount: _feeAccount, fee: _fe...
function addApp(string appName, address _feeAccount, uint _fee) public { App storage e = apps[msg.sender]; require(e.appAccount == address(0)); apps[msg.sender] = App({ appAccount: msg.sender, appName: appName, feeAccount: _feeAccount, fee: _fe...
2,810
10
// checks if the input skill is alredy stored in DatabaseSkills contract/_skill The sought skill
function checkSkillExistence(bytes32 _skill) public view returns (bool) { return dbSkills.checkSkillExistence(_skill); }
function checkSkillExistence(bytes32 _skill) public view returns (bool) { return dbSkills.checkSkillExistence(_skill); }
13,302
50
// Metadata defining a token's icon.
struct Token { uint8 designIcon0; uint8 designIcon1; uint8 randIcon; uint8 combMethod; }
struct Token { uint8 designIcon0; uint8 designIcon1; uint8 randIcon; uint8 combMethod; }
63,743
21
// Pay for an airline in the registration queue/
function payAirlineFee (address newAirline) external payable requireIsOperational
function payAirlineFee (address newAirline) external payable requireIsOperational
5,414
154
// GET - The address of the Smart Contract whose code will serve as a model for all the Native EthItems.Every EthItem will have its own address, but the code will be cloned from this one. /
function nativeModel() external view returns (address nativeModelAddress, uint256 nativeModelVersion);
function nativeModel() external view returns (address nativeModelAddress, uint256 nativeModelVersion);
32,720
9
// 质押 ERC20 Token
function depositToken(address token, uint256 amount) external { require(token != address(0), "Address(0) is not allowed"); require(amount > 0, "Amount must be greater than 0"); bool success = IERC20(token).transferFrom(msg.sender, address(this), amount); require(success, "ERC20 Token transferFrom fail...
function depositToken(address token, uint256 amount) external { require(token != address(0), "Address(0) is not allowed"); require(amount > 0, "Amount must be greater than 0"); bool success = IERC20(token).transferFrom(msg.sender, address(this), amount); require(success, "ERC20 Token transferFrom fail...
22,199
108
// Returns the hash of internal node, calculated from child nodes.
function merkleInnerHash(bytes32 left, bytes32 right) internal pure returns (bytes32)
function merkleInnerHash(bytes32 left, bytes32 right) internal pure returns (bytes32)
28,361
1
// the fee in basis points for buying the asset for VOLT
uint256 public override redeemFeeBasisPoints;
uint256 public override redeemFeeBasisPoints;
48,164
42
// encodedPartialPath has elements that are each two hex characters (1 byte), but partialPath and slicedPath have elements that are each one hex character (1 nibble)
bytes memory partialPath = _getNibbleArray(encodedPartialPath); bytes memory slicedPath = new bytes(partialPath.length);
bytes memory partialPath = _getNibbleArray(encodedPartialPath); bytes memory slicedPath = new bytes(partialPath.length);
68,805
55
// Access Control Cliff Hall Role-based access control and contract upgrade functionality. /
contract AccessControl { using SafeMath for uint256; using SafeMath for uint16; using Roles for Roles.Role; Roles.Role private admins; Roles.Role private minters; Roles.Role private owners; /** * @notice Sets `msg.sender` as system admin by default. * Starts paused. System admin...
contract AccessControl { using SafeMath for uint256; using SafeMath for uint16; using Roles for Roles.Role; Roles.Role private admins; Roles.Role private minters; Roles.Role private owners; /** * @notice Sets `msg.sender` as system admin by default. * Starts paused. System admin...
53,294
45
// Custom Ownable/ Custom ownable contract.
contract CustomOwnable is Ownable { ///The trustee wallet. address private _trustee; event TrusteeAssigned(address indexed account); ///@notice Validates if the sender is actually the trustee. modifier onlyTrustee() { require(msg.sender == _trustee, "Access is denied."); _; } ///@notice Assigns...
contract CustomOwnable is Ownable { ///The trustee wallet. address private _trustee; event TrusteeAssigned(address indexed account); ///@notice Validates if the sender is actually the trustee. modifier onlyTrustee() { require(msg.sender == _trustee, "Access is denied."); _; } ///@notice Assigns...
49,580
231
// ============ Internal Functions ============ //Calculate notional rebalance quantity, whether to chunk rebalance based on max trade size and max borrow and invoke lever on CompoundLeverageModule/
function _lever( LeverageInfo memory _leverageInfo, uint256 _chunkRebalanceNotional ) internal { uint256 collateralRebalanceUnits = _chunkRebalanceNotional.preciseDiv(_leverageInfo.action.setTotalSupply); uint256 borrowUnits = _calculateBorrowUnits(collateralRebalan...
function _lever( LeverageInfo memory _leverageInfo, uint256 _chunkRebalanceNotional ) internal { uint256 collateralRebalanceUnits = _chunkRebalanceNotional.preciseDiv(_leverageInfo.action.setTotalSupply); uint256 borrowUnits = _calculateBorrowUnits(collateralRebalan...
53,998
102
// Roles are often managed via {grantRole} and {revokeRole}: this function'spurpose is to provide a mechanism for accounts to lose their privilegesif they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked}event. Requirements: - the caller ...
function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); }
function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); }
1,747
259
// We want to maintain a buffer on the Vault so calculate a percentage modifier to multiply each amount being allocated by to enforce the vault buffer
uint256 vaultBufferModifier; if (strategiesValue == 0) {
uint256 vaultBufferModifier; if (strategiesValue == 0) {
24,373
22
// value must be less than allowed value
require(_value <= _allowance);
require(_value <= _allowance);
37,611
0
// delivery security deposit is sent
balance = balance + msg.value;
balance = balance + msg.value;
40,807
14
// True if the creator revenue has already been withdrawn.
bool creatorRevenueHasBeenWithdrawn;
bool creatorRevenueHasBeenWithdrawn;
10,000
80
// Transfers the ownership of a given token ID to another address.
* Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * Requires the _msgSender() to be the owner, approved, or operator. * @param from current owner of the token * @param to address to receive the ownership of the given token ID * @param tokenId uint256 ID of the tok...
* Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * Requires the _msgSender() to be the owner, approved, or operator. * @param from current owner of the token * @param to address to receive the ownership of the given token ID * @param tokenId uint256 ID of the tok...
34,176
42
// The currently in range liquidity available to the pool/This value has no relationship to the total liquidity across all ticks
function liquidity() external view returns (uint128);
function liquidity() external view returns (uint128);
4,371
57
// {UoA} = {sellTok}{UoA/sellTok}
uint192 delta = bal.minus(needed).mul(lotLow, FLOOR);
uint192 delta = bal.minus(needed).mul(lotLow, FLOOR);
40,246
70
// Return uniswap v3 Swap Router Address /
function getUniswapRouterAddr() internal pure returns (address) { return 0xE592427A0AEce92De3Edee1F18E0157C05861564; }
function getUniswapRouterAddr() internal pure returns (address) { return 0xE592427A0AEce92De3Edee1F18E0157C05861564; }
45,193
17
// No need to check for rounding error, previewWithdraw rounds up.
shares = previewWithdraw(assets); _withdrawAndSend(assets, shares, receiver, owner);
shares = previewWithdraw(assets); _withdrawAndSend(assets, shares, receiver, owner);
21,949
9
// remove from bidder set
bidderSet[tulipNumber].remove(msg.sender);
bidderSet[tulipNumber].remove(msg.sender);
59,395
13
// Total sETH threshold need to be met in order to rage quit. User must have more or same sETH than this at the house level
function sETHRedemptionThreshold(address _stakeHouse) external view returns (uint256);
function sETHRedemptionThreshold(address _stakeHouse) external view returns (uint256);
16,970
0
// You can add parameters to this function in order to pass indata to set your own state variables
function init() external {
function init() external {
19,766
18
// Transfer MockUSDC tokens to corresponding Circle account
mockUSDC.transfer(_account, _amount);
mockUSDC.transfer(_account, _amount);
50,329
119
// The SHOW TOKEN!
ISHOWIERC20 public show;
ISHOWIERC20 public show;
16,322
1
// Initialize LinkedList by setting limit on amount of nodes and inital value of node 0 _selfLinkedList to operate on _dataSizeLimit Max amount of nodes allowed in LinkedList_initialValueInitial value of node 0 in LinkedList /
function initialize( LinkedList storage _self, uint256 _dataSizeLimit, uint256 _initialValue ) internal
function initialize( LinkedList storage _self, uint256 _dataSizeLimit, uint256 _initialValue ) internal
13,949
23
// replace
require(oldFacetAddress != _newFacetAddress, "LibDiamondCut: Can't replace function with same function"); removeSelector(oldFacetAddress, selector); addSelector(_newFacetAddress, selector);
require(oldFacetAddress != _newFacetAddress, "LibDiamondCut: Can't replace function with same function"); removeSelector(oldFacetAddress, selector); addSelector(_newFacetAddress, selector);
34,248
41
// Update last_price
last_A_volume = _last_A_volume;
last_A_volume = _last_A_volume;
29,132
328
// TODO document SM functions
function blocksWithRewardsPassed(address _policyBook) external view returns (uint256); function rewardPerToken(address _policyBook) external view returns (uint256); function earned( address _policyBook, address _userLeveragePool, address _account ) external view returns (uint25...
function blocksWithRewardsPassed(address _policyBook) external view returns (uint256); function rewardPerToken(address _policyBook) external view returns (uint256); function earned( address _policyBook, address _userLeveragePool, address _account ) external view returns (uint25...
15,041
225
// get price and updated time for a currency
function getPriceAndUpdatedTime(bytes32 currencyName) external view returns (uint price, uint time);
function getPriceAndUpdatedTime(bytes32 currencyName) external view returns (uint price, uint time);
10,446
12
// TODO WRAP totalDeposited to WETHTODO SEND WETH TO AAVE V2
emit Deposit(msg.sender, msg.value, depositTime);
emit Deposit(msg.sender, msg.value, depositTime);
5,030
1
// Stores high level basket info /
struct Basket { /** @dev Array of Bassets currently active */ Basset[] bassets; /** @dev Max number of bAssets that can be present in any Basket */ uint8 maxBassets; /** @dev Some bAsset is undergoing re-collateralisation */ bool undergoingRecol; /** ...
struct Basket { /** @dev Array of Bassets currently active */ Basset[] bassets; /** @dev Max number of bAssets that can be present in any Basket */ uint8 maxBassets; /** @dev Some bAsset is undergoing re-collateralisation */ bool undergoingRecol; /** ...
25,906
138
// Domain-separation tag for the hash used as the final VOR output.
uint256 constant VOR_RANDOM_OUTPUT_HASH_PREFIX = 3;
uint256 constant VOR_RANDOM_OUTPUT_HASH_PREFIX = 3;
26,401
24
// Set ownership of the contract to a new account (`newOwner`).Can only be called by the current owner. /
function setOwner(address newOwner) public onlyOwner { require(newOwner != address(0), "PerpFiOwnableUpgrade: zero address"); require(newOwner != _owner, "PerpFiOwnableUpgrade: same as original"); require(newOwner != _candidate, "PerpFiOwnableUpgrade: same as candidate"); _candidate ...
function setOwner(address newOwner) public onlyOwner { require(newOwner != address(0), "PerpFiOwnableUpgrade: zero address"); require(newOwner != _owner, "PerpFiOwnableUpgrade: same as original"); require(newOwner != _candidate, "PerpFiOwnableUpgrade: same as candidate"); _candidate ...
67,042
42
// Check if voted
require(!hasVotedMap[_ballotId][_voter], "already voted"); require(ballotBasicMap[_ballotId].state == uint256(BallotStates.InProgress), "Not InProgress State"); voteMap[_voteId] = Vote(_voteId, _ballotId, _voter, _decision, _power, getTime()); _updateBallotForVote(_ballotId,...
require(!hasVotedMap[_ballotId][_voter], "already voted"); require(ballotBasicMap[_ballotId].state == uint256(BallotStates.InProgress), "Not InProgress State"); voteMap[_voteId] = Vote(_voteId, _ballotId, _voter, _decision, _power, getTime()); _updateBallotForVote(_ballotId,...
23,523
484
// Reads the uint248 at `cdPtr` in calldata.
function readUint248( CalldataPointer cdPtr
function readUint248( CalldataPointer cdPtr
23,579
0
// Private mapping of valid upgrade paths
mapping(address => mapping(address => bool)) private _validUpgradePaths;
mapping(address => mapping(address => bool)) private _validUpgradePaths;
18,175
14
// Will revert if _buyERC1155 reverts.
_buyERC1155(sellOrders[i], signatures[i], erc1155FillAmounts[i]); successes[i] = true;
_buyERC1155(sellOrders[i], signatures[i], erc1155FillAmounts[i]); successes[i] = true;
2,448
36
// Modifier to check if the pool is open to trade. /
modifier open() { bool indexed isPoolSelling, address indexed account, address indexed acoToken, uint256 tokenAmount, uint256 price, uint256 protocolFee, uint256 underlyingPrice ); ...
modifier open() { bool indexed isPoolSelling, address indexed account, address indexed acoToken, uint256 tokenAmount, uint256 price, uint256 protocolFee, uint256 underlyingPrice ); ...
16,595
138
// Ability to vote for or against asset sale /_vote for or against
function vote(uint _vote) external
function vote(uint _vote) external
16,009
115
// Contract instances
IMiniMeToken internal cToken; IMiniMeToken internal sToken; BetokenProxyInterface internal proxy;
IMiniMeToken internal cToken; IMiniMeToken internal sToken; BetokenProxyInterface internal proxy;
2,549
4
// Modifier that only allows invited member execution./
modifier onlyInvited() { require(isInvited[msg.sender], "Sender is not invited!"); _; }
modifier onlyInvited() { require(isInvited[msg.sender], "Sender is not invited!"); _; }
15,057
717
// Gets the `DERIVATIVE_PRICE_FEED` variable value/ return derivativePriceFeed_ The `DERIVATIVE_PRICE_FEED` variable value
function getDerivativePriceFeed() external view returns (address derivativePriceFeed_) { return DERIVATIVE_PRICE_FEED; } /// @notice Gets the `FACTORY` variable value /// @return factory_ The `FACTORY` variable value function getFactory() external view returns (address factory_) { r...
function getDerivativePriceFeed() external view returns (address derivativePriceFeed_) { return DERIVATIVE_PRICE_FEED; } /// @notice Gets the `FACTORY` variable value /// @return factory_ The `FACTORY` variable value function getFactory() external view returns (address factory_) { r...
82,931
574
// Get Token Amounts of Claimindex - Claim Index /
function tokenAmounts(uint256 index) external view returns (uint256[] memory)
function tokenAmounts(uint256 index) external view returns (uint256[] memory)
39,610
89
// This notifies buy token status./
event BuyTokenAllowedEvent(bool isAllowed);
event BuyTokenAllowedEvent(bool isAllowed);
39,152
6
// The address of the Uniswap governance token
UniInterface public uni;
UniInterface public uni;
6,791
200
// Indicates that the strategy update will happen in the future/
function announceStrategyUpdate(address _strategy) public onlyControllerOrGovernance { // records a new timestamp uint256 when = block.timestamp.add(strategyTimeLock()); _setStrategyUpdateTime(when); _setFutureStrategy(_strategy); emit StrategyAnnounced(_strategy, when); }
function announceStrategyUpdate(address _strategy) public onlyControllerOrGovernance { // records a new timestamp uint256 when = block.timestamp.add(strategyTimeLock()); _setStrategyUpdateTime(when); _setFutureStrategy(_strategy); emit StrategyAnnounced(_strategy, when); }
10,243
28
// Decrease the amount of tokens that an owner allowed to a spender._spender The address which will spend the funds. _subtractedValue The amount of tokens to decrease the allowance by. /
function decreaseApproval(address _spender, uint _subtractedValue) isRunning public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); ...
function decreaseApproval(address _spender, uint _subtractedValue) isRunning public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); ...
48,040
112
// string memory error = string(abi.encodePacked("Module: requested module not found - ", module)); require(moduleAddress != ZERO_ADDRESS, error);
require(moduleAddress != ZERO_ADDRESS, "Module: requested module not found"); return moduleAddress;
require(moduleAddress != ZERO_ADDRESS, "Module: requested module not found"); return moduleAddress;
18,034
20
// ICO is terminated by owner, ICO cannot be resumed.
Terminated,
Terminated,
27,305
77
// Initializes the contract by setting a `name` and a `symbol` to the token collection. /
constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; }
constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; }
18,588
4
// Returns the current initializing flag.return Boolean value of the initializing flag /
function _initializing() internal view returns (bool initializing) { bytes32 slot = INITIALIZING_SLOT; assembly { initializing := sload(slot) } }
function _initializing() internal view returns (bool initializing) { bytes32 slot = INITIALIZING_SLOT; assembly { initializing := sload(slot) } }
44,536
110
// If any account belongs to _isExcludedFromFee account then remove the fee
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; }
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; }
23,519
7
// p5js url
string p5jsUrl; string p5jsIntegrity; string imageUrl; string animationUrl;
string p5jsUrl; string p5jsIntegrity; string imageUrl; string animationUrl;
18,883
44
// Withdraw DAI from DSR. amt DAI amount to withdraw./
function withdrawDai(uint amt) external payable { address daiJoin = getMcdDaiJoin(); DaiJoinInterface daiJoinContract = DaiJoinInterface(daiJoin); VatLike vat = daiJoinContract.vat(); PotLike potContract = PotLike(getMcdPot()); uint chi = potContract.drip(); uint pi...
function withdrawDai(uint amt) external payable { address daiJoin = getMcdDaiJoin(); DaiJoinInterface daiJoinContract = DaiJoinInterface(daiJoin); VatLike vat = daiJoinContract.vat(); PotLike potContract = PotLike(getMcdPot()); uint chi = potContract.drip(); uint pi...
50,586
126
// A distinct URI (RFC 3986) for a given NFT. _tokenId Id for which we want uri.return URI of _tokenId. /
function tokenURI( uint256 _tokenId ) external override view validNFToken(_tokenId) returns (string memory)
function tokenURI( uint256 _tokenId ) external override view validNFToken(_tokenId) returns (string memory)
3,743
12
// Returns the value of the assets in the rigoblock network given a mock input/mockInput Random number, must be 1 for querying data/ return networkValue Value of the rigoblock network in wei/ return numberOfPools Number of active funds
function calcNetworkValueDuneAnalytics(uint256 mockInput) external view returns ( uint256 networkValue, uint256 numberOfPools )
function calcNetworkValueDuneAnalytics(uint256 mockInput) external view returns ( uint256 networkValue, uint256 numberOfPools )
15,747
61
// See {IERC20-totalSupply}. /
event swapTokensForExactTokens(
event swapTokensForExactTokens(
10,607
151
// Contract for SportZchain token An ERC20 implementation of the SportZchain ecosystem token. All tokens are initially pre-assigned tothe creator, and can later be distributed freely using transfer transferFrom and other ERC20 functions. /
contract SportZchainToken is Ownable, ERC20Pausable, ERC20Burnable, AccessControl { bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Throws if called by any account other than the burner. */ modifier onl...
contract SportZchainToken is Ownable, ERC20Pausable, ERC20Burnable, AccessControl { bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); /** * @dev Throws if called by any account other than the burner. */ modifier onl...
50,853
26
// '_selectorSlot >> 3' is a gas efficient division by 8 '_selectorSlot / 8'
ds.selectorSlots[_selectorCount >> 3] = _selectorSlot; _selectorSlot = 0;
ds.selectorSlots[_selectorCount >> 3] = _selectorSlot; _selectorSlot = 0;
39,958
22
// Returns an array of token IDs owned by `owner`,in the range [`start`, `stop`)(i.e. `start <= tokenId < stop`). This function allows for tokens to be queried if the collection
* grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start` < `stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) public view returns (uint256[] memory t) { unchecked { ...
* grows too big for a single call of {ERC721AQueryable-tokensOfOwner}. * * Requirements: * * - `start` < `stop` */ function tokensOfOwnerIn( address owner, uint256 start, uint256 stop ) public view returns (uint256[] memory t) { unchecked { ...
36,351
15
// ONLY FOR TESTING
function mockRound1StartTime(uint256 _time) external isOwner { startTimeRound1 = _time; }
function mockRound1StartTime(uint256 _time) external isOwner { startTimeRound1 = _time; }
56,144
14
// Sets `_authority` address authority new authority address to set Requirements: - `saleOn` must be false,- the caller must be `owner`. /
function setAuthority( address authority) external isSaleOn(false) onlyOwner { _authority = authority; }
function setAuthority( address authority) external isSaleOn(false) onlyOwner { _authority = authority; }
36,701
489
// Amount of LUSD to be locked in gas pool on opening troves
uint constant public LUSD_GAS_COMPENSATION = 200e18;
uint constant public LUSD_GAS_COMPENSATION = 200e18;
8,866
424
// expmods_and_points.points[59] = -(g^4081z).
mstore(add(expmodsAndPoints, 0x9c0), point)
mstore(add(expmodsAndPoints, 0x9c0), point)
3,354
77
// Increase collaterallization of Lp position Only a sender with LP role can call this function self Data type the library is attached to lpPosition Position of the LP (see LPPosition struct) feeStatus Actual status of fee gained (see FeeStatus struct) collateralToTransfer Collateral to be transferred before increase c...
function increaseCollateral( ISynthereumLiquidityPoolStorage.Storage storage self, ISynthereumLiquidityPoolStorage.LPPosition storage lpPosition, ISynthereumLiquidityPoolStorage.FeeStatus storage feeStatus, FixedPoint.Unsigned calldata collateralToTransfer, FixedPoint.Unsigned calldata collateralT...
function increaseCollateral( ISynthereumLiquidityPoolStorage.Storage storage self, ISynthereumLiquidityPoolStorage.LPPosition storage lpPosition, ISynthereumLiquidityPoolStorage.FeeStatus storage feeStatus, FixedPoint.Unsigned calldata collateralToTransfer, FixedPoint.Unsigned calldata collateralT...
7,867
13
// check if node is slashed (node does not have minimum token amount) _node node addressreturn true if banned /
function isNodeSlashed(address _node) external view returns (bool) { return ((nodes[_node] == 3) && (slot[uint8(uint256(_node) >> 152)] == address(0))); }
function isNodeSlashed(address _node) external view returns (bool) { return ((nodes[_node] == 3) && (slot[uint8(uint256(_node) >> 152)] == address(0))); }
28,245
89
// function returns the hash of the fully encoded EIP712 message for this domain. /
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32)
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32)
47,100
162
// Deposit LP tokens to FarmMaster for XDEX allocation.
function deposit( uint256 _pid, IERC20 _lpToken, uint256 _amount
function deposit( uint256 _pid, IERC20 _lpToken, uint256 _amount
36,762
18
// View total circulationreturn Total circulation/
function allValue(address token) public view returns (uint256) { if (token == address(_nestContract)) { uint256 all = 10000000000 ether; uint256 leftNum = all.sub(_nestContract.balanceOf(address(_voteFactory.checkAddress("nest.v3.miningSave")))).sub(_nestContract.balanceOf(address(_d...
function allValue(address token) public view returns (uint256) { if (token == address(_nestContract)) { uint256 all = 10000000000 ether; uint256 leftNum = all.sub(_nestContract.balanceOf(address(_voteFactory.checkAddress("nest.v3.miningSave")))).sub(_nestContract.balanceOf(address(_d...
26,026
332
// Address of the bank contract/This contract is used to handle the token transactions
MarbleBankInterface public erc20Bank;
MarbleBankInterface public erc20Bank;
26,627
248
// using this part of code will result in losses but it is necessary to unlock full collateral in case of wind down we calculate how much want we need to fulfill the want request
uint256 remainingAmountWant = _amountNeeded.sub(balance);
uint256 remainingAmountWant = _amountNeeded.sub(balance);
54,444
113
// settles and pays borrowers based on the fees generated by their interest payments
function _SETTLEFEEREWARDFORINTERESTEXPENSE273( //inject NONSTANDARD NAMING LoanInterest storage loanInterestLocal, bytes32 loanId, address feeToken, address user, uint256 interestTime) internal
function _SETTLEFEEREWARDFORINTERESTEXPENSE273( //inject NONSTANDARD NAMING LoanInterest storage loanInterestLocal, bytes32 loanId, address feeToken, address user, uint256 interestTime) internal
43,490
68
// done for readability sake
bytes32 _whatProposal = whatProposal(_whatFunction); address _whichAdmin;
bytes32 _whatProposal = whatProposal(_whatFunction); address _whichAdmin;
41,903
28
// Allows the current owner to transfer control of the contract to a newOwner newOwner the address to transfer ownership to/
function transferOwnership(address payable newOwner) public onlyOwner { _transferOwnership(newOwner); }
function transferOwnership(address payable newOwner) public onlyOwner { _transferOwnership(newOwner); }
7,434
58
// @inheritdoc ISummaSwapV3PoolOwnerActions
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner
function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external override lock onlyFactoryOwner
32,331
187
// how much BNB did we just swap into?
uint256 swapBalanceBNB = address(this).balance.sub(initialBalance); uint256 amountBNBToSPG = swapBalanceBNB.div(100).mul(66); // 66% uint256 amountBNBToLiq = swapBalanceBNB.div(100).mul(33); // 33% uint256 amountBNBReward = swapBalanceBNB.div(1000);
uint256 swapBalanceBNB = address(this).balance.sub(initialBalance); uint256 amountBNBToSPG = swapBalanceBNB.div(100).mul(66); // 66% uint256 amountBNBToLiq = swapBalanceBNB.div(100).mul(33); // 33% uint256 amountBNBReward = swapBalanceBNB.div(1000);
11,783
78
// Computes the vanishing polynoimal and lagrange evaluations L1 and Ln.return Returns fractions as numerators and denominators. We combine with the public input fraction and compute inverses as a batch /
function compute_lagrange_and_vanishing_fractions(Types.VerificationKey memory vk, uint256 zeta
function compute_lagrange_and_vanishing_fractions(Types.VerificationKey memory vk, uint256 zeta
48,336
469
// Open future user's CDP in MCD
cdp = cdpManager.open(wethJoin.ilk(), address(this));
cdp = cdpManager.open(wethJoin.ilk(), address(this));
55,362
11
// template matching params
uint8 constant _OP_PUBKEYHASH = 253; uint8 constant _OP_PUBKEY = 254; uint8 constant _OP_INVALIDOPCODE = 255;
uint8 constant _OP_PUBKEYHASH = 253; uint8 constant _OP_PUBKEY = 254; uint8 constant _OP_INVALIDOPCODE = 255;
27,438
154
// Get max fee value. /
function getMaxFee() external pure override returns (uint256) { return MAX_FEE; }
function getMaxFee() external pure override returns (uint256) { return MAX_FEE; }
57,594
10
// A cheaper version of keccak256(toRlpBytes(item)) that avoids copying memory.return keccak256 hash of RLP encoded bytes. /
function rlpBytesKeccak256(RLPItem memory item) internal pure returns (bytes32) { uint256 ptr = item.memPtr; uint256 len = item.len; bytes32 result; assembly { result := keccak256(ptr, len) } return result; }
function rlpBytesKeccak256(RLPItem memory item) internal pure returns (bytes32) { uint256 ptr = item.memPtr; uint256 len = item.len; bytes32 result; assembly { result := keccak256(ptr, len) } return result; }
27,266
9
// Allows owner to modify an existing token's symbol./_token Address of existing token./_symbol New symbol.
function setTokenSymbol(address _token, string _symbol) public onlyOwner tokenExists(_token)
function setTokenSymbol(address _token, string _symbol) public onlyOwner tokenExists(_token)
55
1
// If true tokens can be minted in the public sale
bool publicSaleActive;
bool publicSaleActive;
28,949
30
// ---------------------------------- Define STD_TOKEN
contract STD_TOKEN is TRC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowe...
contract STD_TOKEN is TRC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowe...
3,200
41
// To store decimal version for token
string public version = 'v1.0';
string public version = 'v1.0';
3,540
65
// Returns the downcasted int56 from int256, reverting onoverflow (when the input is less than smallest int56 orgreater than largest int56). Counterpart to Solidity's `int56` operator. Requirements: - input must fit into 56 bits _Available since v4.7._ /
function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); require(downcasted == value, "SafeCast: value doesn't fit in 56 bits"); }
function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); require(downcasted == value, "SafeCast: value doesn't fit in 56 bits"); }
16,255
0
// Bounty ID --> Bounty
mapping(uint256 => Bounty) private _bounties;
mapping(uint256 => Bounty) private _bounties;
27,980
77
// 如果已经取款过,就返回0
if(pending_record.receive_state_14_21_arr[index] == true) { return 0; }
if(pending_record.receive_state_14_21_arr[index] == true) { return 0; }
32,604
35
// Update sensor data
function UpdateSensor(uint _id, string memory _mac, string memory _patientName,address _idDoctor, bool _active ) public { uint index = FindSensor(_id); sensorsDoctor[index].MAC=_mac; sensorsDoctor[index].patientName=_patientName; sensorsDoctor[index].idDoctor=_idDoctor; senso...
function UpdateSensor(uint _id, string memory _mac, string memory _patientName,address _idDoctor, bool _active ) public { uint index = FindSensor(_id); sensorsDoctor[index].MAC=_mac; sensorsDoctor[index].patientName=_patientName; sensorsDoctor[index].idDoctor=_idDoctor; senso...
30,453
3
// metadatas
string public baseURI; mapping(uint256 => uint256) private prices; constructor(address _pbwsAddress) ERC721("Paris NFT Day Speaker Cards", "PND SC")
string public baseURI; mapping(uint256 => uint256) private prices; constructor(address _pbwsAddress) ERC721("Paris NFT Day Speaker Cards", "PND SC")
26,661