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
60
// [{"constant":false,"inputs":[{"name":"_multisigVault","type":"address"}],"name":"setMultisigVault","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"authorizerIndex","type":"uint256"}],"name":"getAuthorizer","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"}...
modifier saleIsOn() { require(now > start && now < start + 30 days); _; }
modifier saleIsOn() { require(now > start && now < start + 30 days); _; }
8,817
9
// Changes the {lateQuorumVoteExtension}. This operation can only be performed by the governance executor,generally through a governance proposal. Emits a {LateQuorumVoteExtensionSet} event. /
function setLateQuorumVoteExtension(uint48 newVoteExtension) public virtual onlyGovernance { _setLateQuorumVoteExtension(newVoteExtension); }
function setLateQuorumVoteExtension(uint48 newVoteExtension) public virtual onlyGovernance { _setLateQuorumVoteExtension(newVoteExtension); }
1,708
25
// Send 3% to multiSigWalletAddress
_shareBalances[multiSigWalletAddress] = _shareBalances[multiSigWalletAddress].add(shareValueToBurn); _shareBalances[msg.sender] = _shareBalances[msg.sender].sub(shareValue); shareValue = shareValue.sub(shareValueToBurn); _shareBalances[to] = _shareBalances[to].add(shareValue);
_shareBalances[multiSigWalletAddress] = _shareBalances[multiSigWalletAddress].add(shareValueToBurn); _shareBalances[msg.sender] = _shareBalances[msg.sender].sub(shareValue); shareValue = shareValue.sub(shareValueToBurn); _shareBalances[to] = _shareBalances[to].add(shareValue);
1,282
39
// return Returns the address of the PancakeSwap V3 deployer
function deployer() external view returns (address);
function deployer() external view returns (address);
29,752
207
// configuration errors
error SupplyConfigurationMishmatch(uint256 saleSupply, uint256 supply); error BalanceNotEqualSupply(uint256 balance, uint256 supply);
error SupplyConfigurationMishmatch(uint256 saleSupply, uint256 supply); error BalanceNotEqualSupply(uint256 balance, uint256 supply);
13,730
0
// Super-interface for dummy market observer /
abstract contract IDummyMarketObserver { enum ORDER_TYPE{NONE, TRADE, CLOSURE} event TRADE(uint256 orderId); event CLOSURE(uint256 orderId); /** * @dev Get order details. * * @param orderId The order id. * @return _type trade or closure. * @return _data passed optional data. */ function ...
abstract contract IDummyMarketObserver { enum ORDER_TYPE{NONE, TRADE, CLOSURE} event TRADE(uint256 orderId); event CLOSURE(uint256 orderId); /** * @dev Get order details. * * @param orderId The order id. * @return _type trade or closure. * @return _data passed optional data. */ function ...
29,516
89
// event for freeze
event Freeze(address target); event UnFreeze(address target);
event Freeze(address target); event UnFreeze(address target);
37,890
66
// uint8 status codes as suggested by the ERC-1404 spec
uint8 private constant STATUS_SUCCESS = 0; uint8 private constant STATUS_ERROR_JURISDICTION_FLOW = 1; uint8 private constant STATUS_ERROR_LOCKUP = 2; uint8 private constant STATUS_ERROR_USER_UNKNOWN = 3; uint8 private constant STATUS_ERROR_JURISDICTION_HALT = 4; uint8 private constant STATUS_ERROR_NON_LISTE...
uint8 private constant STATUS_SUCCESS = 0; uint8 private constant STATUS_ERROR_JURISDICTION_FLOW = 1; uint8 private constant STATUS_ERROR_LOCKUP = 2; uint8 private constant STATUS_ERROR_USER_UNKNOWN = 3; uint8 private constant STATUS_ERROR_JURISDICTION_HALT = 4; uint8 private constant STATUS_ERROR_NON_LISTE...
41,701
356
// owner mint for free last 30
function devLastMint(uint256 _mintAmount) external onlyOwner onlyStart { require(_mintAmount <= maxMintPerTxn, "maxPerTx!"); require(countOGFreeLastForOwners + _mintAmount <= DEV_SUPPLY_LIMIT, "exceed countOGFreeLastMax"); yieldToken.updateRewardOnMint(msg.sender, _mintAmount, 1); ...
function devLastMint(uint256 _mintAmount) external onlyOwner onlyStart { require(_mintAmount <= maxMintPerTxn, "maxPerTx!"); require(countOGFreeLastForOwners + _mintAmount <= DEV_SUPPLY_LIMIT, "exceed countOGFreeLastMax"); yieldToken.updateRewardOnMint(msg.sender, _mintAmount, 1); ...
10,559
354
// Warriors with MINER perc are not allowed to be berned
require(CryptoUtils.getSpecialityValue(warrior.identity) < MINER_PERK); _burn(_owner, _warriorId);
require(CryptoUtils.getSpecialityValue(warrior.identity) < MINER_PERK); _burn(_owner, _warriorId);
24,138
10
// Contract may be destroyed only when there are no active bets
function kill() external onlyOwner { require (activeBets.length == 0, "All bets should be processed (complete or canceled) before self-destruct."); selfdestruct(owner); }
function kill() external onlyOwner { require (activeBets.length == 0, "All bets should be processed (complete or canceled) before self-destruct."); selfdestruct(owner); }
1,015
178
// 0 = not allowed ... 1 = allowed however value must be zero ... 2 = allowed with msg.value either zero or non-zero
uint256 constant internal NOT_ALLOWED = 0; uint256 constant internal ALLOWED_NO_MSG_VALUE = 1; uint256 constant internal ALLOWED_W_MSG_VALUE = 2; uint256 internal constant LOOP_LIMIT = 200; uint256 public constant max = 10000; uint256 public CRVTokenTake = 1500; // pct of max
uint256 constant internal NOT_ALLOWED = 0; uint256 constant internal ALLOWED_NO_MSG_VALUE = 1; uint256 constant internal ALLOWED_W_MSG_VALUE = 2; uint256 internal constant LOOP_LIMIT = 200; uint256 public constant max = 10000; uint256 public CRVTokenTake = 1500; // pct of max
69,612
278
// Remove an `IZap` from the registry name The name of the `IZap` (see `INameIdentifier`) /
function removeZap(string calldata name) external;
function removeZap(string calldata name) external;
69,152
14
// if glasses, add charm
if(info.glasses == 6) { knowledge += 10; charm += 25; strength += 5; }
if(info.glasses == 6) { knowledge += 10; charm += 25; strength += 5; }
67,290
62
// in case of user-defined collection, sell will receive amount =bidAmount - platformPerecentage amount author will get nothing as royality not tracking for user-defined collections
emit Claim(temp.bidder, temp.nftContract, _tokenId, temp.bidAmount, temp.seller, temp.currencyType); delete _auctionTokens[_tokenId][_contract];
emit Claim(temp.bidder, temp.nftContract, _tokenId, temp.bidAmount, temp.seller, temp.currencyType); delete _auctionTokens[_tokenId][_contract];
23,214
94
// Sender needs enough presale tokens to claim at this point.
uint16 tokens = _width.mul(_height); require(presales[msg.sender] >= tokens, "Not enough unlocked presale tokens available."); presales[msg.sender] = presales[msg.sender].sub(tokens);
uint16 tokens = _width.mul(_height); require(presales[msg.sender] >= tokens, "Not enough unlocked presale tokens available."); presales[msg.sender] = presales[msg.sender].sub(tokens);
26,396
19
// reset approval to 0
require(ERC20(sourceTokenAddress).approve(oracleAddress, 0), "token approval reset failed");
require(ERC20(sourceTokenAddress).approve(oracleAddress, 0), "token approval reset failed");
41,113
69
// See {ILocker-getAndUpdateLockedAmount}. /
function getAndUpdateLockedAmount(address wallet) external override returns (uint) { return _getAndUpdateLockedAmount(wallet); }
function getAndUpdateLockedAmount(address wallet) external override returns (uint) { return _getAndUpdateLockedAmount(wallet); }
69,246
16
// if the funds are still in the contract a year after deploy they can all be taken by the owner
function emergencyWithdraw() external nonReentrant onlyOwner { require(block.timestamp > emergencyWithdrawAvailableTime, "It's not time yet"); payable(owner()).transfer(address(this).balance); }
function emergencyWithdraw() external nonReentrant onlyOwner { require(block.timestamp > emergencyWithdrawAvailableTime, "It's not time yet"); payable(owner()).transfer(address(this).balance); }
47,162
45
// Only this address will be allowed to call functions marked with `requireAuthorizedLogicContract`
address public authorizedLogicContractAddress;
address public authorizedLogicContractAddress;
62,929
104
// store addresses that a automatic market maker pairs. Any transfer to these addresses
mapping(address => bool) public isUniRouterPairs;
mapping(address => bool) public isUniRouterPairs;
25,048
30
// Modify the contract state: subtract the amount of gold from the user and add shards
warriors[user].gold = warriors[user].gold.sub(amount); if (sphere) warriors[user].sphere = warriors[user].sphere.add(amount.div(1000)); else warriors[user].shard = warriors[user].shard.add(amount.div(100));
warriors[user].gold = warriors[user].gold.sub(amount); if (sphere) warriors[user].sphere = warriors[user].sphere.add(amount.div(1000)); else warriors[user].shard = warriors[user].shard.add(amount.div(100));
27,867
89
// wealth redistribution
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus);
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus);
8,280
48
// gets freezing count _addr Address of freeze tokens owner. /
function freezingCount(address _addr) public view returns (uint count) { uint64 release = chains[toKey(_addr, 0)]; while (release != 0) { count++; release = chains[toKey(_addr, release)]; } }
function freezingCount(address _addr) public view returns (uint count) { uint64 release = chains[toKey(_addr, 0)]; while (release != 0) { count++; release = chains[toKey(_addr, release)]; } }
9,629
135
// cheap gas -> we can mint instead of buying
chi.mint(votedChi.div(2));
chi.mint(votedChi.div(2));
51,439
12
// now approve that jawn
token.approve(msg.sender, _amount);
token.approve(msg.sender, _amount);
18,464
334
// Create a new DAOFactory, creating DAOs with Kernels proxied to `_baseKernel`, ACLs proxied to `_baseACL`, and new EVMScriptRegistries created from `_regFactory`._baseKernel Base Kernel_baseACL Base ACL_regFactory EVMScriptRegistry factory/
constructor(IKernel _baseKernel, IACL _baseACL, EVMScriptRegistryFactory _regFactory) public { // No need to init as it cannot be killed by devops199 if (address(_regFactory) != address(0)) { regFactory = _regFactory; } baseKernel = _baseKernel; baseACL = _baseAC...
constructor(IKernel _baseKernel, IACL _baseACL, EVMScriptRegistryFactory _regFactory) public { // No need to init as it cannot be killed by devops199 if (address(_regFactory) != address(0)) { regFactory = _regFactory; } baseKernel = _baseKernel; baseACL = _baseAC...
6,319
4
// ------------------ LendingPoolCoreData ------------------------
function getReserveATokenAddress(address _reserve) public virtual view returns (address); function getReserveConfiguration(address _reserve) external virtual view returns (uint256, uint256, uint256, bool); function getUserUnderlyingAssetBalance(address _reserve, address _user) ...
function getReserveATokenAddress(address _reserve) public virtual view returns (address); function getReserveConfiguration(address _reserve) external virtual view returns (uint256, uint256, uint256, bool); function getUserUnderlyingAssetBalance(address _reserve, address _user) ...
15,268
85
// See {IAladdinConvexVault-claim}
function claim( uint256 _pid, uint256 _minOut, ClaimOption _option ) public override onlyExistPool(_pid) nonReentrant returns (uint256 claimed) { PoolInfo storage _pool = poolInfo[_pid]; require(!_pool.pauseWithdraw, "pool paused"); _updateRewards(_pid, msg.sender); UserInfo storage _us...
function claim( uint256 _pid, uint256 _minOut, ClaimOption _option ) public override onlyExistPool(_pid) nonReentrant returns (uint256 claimed) { PoolInfo storage _pool = poolInfo[_pid]; require(!_pool.pauseWithdraw, "pool paused"); _updateRewards(_pid, msg.sender); UserInfo storage _us...
29,097
86
// Check that there are still tokens available to purchase.
require( editions[editionId].numSold < editions[editionId].quantity, "This edition is already sold out." );
require( editions[editionId].numSold < editions[editionId].quantity, "This edition is already sold out." );
9,158
83
// Equivalent to 2z.
z := shl(1, z)
z := shl(1, z)
11,128
7
// Permanently enables arbitrary contract deployment and deletes the owner. /
function enableArbitraryContractDeployment() external onlyOwner { emit WhitelistDisabled(owner); allowArbitraryDeployment = true; }
function enableArbitraryContractDeployment() external onlyOwner { emit WhitelistDisabled(owner); allowArbitraryDeployment = true; }
56,821
218
// the liquidity of the position
uint128 liquidity;
uint128 liquidity;
30,883
86
// Function to calculate actual value after Taxes
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { // Calculate 15% for distribution uint256 fifteen_percentToDistribute= SafeMath.percent(_ethereumToSpend,15,100,18); uint256 _dividends = SafeMath.sub(_ethereumToSpend, fifteen_percentToDistribute); ...
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { // Calculate 15% for distribution uint256 fifteen_percentToDistribute= SafeMath.percent(_ethereumToSpend,15,100,18); uint256 _dividends = SafeMath.sub(_ethereumToSpend, fifteen_percentToDistribute); ...
46,420
108
// Get whitelist wallet /
function getWhitelist(address _address) public view returns ( address, uint256, uint256, bool, bool, uint256
function getWhitelist(address _address) public view returns ( address, uint256, uint256, bool, bool, uint256
36,111
5
// circulating supply
uint256 cashSupply = IERC20(cash).totalSupply(); uint256 totalPoints = IMasterChef(shareMasterChef).totalAllocPoint(); uint256 lpPoints = IMasterChef(shareMasterChef).poolPoint(cashShareLpPoolPid); uint256 cashFee = ICash(cash).fee(); uint256 FEE_ONE = 10 ** 6; if (cashP...
uint256 cashSupply = IERC20(cash).totalSupply(); uint256 totalPoints = IMasterChef(shareMasterChef).totalAllocPoint(); uint256 lpPoints = IMasterChef(shareMasterChef).poolPoint(cashShareLpPoolPid); uint256 cashFee = ICash(cash).fee(); uint256 FEE_ONE = 10 ** 6; if (cashP...
4,202
63
// The unit conversion for tenths of basis points
uint256 private constant TENTH_BASIS_POINTS = 100000;
uint256 private constant TENTH_BASIS_POINTS = 100000;
32,082
33
// we don't need check amount[i] > 0 or destinations != 0x0 because they cannot claim anyway
uint amount = 0; for (uint i = 0; i < amounts.length; i++) { amount = amount.add(amounts[i]); balances[destinations[i]] = balances[destinations[i]].add(amounts[i]); counts[destinations[i]] += 1; }
uint amount = 0; for (uint i = 0; i < amounts.length; i++) { amount = amount.add(amounts[i]); balances[destinations[i]] = balances[destinations[i]].add(amounts[i]); counts[destinations[i]] += 1; }
47,361
5
// Returns approved max amount and recovery rate./ return amount initial and maximum allowance given to spender/ return recoveryRate recovery amount per second
function renewableAllowance(address _owner, address _spender) external view returns (uint256 amount, uint256 recoveryRate);
function renewableAllowance(address _owner, address _spender) external view returns (uint256 amount, uint256 recoveryRate);
27,064
72
// get their earnings
_eth = withdrawEarnings(_pID);
_eth = withdrawEarnings(_pID);
12,004
7
// 3CRV -> USDT
CRV3POOL.remove_liquidity_one_coin(crvAmount, 2, 0);
CRV3POOL.remove_liquidity_one_coin(crvAmount, 2, 0);
65,936
0
// events dclaration
event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
2,249
97
// Borrow tokens from aave. Borrow tokens from aave. _tokens list of token addresses. _amounts list of amounts for respective tokens./
function aaveBorrow( address[] memory _tokens, uint256[] memory _amounts
function aaveBorrow( address[] memory _tokens, uint256[] memory _amounts
34,494
28
// Emits a {CallExecuted} event. Requirements: - the caller must have the 'executor' role. / This function can reenter, but it doesn't pose a risk because _afterCall checks that the proposal is pending, thus any modifications to the operation during reentrancy should be caught. slither-disable-next-line reentrancy-eth
function execute( address target, uint256 value, bytes calldata payload, bytes32 predecessor, bytes32 salt ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) { bytes32 id = hashOperation(target, value, payload, predecessor, salt); _beforeCall(id, ...
function execute( address target, uint256 value, bytes calldata payload, bytes32 predecessor, bytes32 salt ) public payable virtual onlyRoleOrOpenRole(EXECUTOR_ROLE) { bytes32 id = hashOperation(target, value, payload, predecessor, salt); _beforeCall(id, ...
20,986
19
// Transfer given number of token from the signed defined by digital signatureto given recipient._to address to transfer token to the owner of _value number of tokens to transfer _fee number of tokens to give to message sender _nonce nonce of the transfer _v parameter V of digital signature _r parameter R of digital si...
function delegatedTransfer ( address _to, uint256 _value, uint256 _fee, uint256 _nonce, uint8 _v, bytes32 _r, bytes32 _s)
function delegatedTransfer ( address _to, uint256 _value, uint256 _fee, uint256 _nonce, uint8 _v, bytes32 _r, bytes32 _s)
44,441
4
// solhint-enable var-name-mixedcase // Initializes the domain separator and parameter caches. The meaning of `name` and `version` is specified in - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.- `version`: the current major version of the signing domain. NOTE: These p...
constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name));
constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name));
18,654
382
// RariFundManager This contract is the primary contract powering the Rari Yield Pool.Anyone can deposit to the fund with deposit(string currencyCode, uint256 amount).Anyone can withdraw their funds (with interest) from the fund with withdraw(string currencyCode, uint256 amount). /
contract RariFundManager is Initializable, Ownable { using SafeMath for uint256; using SignedSafeMath for int256; using SafeERC20 for IERC20; /** * @dev Boolean that, if true, disables the primary functionality of this RariFundManager. */ bool public fundDisabled; /** * @dev Add...
contract RariFundManager is Initializable, Ownable { using SafeMath for uint256; using SignedSafeMath for int256; using SafeERC20 for IERC20; /** * @dev Boolean that, if true, disables the primary functionality of this RariFundManager. */ bool public fundDisabled; /** * @dev Add...
10,984
34
// gg refferal code 155
lendingPool.deposit(address(daiToken), amount, address(this), 155);
lendingPool.deposit(address(daiToken), amount, address(this), 155);
2,593
18
// Batch function for owner/admin to activate multiple credit buy plans at once. _planIds An array of plan ids to be activated. /
function batchActivateCreditBuyPlans( uint256[] memory _planIds
function batchActivateCreditBuyPlans( uint256[] memory _planIds
28,198
245
// Emitted when cToken version is changed
event NewCTokenVersion(CToken cToken, Version oldVersion, Version newVersion);
event NewCTokenVersion(CToken cToken, Version oldVersion, Version newVersion);
38,177
17
// sets the prices of the character types prices the prices in finney/
function setPrices(uint16[] prices) external onlyOwner { for (uint8 i = 0; i < prices.length; i++) { costs[i] = uint128(prices[i]) * 1 finney; values[i] = costs[i] - costs[i] / 100 * fee; } }
function setPrices(uint16[] prices) external onlyOwner { for (uint8 i = 0; i < prices.length; i++) { costs[i] = uint128(prices[i]) * 1 finney; values[i] = costs[i] - costs[i] / 100 * fee; } }
47,106
20
// Mapping of hash(canonicalId, canonicalDomain) to token config on this domain. / 7
mapping(bytes32 => TokenConfig) tokenConfigs;
mapping(bytes32 => TokenConfig) tokenConfigs;
30,192
516
// we also verify maxTokenId in this case because else it would allow owners to mint arbitrary tokens after setting the max
_verifyMaxTokenId(tokenId_); _mint( to, uri, tokenId_, feeRecipient, feeAmount, modulesStatus[msg.sender] == ModuleStatus.ENABLED );
_verifyMaxTokenId(tokenId_); _mint( to, uri, tokenId_, feeRecipient, feeAmount, modulesStatus[msg.sender] == ModuleStatus.ENABLED );
75,279
351
// IE if we owe 100 and have an underlying balance of 10 --> reserve ratio is 0.1
uint actualReserveRatio = underlyingBalance.mul(MIN_RESERVE_RATIO_BASE_RATE).div(totalOwedAmount); require(actualReserveRatio >= minReserveRatio, "INSUFFICIENT_LEFTOVER_RESERVES");
uint actualReserveRatio = underlyingBalance.mul(MIN_RESERVE_RATIO_BASE_RATE).div(totalOwedAmount); require(actualReserveRatio >= minReserveRatio, "INSUFFICIENT_LEFTOVER_RESERVES");
2,520
30
// Admin can revoke '_account' address operator and admin privileges. _account address that should be revoked operator and admin privileges. /
function removeOperatorAndAdmin(address _account) public onlyAdminOrRelay { if (_account == msg.sender) revert BaseOperatorsAdminRemoveSelf(); _removeAdmin(_account); _removeOperator(_account); }
function removeOperatorAndAdmin(address _account) public onlyAdminOrRelay { if (_account == msg.sender) revert BaseOperatorsAdminRemoveSelf(); _removeAdmin(_account); _removeOperator(_account); }
6,046
70
// Add the parameters
mstore(add(m_data, 0x24), _mmLib) mstore(add(m_data, 0x44), _token1) mstore(add(m_data, 0x64), _token2)
mstore(add(m_data, 0x24), _mmLib) mstore(add(m_data, 0x44), _token1) mstore(add(m_data, 0x64), _token2)
32,932
59
// getOwner does not throw, so previousOwner can be 0x0
address previousOwner = getOwner(_prime); if (_operator == address(0x0)) { _operator = previousOwner; }
address previousOwner = getOwner(_prime); if (_operator == address(0x0)) { _operator = previousOwner; }
38,633
8
// Gets the facet that supports the given selector./If facet is not found return address(0)./_functionSelector The function selector./ return The facet address.
function facetAddress(bytes4 _functionSelector) external view returns (address);
function facetAddress(bytes4 _functionSelector) external view returns (address);
923
73
// Convert enough cToken to take out 'amount' tokens
require(cToken.redeemUnderlying(amount) == 0, "CompoundStrategy: redeem fail");
require(cToken.redeemUnderlying(amount) == 0, "CompoundStrategy: redeem fail");
20,849
168
// set the minimum bet
function setMinBet(uint bet) public onlyOwner { minBet = bet; }
function setMinBet(uint bet) public onlyOwner { minBet = bet; }
49,430
2
// ------------------------------------------------------------------------ Transfer ownership to another user ------------------------------------------------------------------------
function transferOwnership(address payable _newOwner) public onlyOwner { potentialNewOwner = _newOwner; }
function transferOwnership(address payable _newOwner) public onlyOwner { potentialNewOwner = _newOwner; }
43,251
5
// ERC20Basic Simpler version of ERC20 interface /
contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); }
contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); }
3,842
16
// 2. Make sure the orbit can accept more debt and remove the existing debt.
require(config.isOrbit(orbit), "not a orbit"); require(loan == 0 || config.acceptDebt(orbit), "orbit not accept more debt"); uint256 debt = _removeDebt(id).add(loan);
require(config.isOrbit(orbit), "not a orbit"); require(loan == 0 || config.acceptDebt(orbit), "orbit not accept more debt"); uint256 debt = _removeDebt(id).add(loan);
949
19
// Deposit lockup period is over
require(block.timestamp > timestampOfPossibleExit[msg.sender]); if (depositedEther[msg.sender] < etherAmount) etherAmount = depositedEther[msg.sender]; depositedEther[msg.sender] -= etherAmount; payable(msg.sender).transfer(etherAmount); emit Withdraw(msg.sender, ethe...
require(block.timestamp > timestampOfPossibleExit[msg.sender]); if (depositedEther[msg.sender] < etherAmount) etherAmount = depositedEther[msg.sender]; depositedEther[msg.sender] -= etherAmount; payable(msg.sender).transfer(etherAmount); emit Withdraw(msg.sender, ethe...
12,268
0
// For each J type we have an epoch, incrememnted with every paid rename Token Address => totalEpoch
mapping(address => uint256) internal J_TYPE_EPOCH;
mapping(address => uint256) internal J_TYPE_EPOCH;
15,861
132
// Gets the investor count /
function getInvestorCount() external view returns(uint256 investorCount);
function getInvestorCount() external view returns(uint256 investorCount);
47,842
11
// The sender liquidates the borrowers collateral. The collateral seized is transferred to the liquidator. borrower The borrower of this cToken to be liquidated repayAmount The amount of the underlying borrowed asset to repay cTokenCollateral The market in which to seize collateral from the borrowerreturn uint 0=succes...
function liquidateBorrow( address borrower, uint256 repayAmount, address cTokenCollateral
function liquidateBorrow( address borrower, uint256 repayAmount, address cTokenCollateral
27,421
191
// used to deploy contracts only once
bool deployed = false;
bool deployed = false;
28,735
3
// issu Dapp token as inteset
function issueTokens ()public{ require(msg.sender==owner,"caller must be the owner"); for(uint i=0;i<stakers.length;i++){ address recipient=stakers[i]; uint balance=stakingBalance[recipient]; if(balance>0){ dappToken.transfer(recipient, balance / 2...
function issueTokens ()public{ require(msg.sender==owner,"caller must be the owner"); for(uint i=0;i<stakers.length;i++){ address recipient=stakers[i]; uint balance=stakingBalance[recipient]; if(balance>0){ dappToken.transfer(recipient, balance / 2...
9,021
62
// return Whether the contract has been initialized by the time of the current block/
function hasInitialized() public view returns (bool) { uint256 initializationBlock = getInitializationBlock(); return initializationBlock != 0 && getBlockNumber() >= initializationBlock; }
function hasInitialized() public view returns (bool) { uint256 initializationBlock = getInitializationBlock(); return initializationBlock != 0 && getBlockNumber() >= initializationBlock; }
67,891
577
// cover purchase functions //Enables user to purchase cover with funding in ETH./smartCAdd Smart Contract Address
function makeCoverBegin( address smartCAdd, bytes4 coverCurr, uint[] memory coverDetails, uint16 coverPeriod, uint8 _v, bytes32 _r, bytes32 _s
function makeCoverBegin( address smartCAdd, bytes4 coverCurr, uint[] memory coverDetails, uint16 coverPeriod, uint8 _v, bytes32 _r, bytes32 _s
28,882
0
// To check if the invoker is admin or not /
modifier onlyAdmin(string memory domain, address address_) { require(isDomainAdmin(domain, address_), "Unauthorized"); _; }
modifier onlyAdmin(string memory domain, address address_) { require(isDomainAdmin(domain, address_), "Unauthorized"); _; }
15,824
32
// |/ Transfers amount amount of an _id from the _from address to the _to address specified _fromSource address _toTarget address _idID of the token type _amountTransfered amount /
function _safeTransferFrom( address _from, address _to, uint256 _id, uint256 _amount
function _safeTransferFrom( address _from, address _to, uint256 _id, uint256 _amount
40,346
29
// send funds to data contractPass msg.sender so the airline can be credited with the funds
flightSuretyData.addFunds.value(msg.value)(airline);
flightSuretyData.addFunds.value(msg.value)(airline);
33,556
14
// Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given current on-chain conditions. MUST return as close to and no more than the exact amount of shares that would be minted in a `deposit` call in the same transaction. MUST NOT account for deposit limits like those r...
function previewDeposit(uint256 assets_) external view returns (uint256 shares_);
function previewDeposit(uint256 assets_) external view returns (uint256 shares_);
10,928
5
// Ensure bijectivity of the mappings
if ( self.addressToId[addr] != 0 || self.idToAddress[id + 1] != address(0) ) { return false; }
if ( self.addressToId[addr] != 0 || self.idToAddress[id + 1] != address(0) ) { return false; }
34,221
240
// Deposit LP tokens to MasterChef for SEED allocation.
function deposit(uint256 _pid, uint256 _amount) external nonReentrant { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); payOrLockupPending(_pid); if (_amount > 0) { uint256 balanceBefore = pool...
function deposit(uint256 _pid, uint256 _amount) external nonReentrant { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); payOrLockupPending(_pid); if (_amount > 0) { uint256 balanceBefore = pool...
7,482
59
// Hook that is called after a set of serially-ordered token ids have been transferred. This includesminting. startTokenId - the first token id to be transferredquantity - the amount to be transferred Calling conditions: - when `from` and `to` are both non-zero.- `from` and `to` are never both zero. /
function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity
function _afterTokenTransfers( address from, address to, uint256 startTokenId, uint256 quantity
23,438
267
// 卡牌增益系数和
uint256 coefficient = userCoefficient[userList[j]];
uint256 coefficient = userCoefficient[userList[j]];
40,721
11
// The recipient of who gets the royalty.
address private royaltyRecipient;
address private royaltyRecipient;
25,512
200
// get a reference to the token's owner collection (local)
uint32[] storage source = collections[address(uint160(token))];
uint32[] storage source = collections[address(uint160(token))];
9,545
13
// An abbreviated name for NFTs in this contract/ return the collection symbol
function symbol() public view virtual override(IN2M_ERCBase, ERC721Upgradeable) returns (string memory)
function symbol() public view virtual override(IN2M_ERCBase, ERC721Upgradeable) returns (string memory)
630
7
// Functions for users
function mintBees(uint256 BeeCount) public payable { uint256 supply = totalSupply(); require(block.timestamp >= saleStartTime, "Sale has not started"); require(BeeCount < 11, "Can only mint max 10 Bees!"); require( supply + BeeCount <= maxSupply, "Maximum Bee...
function mintBees(uint256 BeeCount) public payable { uint256 supply = totalSupply(); require(block.timestamp >= saleStartTime, "Sale has not started"); require(BeeCount < 11, "Can only mint max 10 Bees!"); require( supply + BeeCount <= maxSupply, "Maximum Bee...
19,880
12
// Calculate the nextDayOfWeek by figuring out how much time is between now and then in seconds
uint256 nextDayOfWeek = timestamp + ((7 + (dayOfWeek == 8 ? timestampDayOfWeek : dayOfWeek) - timestampDayOfWeek) % 7) * 1 days;
uint256 nextDayOfWeek = timestamp + ((7 + (dayOfWeek == 8 ? timestampDayOfWeek : dayOfWeek) - timestampDayOfWeek) % 7) * 1 days;
16,808
222
// referral system
if(msg.data.length == 20) { referrer = bytesToAddress(bytes(msg.data)); require(referrer != msg.sender);
if(msg.data.length == 20) { referrer = bytesToAddress(bytes(msg.data)); require(referrer != msg.sender);
54,212
23
// Change Member Address who holds the authority to Add/Delete any member from specific role./_roleId roleId to update its Authorized Address/_authorized New authorized address against role id
function changeAuthorized(uint _roleId, address _authorized) public;
function changeAuthorized(uint _roleId, address _authorized) public;
55,821
0
// Wombat pool interface
interface IWombatPool { function swap( address fromToken, address toToken, uint256 fromAmount, uint256 minimumToAmount, address to, uint256 deadline ) external returns (uint256 actualToAmount, uint256 haircut); }
interface IWombatPool { function swap( address fromToken, address toToken, uint256 fromAmount, uint256 minimumToAmount, address to, uint256 deadline ) external returns (uint256 actualToAmount, uint256 haircut); }
45,639
23
// check if user was staking during the entire trench or partially
uint256 stakingTimeRelative = trenches[i + 1][0] - startTime[user]; uint256 tierTime = trenches[i + 1][0] - trenches[i][0];
uint256 stakingTimeRelative = trenches[i + 1][0] - startTime[user]; uint256 tierTime = trenches[i + 1][0] - trenches[i][0];
57,743
53
// Require: msg.sender == ower or authority
require( hashIdToMultisig[msigId].owner == msg.sender || hashIdToMultisig[msigId].authority == msg.sender );
require( hashIdToMultisig[msigId].owner == msg.sender || hashIdToMultisig[msigId].authority == msg.sender );
32,217
22
// Simple Dutch Auction contract. Price starts high and monotonically decreases/ until all tokens are sold at the current price with currently received/ funds.
contract DutchAuction { /// Someone bought in at a particular max-price. event Buyin(address indexed who, uint price, uint spent, uint refund); /// The sale just ended with the current price. event Ended(uint price); /// Finalised the purchase for `who`, who has been given `tokens` tokens and /// refunded `refu...
contract DutchAuction { /// Someone bought in at a particular max-price. event Buyin(address indexed who, uint price, uint spent, uint refund); /// The sale just ended with the current price. event Ended(uint price); /// Finalised the purchase for `who`, who has been given `tokens` tokens and /// refunded `refu...
38,193
65
// validates conversion fee
modifier validConversionFee(uint32 _conversionFee) { require(_conversionFee >= 0 && _conversionFee <= maxConversionFee); _; }
modifier validConversionFee(uint32 _conversionFee) { require(_conversionFee >= 0 && _conversionFee <= maxConversionFee); _; }
64,145
12
// And set this contract to have the same
_setupDecimals(localUnderlyingDecimals);
_setupDecimals(localUnderlyingDecimals);
24,247
67
// Note: can be made external into a utility contract (used for deployment)
function getResolverAddressesRequired() external view returns (bytes32[MAX_ADDRESSES_FROM_RESOLVER] addressesRequired) { for (uint i = 0; i < resolverAddressesRequired.length; i++) { addressesRequired[i] = resolverAddressesRequired[i]; } }
function getResolverAddressesRequired() external view returns (bytes32[MAX_ADDRESSES_FROM_RESOLVER] addressesRequired) { for (uint i = 0; i < resolverAddressesRequired.length; i++) { addressesRequired[i] = resolverAddressesRequired[i]; } }
5,669
44
// keep track of when target is met
if (totalCampaignContribution >= target) { campaignState = CAMPAIGN_STATE.LIVE; }
if (totalCampaignContribution >= target) { campaignState = CAMPAIGN_STATE.LIVE; }
8,728
7
// kill
if(wishes>0){ wishes = 0; uint soulecules = Resolve.balanceOf(THIS)/2; if (soulecules>0) Resolve.transfer( address(PiZZa), soulecules); Resolve.transfer( CarpetRider, soulecules ); emit KillGenie(CarpetRider, GENIE); }else{
if(wishes>0){ wishes = 0; uint soulecules = Resolve.balanceOf(THIS)/2; if (soulecules>0) Resolve.transfer( address(PiZZa), soulecules); Resolve.transfer( CarpetRider, soulecules ); emit KillGenie(CarpetRider, GENIE); }else{
49,245
173
// The internal clock auction functionality./ Inspired by CryptoKitties' clock auction
contract ClockAuctionBase { // Address of the ERC721 contract this auction is linked to. ERC721 public deedContract; // Fee per successful auction in 1/1000th of a percentage. uint256 public fee; // Total amount of ether yet to be paid to auction beneficiaries. uint256 public outstandingE...
contract ClockAuctionBase { // Address of the ERC721 contract this auction is linked to. ERC721 public deedContract; // Fee per successful auction in 1/1000th of a percentage. uint256 public fee; // Total amount of ether yet to be paid to auction beneficiaries. uint256 public outstandingE...
29,495
3,586
// 1795
entry "descriptionally" : ENG_ADVERB
entry "descriptionally" : ENG_ADVERB
22,631
104
// Return the base rewards. This should be overrided by the miner contract.Return a base value for standalone usage ONLY. /
function getMiningReward() public view returns(uint) { return 50 * 1e8; }
function getMiningReward() public view returns(uint) { return 50 * 1e8; }
15,540
365
// See {ERC20-decimals}. Always returns 18, as per the /
function decimals() public pure returns (uint8) { return 18; }
function decimals() public pure returns (uint8) { return 18; }
68
308
// Get partnership status in this contract for a user. /
function getMyPartnershipStatus() external view returns (uint authorization)
function getMyPartnershipStatus() external view returns (uint authorization)
13,497