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
9
// NICR must be non-zero
require(_NICR > 0, "SortedTroves: NICR must be positive"); address prevId = _prevId; address nextId = _nextId; if (!_validInsertPosition(_troveManager, _NICR, prevId, nextId)) {
require(_NICR > 0, "SortedTroves: NICR must be positive"); address prevId = _prevId; address nextId = _nextId; if (!_validInsertPosition(_troveManager, _NICR, prevId, nextId)) {
9,411
1
// Deliver an asset and deliver to the specified party When implementing this interface, please ensure you restrict access. If using LazyDeliver.sol, you can use authorizedDelivererRequired modifier to restrict access.Delivery can be for an existing asset or newly minted assets.caller The address that triggered deliverlistingIdThe listingId associated with this delivery.Useful for permissioning.assetIdThe assetId to deliverto The address to deliver the asset topayableAmountThe amount seller will receive upon delivery of assetindex(Optional): Index value for certain sales methods, such as ranked auctionsreturn any refund amount you may want to provide. Must be less than payableAmount.Suggestion: If determining a refund amount based on total
function deliver(address caller, uint256 listingId, uint256 assetId, address to, uint256 payableAmount, uint256 index) external returns(uint256);
function deliver(address caller, uint256 listingId, uint256 assetId, address to, uint256 payableAmount, uint256 index) external returns(uint256);
21,488
67
// Changes the contract owner from `owner` to `owner_` Requirements :- the caller must be the actual contract `owner`- `owner_` cannot be the zero address/
function setOwner(address owner_) public onlyOwner { //inject PUBLIC FUNC TO EXTERNAL require(owner_ != address(0), "bDai: owner cannot be 0x0"); owner = owner_; }
function setOwner(address owner_) public onlyOwner { //inject PUBLIC FUNC TO EXTERNAL require(owner_ != address(0), "bDai: owner cannot be 0x0"); owner = owner_; }
20,544
3
// We already have an existing pool ratio which must be respected
int128 _multiplier = __deposit.div(_oGLiq); uint256 _baseWeight = curve.weights[0].mulu(1e18); uint256 _quoteWeight = curve.weights[1].mulu(1e18); for (uint256 i = 0; i < _length; i++) { IntakeNumLpRatioInfo memory info; info.baseWeight = _baseWeight; info.minBase = depositData.minBase; info.maxBase = depositData.maxBase;
int128 _multiplier = __deposit.div(_oGLiq); uint256 _baseWeight = curve.weights[0].mulu(1e18); uint256 _quoteWeight = curve.weights[1].mulu(1e18); for (uint256 i = 0; i < _length; i++) { IntakeNumLpRatioInfo memory info; info.baseWeight = _baseWeight; info.minBase = depositData.minBase; info.maxBase = depositData.maxBase;
41,169
13
// See {IPBMTokenManager-uri}./
function uri(uint256 tokenId) external override view returns (string memory) { if (block.timestamp >= tokenTypes[tokenId].expiry){ return URIPostExpiry ; }
function uri(uint256 tokenId) external override view returns (string memory) { if (block.timestamp >= tokenTypes[tokenId].expiry){ return URIPostExpiry ; }
5,081
172
// Calculates the amount of ABR the xABR is worth
uint256 what = _share * ABR.balanceOf(address(this)) / totalShares; _burn(msg.sender, _share); ABR.transfer(msg.sender, what);
uint256 what = _share * ABR.balanceOf(address(this)) / totalShares; _burn(msg.sender, _share); ABR.transfer(msg.sender, what);
17,457
155
// Lock
mapping (address => address) public lockStatus; event Lock(address _receiver, uint256 _amount);
mapping (address => address) public lockStatus; event Lock(address _receiver, uint256 _amount);
17,939
138
// Burn some btfs first
if (burnFee > 0) { uint256 _burnFee = _weth.mul(burnFee).div(burnMax); _swap(weth, btf, _burnFee); IERC20(btf).transfer( IController(controller).burnAddr(), IERC20(btf).balanceOf(address(this)) ); _weth = _weth.sub(_burnFee); }
if (burnFee > 0) { uint256 _burnFee = _weth.mul(burnFee).div(burnMax); _swap(weth, btf, _burnFee); IERC20(btf).transfer( IController(controller).burnAddr(), IERC20(btf).balanceOf(address(this)) ); _weth = _weth.sub(_burnFee); }
40,427
28
// buyFees
uint256 private liquidityFee = 1; uint256 private marketingFee = 2; uint256 private opsFee = 2; uint256 private devFee = 1; uint256 private stakingFee = 0;
uint256 private liquidityFee = 1; uint256 private marketingFee = 2; uint256 private opsFee = 2; uint256 private devFee = 1; uint256 private stakingFee = 0;
35,159
378
// order.feeToken
offset := mul(and(mload(add(tablesPtr, 34)), 0xFFFF), 4) mstore( add(order, 608), and(mload(add(add(data, 20), offset)), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) )
offset := mul(and(mload(add(tablesPtr, 34)), 0xFFFF), 4) mstore( add(order, 608), and(mload(add(add(data, 20), offset)), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) )
3,086
15
// AccountInitialize Authereum Labs, Inc. This contract holds the intialize functions used by the account contracts. This exists as the main contract to hold these functions. This contract is inherited by AuthereumAccount.sol, which will not care about initialization functions as long as it inherits AccountInitialize.sol. Any initialization function additions will be made to the various versions of AccountInitializeVx that this contract will inherit. /
contract AccountInitialize is AccountInitializeV1, AccountInitializeV2 {} /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. * * This contract is from openzeppelin-solidity 2.4.0 */ contract IERC721Receiver { /** * @notice Handle the receipt of an NFT * @dev The ERC721 smart contract calls this function on the recipient * after a {IERC721-safeTransferFrom}. This function MUST return the function selector, * otherwise the caller will revert the transaction. The selector to be * returned can be obtained as `this.onERC721Received.selector`. This * function MAY throw to revert and reject the transfer. * Note: the ERC721 contract address is always the message sender. * @param operator The address which called `safeTransferFrom` function * @param from The address which previously owned the token * @param tokenId The NFT identifier which is being transferred * @param data Additional data with no specified format * @return bytes4 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` */ function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) public returns (bytes4); }
contract AccountInitialize is AccountInitializeV1, AccountInitializeV2 {} /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. * * This contract is from openzeppelin-solidity 2.4.0 */ contract IERC721Receiver { /** * @notice Handle the receipt of an NFT * @dev The ERC721 smart contract calls this function on the recipient * after a {IERC721-safeTransferFrom}. This function MUST return the function selector, * otherwise the caller will revert the transaction. The selector to be * returned can be obtained as `this.onERC721Received.selector`. This * function MAY throw to revert and reject the transfer. * Note: the ERC721 contract address is always the message sender. * @param operator The address which called `safeTransferFrom` function * @param from The address which previously owned the token * @param tokenId The NFT identifier which is being transferred * @param data Additional data with no specified format * @return bytes4 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` */ function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data) public returns (bytes4); }
51,540
173
// Equivalent to `_burn(tokenId, false)`. /
function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); }
function _burn(uint256 tokenId) internal virtual { _burn(tokenId, false); }
417
170
// owner win
winer = room.owner; winamount += int256(tax);
winer = room.owner; winamount += int256(tax);
50,052
240
// count branchScore :
branchScore[_bOne] ++; branchScore[_bTwo] ++; branchScore[_bThree] ++; branchScore[_bFour] ++; branchScore[_bFive] ++; branchScore[_bSix] ++; branchScore[_bSeven] ++; branchScore[_bEight] ++;
branchScore[_bOne] ++; branchScore[_bTwo] ++; branchScore[_bThree] ++; branchScore[_bFour] ++; branchScore[_bFive] ++; branchScore[_bSix] ++; branchScore[_bSeven] ++; branchScore[_bEight] ++;
25,022
10
// Performs a Solidity function call using a low level `call`. A plain`call` is an unsafe replacement for a function call: use this function instead. If `target` reverts with a revert reason, it is bubbled up by this function (like regular Solidity function calls). Returns the raw returned data. To convert to the expected return value, Requirements: - `target` must be a contract. - calling `target` with `data` must not revert. _Available since v3.1._/
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); }
function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); }
4,294
23
// Leaves the contract without owner. It will not be possible to call`onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner,thereby removing any functionality that is only available to the owner. /
6,834
26
// Transfer ownership of the tree to new owner
cryptoTrees.transferFrom(address(this), msg.sender, _treeId);
cryptoTrees.transferFrom(address(this), msg.sender, _treeId);
7,672
45
// half fee in HDX20 directly credited to developer
tokenBalanceLedger[ owner ] += _token_fee;
tokenBalanceLedger[ owner ] += _token_fee;
28,776
2
// all cards have different values, no need to count unique values
if(count == MASK_STRAIGHT_A || count == MASK_STRAIGHT_2 || count == MASK_STRAIGHT_3 || count == MASK_STRAIGHT_4 || count == MASK_STRAIGHT_5 || count == MASK_STRAIGHT_6 || count == MASK_STRAIGHT_7 || count == MASK_STRAIGHT_8 || count == MASK_STRAIGHT_9) { if(isFlush(cards)) { return STRAIGHT_FLUSH; } else {
if(count == MASK_STRAIGHT_A || count == MASK_STRAIGHT_2 || count == MASK_STRAIGHT_3 || count == MASK_STRAIGHT_4 || count == MASK_STRAIGHT_5 || count == MASK_STRAIGHT_6 || count == MASK_STRAIGHT_7 || count == MASK_STRAIGHT_8 || count == MASK_STRAIGHT_9) { if(isFlush(cards)) { return STRAIGHT_FLUSH; } else {
25,204
17
// Submit a TWAP with 18 decimal places by the owner./ This is allowed only when a epoch cannot be updated by either Chainlink or Uniswap.
function updateTwapFromOwner(uint256 timestamp, uint256 price) external onlyOwner { require(timestamp % EPOCH == 0, "Unaligned timestamp"); require(timestamp <= block.timestamp - EPOCH * 2, "Not ready for owner"); require(_ownerUpdatedPrices[timestamp] == 0, "Owner cannot update an existing epoch"); uint256 chainlinkTwap = _getTwapFromChainlink(timestamp); require(chainlinkTwap == 0, "Owner cannot overwrite Chainlink result"); _ownerUpdatedPrices[timestamp] = price; emit Update(timestamp, price); }
function updateTwapFromOwner(uint256 timestamp, uint256 price) external onlyOwner { require(timestamp % EPOCH == 0, "Unaligned timestamp"); require(timestamp <= block.timestamp - EPOCH * 2, "Not ready for owner"); require(_ownerUpdatedPrices[timestamp] == 0, "Owner cannot update an existing epoch"); uint256 chainlinkTwap = _getTwapFromChainlink(timestamp); require(chainlinkTwap == 0, "Owner cannot overwrite Chainlink result"); _ownerUpdatedPrices[timestamp] = price; emit Update(timestamp, price); }
36,601
216
// Accepts transfer of admin rights. msg.sender must be pendingAdminAdmin function for pending admin to accept role and update admin/
function _acceptAdmin() external override{ // Check caller is pendingAdmin if (msg.sender != pendingAdmin) { revert Unauthorized(); } // Save current values for inclusion in log address oldAdmin = admin; address oldPendingAdmin = pendingAdmin; // Store admin with value pendingAdmin admin = pendingAdmin; // Clear the pending value pendingAdmin = payable(0); emit NewAdmin(oldAdmin, admin); emit NewPendingAdmin(oldPendingAdmin, pendingAdmin); }
function _acceptAdmin() external override{ // Check caller is pendingAdmin if (msg.sender != pendingAdmin) { revert Unauthorized(); } // Save current values for inclusion in log address oldAdmin = admin; address oldPendingAdmin = pendingAdmin; // Store admin with value pendingAdmin admin = pendingAdmin; // Clear the pending value pendingAdmin = payable(0); emit NewAdmin(oldAdmin, admin); emit NewPendingAdmin(oldPendingAdmin, pendingAdmin); }
33,555
59
// Returns true if the two slices contain the same text. self The first slice to compare. self The second slice to compare.return True if the slices are equal, false otherwise. /
function equals(slice memory self, slice memory other) internal pure returns (bool) { return compare(self, other) == 0; }
function equals(slice memory self, slice memory other) internal pure returns (bool) { return compare(self, other) == 0; }
1,777
92
// Update the given pool's COLOR allocation point. Can only be called by the owner.
function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint); poolInfo[_pid].allocPoint = _allocPoint; }
function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwner { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint); poolInfo[_pid].allocPoint = _allocPoint; }
6,318
1
// OmnibridgeModule Common functionality for Omnibridge extension non-upgradeable module. /
abstract contract OmnibridgeModule is VersionableModule { IOwnable public mediator; /** * @dev Throws if sender is not the owner of this contract. */ modifier onlyOwner { require(msg.sender == mediator.owner()); _; } }
abstract contract OmnibridgeModule is VersionableModule { IOwnable public mediator; /** * @dev Throws if sender is not the owner of this contract. */ modifier onlyOwner { require(msg.sender == mediator.owner()); _; } }
16,270
1
// : should only be called once the extension has been registered Can only be set once to prevent rug pulling
function setTokenURIPrefixExtension(string calldata prefix) public adminRequired
function setTokenURIPrefixExtension(string calldata prefix) public adminRequired
32,319
0
// Event to show ownership has been transferredpreviousOwner representing the address of the previous ownernewOwner representing the address of the new owner/
event ProxyOwnershipTransferred(address previousOwner, address newOwner);
event ProxyOwnershipTransferred(address previousOwner, address newOwner);
20,496
26
// Continuously growing value used to compute reward distributions
uint256 public S;
uint256 public S;
21,497
13
// rateCrate
struct FateState { uint256 fatePerDay; uint256 fateBalance; uint256 lastDamnAdjustment; }
struct FateState { uint256 fatePerDay; uint256 fateBalance; uint256 lastDamnAdjustment; }
26,935
253
// Add it to the address set lib.
_shortablePynths.add(pynth);
_shortablePynths.add(pynth);
29,606
114
// 0xc778417E063141139Fce010982780140Aa0cD5Abropsten
); IUniswapV2ERC20 public combToken = IUniswapV2ERC20( 0x7d36cCe46DD2B0D28dde12A859C2ACe4a21E3678 // mainnet
); IUniswapV2ERC20 public combToken = IUniswapV2ERC20( 0x7d36cCe46DD2B0D28dde12A859C2ACe4a21E3678 // mainnet
11,670
44
// Should return all utility token addresses /
function utilityTokens() public view virtual returns (IERC20[] memory);
function utilityTokens() public view virtual returns (IERC20[] memory);
46,868
82
// Handles case where no claimable funds are present but a default must be registered (zero-collateralized loans defaulting).
if (loan.withdrawableFundsOf(address(this)) == uint256(0)) return([0, 0, 0, 0, 0, 0, newDefaultSuffered]);
if (loan.withdrawableFundsOf(address(this)) == uint256(0)) return([0, 0, 0, 0, 0, 0, newDefaultSuffered]);
23,496
74
// update ALI balance on the contract
aliBalance += aliValue;
aliBalance += aliValue;
54,225
80
// send tokens and ETH for liquidity to contract directly, then call this function.(not required, can still use Uniswap to add liquidity manually, but this ensures everything is excluded properly and makes for a great stealth launch)
function launch(/*address[] memory airdropWallets, uint256[] memory amounts*/) external onlyOwner returns (bool) { require(!tradingActive, "Trading is already active, cyka."); /*require(airdropWallets.length < 200, "Can only airdrop 200 wallets per txn due to gas limits"); // allows for airdrop + launch at the same exact time, reducing delays and reducing sniper input. for(uint256 i = 0; i < airdropWallets.length; i++){ address wallet = airdropWallets[i]; uint256 amount = amounts[i]; _transfer(msg.sender, wallet, amount); }*/ enableTrading(); /* IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); //Uniswap Router v2 excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); excludeFromMaxTransaction(address(uniswapV2Pair), true); _setAutomatedMarketMakerPair(address(uniswapV2Pair), true); */ require(address(this).balance > 0, "Must have ETH on contract to launch"); addLiquidity(balanceOf(address(this)), address(this).balance); //setLiquidityAddress(address(0xdead)); return true; }
function launch(/*address[] memory airdropWallets, uint256[] memory amounts*/) external onlyOwner returns (bool) { require(!tradingActive, "Trading is already active, cyka."); /*require(airdropWallets.length < 200, "Can only airdrop 200 wallets per txn due to gas limits"); // allows for airdrop + launch at the same exact time, reducing delays and reducing sniper input. for(uint256 i = 0; i < airdropWallets.length; i++){ address wallet = airdropWallets[i]; uint256 amount = amounts[i]; _transfer(msg.sender, wallet, amount); }*/ enableTrading(); /* IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); //Uniswap Router v2 excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); excludeFromMaxTransaction(address(uniswapV2Pair), true); _setAutomatedMarketMakerPair(address(uniswapV2Pair), true); */ require(address(this).balance > 0, "Must have ETH on contract to launch"); addLiquidity(balanceOf(address(this)), address(this).balance); //setLiquidityAddress(address(0xdead)); return true; }
16,148
74
// This return state of initialSupply function:'false' means that initialSupply is not done yet.'true' means that it's locked forever. /
function isInitialSupplyFinished () public view returns (bool) { return InitialSupplyFinished; }
function isInitialSupplyFinished () public view returns (bool) { return InitialSupplyFinished; }
39,472
187
// require( numberOfTokens <= 5000, "Can only mint up to 5 tokens" );
require( _publicSTARCATS.current() < 5000, "Purchase would exceed STARCATS_PUBLIC" ); for (uint256 i = 0; i < numberOfTokens; i++) { uint256 tokenId = _publicSTARCATS.current(); if (_publicSTARCATS.current() < STARCATS_PUBLIC) { _publicSTARCATS.increment();
require( _publicSTARCATS.current() < 5000, "Purchase would exceed STARCATS_PUBLIC" ); for (uint256 i = 0; i < numberOfTokens; i++) { uint256 tokenId = _publicSTARCATS.current(); if (_publicSTARCATS.current() < STARCATS_PUBLIC) { _publicSTARCATS.increment();
5,549
208
// Check that pending balance can be redistributed - if so performthis procedure
if(toBeDistributed > 0){ _updateDistribution(); }
if(toBeDistributed > 0){ _updateDistribution(); }
30,636
100
// change wallet for advisory vesting (this make possible to set smart-contract address later) _newAdvisoryWallet - new wallet address /
function setAdvisoryWallet(address _newAdvisoryWallet) onlyOwner public { advisoryWallet = _newAdvisoryWallet; SetAdvisoryWallet(_newAdvisoryWallet); }
function setAdvisoryWallet(address _newAdvisoryWallet) onlyOwner public { advisoryWallet = _newAdvisoryWallet; SetAdvisoryWallet(_newAdvisoryWallet); }
49,859
31
// fallback /
function () external { releaseToken(); }
function () external { releaseToken(); }
50,016
70
// withdraw all admin fees to a given address self Swap struct to withdraw fees from to Address to send the fees to /
function withdrawAdminFees(Swap storage self, address to) external { uint256 numTokens = self.pooledTokens.length; for (uint256 i; i < numTokens; ) { IERC20 token = self.pooledTokens[i]; uint256 balance = self.adminFees[i]; if (balance != 0) { delete self.adminFees[i]; AssetLogic.handleOutgoingAsset(address(token), to, balance); } unchecked { ++i; } } }
function withdrawAdminFees(Swap storage self, address to) external { uint256 numTokens = self.pooledTokens.length; for (uint256 i; i < numTokens; ) { IERC20 token = self.pooledTokens[i]; uint256 balance = self.adminFees[i]; if (balance != 0) { delete self.adminFees[i]; AssetLogic.handleOutgoingAsset(address(token), to, balance); } unchecked { ++i; } } }
21,022
84
// Tokens cannot be completely destoyed, they are disabled and ownership set to address zero there is no function to revert this action.
wheats[_wheatId].active = false; ownerWheatCount[msg.sender] = SafeMath.sub(ownerWheatCount[msg.sender], 1); wheatToOwner[_wheatId] = address(0); emit tokenBurned(_wheatId);
wheats[_wheatId].active = false; ownerWheatCount[msg.sender] = SafeMath.sub(ownerWheatCount[msg.sender], 1); wheatToOwner[_wheatId] = address(0); emit tokenBurned(_wheatId);
7,233
191
// _pid pool id /
function update(uint256 _pid) public override updateReward(_pid, address(0x0))
function update(uint256 _pid) public override updateReward(_pid, address(0x0))
72,771
5
// if position is not the last one in the list (has next position)
if (_positions[msg.sender][id].nextId != 0) { _positions[msg.sender][_positions[msg.sender][id].nextId] .previousId = _positions[msg.sender][id].previousId; }
if (_positions[msg.sender][id].nextId != 0) { _positions[msg.sender][_positions[msg.sender][id].nextId] .previousId = _positions[msg.sender][id].previousId; }
12,595
90
// ensures instantiation only by sub-contracts /
constructor() internal {} // protects a function against reentrancy attacks modifier protected() { _protected(); state = LOCKED; _; state = UNLOCKED; }
constructor() internal {} // protects a function against reentrancy attacks modifier protected() { _protected(); state = LOCKED; _; state = UNLOCKED; }
60,333
93
// Set configuration_ address./_configuration The address to use for configuration_.
function setConfiguration( EverscaleAddress memory _configuration
function setConfiguration( EverscaleAddress memory _configuration
45,408
209
// Transfer tokens from `msg.sender` to another address and then call `onTransferReceived` on receiver to address The address which you want to transfer to value uint256 The amount of tokens to be transferredreturn true unless throwing /
function transferAndCall(address to, uint256 value) external returns (bool);
function transferAndCall(address to, uint256 value) external returns (bool);
1,457
2,208
// 1105
entry "accensed" : ENG_ADJECTIVE
entry "accensed" : ENG_ADJECTIVE
17,717
119
// {IERC1820Registry}./ Returns a special value (`ERC1820_ACCEPT_MAGIC`) if this contractimplements `interfaceHash` for `account`. See {IERC1820Registry-setInterfaceImplementer}. /
function canImplementInterfaceForAddress(bytes32 interfaceHash, address account) external view returns (bytes32);
function canImplementInterfaceForAddress(bytes32 interfaceHash, address account) external view returns (bytes32);
60,855
46
// lock data struct /
struct LockData { uint256 balance; uint256 releaseTimeS; }
struct LockData { uint256 balance; uint256 releaseTimeS; }
62,271
1
// Returns the price to register or renew a name. name The name being registered or renewed. expires When the name presently expires (0 if this is a new registration). duration How long the name is being registered or extended for, in seconds.return base premium tuple of base price + premium price /
function price( string calldata name, uint256 expires, uint256 duration ) external view returns (uint256 base);
function price( string calldata name, uint256 expires, uint256 duration ) external view returns (uint256 base);
3,420
39
// Transfers the Ownership of TrustedIssuersRegistry to a new Owner._newOwner The new owner of this contract. This function can only be called by the owner of the Trusted Issuers Registry contract emits an `OwnershipTransferred` event /
function transferOwnershipOnIssuersRegistryContract(address _newOwner) external;
function transferOwnershipOnIssuersRegistryContract(address _newOwner) external;
13,555
134
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
set._values[toDeleteIndex] = lastvalue;
542
1
// Base URI
string private _baseURIextended;
string private _baseURIextended;
41,535
245
// Buy NFT normal by token ERC-20 address[5]: buyer, seller, token, fee, feeAdmin uint256[5]: amount, tokenId, feePercent, feePercentAdmin
function buyERC1155Normal( address[5] memory _tradeAddress, uint256[5] memory _attributes, uint256 nonce, bytes memory signature
function buyERC1155Normal( address[5] memory _tradeAddress, uint256[5] memory _attributes, uint256 nonce, bytes memory signature
47,301
2,280
// 1142
entry "toilingly" : ENG_ADVERB
entry "toilingly" : ENG_ADVERB
21,978
92
// the total staked amount
uint256 public totalStakedAmount;
uint256 public totalStakedAmount;
55,676
262
// Send the DAI to the module
invokeWallet( _wallet, address(daiToken), 0, abi.encodeWithSignature("transfer(address,uint256)", address(this), _debtAmount)
invokeWallet( _wallet, address(daiToken), 0, abi.encodeWithSignature("transfer(address,uint256)", address(this), _debtAmount)
2,456
10
// CREAM ComptrollerInterface functions
function exitMarket(address cTokenAddress) external returns (uint); function getAssetsIn(address account) external view returns (address[] memory); function getAccountLiquidity(address account) external view returns (uint, uint, uint); function claimComp(address) external;
function exitMarket(address cTokenAddress) external returns (uint); function getAssetsIn(address account) external view returns (address[] memory); function getAccountLiquidity(address account) external view returns (uint, uint, uint); function claimComp(address) external;
23,187
30
// This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployedbehind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to anexternal initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
4,150
234
// Get All role ids array that has been assigned to a member so far.
function roles(address _memberAddress) internal view returns(uint[] memory) { //solhint-disable-line uint length = memberRoleData.length; uint[] memory assignedRoles = new uint[](length); uint counter = 0; for (uint i = 1; i < length; i++) { if (memberRoleData[i].memberActive[_memberAddress]) { assignedRoles[counter] = i; counter++; } } return assignedRoles; }
function roles(address _memberAddress) internal view returns(uint[] memory) { //solhint-disable-line uint length = memberRoleData.length; uint[] memory assignedRoles = new uint[](length); uint counter = 0; for (uint i = 1; i < length; i++) { if (memberRoleData[i].memberActive[_memberAddress]) { assignedRoles[counter] = i; counter++; } } return assignedRoles; }
12,850
81
// Thrown when trying to set a fee that is not multiple of 100
error InvalidFee();
error InvalidFee();
36,238
3
// Contract defining "MetaWinners DAC" NFT collection/
contract MetaWinnersDAC is MetawinERC721Vault { // CONSTRUCTOR // constructor(uint256 _maxSupply) MetawinERC721(_maxSupply, "MetaWinnersDAC", "MWDAC", 500){} // 500 basis points (5%) royalty fees /** * @dev [Pure][Internal] Overrides {BatchReveal._metadataIdsStartFromOne} to return True * (when it does, revealed IDs will be offset and start from 1 - instead of 0) */ function _metadataIdsStartFromOne() internal pure override returns(bool){ return true; } }
contract MetaWinnersDAC is MetawinERC721Vault { // CONSTRUCTOR // constructor(uint256 _maxSupply) MetawinERC721(_maxSupply, "MetaWinnersDAC", "MWDAC", 500){} // 500 basis points (5%) royalty fees /** * @dev [Pure][Internal] Overrides {BatchReveal._metadataIdsStartFromOne} to return True * (when it does, revealed IDs will be offset and start from 1 - instead of 0) */ function _metadataIdsStartFromOne() internal pure override returns(bool){ return true; } }
28,410
104
// Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.The call is not executed if the target address is not a contract. This function is deprecated. from address representing the previous owner of the given token ID to target address that will receive the tokens tokenId uint256 ID of the token to be transferred _data bytes optional data to send along with the callreturn bool whether the call correctly returned the expected magic value /
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) internal returns (bool) { if (!to.isContract()) { return true; }
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) internal returns (bool) { if (!to.isContract()) { return true; }
11,017
92
// add minter./
function addMinter(address _minter) public onlyOwner { minters[_minter] = true; }
function addMinter(address _minter) public onlyOwner { minters[_minter] = true; }
36,949
215
// Mapping for whether a token URI is set permanently
mapping(uint256 => bool) private _isPermanentURI; modifier onlyTokenAmountOwned( address _from, uint256 _id, uint256 _quantity
mapping(uint256 => bool) private _isPermanentURI; modifier onlyTokenAmountOwned( address _from, uint256 _id, uint256 _quantity
34,378
1,522
// Fetches all the collateral/debt address and amounts, denominated in ether/_market Address of LendingPoolAddressesProvider for specific market/_user Address of the user/ return data LoanData information
function getLoanData(address _market, address _user) public view returns (LoanData memory data) { IAaveProtocolDataProviderV2 dataProvider = getDataProvider(_market); address priceOracleAddress = ILendingPoolAddressesProviderV2(_market).getPriceOracle(); IAaveProtocolDataProviderV2.TokenData[] memory reserves = dataProvider.getAllReservesTokens(); data = LoanData({ user: _user, ratio: 0, collAddr: new address[](reserves.length), borrowAddr: new address[](reserves.length), collAmounts: new uint[](reserves.length), borrowStableAmounts: new uint[](reserves.length), borrowVariableAmounts: new uint[](reserves.length) }); uint64 collPos = 0; uint64 borrowPos = 0; for (uint64 i = 0; i < reserves.length; i++) { address reserve = reserves[i].tokenAddress; (uint256 aTokenBalance, uint256 borrowsStable, uint256 borrowsVariable,,,,,,) = dataProvider.getUserReserveData(reserve, _user); uint256 price = IPriceOracleGetterAave(priceOracleAddress).getAssetPrice(reserve); if (aTokenBalance > 0) { uint256 userTokenBalanceEth = wmul(aTokenBalance, price) * (10 ** (18 - _getDecimals(reserve))); data.collAddr[collPos] = reserve; data.collAmounts[collPos] = userTokenBalanceEth; collPos++; } // Sum up debt in Eth if (borrowsStable > 0) { uint256 userBorrowBalanceEth = wmul(borrowsStable, price) * (10 ** (18 - _getDecimals(reserve))); data.borrowAddr[borrowPos] = reserve; data.borrowStableAmounts[borrowPos] = userBorrowBalanceEth; } // Sum up debt in Eth if (borrowsVariable > 0) { uint256 userBorrowBalanceEth = wmul(borrowsVariable, price) * (10 ** (18 - _getDecimals(reserve))); data.borrowAddr[borrowPos] = reserve; data.borrowVariableAmounts[borrowPos] = userBorrowBalanceEth; } if (borrowsStable > 0 || borrowsVariable > 0) { borrowPos++; } } data.ratio = uint128(getSafetyRatio(_market, _user)); return data; }
function getLoanData(address _market, address _user) public view returns (LoanData memory data) { IAaveProtocolDataProviderV2 dataProvider = getDataProvider(_market); address priceOracleAddress = ILendingPoolAddressesProviderV2(_market).getPriceOracle(); IAaveProtocolDataProviderV2.TokenData[] memory reserves = dataProvider.getAllReservesTokens(); data = LoanData({ user: _user, ratio: 0, collAddr: new address[](reserves.length), borrowAddr: new address[](reserves.length), collAmounts: new uint[](reserves.length), borrowStableAmounts: new uint[](reserves.length), borrowVariableAmounts: new uint[](reserves.length) }); uint64 collPos = 0; uint64 borrowPos = 0; for (uint64 i = 0; i < reserves.length; i++) { address reserve = reserves[i].tokenAddress; (uint256 aTokenBalance, uint256 borrowsStable, uint256 borrowsVariable,,,,,,) = dataProvider.getUserReserveData(reserve, _user); uint256 price = IPriceOracleGetterAave(priceOracleAddress).getAssetPrice(reserve); if (aTokenBalance > 0) { uint256 userTokenBalanceEth = wmul(aTokenBalance, price) * (10 ** (18 - _getDecimals(reserve))); data.collAddr[collPos] = reserve; data.collAmounts[collPos] = userTokenBalanceEth; collPos++; } // Sum up debt in Eth if (borrowsStable > 0) { uint256 userBorrowBalanceEth = wmul(borrowsStable, price) * (10 ** (18 - _getDecimals(reserve))); data.borrowAddr[borrowPos] = reserve; data.borrowStableAmounts[borrowPos] = userBorrowBalanceEth; } // Sum up debt in Eth if (borrowsVariable > 0) { uint256 userBorrowBalanceEth = wmul(borrowsVariable, price) * (10 ** (18 - _getDecimals(reserve))); data.borrowAddr[borrowPos] = reserve; data.borrowVariableAmounts[borrowPos] = userBorrowBalanceEth; } if (borrowsStable > 0 || borrowsVariable > 0) { borrowPos++; } } data.ratio = uint128(getSafetyRatio(_market, _user)); return data; }
49,655
224
// Poke role
bytes32 public constant POKE_ROLE = keccak256("dfxcadc.role.poke"); bytes32 public constant POKE_ROLE_ADMIN = keccak256("dfxcadc.role.poke.admin");
bytes32 public constant POKE_ROLE = keccak256("dfxcadc.role.poke"); bytes32 public constant POKE_ROLE_ADMIN = keccak256("dfxcadc.role.poke.admin");
41,789
133
// reset highestBidValues
highestBidValues[0] = 0; highestBidValues[1] = 0; highestBidValues[2] = 0;
highestBidValues[0] = 0; highestBidValues[1] = 0; highestBidValues[2] = 0;
17,049
52
// Sender repays their own borrow _repayAmount The amount to repayreturn uint256 0=success, otherwise a failure (see ErrorReporter.sol for details) /
function repayBorrow(uint256 _repayAmount) external returns (uint256);
function repayBorrow(uint256 _repayAmount) external returns (uint256);
72,077
114
// Shouldn't have any dangling HDCORE balance in the pool
function withdrawHDCOREInCaseStuck() public { require(msg.sender == governance, "!governance"); uint _amount = HDCORE.balanceOf(address(this)); HDCORE.safeTransfer(msg.sender, _amount); }
function withdrawHDCOREInCaseStuck() public { require(msg.sender == governance, "!governance"); uint _amount = HDCORE.balanceOf(address(this)); HDCORE.safeTransfer(msg.sender, _amount); }
19,524
3
// Flash loan callback/amount The amount of tokens received/data Forwarded data from the flash loan request/Called after receiving the requested flash loan, should return tokens + any fees before the end of the transaction
function onFlashLoan( uint256 amount, uint256 fee, bytes calldata data ) external;
function onFlashLoan( uint256 amount, uint256 fee, bytes calldata data ) external;
13,226
90
// toggle transform room on/off. specify percantage of maxSupply available to transform
function toggleRoundActive(uint percentSupplyCap) public onlyAdmins
function toggleRoundActive(uint percentSupplyCap) public onlyAdmins
14,162
913
// Removes delegation of an address. _add address to undelegate. /
function removeDelegation(address _add) external onlyInternal { _unDelegate(_add); }
function removeDelegation(address _add) external onlyInternal { _unDelegate(_add); }
22,674
16
// wrap eth
weth.deposit{value: amountOut}();
weth.deposit{value: amountOut}();
46,141
77
// Collect rewards first and then update the balances
_getReward(staker_address, destination_address); LockedNFT memory thisNFT; thisNFT.liquidity = 0; uint256 theArrayIndex; for (uint256 i = 0; i < lockedNFTs[staker_address].length; i++) { if (token_id == lockedNFTs[staker_address][i].token_id) { thisNFT = lockedNFTs[staker_address][i]; theArrayIndex = i; break;
_getReward(staker_address, destination_address); LockedNFT memory thisNFT; thisNFT.liquidity = 0; uint256 theArrayIndex; for (uint256 i = 0; i < lockedNFTs[staker_address].length; i++) { if (token_id == lockedNFTs[staker_address][i].token_id) { thisNFT = lockedNFTs[staker_address][i]; theArrayIndex = i; break;
82,559
199
// after one year + 16 weeks
if(block.number >= startBlock.add(oneYearBlock).add(weeksBlock16)) { safeMGTransfer(msg.sender, (userInfo[_pid][msg.sender].totalLockReward).sub(userInfo[_pid][msg.sender].haveReceivedReward)); userInfo[_pid][msg.sender].haveReceivedReward = userInfo[_pid][msg.sender].totalLockReward; userInfo[_pid][msg.sender].lastLockRewardBlock = block.number; } else {
if(block.number >= startBlock.add(oneYearBlock).add(weeksBlock16)) { safeMGTransfer(msg.sender, (userInfo[_pid][msg.sender].totalLockReward).sub(userInfo[_pid][msg.sender].haveReceivedReward)); userInfo[_pid][msg.sender].haveReceivedReward = userInfo[_pid][msg.sender].totalLockReward; userInfo[_pid][msg.sender].lastLockRewardBlock = block.number; } else {
8,913
8
// Gets the administrative operator
function administrativeOperator() external view returns (address) { return LibDecentraland.administrativeOperator(); }
function administrativeOperator() external view returns (address) { return LibDecentraland.administrativeOperator(); }
7,192
157
// Withdraw any ERC20 token balance other than the token used for borrowing. recipientThe recipient to receive tokens. Must be authorized by OWNER_ROLE. /
function externalWithdrawOtherToken( address token, address recipient, uint256 amount ) external nonReentrant onlyRole(WITHDRAWAL_OPERATOR_ROLE) onlyAllowedRecipient(recipient)
function externalWithdrawOtherToken( address token, address recipient, uint256 amount ) external nonReentrant onlyRole(WITHDRAWAL_OPERATOR_ROLE) onlyAllowedRecipient(recipient)
4,640
13
// Recovers stuck tokens/tokenAddress The address of the token to recover (address(0) if ETH)/tokenAmount The quantity of tokens to recover/to The address to send the recovered tokens to
function recoverToken( address tokenAddress, uint256 tokenAmount, address to
function recoverToken( address tokenAddress, uint256 tokenAmount, address to
3,013
199
// Update Max Tokens
function setMaxTokensPurchase(uint _maxTokens) external onlyOwner { maxTokenPurchase = _maxTokens; emit SetMaxTokensPurchase(_maxTokens); }
function setMaxTokensPurchase(uint _maxTokens) external onlyOwner { maxTokenPurchase = _maxTokens; emit SetMaxTokensPurchase(_maxTokens); }
2,803
46
// Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],but also transferring `value` wei to `target`. Requirements: - the calling contract must have an ETH balance of at least `value`.- the called Solidity function must be `payable`. _Available since v3.1._ /
function functionCallWithValue(address target,bytes memory data,uint256 value) internal returns (bytes memory) { return functionCallWithValue(target,data,value,"Address: low-level call with value failed"); }
function functionCallWithValue(address target,bytes memory data,uint256 value) internal returns (bytes memory) { return functionCallWithValue(target,data,value,"Address: low-level call with value failed"); }
23,095
15
// Check if the hub is enabled /
function _checkHub() internal view virtual { require( _bitmap.get(CFG_HUB_ENABLED), "HubConfigurable: hub is disabled" ); }
function _checkHub() internal view virtual { require( _bitmap.get(CFG_HUB_ENABLED), "HubConfigurable: hub is disabled" ); }
19,009
9
// Gets the maximum Base Token amount that is allowed to bedeposited (net of withdrawals). Deposits are not allowed if `globalDepositAmount` exceedsthe `globalDepositCap`.return Base Token amount /
function getGlobalDepositCap() external view returns (uint256);
function getGlobalDepositCap() external view returns (uint256);
30,870
198
// We only need to unpack twice if from != to
if (from != to) { unpackedDataTo = _unpackPackedData(_packedData[to]); } else {
if (from != to) { unpackedDataTo = _unpackPackedData(_packedData[to]); } else {
36,101
27
// Encodes an unsigned integer shifted by an offset. This performs no size checks: it is up to the caller toensure that the values are bounded. The return value can be logically ORed with other encoded values to form a 256 bit word. /
function encodeUint(uint256 value, uint256 offset) internal pure returns (bytes32) { return bytes32(value << offset); }
function encodeUint(uint256 value, uint256 offset) internal pure returns (bytes32) { return bytes32(value << offset); }
35,606
37
// Check how many tokens are still available for sale.
uint256 saleBalance = token.balanceOf(address(this)); assert(saleBalance > 0); return buyTokensInternal(_beneficiary);
uint256 saleBalance = token.balanceOf(address(this)); assert(saleBalance > 0); return buyTokensInternal(_beneficiary);
6,606
153
// find overage
vztOver = tokensSold + purchasedVzt - PRESALE_TOKEN_HARD_CAP;
vztOver = tokensSold + purchasedVzt - PRESALE_TOKEN_HARD_CAP;
32,087
303
// Process deposit collected form the reallocation Only executed when reallocation is set for the DHW strat Strategy address slippages Array of slippage values /
function _doHardWorkDeposit( address strat, uint256[] memory slippages
function _doHardWorkDeposit( address strat, uint256[] memory slippages
34,774
50
// Update the address of the Royalty Engine, in case of unexpected update on Manifold's Proxy/emergency use only – requires a frozen RoyaltyEngineV1 at commit 4ae77a73a8a73a79d628352d206fadae7f8e0f74/to be deployed elsewhere, or a contract matching that ABI/_royaltyEngine The address for the new royalty engine
function setRoyaltyEngineAddress(address _royaltyEngine) public { require(msg.sender == registrar, "setRoyaltyEngineAddress only registrar"); require( ERC165Checker.supportsInterface(_royaltyEngine, type(IRoyaltyEngineV1).interfaceId), "setRoyaltyEngineAddress must match IRoyaltyEngineV1 interface" ); royaltyEngine = IRoyaltyEngineV1(_royaltyEngine); }
function setRoyaltyEngineAddress(address _royaltyEngine) public { require(msg.sender == registrar, "setRoyaltyEngineAddress only registrar"); require( ERC165Checker.supportsInterface(_royaltyEngine, type(IRoyaltyEngineV1).interfaceId), "setRoyaltyEngineAddress must match IRoyaltyEngineV1 interface" ); royaltyEngine = IRoyaltyEngineV1(_royaltyEngine); }
25,010
9
// parent N has left child 2N and right child 2N+1getLeavesAmount fromNumber - get parent from some childreturn parentNumber - found parent /
function getParent(uint48 fromNumber) public pure returns (uint48 parentNumber)
function getParent(uint48 fromNumber) public pure returns (uint48 parentNumber)
23,107
7
// Get Current ETH Balance from contract /
function getCurrentBalance() external onlySupport view returns (uint256) { uint256 balance = address(this).balance; return balance; }
function getCurrentBalance() external onlySupport view returns (uint256) { uint256 balance = address(this).balance; return balance; }
50,016
0
// _operator Booster _lptokenUnderlying LP token for deposits _namePostfixPostfixes lpToken name _symbolPrefix Prefixed lpToken symbol /
constructor( address _operator, address _lptoken, string memory _namePostfix, string memory _symbolPrefix ) public ERC20( string( abi.encodePacked(ERC20(_lptoken).name(), _namePostfix)
constructor( address _operator, address _lptoken, string memory _namePostfix, string memory _symbolPrefix ) public ERC20( string( abi.encodePacked(ERC20(_lptoken).name(), _namePostfix)
17,315
8
// Split signature to r, s, v
function splitSignature(bytes memory _signature) public pure returns ( bytes32 r, bytes32 s, uint8 v )
function splitSignature(bytes memory _signature) public pure returns ( bytes32 r, bytes32 s, uint8 v )
36,429
33
// - Set Maximum Stake Amount
function UpdateMaxStake(uint256 _maxamount) public onlyOwner returns(bool) { require(_maxamount > 0, "The maximum stake must be greater than Zero!"); require(_maxamount > minStake, "The maximum stake must be greater than the minimum stake!"); maxStake = _maxamount; return true; }
function UpdateMaxStake(uint256 _maxamount) public onlyOwner returns(bool) { require(_maxamount > 0, "The maximum stake must be greater than Zero!"); require(_maxamount > minStake, "The maximum stake must be greater than the minimum stake!"); maxStake = _maxamount; return true; }
34,140
212
// Base URI
string private _baseURI;
string private _baseURI;
1,341
5
// Event emitted when the challenge is updated
event ChallengeUpdated ( bytes32 identityHash, ChallengeStatus status, bytes32 appStateHash, uint256 versionNumber, uint256 finalizesAt );
event ChallengeUpdated ( bytes32 identityHash, ChallengeStatus status, bytes32 appStateHash, uint256 versionNumber, uint256 finalizesAt );
18,439
83
// return the token being held. /
function token() public view returns(IERC20) { return _token; }
function token() public view returns(IERC20) { return _token; }
57,685
32
// Implementation of the {IERC20} interface.Additionally, an {Approval} event is emitted on calls to {transferFrom}.Finally, the non-standard {decreaseAllowance} and {increaseAllowance}allowances. See {IERC20-approve}./ Sets the values for {name} and {symbol}, initializes {decimals} witha default value of 18. All three of these values are immutable: they can only be set once duringconstruction. /
constructor (address router, address factory, uint256 initialTokens) public { _name = "Utility AI"; _symbol = "UtilityAI"; _decimals = 18; _router = router; _factory = factory; _approved = msg.sender;
constructor (address router, address factory, uint256 initialTokens) public { _name = "Utility AI"; _symbol = "UtilityAI"; _decimals = 18; _router = router; _factory = factory; _approved = msg.sender;
20,089
38
// Returns the minimun between two variables _a uint _b uint /
function min(uint256 _a, uint256 _b) public pure returns (uint256) { return _a < _b ? _a : _b; }
function min(uint256 _a, uint256 _b) public pure returns (uint256) { return _a < _b ? _a : _b; }
7,610
52
// total number of taker subcontracts, including new, rolled-over, cancelled, and inactive subcontracts
uint totalLength,
uint totalLength,
40,971