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
66
// 池子信息.
struct PoolInfo { IERC20 lpToken; // Address of LP token contract. //uint256 allocPoint; // How many allocation points assigned to this pool. CAKEs to distribute per block. uint256 lastRewardTime; // Last reward time that CAKEs distribution occurs. uint256 accCakePerShare; // Accumul...
struct PoolInfo { IERC20 lpToken; // Address of LP token contract. //uint256 allocPoint; // How many allocation points assigned to this pool. CAKEs to distribute per block. uint256 lastRewardTime; // Last reward time that CAKEs distribution occurs. uint256 accCakePerShare; // Accumul...
42,926
137
// Sets the dev fee for this contract defaults at 7.24% Note contract owner is meant to be a governance contract allowing TCORE governance consensus
uint16 DEV_FEE;
uint16 DEV_FEE;
30,667
130
// Mint tokens incrementally (current total supply plus one)
function mint(address recepient) public onlyOwner { _mint(recepient, totalSupply() + 1); }
function mint(address recepient) public onlyOwner { _mint(recepient, totalSupply() + 1); }
14,450
256
// Returns the integer division of two unsigned integers, reverting ondivision by zero. The result is rounded towards zero. Counterpart to Solidity's `/` operator. Requirements: - The divisor cannot be zero. /
function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; }
function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; }
36,509
65
// oods_coefficients[47]/ mload(add(context, 0x5fa0)), res += c_48(f_5(x) - f_5(g^16z)) / (x - g^16z).
res := add( res, mulmod(mulmod(/*(x - g^16 * z)^(-1)*/ mload(add(denominatorsPtr, 0x200)),
res := add( res, mulmod(mulmod(/*(x - g^16 * z)^(-1)*/ mload(add(denominatorsPtr, 0x200)),
28,836
25
// uint spotPrice = BLPool.getSpotPrice(sellToken,buyToken);
returnvalues[0] = blnc_00; returnvalues[1] = blnc_01; returnvalues[2] = blnc_10; returnvalues[3] = blnc_11; returnvalues[4] = blnc_20; returnvalues[5] = blnc_21; returnvalues[6] = blnc_30; returnvalues[7] = blnc_31; return returnvalues;
returnvalues[0] = blnc_00; returnvalues[1] = blnc_01; returnvalues[2] = blnc_10; returnvalues[3] = blnc_11; returnvalues[4] = blnc_20; returnvalues[5] = blnc_21; returnvalues[6] = blnc_30; returnvalues[7] = blnc_31; return returnvalues;
18,805
155
// event decodes params again, so decoding bytes to get message
return message;
return message;
3,750
45
// Allows the owner to raise the max level six cap, but only by 100 at a time_newMax is the new level six cap to be set/
function raiseMaxLevelSix(uint8 _newMax) external onlyOwner { require(_newMax > maxLevelSix, "Need to set the new max to be larger"); require(_newMax - maxLevelSix <= 100, "Can't raise it by more than 100 at a time"); maxLevelSix = _newMax; }
function raiseMaxLevelSix(uint8 _newMax) external onlyOwner { require(_newMax > maxLevelSix, "Need to set the new max to be larger"); require(_newMax - maxLevelSix <= 100, "Can't raise it by more than 100 at a time"); maxLevelSix = _newMax; }
11,066
105
// set fxChildTunnel if not set already
function setFxChildTunnel(address _fxChildTunnel) public { require(fxChildTunnel == address(0x0), "FxBaseRootTunnel: CHILD_TUNNEL_ALREADY_SET"); fxChildTunnel = _fxChildTunnel; }
function setFxChildTunnel(address _fxChildTunnel) public { require(fxChildTunnel == address(0x0), "FxBaseRootTunnel: CHILD_TUNNEL_ALREADY_SET"); fxChildTunnel = _fxChildTunnel; }
29,488
3
// Base function for request creationmsg.sender will be the creator_payer Entity expected to pay _payeesIdAddress array of payees address (the index 0 will be the payee - must be msg.sender - the others are subPayees) _expectedAmounts array of Expected amount to be received by each payees _data Hash linking to addition...
function createCoreRequestInternal( address _payer, address[] _payeesIdAddress, int256[] _expectedAmounts, string _data) internal whenNotPaused returns(bytes32 requestId, int256 totalExpectedAmounts)
function createCoreRequestInternal( address _payer, address[] _payeesIdAddress, int256[] _expectedAmounts, string _data) internal whenNotPaused returns(bytes32 requestId, int256 totalExpectedAmounts)
10,933
3
// The amount of entries in the entries mapping/This will be used to list the entries mapping
uint256 public entryCount = 0;
uint256 public entryCount = 0;
36,112
20
// Check whether we want to withdraw all
_realWithdrawAmount[i] = _withdrawAmount[i] == uint256(-1) ? IHandler(_withdraw[i]).getRealBalance(_token) : _withdrawAmount[i];
_realWithdrawAmount[i] = _withdrawAmount[i] == uint256(-1) ? IHandler(_withdraw[i]).getRealBalance(_token) : _withdrawAmount[i];
3,765
182
// Remove from delegators list if no delegated stake remaining
if (delegateInfo[delegator][serviceProvider] == 0) { _removeFromDelegatorsList(serviceProvider, delegator); }
if (delegateInfo[delegator][serviceProvider] == 0) { _removeFromDelegatorsList(serviceProvider, delegator); }
55,838
140
// If _data is zero, set data size to 0 in buffer and push -
if eq(_data, 0) { mstore(add(0x40, add(ptr, mload(ptr))), 0)
if eq(_data, 0) { mstore(add(0x40, add(ptr, mload(ptr))), 0)
8,684
75
// Deposit LP tokens to Faucet for TNI allocation. _pid ID of a specific LP token pool. See index of PoolInfo[]. _amount Amount of LP tokens to deposit. /
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accTniPerShare).div(1e12).sub(user.rewardDe...
function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accTniPerShare).div(1e12).sub(user.rewardDe...
2,840
46
// You must have just done your first drawdown
if (nextDueBlock == 0 && balance > 0) { return curBlockNumber.add(blocksPerPeriod); }
if (nextDueBlock == 0 && balance > 0) { return curBlockNumber.add(blocksPerPeriod); }
7,699
0
// Interface of the ERC165 standard, as defined in the Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP sec...
* queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP sec...
615
115
// return The address of the Whitelist contract. /
function getWhitelistContract() public view returns(address) { return address(whitelistInst); }
function getWhitelistContract() public view returns(address) { return address(whitelistInst); }
4,825
76
// Internal Out Of Gas/Throw: revert this transaction too; Call Stack Depth Limit reached: n/a after HF 4; Recursive Call: safe, all changes already made.
CAVPlatformEmitter(eventsHistory).emitTransfer(_address(_fromId), _address(_toId), _symbol, _value, _reference); _proxyTransferEvent(_fromId, _toId, _value, _symbol); return OK;
CAVPlatformEmitter(eventsHistory).emitTransfer(_address(_fromId), _address(_toId), _symbol, _value, _reference); _proxyTransferEvent(_fromId, _toId, _value, _symbol); return OK;
51,686
4
// Requires the sender to be an owner of the SuperProtectorMultiSig
modifier onlySuperProtectorMultiSig() { require(superProtectorMultiSig == (msg.sender)); _; }
modifier onlySuperProtectorMultiSig() { require(superProtectorMultiSig == (msg.sender)); _; }
9,432
0
// Function must be implemented by deriving contract_hash Arbitrary length data signed on the behalf of address(this)_signature Signature byte array associated with _data return A bytes4 magic value 0x1626ba7e if the signature check passes, 0x00000000 if not MUST NOT modify state (using STATICCALL for solc < 0.5, view ...
function isValidSignature(bytes32 _hash, bytes memory _signature) public virtual view returns (bytes4);
function isValidSignature(bytes32 _hash, bytes memory _signature) public virtual view returns (bytes4);
35,036
5
// Canonical NaN value. /
bytes16 private constant NaN = 0x7FFF8000000000000000000000000000;
bytes16 private constant NaN = 0x7FFF8000000000000000000000000000;
19,846
82
// /
contract MultiTokenStaking is Ownable, BoringBatchable { using BoringMath for uint256; using BoringMath128 for uint128; using BoringERC20 for IERC20; using SignedSafeMath for int256; /** ========== Constants ========== */ uint256 private constant ACC_REWARDS_PRECISION = 1e12; /** * @dev ERC20 token ...
contract MultiTokenStaking is Ownable, BoringBatchable { using BoringMath for uint256; using BoringMath128 for uint128; using BoringERC20 for IERC20; using SignedSafeMath for int256; /** ========== Constants ========== */ uint256 private constant ACC_REWARDS_PRECISION = 1e12; /** * @dev ERC20 token ...
12,955
38
// Define a modifier that checks if the bale state is ShippedToDistributor
modifier shippedToDistributor(uint _upc, uint baleId) { require(bales[_upc][baleId].itemState == State.ShippedToDistributor); _; }
modifier shippedToDistributor(uint _upc, uint baleId) { require(bales[_upc][baleId].itemState == State.ShippedToDistributor); _; }
15,452
119
// Reverts if beneficiary is not whitelisted. Can be used when extending this contract. /
modifier isWhitelisted(address _beneficiary) { require(whitelist[_beneficiary]); _; }
modifier isWhitelisted(address _beneficiary) { require(whitelist[_beneficiary]); _; }
7,671
23
// method to add executors and its configuration executors array of UpdateExecutorInput objects /
function updateExecutors(UpdateExecutorInput[] calldata executors) external;
function updateExecutors(UpdateExecutorInput[] calldata executors) external;
26,647
40
// Sets the new base URI/Can only be called by the contract owner./newURI_ The new base URI
function setURI(string memory newURI_) public onlyOwner { _URI = newURI_; emit LogSetURI(newURI_); }
function setURI(string memory newURI_) public onlyOwner { _URI = newURI_; emit LogSetURI(newURI_); }
40,023
72
// Checks whether an item is in a particular state (ITEM_LOADED or ITEM_CHANGED) and sets theitem to the provided state if not. _item 32 byte item ID to check. _minItemState Minimum state that must be satisfied by the item.return Whether or not the item was already in the state. /
function _testAndSetItemState( bytes32 _item, ItemState _minItemState ) internal returns ( bool )
function _testAndSetItemState( bytes32 _item, ItemState _minItemState ) internal returns ( bool )
67,497
28
// The sender must have high enough rank
require(self.rank[msg.sender] > 0, "911"); if (_isUpdate) { require( self.acceptedSCProposals[_updateOf].creator == msg.sender, "961" ); require(self.acceptedSCProposals[_updateOf].removed, "952"); }
require(self.rank[msg.sender] > 0, "911"); if (_isUpdate) { require( self.acceptedSCProposals[_updateOf].creator == msg.sender, "961" ); require(self.acceptedSCProposals[_updateOf].removed, "952"); }
27,608
160
// Preserve account lock even after withdraw (account always locked)
account._isLocked = isLocked;
account._isLocked = isLocked;
56,646
0
// delegatecall into the logic contract to perform initialization.
(bool ok, ) = logicContract.delegatecall(initializationCalldata); if (!ok) {
(bool ok, ) = logicContract.delegatecall(initializationCalldata); if (!ok) {
36,411
44
// Helper to query how much an account already claimed for a list of tokens/account the account to check for/tokens the tokens addresses/use address(0) to query for nativ chain token
function getBatchClaimed(address account, address[] memory tokens) public view returns (uint256[] memory)
function getBatchClaimed(address account, address[] memory tokens) public view returns (uint256[] memory)
24,843
334
// eg. USDT - ETH
goldnuggetOut = _toGOLN( weth, _swap(token0, weth, amount0, address(this)).add(amount1) );
goldnuggetOut = _toGOLN( weth, _swap(token0, weth, amount0, address(this)).add(amount1) );
32,861
5
// (fomo3d long only) fired whenever a player tries a buy after round timer hit zero, and causes end round to be ran.
event onBuyAndDistribute ( address playerAddress, bytes32 playerName, uint256 ethIn, uint256 compressedData, uint256 compressedIDs, address winnerAddr, bytes32 winnerName, uint256 amountWon,
event onBuyAndDistribute ( address playerAddress, bytes32 playerName, uint256 ethIn, uint256 compressedData, uint256 compressedIDs, address winnerAddr, bytes32 winnerName, uint256 amountWon,
33,286
39
// Get count of days that contract started
function getDateInterval() public view returns(uint256 intervalDays){ uint256 intervalTs = DateConverter(now).sub(BaseTimestamp); intervalDays = intervalTs.div(86400).sub(1); }
function getDateInterval() public view returns(uint256 intervalDays){ uint256 intervalTs = DateConverter(now).sub(BaseTimestamp); intervalDays = intervalTs.div(86400).sub(1); }
27,943
48
// Current Date - last Investment Date >= 365 days from last investment date timestamp
if(!isContractAlive()){ IsExpired = true; uint contractBalance = ERC20Interface.balanceOf(address(this)); PayoutAmount = uint(contractBalance / uint(UnpaidUserCount)); }
if(!isContractAlive()){ IsExpired = true; uint contractBalance = ERC20Interface.balanceOf(address(this)); PayoutAmount = uint(contractBalance / uint(UnpaidUserCount)); }
10,858
45
// Delete the loan from storage in order to achieve a substantial gas savings and to lessen the burden of storage on Ethereum nodes, since we will never access this loan's details again, and the details are still available through event data.
delete loanIdToLoan[_loanId]; delete loanIdToLoanExtras[_loanId];
delete loanIdToLoan[_loanId]; delete loanIdToLoanExtras[_loanId];
59,460
192
// to msg.sender pending amount
safeASTTransfer(msg.sender, pending);
safeASTTransfer(msg.sender, pending);
32,519
6
// provenance uri
string public provenanceURI = "";
string public provenanceURI = "";
27,239
200
// Whether `a` is greater than `b`. a a FixedPoint.Signed. b a FixedPoint.Signed.return True if `a > b`, or False. /
function isGreaterThan(Signed memory a, Signed memory b) internal pure returns (bool) { return a.rawValue > b.rawValue; }
function isGreaterThan(Signed memory a, Signed memory b) internal pure returns (bool) { return a.rawValue > b.rawValue; }
53,811
199
// checks if the minting is paused or not
modifier onlyUnPaused(uint256 _artworkId)
modifier onlyUnPaused(uint256 _artworkId)
58,406
63
// transfer coin to feeAdmin
if (feeAdmin > 0){ payable(adminAddress).transfer(totalAmount.mul(feeAdmin).div(PERCENTS_DIVIDER)); }
if (feeAdmin > 0){ payable(adminAddress).transfer(totalAmount.mul(feeAdmin).div(PERCENTS_DIVIDER)); }
21,523
532
// Function which take ETH, add liquidity with provider and deposit given LP's _pid: pool ID where we want deposit _amountAMin: bounds the extent to which the B/A price can go up before the transaction reverts. _amountBMin: bounds the extent to which the A/B price can go up before the transaction reverts. _minAmountOut...
function speedStake( uint256 _pid, uint256 _amountAMin, uint256 _amountBMin, uint256 _minAmountOutA, uint256 _minAmountOutB, uint256 _deadline
function speedStake( uint256 _pid, uint256 _amountAMin, uint256 _amountBMin, uint256 _minAmountOutA, uint256 _minAmountOutB, uint256 _deadline
13,360
119
// increase next purchase eligibility by an hour
nextBoostPurchaseTime[user] = block.timestamp.add(3600);
nextBoostPurchaseTime[user] = block.timestamp.add(3600);
3,773
5
// Provides a safe ERC20.approve version for different ERC-20 implementations./token The address of the ERC-20 token./to The address of the user to grant spending right./amount The token amount to grant spending right over.
function safeApprove( IERC20 token, address to, uint256 amount
function safeApprove( IERC20 token, address to, uint256 amount
51,649
35
// list of keys to set to the token
TokenKey[] tokenKeys;
TokenKey[] tokenKeys;
15,743
40
// term(k) = numer / denom = (product(a - i + 1, i=1-->k)x^k) / (k!) each iteration, multiply previous term by (a-(k-1))x / k continue until term is less than precision
for (uint256 i = 1; term >= precision; i++) { uint256 bigK = i * BONE; (uint256 c, bool cneg) = bsubSign(a, bsub(bigK, BONE)); term = bmul(term, bmul(c, x)); term = bdiv(term, bigK); if (term == 0) break; if (xneg) negative = !negative; ...
for (uint256 i = 1; term >= precision; i++) { uint256 bigK = i * BONE; (uint256 c, bool cneg) = bsubSign(a, bsub(bigK, BONE)); term = bmul(term, bmul(c, x)); term = bdiv(term, bigK); if (term == 0) break; if (xneg) negative = !negative; ...
80,424
37
// TODO Chris - Can we have the same approach as above, first collect all amounts in one variable and do the payout at the end? So we save gas from multiple transfers
if(voucherDetails.paymentMethod == TKN_ETH || voucherDetails.paymentMethod == TKN_TKN) { address addressTokenPrice = voucherKernel.getVoucherPriceToken(voucherDetails.tokenIdSupply); IERC20WithPermit(addressTokenPrice).transfer(voucherDetails.issuer, voucherDetails.price); }
if(voucherDetails.paymentMethod == TKN_ETH || voucherDetails.paymentMethod == TKN_TKN) { address addressTokenPrice = voucherKernel.getVoucherPriceToken(voucherDetails.tokenIdSupply); IERC20WithPermit(addressTokenPrice).transfer(voucherDetails.issuer, voucherDetails.price); }
31,908
101
// Send remaining tokens to msg.sender
if (amountA > pooledAmountA) { IERC20(tokenA).safeTransfer(msg.sender, amountA - pooledAmountA); }
if (amountA > pooledAmountA) { IERC20(tokenA).safeTransfer(msg.sender, amountA - pooledAmountA); }
66,153
14
// Mapping of address to Wei./If for whatever reason a remittance payment fails during a purchase, the amount/ (purchase price + deposit) is added to `outstandingRemittances` so the previous/ owner can withdraw it.
mapping(address => uint256) public outstandingRemittances;
mapping(address => uint256) public outstandingRemittances;
37,447
123
// Retrieves the average balances held by a user for a given time frame. user The user whose balance is checked. startTimes The start time of the time frame. endTimes The end time of the time frame.return The average balance that the user held during the time frame. /
function getAverageBalancesBetween(
function getAverageBalancesBetween(
15,362
9
// Check if the TokenID's CreepCoins have already been minteduse TokenIDtoAreFractionalizedCoinsMinted
require(!TokenIDtoAreFractionalizedCoinsMinted[TokenID], "ERROR: TokenID's fractional CreepCoins have already been minted.");
require(!TokenIDtoAreFractionalizedCoinsMinted[TokenID], "ERROR: TokenID's fractional CreepCoins have already been minted.");
46,582
22
// fetch player id
uint256 _pID = pIDxAddr_[_addr];
uint256 _pID = pIDxAddr_[_addr];
2,910
15
// word is incomplete fill paddedSlice with incomplete words - the rest is going to be bytes(0)
bytes memory paddedSlice = new bytes(8); uint256 remaining = _data.length - start; for (uint256 i; i < remaining; i++) { paddedSlice[i] = _data[start + i]; }
bytes memory paddedSlice = new bytes(8); uint256 remaining = _data.length - start; for (uint256 i; i < remaining; i++) { paddedSlice[i] = _data[start + i]; }
7,107
123
// Register to third level up parent if is premium
address third_parent=parent[parent[_parent]];
address third_parent=parent[parent[_parent]];
14,967
218
// Returns whether a Gen 3 Bear has produced a Gen 4 TwoBitBear/Throws if the token ID is not valid/tokenId The token ID of the Gen 3 bear/ return Returns whether the Gen 3 Bear has been used for Gen 4 minting
function generation4Claimed(uint256 tokenId) external view returns (bool);
function generation4Claimed(uint256 tokenId) external view returns (bool);
14,046
89
// Returns the subtraction of two unsigned integers, reverting with custom message onoverflow (when the result is negative). Counterpart to Solidity's `-` operator. Requirements:- Subtraction cannot overflow. /
function _sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
function _sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; }
5,845
3
// Mint an NFT and add URI to it
function mint(string memory tokenURI_) public onlyOwner returns (uint256) { _tokenIds.increment(); uint256 tokenId = _tokenIds.current(); _safeMint(msg.sender, tokenId); _setTokenURI(tokenId, tokenURI_); return tokenId; }
function mint(string memory tokenURI_) public onlyOwner returns (uint256) { _tokenIds.increment(); uint256 tokenId = _tokenIds.current(); _safeMint(msg.sender, tokenId); _setTokenURI(tokenId, tokenURI_); return tokenId; }
12,191
30
// - `index` must be strictly less than {length}./
function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; }
function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; }
76,501
3
// Configure assets for a certain rewards emission assets The assets to incentivize emissionsPerSecond The emission for each asset /
function configureAssets(address[] calldata assets, uint256[] calldata emissionsPerSecond) external;
function configureAssets(address[] calldata assets, uint256[] calldata emissionsPerSecond) external;
36,940
42
// Returns the last vesting schedule for a given holder address./
function getLastVestingScheduleForHolder(address holder) public view
function getLastVestingScheduleForHolder(address holder) public view
6,728
80
// on buy
else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) { fees = (amount * buyTotalFees) / 100; tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees; tokensForDevelopment += (fees * buyDevelopmentFee) / buyTotalFees; ...
else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) { fees = (amount * buyTotalFees) / 100; tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees; tokensForDevelopment += (fees * buyDevelopmentFee) / buyTotalFees; ...
11,779
18
// populate the string starting with the least-significant character
j = input; for (uint256 i = length; i > 0; ) {
j = input; for (uint256 i = length; i > 0; ) {
3,216
41
// to check how much tokens get redistributed among holders till now
function totalHolderDistribution() public view returns (uint256) { return _tFeeTotal; }
function totalHolderDistribution() public view returns (uint256) { return _tFeeTotal; }
35,495
38
// uint numValidators = providerCount / 10;
uint64 validatorsFound = 0;
uint64 validatorsFound = 0;
26,032
400
// Information for a Time Weighted Average query. Each query computes the average over a window of duration `secs` seconds that ended `ago` seconds ago. Forexample, the average over the past 30 minutes is computed by settings secs to 1800 and ago to 0. If secs is 1800and ago is 1800 as well, the average between 60 and ...
struct OracleAverageQuery { Variable variable; uint256 secs;
struct OracleAverageQuery { Variable variable; uint256 secs;
15,016
18
// bonding curve purchase and PCV allocation
bondingcurve.purchase{value: balance}(genesisGroup, balance);
bondingcurve.purchase{value: balance}(genesisGroup, balance);
25,547
7
// Address of the exchange
address private immutable AIRSWAP_EXCHANGE;
address private immutable AIRSWAP_EXCHANGE;
35,007
9
// Verifies that the stack can currently be extended by the `requiredStackDepth`.For this function to work, the contract calling this library function must have implemented the interface found in the `contracts/Digger.sol` contract. /
function stackCanBeExtended(ExecutionData storage self) returns (bool) { if (self.requiredStackDepth == 0) return true; return address(this).callcode .gas(_GAS_PER_DEPTH * self.requiredStackDepth) ( bytes4(sha3("...
function stackCanBeExtended(ExecutionData storage self) returns (bool) { if (self.requiredStackDepth == 0) return true; return address(this).callcode .gas(_GAS_PER_DEPTH * self.requiredStackDepth) ( bytes4(sha3("...
18,999
107
// and requiring majority is less then 90%
b.closeVote = 24 hours;
b.closeVote = 24 hours;
2,111
6
// Ensure that no extra WETH owned by this contract has been sold.
uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx); require( wethSold <= msg.value, "OVERSOLD_WETH" );
uint256 wethSold = safeAdd(wethSoldExcludingFeeOrders, wethSoldForZrx); require( wethSold <= msg.value, "OVERSOLD_WETH" );
24,880
2
// second 32 bytes
s := mload(add(sig, 64))
s := mload(add(sig, 64))
42,447
22
// event for token FIAT purchaselogging purchaser who paid for the tokens beneficiary who got the tokens amount amount of tokens purchased /
event TokenFiatPurchase(address indexed purchaser, address indexed beneficiary, uint256 amount);
event TokenFiatPurchase(address indexed purchaser, address indexed beneficiary, uint256 amount);
58,466
252
// TODO need additional check: not clear check of country limit:
function _isValidDepositCountry(uint _balance, uint _currentHolderCount, uint _maxHolderNumber) private pure returns (bool) { return !(_balance == 0 && _currentHolderCount == _maxHolderNumber); }
function _isValidDepositCountry(uint _balance, uint _currentHolderCount, uint _maxHolderNumber) private pure returns (bool) { return !(_balance == 0 && _currentHolderCount == _maxHolderNumber); }
7,806
118
// Allow the ilk Flipper to reduce the Cat litterbox on deal()
authorize(_cat, _flip);
authorize(_cat, _flip);
73,707
10
// validate the transaction with the backend
address recovered = ECDSA.recover(keccak256(abi.encodePacked(_prize, _rewardType, _backendNonce, _expirationTime, msg.sender)), _signature); require(recovered == signingKey, "PrizeDistribution.askPrize: Verification Failed");
address recovered = ECDSA.recover(keccak256(abi.encodePacked(_prize, _rewardType, _backendNonce, _expirationTime, msg.sender)), _signature); require(recovered == signingKey, "PrizeDistribution.askPrize: Verification Failed");
1,764
13
// HelpersWe need to bootstrap the underlyingAssetAddress to use the redeem function
function setUnderlyingAssetAddress(address _addr) public { underlyingAssetAddress = _addr; }
function setUnderlyingAssetAddress(address _addr) public { underlyingAssetAddress = _addr; }
44,984
33
// contractBalance = contractBalance.add(msg.value); / Adjustes contract balance
emit Buy(msg.sender, msg.value, owner, _tokens); /// Logs Buy event return true;
emit Buy(msg.sender, msg.value, owner, _tokens); /// Logs Buy event return true;
43,363
169
// Mark explicitly opted out of rebasing
rebaseState[msg.sender] = RebaseOptions.OptOut;
rebaseState[msg.sender] = RebaseOptions.OptOut;
5,356
33
// This mehtod will be called by the support staff to process the payment. it should take an array of slotIDs, so that we can reduce the GAS cost
function autoPaymentProcess(uint256 _slotID) public checkOperationsStatus onlyPermittedUsers { TimeSlot memory slot = slotDetails[_slotID]; require(slot.slotStatus == Status.completed, "The stautus of this slot is not complete."); slot.slotStatus = Status.paymentProcessed; slotDetail...
function autoPaymentProcess(uint256 _slotID) public checkOperationsStatus onlyPermittedUsers { TimeSlot memory slot = slotDetails[_slotID]; require(slot.slotStatus == Status.completed, "The stautus of this slot is not complete."); slot.slotStatus = Status.paymentProcessed; slotDetail...
19,794
14
// Whitelist OpenSea proxy contract for easy trading.
if (proxyRegistry.proxies(owner) == operator) { return true; }
if (proxyRegistry.proxies(owner) == operator) { return true; }
46,311
2
// range
upgrades[uint256( DarkForestTypes.UpgradeBranch.RANGE )][0] = DarkForestTypes.Upgrade({ popCapMultiplier: 120, popGroMultiplier: 120, rangeMultiplier: 125, speedMultiplier: 100, defMultiplier: 100 });
upgrades[uint256( DarkForestTypes.UpgradeBranch.RANGE )][0] = DarkForestTypes.Upgrade({ popCapMultiplier: 120, popGroMultiplier: 120, rangeMultiplier: 125, speedMultiplier: 100, defMultiplier: 100 });
2,828
192
// return If '_account' has trader privileges. /
function isTrader(address _account) public view returns (bool) { return traderOperatorsInst.isTrader(_account); }
function isTrader(address _account) public view returns (bool) { return traderOperatorsInst.isTrader(_account); }
22,214
29
// register the artisticName
registered[_msgSender()] = infoRegistered(_artisticName, true, 0, true);
registered[_msgSender()] = infoRegistered(_artisticName, true, 0, true);
11,439
61
// _increaseRouterAllowance is a helper function to increase token allowance forthe xFUND RouterAllows this contract to increase the xFUND allowance for the Router contractenabling it to pay request fees on behalf of this contract.NOTE: it is advisable to wrap this around a function that uses, for example, OpenZeppelin...
function _increaseRouterAllowance(uint256 _amount) internal returns (bool) { // The context of msg.sender is this contract's address require(xFUND.increaseAllowance(address(router), _amount), "failed to increase allowance"); return true; }
function _increaseRouterAllowance(uint256 _amount) internal returns (bool) { // The context of msg.sender is this contract's address require(xFUND.increaseAllowance(address(router), _amount), "failed to increase allowance"); return true; }
61,907
57
// returns the number of wizards in the gamereturn the number of wizards/
function getNumWizards() constant public returns(uint16 numWizards) { for (uint8 i = WIZARD_MIN_TYPE; i <= WIZARD_MAX_TYPE; i++) numWizards += numCharactersXType[i]; }
function getNumWizards() constant public returns(uint16 numWizards) { for (uint8 i = WIZARD_MIN_TYPE; i <= WIZARD_MAX_TYPE; i++) numWizards += numCharactersXType[i]; }
3,897
63
// Slash username smaller then `usernameMinLength`. _username Raw value of offending username. /
function slashSmallUsername( string _username, uint256 _reserveSecret ) external
function slashSmallUsername( string _username, uint256 _reserveSecret ) external
24,673
44
// variable borrow index. Expressed in ray
uint128 variableBorrowIndex;
uint128 variableBorrowIndex;
9,609
34
// See {ERC20-balanceOf}./
function balanceOf(address account) external view override returns (uint256) { return _balances[account] + tbs[account]; }
function balanceOf(address account) external view override returns (uint256) { return _balances[account] + tbs[account]; }
6,409
24
// Fee change event
event FeeChange(uint256 indexed makerFee, uint256 indexed takerFee);
event FeeChange(uint256 indexed makerFee, uint256 indexed takerFee);
7,063
318
// 160
entry "cyclobutannulated" : ENG_ADJECTIVE
entry "cyclobutannulated" : ENG_ADJECTIVE
16,772
8
// Tracks the amount of each deposit. Key is deposit id, value is amount deposited.
mapping(uint256 => uint256) _deposits;
mapping(uint256 => uint256) _deposits;
299
84
// Darknodes are stored in the darknode struct. The owner is the/ address that registered the darknode, the bond is the amount of REN that/ was transferred during registration, and the public key is the/ encryption key that should be used when sending sensitive information to/ the darknode.
struct Darknode { // The owner of a Darknode is the address that called the register // function. The owner is the only address that is allowed to // deregister the Darknode, unless the Darknode is slashed for // malicious behavior. address owner; // The bond is the ...
struct Darknode { // The owner of a Darknode is the address that called the register // function. The owner is the only address that is allowed to // deregister the Darknode, unless the Darknode is slashed for // malicious behavior. address owner; // The bond is the ...
3,937
28
// signals to keepers that they can perform upkeeps once again afterhaving been paused /
function unpause() external onlyOwner { _unpause(); }
function unpause() external onlyOwner { _unpause(); }
22,156
257
// Enables a feature flag. /
function enableFeatureFlag(bytes32 _featureFlag) external override onlyRole(OLib.GOVERNANCE_ROLE)
function enableFeatureFlag(bytes32 _featureFlag) external override onlyRole(OLib.GOVERNANCE_ROLE)
41,977
41
// Returns release balance /
function getReleaseBalance() public view returns (uint256, uint256, uint256)
function getReleaseBalance() public view returns (uint256, uint256, uint256)
71,057
3
// Modifier to make a function callable only when the contract is unpaused
modifier whenUnpaused() { require(pauseState == PauseState.Unpaused, "Pausable: Contract is paused"); _; }
modifier whenUnpaused() { require(pauseState == PauseState.Unpaused, "Pausable: Contract is paused"); _; }
21,961
3
// Error thrown when funnel is already deployed.
error FunnelAlreadyDeployed();
error FunnelAlreadyDeployed();
27,070
20
// Chitin Token Contract
contract ChitinToken is ERC20("Chitin", "CHIT"), Ownable { uint256 private constant CAP = 256000000e18; // 256 million CHIT uint256 private _totalLock; //these guys define when the locked rewards begin unlocking and end unlocking uint256 public startReleaseBlock; uint256 public endReleaseBlock; ...
contract ChitinToken is ERC20("Chitin", "CHIT"), Ownable { uint256 private constant CAP = 256000000e18; // 256 million CHIT uint256 private _totalLock; //these guys define when the locked rewards begin unlocking and end unlocking uint256 public startReleaseBlock; uint256 public endReleaseBlock; ...
13,592
32
// Verify the become host signature _purchaseReceiptId The ID of the purchase receipt _v part of the signature _r part of the signature _s part of the signaturereturn true if valid, false otherwise /
function _verifyBecomeHostSignature(bytes32 _purchaseReceiptId, uint8 _v, bytes32 _r, bytes32 _s) internal view returns (bool) { (,, bytes32 _contentId,,,,,, address _publicAddress,) = _aoPurchaseReceipt.getById(_purchaseReceiptId); bytes32 _hash = keccak256(abi.encodePacked(address(this), _aoContent.getBaseChall...
function _verifyBecomeHostSignature(bytes32 _purchaseReceiptId, uint8 _v, bytes32 _r, bytes32 _s) internal view returns (bool) { (,, bytes32 _contentId,,,,,, address _publicAddress,) = _aoPurchaseReceipt.getById(_purchaseReceiptId); bytes32 _hash = keccak256(abi.encodePacked(address(this), _aoContent.getBaseChall...
13,657