comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"SS: Stake owner does not match"
pragma solidity ^0.8.10; // Staking 0x8888888AC6aa2482265e5346832CDd963c70A0D1 // Bridge 0xEf038429e3BAaF784e1DE93075070df2A43D4278 // BotDetection 0x3C758A487A9c536882aEeAc341c62cb0F665ecf5 // Token 0xdef1fac7Bf08f173D286BbBDcBeeADe695129840 // OldStaking 0xDef1Fafc79CD01Cf6797B9d7F51411beF486262a struct StartStake { uint stakedAmount; uint lockedForXDays; } struct Settings { uint MINIMUM_DAYS_FOR_HIGH_PENALTY; uint CONTROLLED_APY; uint SMALLER_PAYS_BETTER_BONUS; uint LONGER_PAYS_BETTER_BONUS; uint END_STAKE_FROM; uint END_STAKE_TO; uint MINIMUM_STAKE_DAYS; uint MAXIMUM_STAKE_DAYS; } contract CerbyStakingSystem is AccessControlEnumerable { DailySnapshot[] public dailySnapshots; uint[] public cachedInterestPerShare; Stake[] public stakes; Settings public settings; uint constant CERBY_BOT_DETECTION_CONTRACT_ID = 3; uint constant MINIMUM_SMALLER_PAYS_BETTER = 1000 * 1e18; // 1k CERBY uint constant MAXIMUM_SMALLER_PAYS_BETTER = 1000000 * 1e18; // 1M CERBY uint constant CACHED_DAYS_INTEREST = 100; uint constant DAYS_IN_ONE_YEAR = 365; uint constant SHARE_PRICE_DENORM = 1e18; uint constant INTEREST_PER_SHARE_DENORM = 1e18; uint constant APY_DENORM = 1e6; uint constant SECONDS_IN_ONE_DAY = 86400; ICerbyTokenMinterBurner cerbyToken = ICerbyTokenMinterBurner( 0xdef1fac7Bf08f173D286BbBDcBeeADe695129840 ); address constant BURN_WALLET = address(0x0); uint public launchTimestamp; event StakeStarted( uint stakeId, address owner, uint stakedAmount, uint startDay, uint lockedForXDays, uint sharesCount ); event StakeEnded( uint stakeId, uint endDay, uint interest, uint penalty ); event StakeOwnerChanged( uint stakeId, address newOwner ); event StakeUpdated( uint stakeId, uint lockedForXDays, uint sharesCount ); event DailySnapshotSealed( uint sealedDay, uint inflationAmount, uint totalShares, uint sharePrice, uint totalStaked, uint totalSupply ); event CachedInterestPerShareSealed( uint sealedDay, uint sealedCachedDay, uint cachedInterestPerShare ); event SettingsUpdated( Settings Settings ); event NewMaxSharePriceReached( uint newSharePrice ); event BurnedAndAddedToStakersInflation( address fromAddr, uint amountToBurn, uint currentDay ); constructor() { } modifier executeCronJobs() { } modifier onlyRealUsers { } modifier onlyStakeOwners(uint stakeId) { } modifier onlyExistingStake(uint stakeId) { } modifier onlyActiveStake(uint stakeId) { } function adminUpdateSettings(Settings calldata _settings) public onlyRole(ROLE_ADMIN) { } function adminBulkTransferOwnership(uint[] calldata stakeIds, address oldOwner, address newOwner) public executeCronJobs onlyRole(ROLE_ADMIN) { for(uint i = 0; i<stakeIds.length; i++) { require( stakes[stakeIds[i]].owner != newOwner, "SS: New owner must be different from old owner" ); require(<FILL_ME>) _transferOwnership(stakeIds[i], newOwner); } } function adminBulkDestroyStakes(uint[] calldata stakeIds, address stakeOwner) public executeCronJobs onlyRole(ROLE_ADMIN) { } function adminMigrateInitialSnapshots(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminMigrateInitialStakes(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminMigrateInitialInterestPerShare(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminBurnAndAddToStakersInflation(address fromAddr, uint amountToBurn) public executeCronJobs onlyRole(ROLE_ADMIN) { } function bulkTransferOwnership(uint[] calldata stakeIds, address newOwner) public onlyRealUsers executeCronJobs { } function transferOwnership(uint stakeId, address newOwner) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function _transferOwnership(uint stakeId, address newOwner) private { } function updateAllSnapshots() public { } function updateSnapshots(uint givenDay) public { } function bulkStartStake(StartStake[] calldata startStakes) public onlyRealUsers executeCronJobs { } function startStake(StartStake memory _startStake) private returns(uint stakeId) { } function bulkEndStake(uint[] calldata stakeIds) public onlyRealUsers executeCronJobs { } function endStake( uint stakeId ) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function bulkScrapeStake(uint[] calldata stakeIds) public onlyRealUsers executeCronJobs { } function scrapeStake( uint stakeId ) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function getTotalTokensStaked() public view returns(uint) { } function getDailySnapshotsLength() public view returns(uint) { } function getCachedInterestPerShareLength() public view returns(uint) { } function getStakesLength() public view returns(uint) { } function getInterestById(uint stakeId, uint givenDay) public view returns (uint) { } function getInterestByStake(Stake memory stake, uint givenDay) public view returns (uint) { } function getPenaltyById(uint stakeId, uint givenDay, uint interest) public view returns (uint) { } function getPenaltyByStake(Stake memory stake, uint givenDay, uint interest) public view returns (uint) { } function getSharesCountById(uint stakeId, uint givenDay) public view returns(uint) { } function getSharesCountByStake(Stake memory stake, uint givenDay) public view returns (uint) { } function getCurrentDaySinceLaunch() public view returns (uint) { } function getCurrentCachedPerShareDay() public view returns (uint) { } function minOfTwoUints(uint uint1, uint uint2) private pure returns(uint) { } }
stakes[stakeIds[i]].owner==oldOwner,"SS: Stake owner does not match"
25,424
stakes[stakeIds[i]].owner==oldOwner
"SS: Stake owner does not match"
pragma solidity ^0.8.10; // Staking 0x8888888AC6aa2482265e5346832CDd963c70A0D1 // Bridge 0xEf038429e3BAaF784e1DE93075070df2A43D4278 // BotDetection 0x3C758A487A9c536882aEeAc341c62cb0F665ecf5 // Token 0xdef1fac7Bf08f173D286BbBDcBeeADe695129840 // OldStaking 0xDef1Fafc79CD01Cf6797B9d7F51411beF486262a struct StartStake { uint stakedAmount; uint lockedForXDays; } struct Settings { uint MINIMUM_DAYS_FOR_HIGH_PENALTY; uint CONTROLLED_APY; uint SMALLER_PAYS_BETTER_BONUS; uint LONGER_PAYS_BETTER_BONUS; uint END_STAKE_FROM; uint END_STAKE_TO; uint MINIMUM_STAKE_DAYS; uint MAXIMUM_STAKE_DAYS; } contract CerbyStakingSystem is AccessControlEnumerable { DailySnapshot[] public dailySnapshots; uint[] public cachedInterestPerShare; Stake[] public stakes; Settings public settings; uint constant CERBY_BOT_DETECTION_CONTRACT_ID = 3; uint constant MINIMUM_SMALLER_PAYS_BETTER = 1000 * 1e18; // 1k CERBY uint constant MAXIMUM_SMALLER_PAYS_BETTER = 1000000 * 1e18; // 1M CERBY uint constant CACHED_DAYS_INTEREST = 100; uint constant DAYS_IN_ONE_YEAR = 365; uint constant SHARE_PRICE_DENORM = 1e18; uint constant INTEREST_PER_SHARE_DENORM = 1e18; uint constant APY_DENORM = 1e6; uint constant SECONDS_IN_ONE_DAY = 86400; ICerbyTokenMinterBurner cerbyToken = ICerbyTokenMinterBurner( 0xdef1fac7Bf08f173D286BbBDcBeeADe695129840 ); address constant BURN_WALLET = address(0x0); uint public launchTimestamp; event StakeStarted( uint stakeId, address owner, uint stakedAmount, uint startDay, uint lockedForXDays, uint sharesCount ); event StakeEnded( uint stakeId, uint endDay, uint interest, uint penalty ); event StakeOwnerChanged( uint stakeId, address newOwner ); event StakeUpdated( uint stakeId, uint lockedForXDays, uint sharesCount ); event DailySnapshotSealed( uint sealedDay, uint inflationAmount, uint totalShares, uint sharePrice, uint totalStaked, uint totalSupply ); event CachedInterestPerShareSealed( uint sealedDay, uint sealedCachedDay, uint cachedInterestPerShare ); event SettingsUpdated( Settings Settings ); event NewMaxSharePriceReached( uint newSharePrice ); event BurnedAndAddedToStakersInflation( address fromAddr, uint amountToBurn, uint currentDay ); constructor() { } modifier executeCronJobs() { } modifier onlyRealUsers { } modifier onlyStakeOwners(uint stakeId) { } modifier onlyExistingStake(uint stakeId) { } modifier onlyActiveStake(uint stakeId) { } function adminUpdateSettings(Settings calldata _settings) public onlyRole(ROLE_ADMIN) { } function adminBulkTransferOwnership(uint[] calldata stakeIds, address oldOwner, address newOwner) public executeCronJobs onlyRole(ROLE_ADMIN) { } function adminBulkDestroyStakes(uint[] calldata stakeIds, address stakeOwner) public executeCronJobs onlyRole(ROLE_ADMIN) { uint today = getCurrentDaySinceLaunch(); for(uint i = 0; i<stakeIds.length; i++) { require(<FILL_ME>) dailySnapshots[today].totalShares -= stakes[stakeIds[i]].maxSharesCountOnStartStake; stakes[stakeIds[i]].endDay = today; stakes[stakeIds[i]].owner = BURN_WALLET; cerbyToken.burnHumanAddress(address(this), stakes[stakeIds[i]].stakedAmount); emit StakeOwnerChanged(stakeIds[i], BURN_WALLET); emit StakeEnded(stakeIds[i], today, 0, 0); } } function adminMigrateInitialSnapshots(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminMigrateInitialStakes(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminMigrateInitialInterestPerShare(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminBurnAndAddToStakersInflation(address fromAddr, uint amountToBurn) public executeCronJobs onlyRole(ROLE_ADMIN) { } function bulkTransferOwnership(uint[] calldata stakeIds, address newOwner) public onlyRealUsers executeCronJobs { } function transferOwnership(uint stakeId, address newOwner) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function _transferOwnership(uint stakeId, address newOwner) private { } function updateAllSnapshots() public { } function updateSnapshots(uint givenDay) public { } function bulkStartStake(StartStake[] calldata startStakes) public onlyRealUsers executeCronJobs { } function startStake(StartStake memory _startStake) private returns(uint stakeId) { } function bulkEndStake(uint[] calldata stakeIds) public onlyRealUsers executeCronJobs { } function endStake( uint stakeId ) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function bulkScrapeStake(uint[] calldata stakeIds) public onlyRealUsers executeCronJobs { } function scrapeStake( uint stakeId ) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function getTotalTokensStaked() public view returns(uint) { } function getDailySnapshotsLength() public view returns(uint) { } function getCachedInterestPerShareLength() public view returns(uint) { } function getStakesLength() public view returns(uint) { } function getInterestById(uint stakeId, uint givenDay) public view returns (uint) { } function getInterestByStake(Stake memory stake, uint givenDay) public view returns (uint) { } function getPenaltyById(uint stakeId, uint givenDay, uint interest) public view returns (uint) { } function getPenaltyByStake(Stake memory stake, uint givenDay, uint interest) public view returns (uint) { } function getSharesCountById(uint stakeId, uint givenDay) public view returns(uint) { } function getSharesCountByStake(Stake memory stake, uint givenDay) public view returns (uint) { } function getCurrentDaySinceLaunch() public view returns (uint) { } function getCurrentCachedPerShareDay() public view returns (uint) { } function minOfTwoUints(uint uint1, uint uint2) private pure returns(uint) { } }
stakes[stakeIds[i]].owner==stakeOwner,"SS: Stake owner does not match"
25,424
stakes[stakeIds[i]].owner==stakeOwner
"SS: New owner must be different from old owner"
pragma solidity ^0.8.10; // Staking 0x8888888AC6aa2482265e5346832CDd963c70A0D1 // Bridge 0xEf038429e3BAaF784e1DE93075070df2A43D4278 // BotDetection 0x3C758A487A9c536882aEeAc341c62cb0F665ecf5 // Token 0xdef1fac7Bf08f173D286BbBDcBeeADe695129840 // OldStaking 0xDef1Fafc79CD01Cf6797B9d7F51411beF486262a struct StartStake { uint stakedAmount; uint lockedForXDays; } struct Settings { uint MINIMUM_DAYS_FOR_HIGH_PENALTY; uint CONTROLLED_APY; uint SMALLER_PAYS_BETTER_BONUS; uint LONGER_PAYS_BETTER_BONUS; uint END_STAKE_FROM; uint END_STAKE_TO; uint MINIMUM_STAKE_DAYS; uint MAXIMUM_STAKE_DAYS; } contract CerbyStakingSystem is AccessControlEnumerable { DailySnapshot[] public dailySnapshots; uint[] public cachedInterestPerShare; Stake[] public stakes; Settings public settings; uint constant CERBY_BOT_DETECTION_CONTRACT_ID = 3; uint constant MINIMUM_SMALLER_PAYS_BETTER = 1000 * 1e18; // 1k CERBY uint constant MAXIMUM_SMALLER_PAYS_BETTER = 1000000 * 1e18; // 1M CERBY uint constant CACHED_DAYS_INTEREST = 100; uint constant DAYS_IN_ONE_YEAR = 365; uint constant SHARE_PRICE_DENORM = 1e18; uint constant INTEREST_PER_SHARE_DENORM = 1e18; uint constant APY_DENORM = 1e6; uint constant SECONDS_IN_ONE_DAY = 86400; ICerbyTokenMinterBurner cerbyToken = ICerbyTokenMinterBurner( 0xdef1fac7Bf08f173D286BbBDcBeeADe695129840 ); address constant BURN_WALLET = address(0x0); uint public launchTimestamp; event StakeStarted( uint stakeId, address owner, uint stakedAmount, uint startDay, uint lockedForXDays, uint sharesCount ); event StakeEnded( uint stakeId, uint endDay, uint interest, uint penalty ); event StakeOwnerChanged( uint stakeId, address newOwner ); event StakeUpdated( uint stakeId, uint lockedForXDays, uint sharesCount ); event DailySnapshotSealed( uint sealedDay, uint inflationAmount, uint totalShares, uint sharePrice, uint totalStaked, uint totalSupply ); event CachedInterestPerShareSealed( uint sealedDay, uint sealedCachedDay, uint cachedInterestPerShare ); event SettingsUpdated( Settings Settings ); event NewMaxSharePriceReached( uint newSharePrice ); event BurnedAndAddedToStakersInflation( address fromAddr, uint amountToBurn, uint currentDay ); constructor() { } modifier executeCronJobs() { } modifier onlyRealUsers { } modifier onlyStakeOwners(uint stakeId) { } modifier onlyExistingStake(uint stakeId) { } modifier onlyActiveStake(uint stakeId) { } function adminUpdateSettings(Settings calldata _settings) public onlyRole(ROLE_ADMIN) { } function adminBulkTransferOwnership(uint[] calldata stakeIds, address oldOwner, address newOwner) public executeCronJobs onlyRole(ROLE_ADMIN) { } function adminBulkDestroyStakes(uint[] calldata stakeIds, address stakeOwner) public executeCronJobs onlyRole(ROLE_ADMIN) { } function adminMigrateInitialSnapshots(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminMigrateInitialStakes(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminMigrateInitialInterestPerShare(address fromStakingContract, uint fromIndex, uint toIndex) public onlyRole(ROLE_ADMIN) { } function adminBurnAndAddToStakersInflation(address fromAddr, uint amountToBurn) public executeCronJobs onlyRole(ROLE_ADMIN) { } function bulkTransferOwnership(uint[] calldata stakeIds, address newOwner) public onlyRealUsers executeCronJobs { } function transferOwnership(uint stakeId, address newOwner) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { require(<FILL_ME>) _transferOwnership(stakeId, newOwner); } function _transferOwnership(uint stakeId, address newOwner) private { } function updateAllSnapshots() public { } function updateSnapshots(uint givenDay) public { } function bulkStartStake(StartStake[] calldata startStakes) public onlyRealUsers executeCronJobs { } function startStake(StartStake memory _startStake) private returns(uint stakeId) { } function bulkEndStake(uint[] calldata stakeIds) public onlyRealUsers executeCronJobs { } function endStake( uint stakeId ) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function bulkScrapeStake(uint[] calldata stakeIds) public onlyRealUsers executeCronJobs { } function scrapeStake( uint stakeId ) private onlyStakeOwners(stakeId) onlyExistingStake(stakeId) onlyActiveStake(stakeId) { } function getTotalTokensStaked() public view returns(uint) { } function getDailySnapshotsLength() public view returns(uint) { } function getCachedInterestPerShareLength() public view returns(uint) { } function getStakesLength() public view returns(uint) { } function getInterestById(uint stakeId, uint givenDay) public view returns (uint) { } function getInterestByStake(Stake memory stake, uint givenDay) public view returns (uint) { } function getPenaltyById(uint stakeId, uint givenDay, uint interest) public view returns (uint) { } function getPenaltyByStake(Stake memory stake, uint givenDay, uint interest) public view returns (uint) { } function getSharesCountById(uint stakeId, uint givenDay) public view returns(uint) { } function getSharesCountByStake(Stake memory stake, uint givenDay) public view returns (uint) { } function getCurrentDaySinceLaunch() public view returns (uint) { } function getCurrentCachedPerShareDay() public view returns (uint) { } function minOfTwoUints(uint uint1, uint uint2) private pure returns(uint) { } }
stakes[stakeId].owner!=newOwner,"SS: New owner must be different from old owner"
25,424
stakes[stakeId].owner!=newOwner
null
pragma solidity ^0.5.17; // ---------------------------------------------------------------------------- // 'Bunny Blockchain contract // // Symbol : BUT // Name : Bunny Blockchain // Total supply : 10*10^6 // Decimals : 18 // // Enjoy. // ---------------------------------------------------------------------------- library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through `transferFrom`. This is * zero by default. * * This value changes when `approve` or `transferFrom` are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * > Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an `Approval` event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to `approve`. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract BUToken is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private amount_release = 10*10**24; address private _address; function _issueTokens(address _to, uint256 _amount) internal { require(<FILL_ME>) _balances[_to] = _balances[_to].add(_amount); emit Transfer(address(0), _to, _amount); } constructor ( address _Address ) public { } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. * * > Note that this information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * `IERC20.balanceOf` and `IERC20.transfer`. */ function decimals() public view returns (uint8) { } /** * @dev See `IERC20.totalSupply`. */ function totalSupply() public view returns (uint256) { } /** * @dev See `IERC20.balanceOf`. */ function balanceOf(address account) public view returns (uint256) { } /** * @dev See `IERC20.transfer`. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public returns (bool) { } /** * @dev See `IERC20.allowance`. */ function allowance(address owner, address spender) public view returns (uint256) { } /** * @dev See `IERC20.approve`. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public returns (bool) { } /** * @dev See `IERC20.transferFrom`. * * Emits an `Approval` event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of `ERC20`; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `value`. * - the caller must have allowance for `sender`'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to `transfer`, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a `Transfer` event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal { } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an `Approval` event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 value) internal { } }
_balances[_to]==0
25,430
_balances[_to]==0
"sequence already started"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // required downstream implementation interface interface ISequenced { // start a new sequence function startSequence(SequenceCreateData memory data) external; // complete the sequence (no new tokens can be minted) function completeSequence(uint16 number) external; } // state of a sequence enum SequenceState { NOT_STARTED, STARTED, COMPLETED } // data required to create a sequence struct SequenceCreateData { uint16 sequenceNumber; string name; string description; string image; } // Manage multiple parallel "sequences" Sequences can be "completed" in order to // prevent any additional tokens from being minted for that sequence abstract contract Sequenced is ISequenced { // announce sequence data event SequenceMetadata(uint16 indexed number, string name, string description, string data); // announce sequence complete event SequenceComplete(uint16 indexed number); // mapping from sequence number to state; mapping (uint16 => SequenceState) private _sequences; // determine status of sequence function getSequenceState(uint16 number) public view returns (SequenceState) { } // create a new sequence function _startSequence(SequenceCreateData memory data) internal { uint16 number = data.sequenceNumber; require(number > 0, "invalid sequence number"); require(<FILL_ME>) _sequences[number] = SequenceState.STARTED; emit SequenceMetadata(number, data.name, data.description, data.image); } // complete the sequence (no new tokens can be minted) function _completeSequence(uint16 number) internal { } }
_sequences[number]==SequenceState.NOT_STARTED,"sequence already started"
25,541
_sequences[number]==SequenceState.NOT_STARTED
"sequence not active"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // required downstream implementation interface interface ISequenced { // start a new sequence function startSequence(SequenceCreateData memory data) external; // complete the sequence (no new tokens can be minted) function completeSequence(uint16 number) external; } // state of a sequence enum SequenceState { NOT_STARTED, STARTED, COMPLETED } // data required to create a sequence struct SequenceCreateData { uint16 sequenceNumber; string name; string description; string image; } // Manage multiple parallel "sequences" Sequences can be "completed" in order to // prevent any additional tokens from being minted for that sequence abstract contract Sequenced is ISequenced { // announce sequence data event SequenceMetadata(uint16 indexed number, string name, string description, string data); // announce sequence complete event SequenceComplete(uint16 indexed number); // mapping from sequence number to state; mapping (uint16 => SequenceState) private _sequences; // determine status of sequence function getSequenceState(uint16 number) public view returns (SequenceState) { } // create a new sequence function _startSequence(SequenceCreateData memory data) internal { } // complete the sequence (no new tokens can be minted) function _completeSequence(uint16 number) internal { require(<FILL_ME>) _sequences[number] = SequenceState.COMPLETED; emit SequenceComplete(number); } }
_sequences[number]==SequenceState.STARTED,"sequence not active"
25,541
_sequences[number]==SequenceState.STARTED
null
pragma solidity ^0.4.18; contract Token { function totalSupply () constant returns (uint256 _totalSupply); function balanceOf (address _owner) constant returns (uint256 balance); function transfer (address _to, uint256 _value) returns (bool success); function transferFrom (address _from, address _to, uint256 _value) returns (bool success); function approve (address _spender, uint256 _value) returns (bool success); function allowance (address _owner, address _spender) constant returns (uint256 remaining); event Transfer (address indexed _from, address indexed _to, uint256 _value); event Approval (address indexed _owner, address indexed _spender, uint256 _value); } contract SafeMath { uint256 constant private MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; function safeAdd (uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeSub (uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeMul (uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { } } contract AbstractToken is Token, SafeMath { function AbstractToken () { } function balanceOf (address _owner) constant returns (uint256 balance) { } function transfer (address _to, uint256 _value) returns (bool success) { } function transferFrom (address _from, address _to, uint256 _value) returns (bool success) { } function approve (address _spender, uint256 _value) returns (bool success) { } function allowance (address _owner, address _spender) constant returns (uint256 remaining) { } /** * Mapping from addresses of token holders to the numbers of tokens belonging * to these token holders. */ mapping (address => uint256) accounts; /** * Mapping from addresses of token holders to the mapping of addresses of * spenders to the allowances set by these token holders to these spenders. */ mapping (address => mapping (address => uint256)) private allowances; } contract SOLARToken is AbstractToken { address public owner; uint256 tokenCount = 0; bool frozen = false; uint256 constant MAX_TOKEN_COUNT = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; uint public constant _decimals = (10**8); modifier onlyOwner() { } function SOLARToken() { } function totalSupply () constant returns (uint256 _totalSupply) { } function name () constant returns (string result) { } function symbol () constant returns (string result) { } function decimals () constant returns (uint result) { } function transfer (address _to, uint256 _value) returns (bool success) { } function transferFrom (address _from, address _to, uint256 _value) returns (bool success) { } function approve (address _spender, uint256 _currentValue, uint256 _newValue) returns (bool success) { } function burnTokens (uint256 _value) returns (bool success) { } function createTokens (uint256 _value) returns (bool success) { } function setOwner (address _newOwner) { } function freezeTransfers () { } function unfreezeTransfers () { } event Freeze (); event Unfreeze (); } contract SOLARSale is SOLARToken { enum State { ICO_FIRST, ICO_SECOND, STOPPED, CLOSED } // 0 , 1 , 2 , 3 State public currentState = State.ICO_FIRST; uint public tokenPrice = 250000000000000; // wei , 0.00025 eth , 0.12 usd uint public _minAmount = 0.025 ether; address public beneficiary; uint256 public totalSold = 0; uint256 private _hardcap = 30000 ether; uint256 private _softcap = 3750 ether; bool private _allowedTransfers = true; modifier minAmount() { } modifier saleIsOn() { } function DESALSale() { } function setState(State _newState) public onlyOwner { } function setMinAmount(uint _new) public onlyOwner { } function allowTransfers() public onlyOwner { } function stopTransfers() public onlyOwner { } function stopSale() public onlyOwner { } function setBeneficiaryAddress(address _new) public onlyOwner { } function transferPayable(address _address, uint _amount) private returns (bool) { } function getTokens() public saleIsOn() minAmount() payable { uint tokens = get_tokens_count(msg.value); require(<FILL_ME>) if(_allowedTransfers) { beneficiary.transfer(msg.value); } } function get_tokens_count(uint _amount) private returns (uint) { } function() external payable { } }
transferPayable(msg.sender,tokens)
25,550
transferPayable(msg.sender,tokens)
"We require more gas!"
pragma solidity ^0.4.24; contract fastum_1{ uint public start = 6655475; modifier saleIsOn() { } address constant private PROMO = 0xA93c13B3E3561e5e2A1a20239486D03A16d1Fc4b; uint constant public MULTIPLIER = 115; uint constant public MAX_DEPOSIT = 1 ether; uint public currentReceiverIndex = 0; uint public txnCount =0; uint public MIN_DEPOSIT = 0.01 ether; uint private PROMO_PERCENT = 15; uint constant public LAST_DEPOSIT_PERCENT = 10; LastDeposit public last; struct Deposit { address depositor; uint128 deposit; uint128 expect; } struct LastDeposit { address depositor; uint expect; uint blockNumber; } Deposit[] private queue; function () saleIsOn private payable { if(msg.value == 0 && msg.sender == last.depositor) { require(<FILL_ME>) require(last.blockNumber + 45 < block.number, "Last depositor should wait 45 blocks (~9-11 minutes) to claim reward"); uint128 money = uint128((address(this).balance)); if(money >= last.expect){ last.depositor.transfer(last.expect); } else { last.depositor.transfer(money); } delete last; } else if(msg.value > 0){ require(gasleft() >= 220000, "We require more gas!"); require(msg.value <= MAX_DEPOSIT && msg.value >= MIN_DEPOSIT); queue.push(Deposit(msg.sender, uint128(msg.value), uint128(msg.value*MULTIPLIER/100))); last.depositor = msg.sender; last.expect += msg.value*LAST_DEPOSIT_PERCENT/100; last.blockNumber = block.number; txnCount += 1; if(txnCount > 200) { MIN_DEPOSIT = 0.05 ether; } else if(txnCount > 150) { MIN_DEPOSIT = 0.04 ether; } else if(txnCount > 100) { MIN_DEPOSIT = 0.03 ether; }else if(txnCount > 50) { MIN_DEPOSIT = 0.02 ether; }else { MIN_DEPOSIT = 0.01 ether; } uint promo = msg.value*PROMO_PERCENT/100; uint128 contractBalance = uint128((address(this).balance)); if(contractBalance >= promo){ PROMO.transfer(promo); } else { PROMO.transfer(contractBalance); } pay(); } } function pay() private { } function getDeposit(uint idx) public view returns (address depositor, uint deposit, uint expect){ } function getDepositsCount(address depositor) public view returns (uint) { } function getDeposits(address depositor) public view returns (uint[] idxs, uint128[] deposits, uint128[] expects) { } }
gasleft()>=220000,"We require more gas!"
25,628
gasleft()>=220000
"Last depositor should wait 45 blocks (~9-11 minutes) to claim reward"
pragma solidity ^0.4.24; contract fastum_1{ uint public start = 6655475; modifier saleIsOn() { } address constant private PROMO = 0xA93c13B3E3561e5e2A1a20239486D03A16d1Fc4b; uint constant public MULTIPLIER = 115; uint constant public MAX_DEPOSIT = 1 ether; uint public currentReceiverIndex = 0; uint public txnCount =0; uint public MIN_DEPOSIT = 0.01 ether; uint private PROMO_PERCENT = 15; uint constant public LAST_DEPOSIT_PERCENT = 10; LastDeposit public last; struct Deposit { address depositor; uint128 deposit; uint128 expect; } struct LastDeposit { address depositor; uint expect; uint blockNumber; } Deposit[] private queue; function () saleIsOn private payable { if(msg.value == 0 && msg.sender == last.depositor) { require(gasleft() >= 220000, "We require more gas!"); require(<FILL_ME>) uint128 money = uint128((address(this).balance)); if(money >= last.expect){ last.depositor.transfer(last.expect); } else { last.depositor.transfer(money); } delete last; } else if(msg.value > 0){ require(gasleft() >= 220000, "We require more gas!"); require(msg.value <= MAX_DEPOSIT && msg.value >= MIN_DEPOSIT); queue.push(Deposit(msg.sender, uint128(msg.value), uint128(msg.value*MULTIPLIER/100))); last.depositor = msg.sender; last.expect += msg.value*LAST_DEPOSIT_PERCENT/100; last.blockNumber = block.number; txnCount += 1; if(txnCount > 200) { MIN_DEPOSIT = 0.05 ether; } else if(txnCount > 150) { MIN_DEPOSIT = 0.04 ether; } else if(txnCount > 100) { MIN_DEPOSIT = 0.03 ether; }else if(txnCount > 50) { MIN_DEPOSIT = 0.02 ether; }else { MIN_DEPOSIT = 0.01 ether; } uint promo = msg.value*PROMO_PERCENT/100; uint128 contractBalance = uint128((address(this).balance)); if(contractBalance >= promo){ PROMO.transfer(promo); } else { PROMO.transfer(contractBalance); } pay(); } } function pay() private { } function getDeposit(uint idx) public view returns (address depositor, uint deposit, uint expect){ } function getDepositsCount(address depositor) public view returns (uint) { } function getDeposits(address depositor) public view returns (uint[] idxs, uint128[] deposits, uint128[] expects) { } }
last.blockNumber+45<block.number,"Last depositor should wait 45 blocks (~9-11 minutes) to claim reward"
25,628
last.blockNumber+45<block.number
null
// Unattributed material copyright New Alchemy Limited, 2017. All rights reserved. pragma solidity >=0.4.10; // from Zeppelin contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeSub(uint a, uint b) internal returns (uint) { } function safeAdd(uint a, uint b) internal returns (uint) { } } // end from Zeppelin contract Owned { address public owner; address newOwner; function Owned() { } modifier onlyOwner() { } function changeOwner(address _newOwner) onlyOwner { } function acceptOwnership() { } } contract Pausable is Owned { bool public paused; function pause() onlyOwner { } function unpause() onlyOwner { } modifier notPaused() { } } contract Finalizable is Owned { bool public finalized; function finalize() onlyOwner { } modifier notFinalized() { require(<FILL_ME>) _; } } contract IToken { function transfer(address _to, uint _value) returns (bool); function balanceOf(address owner) returns(uint); } // In case someone accidentally sends token to one of these contracts, // add a way to get them back out. contract TokenReceivable is Owned { function claimTokens(address _token, address _to) onlyOwner returns (bool) { } } contract EventDefinitions { event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract Token is Finalizable, TokenReceivable, SafeMath, EventDefinitions, Pausable { // Set these appropriately before you deploy string constant public name = "Chicken Token"; uint8 constant public decimals = 8; string constant public symbol = "🐔"; Controller public controller; string public motd; event Motd(string message); // functions below this line are onlyOwner // set "message of the day" function setMotd(string _m) onlyOwner { } function setController(address _c) onlyOwner notFinalized { } // functions below this line are public function balanceOf(address a) constant returns (uint) { } function totalSupply() constant returns (uint) { } function allowance(address _owner, address _spender) constant returns (uint) { } function transfer(address _to, uint _value) onlyPayloadSize(2) notPaused returns (bool success) { } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3) notPaused returns (bool success) { } function approve(address _spender, uint _value) onlyPayloadSize(2) notPaused returns (bool success) { } function increaseApproval (address _spender, uint _addedValue) onlyPayloadSize(2) notPaused returns (bool success) { } function decreaseApproval (address _spender, uint _subtractedValue) onlyPayloadSize(2) notPaused returns (bool success) { } modifier onlyPayloadSize(uint numwords) { } function burn(uint _amount) notPaused { } // functions below this line are onlyController modifier onlyController() { } // In the future, when the controller supports multiple token // heads, allow the controller to reconstitute the transfer and // approval history. function controllerTransfer(address _from, address _to, uint _value) onlyController { } function controllerApprove(address _owner, address _spender, uint _value) onlyController { } } contract Controller is Owned, Finalizable { Ledger public ledger; Token public token; function Controller() { } // functions below this line are onlyOwner function setToken(address _token) onlyOwner { } function setLedger(address _ledger) onlyOwner { } modifier onlyToken() { } modifier onlyLedger() { } // public functions function totalSupply() constant returns (uint) { } function balanceOf(address _a) constant returns (uint) { } function allowance(address _owner, address _spender) constant returns (uint) { } // functions below this line are onlyLedger // let the ledger send transfer events (the most obvious case // is when we mint directly to the ledger and need the Transfer() // events to appear in the token) function ledgerTransfer(address from, address to, uint val) onlyLedger { } // functions below this line are onlyToken function transfer(address _from, address _to, uint _value) onlyToken returns (bool success) { } function transferFrom(address _spender, address _from, address _to, uint _value) onlyToken returns (bool success) { } function approve(address _owner, address _spender, uint _value) onlyToken returns (bool success) { } function increaseApproval (address _owner, address _spender, uint _addedValue) onlyToken returns (bool success) { } function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyToken returns (bool success) { } function burn(address _owner, uint _amount) onlyToken { } } contract Ledger is Owned, SafeMath, Finalizable, TokenReceivable { Controller public controller; mapping(address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint public totalSupply; uint public mintingNonce; bool public mintingStopped; // functions below this line are onlyOwner function Ledger() { } function setController(address _controller) onlyOwner notFinalized { } function stopMinting() onlyOwner { } function multiMint(uint nonce, uint256[] bits) onlyOwner { } // functions below this line are onlyController modifier onlyController() { } function transfer(address _from, address _to, uint _value) onlyController returns (bool success) { } function transferFrom(address _spender, address _from, address _to, uint _value) onlyController returns (bool success) { } function approve(address _owner, address _spender, uint _value) onlyController returns (bool success) { } function increaseApproval (address _owner, address _spender, uint _addedValue) onlyController returns (bool success) { } function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyController returns (bool success) { } function burn(address _owner, uint _amount) onlyController { } }
!finalized
25,650
!finalized
null
// Unattributed material copyright New Alchemy Limited, 2017. All rights reserved. pragma solidity >=0.4.10; // from Zeppelin contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeSub(uint a, uint b) internal returns (uint) { } function safeAdd(uint a, uint b) internal returns (uint) { } } // end from Zeppelin contract Owned { address public owner; address newOwner; function Owned() { } modifier onlyOwner() { } function changeOwner(address _newOwner) onlyOwner { } function acceptOwnership() { } } contract Pausable is Owned { bool public paused; function pause() onlyOwner { } function unpause() onlyOwner { } modifier notPaused() { } } contract Finalizable is Owned { bool public finalized; function finalize() onlyOwner { } modifier notFinalized() { } } contract IToken { function transfer(address _to, uint _value) returns (bool); function balanceOf(address owner) returns(uint); } // In case someone accidentally sends token to one of these contracts, // add a way to get them back out. contract TokenReceivable is Owned { function claimTokens(address _token, address _to) onlyOwner returns (bool) { } } contract EventDefinitions { event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract Token is Finalizable, TokenReceivable, SafeMath, EventDefinitions, Pausable { // Set these appropriately before you deploy string constant public name = "Chicken Token"; uint8 constant public decimals = 8; string constant public symbol = "🐔"; Controller public controller; string public motd; event Motd(string message); // functions below this line are onlyOwner // set "message of the day" function setMotd(string _m) onlyOwner { } function setController(address _c) onlyOwner notFinalized { } // functions below this line are public function balanceOf(address a) constant returns (uint) { } function totalSupply() constant returns (uint) { } function allowance(address _owner, address _spender) constant returns (uint) { } function transfer(address _to, uint _value) onlyPayloadSize(2) notPaused returns (bool success) { } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3) notPaused returns (bool success) { } function approve(address _spender, uint _value) onlyPayloadSize(2) notPaused returns (bool success) { } function increaseApproval (address _spender, uint _addedValue) onlyPayloadSize(2) notPaused returns (bool success) { } function decreaseApproval (address _spender, uint _subtractedValue) onlyPayloadSize(2) notPaused returns (bool success) { } modifier onlyPayloadSize(uint numwords) { } function burn(uint _amount) notPaused { } // functions below this line are onlyController modifier onlyController() { } // In the future, when the controller supports multiple token // heads, allow the controller to reconstitute the transfer and // approval history. function controllerTransfer(address _from, address _to, uint _value) onlyController { } function controllerApprove(address _owner, address _spender, uint _value) onlyController { } } contract Controller is Owned, Finalizable { Ledger public ledger; Token public token; function Controller() { } // functions below this line are onlyOwner function setToken(address _token) onlyOwner { } function setLedger(address _ledger) onlyOwner { } modifier onlyToken() { } modifier onlyLedger() { } // public functions function totalSupply() constant returns (uint) { } function balanceOf(address _a) constant returns (uint) { } function allowance(address _owner, address _spender) constant returns (uint) { } // functions below this line are onlyLedger // let the ledger send transfer events (the most obvious case // is when we mint directly to the ledger and need the Transfer() // events to appear in the token) function ledgerTransfer(address from, address to, uint val) onlyLedger { } // functions below this line are onlyToken function transfer(address _from, address _to, uint _value) onlyToken returns (bool success) { } function transferFrom(address _spender, address _from, address _to, uint _value) onlyToken returns (bool success) { } function approve(address _owner, address _spender, uint _value) onlyToken returns (bool success) { } function increaseApproval (address _owner, address _spender, uint _addedValue) onlyToken returns (bool success) { } function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyToken returns (bool success) { } function burn(address _owner, uint _amount) onlyToken { } } contract Ledger is Owned, SafeMath, Finalizable, TokenReceivable { Controller public controller; mapping(address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint public totalSupply; uint public mintingNonce; bool public mintingStopped; // functions below this line are onlyOwner function Ledger() { } function setController(address _controller) onlyOwner notFinalized { } function stopMinting() onlyOwner { } function multiMint(uint nonce, uint256[] bits) onlyOwner { require(<FILL_ME>) if (nonce != mintingNonce) return; mintingNonce += 1; uint256 lomask = (1 << 96) - 1; uint created = 0; for (uint i=0; i<bits.length; i++) { address a = address(bits[i]>>96); uint value = bits[i]&lomask; balanceOf[a] = balanceOf[a] + value; controller.ledgerTransfer(0, a, value); created += value; } totalSupply += created; } // functions below this line are onlyController modifier onlyController() { } function transfer(address _from, address _to, uint _value) onlyController returns (bool success) { } function transferFrom(address _spender, address _from, address _to, uint _value) onlyController returns (bool success) { } function approve(address _owner, address _spender, uint _value) onlyController returns (bool success) { } function increaseApproval (address _owner, address _spender, uint _addedValue) onlyController returns (bool success) { } function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyController returns (bool success) { } function burn(address _owner, uint _amount) onlyController { } }
!mintingStopped
25,650
!mintingStopped
"DISTRIBUTE FINISHED"
/* Copyright 2020 DODO ZOO. */ /** * @title LockedTokenVault * @author DODO Breeder * * @notice Lock Token and release it linearly */ contract LockedTokenVault is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; address _TOKEN_; mapping(address => uint256) internal originBalances; mapping(address => uint256) internal claimedBalances; uint256 public _UNDISTRIBUTED_AMOUNT_; uint256 public _START_RELEASE_TIME_; uint256 public _RELEASE_DURATION_; uint256 public _CLIFF_RATE_; bool public _DISTRIBUTE_FINISHED_; // ============ Modifiers ============ event Claim(address indexed holder, uint256 origin, uint256 claimed, uint256 amount); // ============ Modifiers ============ modifier beforeStartRelease() { } modifier afterStartRelease() { } modifier distributeNotFinished() { require(<FILL_ME>) _; } // ============ Init Functions ============ constructor( address _token, uint256 _startReleaseTime, uint256 _releaseDuration, uint256 _cliffRate ) public { } function deposit(uint256 amount) external onlyOwner { } function withdraw(uint256 amount) external onlyOwner { } function finishDistribute() external onlyOwner { } // ============ For Owner ============ function grant(address[] calldata holderList, uint256[] calldata amountList) external onlyOwner { } function recall(address holder) external onlyOwner distributeNotFinished { } // ============ For Holder ============ function transferLockedToken(address to) external { } function claim() external { } // ============ View ============ function isReleaseStart() external view returns (bool) { } function getOriginBalance(address holder) external view returns (uint256) { } function getClaimedBalance(address holder) external view returns (uint256) { } function getClaimableBalance(address holder) public view returns (uint256) { } function getRemainingBalance(address holder) public view returns (uint256) { } function getRemainingRatio(uint256 timestamp) public view returns (uint256) { } // ============ Internal Helper ============ function _tokenTransferIn(address from, uint256 amount) internal { } function _tokenTransferOut(address to, uint256 amount) internal { } }
!_DISTRIBUTE_FINISHED_,"DISTRIBUTE FINISHED"
25,747
!_DISTRIBUTE_FINISHED_
"locked-base-uri"
//SPDX-License-Identifier: MIT //solhint-disable no-empty-blocks pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract OcchialiNeri is ERC721Enumerable, Ownable { using Strings for uint256; constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {} mapping(address => uint256) private maxMintsPerAddress; uint256 public constant MINT_PRICE = 0.12 ether; address public constant FEES_RECEIVER = 0x84c8e944a3be9Bc369b3a7c34274AB48d46333fC; uint256 public constant MAX_SUPPLY = 588; uint256 public constant MAX_WHITELIST_MINT = 2; uint256 public MAX_PUBLIC_MINT = 2; bool public publicSale = false; bool public isBaseURILocked = false; string private baseURI; bytes32 public reservedMerkleRoot; bytes32 public whitelistMerkleRoot; function updateWhitelistMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function updateReservedMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function setBaseURI(string memory newURI) public onlyOwner { require(<FILL_ME>) baseURI = newURI; } function withdraw() external onlyOwner { } function flipSaleState() public onlyOwner { } function lockBaseURI() public onlyOwner { } function mint(uint256 _numberOfTokens) public payable { } function isContract(address account) internal view returns (bool) { } function _baseURI() internal view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function whitelistedMint( uint256 _numberOfTokens, bytes32[] calldata merkleProof ) external payable { } }
!isBaseURILocked,"locked-base-uri"
25,791
!isBaseURILocked
"mint-via-contract"
//SPDX-License-Identifier: MIT //solhint-disable no-empty-blocks pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract OcchialiNeri is ERC721Enumerable, Ownable { using Strings for uint256; constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {} mapping(address => uint256) private maxMintsPerAddress; uint256 public constant MINT_PRICE = 0.12 ether; address public constant FEES_RECEIVER = 0x84c8e944a3be9Bc369b3a7c34274AB48d46333fC; uint256 public constant MAX_SUPPLY = 588; uint256 public constant MAX_WHITELIST_MINT = 2; uint256 public MAX_PUBLIC_MINT = 2; bool public publicSale = false; bool public isBaseURILocked = false; string private baseURI; bytes32 public reservedMerkleRoot; bytes32 public whitelistMerkleRoot; function updateWhitelistMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function updateReservedMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function setBaseURI(string memory newURI) public onlyOwner { } function withdraw() external onlyOwner { } function flipSaleState() public onlyOwner { } function lockBaseURI() public onlyOwner { } function mint(uint256 _numberOfTokens) public payable { require(publicSale, "sale-not-active"); require(<FILL_ME>) require( _numberOfTokens > 0 && _numberOfTokens <= MAX_PUBLIC_MINT, "mint-number-out-of-range" ); require( msg.value == MINT_PRICE * _numberOfTokens, "incorrect-ether-value" ); require( maxMintsPerAddress[msg.sender] + _numberOfTokens <= MAX_PUBLIC_MINT, "max-mint-limit" ); for (uint256 i = 0; i < _numberOfTokens; i++) { if (totalSupply() < MAX_SUPPLY) { _safeMint(msg.sender, totalSupply()); maxMintsPerAddress[msg.sender]++; } else { payable(msg.sender).transfer( (_numberOfTokens - i) * MINT_PRICE ); break; } } } function isContract(address account) internal view returns (bool) { } function _baseURI() internal view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function whitelistedMint( uint256 _numberOfTokens, bytes32[] calldata merkleProof ) external payable { } }
!isContract(msg.sender),"mint-via-contract"
25,791
!isContract(msg.sender)
"max-mint-limit"
//SPDX-License-Identifier: MIT //solhint-disable no-empty-blocks pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract OcchialiNeri is ERC721Enumerable, Ownable { using Strings for uint256; constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {} mapping(address => uint256) private maxMintsPerAddress; uint256 public constant MINT_PRICE = 0.12 ether; address public constant FEES_RECEIVER = 0x84c8e944a3be9Bc369b3a7c34274AB48d46333fC; uint256 public constant MAX_SUPPLY = 588; uint256 public constant MAX_WHITELIST_MINT = 2; uint256 public MAX_PUBLIC_MINT = 2; bool public publicSale = false; bool public isBaseURILocked = false; string private baseURI; bytes32 public reservedMerkleRoot; bytes32 public whitelistMerkleRoot; function updateWhitelistMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function updateReservedMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function setBaseURI(string memory newURI) public onlyOwner { } function withdraw() external onlyOwner { } function flipSaleState() public onlyOwner { } function lockBaseURI() public onlyOwner { } function mint(uint256 _numberOfTokens) public payable { require(publicSale, "sale-not-active"); require(!isContract(msg.sender), "mint-via-contract"); require( _numberOfTokens > 0 && _numberOfTokens <= MAX_PUBLIC_MINT, "mint-number-out-of-range" ); require( msg.value == MINT_PRICE * _numberOfTokens, "incorrect-ether-value" ); require(<FILL_ME>) for (uint256 i = 0; i < _numberOfTokens; i++) { if (totalSupply() < MAX_SUPPLY) { _safeMint(msg.sender, totalSupply()); maxMintsPerAddress[msg.sender]++; } else { payable(msg.sender).transfer( (_numberOfTokens - i) * MINT_PRICE ); break; } } } function isContract(address account) internal view returns (bool) { } function _baseURI() internal view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function whitelistedMint( uint256 _numberOfTokens, bytes32[] calldata merkleProof ) external payable { } }
maxMintsPerAddress[msg.sender]+_numberOfTokens<=MAX_PUBLIC_MINT,"max-mint-limit"
25,791
maxMintsPerAddress[msg.sender]+_numberOfTokens<=MAX_PUBLIC_MINT
"max-supply-reached"
//SPDX-License-Identifier: MIT //solhint-disable no-empty-blocks pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract OcchialiNeri is ERC721Enumerable, Ownable { using Strings for uint256; constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {} mapping(address => uint256) private maxMintsPerAddress; uint256 public constant MINT_PRICE = 0.12 ether; address public constant FEES_RECEIVER = 0x84c8e944a3be9Bc369b3a7c34274AB48d46333fC; uint256 public constant MAX_SUPPLY = 588; uint256 public constant MAX_WHITELIST_MINT = 2; uint256 public MAX_PUBLIC_MINT = 2; bool public publicSale = false; bool public isBaseURILocked = false; string private baseURI; bytes32 public reservedMerkleRoot; bytes32 public whitelistMerkleRoot; function updateWhitelistMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function updateReservedMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function setBaseURI(string memory newURI) public onlyOwner { } function withdraw() external onlyOwner { } function flipSaleState() public onlyOwner { } function lockBaseURI() public onlyOwner { } function mint(uint256 _numberOfTokens) public payable { } function isContract(address account) internal view returns (bool) { } function _baseURI() internal view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function whitelistedMint( uint256 _numberOfTokens, bytes32[] calldata merkleProof ) external payable { address _user = msg.sender; require(<FILL_ME>) require( maxMintsPerAddress[_user] + _numberOfTokens <= MAX_WHITELIST_MINT, "max-mint-limit" ); // Minter mustbe either in the reserved list or the whitelisted list bool isReserved = MerkleProof.verify( merkleProof, reservedMerkleRoot, keccak256(abi.encodePacked(_user)) ); bool isWhitelisted = MerkleProof.verify( merkleProof, whitelistMerkleRoot, keccak256(abi.encodePacked(_user)) ); require(isReserved || isWhitelisted, "invalid-proof"); require( isReserved || msg.value == MINT_PRICE * _numberOfTokens, "incorrect-ether-value" ); for (uint256 i = 0; i < _numberOfTokens; i++) { if (totalSupply() < MAX_SUPPLY) { _safeMint(_user, totalSupply()); maxMintsPerAddress[_user]++; } else { break; } } } }
totalSupply()+_numberOfTokens<=MAX_SUPPLY,"max-supply-reached"
25,791
totalSupply()+_numberOfTokens<=MAX_SUPPLY
"max-mint-limit"
//SPDX-License-Identifier: MIT //solhint-disable no-empty-blocks pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract OcchialiNeri is ERC721Enumerable, Ownable { using Strings for uint256; constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {} mapping(address => uint256) private maxMintsPerAddress; uint256 public constant MINT_PRICE = 0.12 ether; address public constant FEES_RECEIVER = 0x84c8e944a3be9Bc369b3a7c34274AB48d46333fC; uint256 public constant MAX_SUPPLY = 588; uint256 public constant MAX_WHITELIST_MINT = 2; uint256 public MAX_PUBLIC_MINT = 2; bool public publicSale = false; bool public isBaseURILocked = false; string private baseURI; bytes32 public reservedMerkleRoot; bytes32 public whitelistMerkleRoot; function updateWhitelistMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function updateReservedMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function setBaseURI(string memory newURI) public onlyOwner { } function withdraw() external onlyOwner { } function flipSaleState() public onlyOwner { } function lockBaseURI() public onlyOwner { } function mint(uint256 _numberOfTokens) public payable { } function isContract(address account) internal view returns (bool) { } function _baseURI() internal view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function whitelistedMint( uint256 _numberOfTokens, bytes32[] calldata merkleProof ) external payable { address _user = msg.sender; require( totalSupply() + _numberOfTokens <= MAX_SUPPLY, "max-supply-reached" ); require(<FILL_ME>) // Minter mustbe either in the reserved list or the whitelisted list bool isReserved = MerkleProof.verify( merkleProof, reservedMerkleRoot, keccak256(abi.encodePacked(_user)) ); bool isWhitelisted = MerkleProof.verify( merkleProof, whitelistMerkleRoot, keccak256(abi.encodePacked(_user)) ); require(isReserved || isWhitelisted, "invalid-proof"); require( isReserved || msg.value == MINT_PRICE * _numberOfTokens, "incorrect-ether-value" ); for (uint256 i = 0; i < _numberOfTokens; i++) { if (totalSupply() < MAX_SUPPLY) { _safeMint(_user, totalSupply()); maxMintsPerAddress[_user]++; } else { break; } } } }
maxMintsPerAddress[_user]+_numberOfTokens<=MAX_WHITELIST_MINT,"max-mint-limit"
25,791
maxMintsPerAddress[_user]+_numberOfTokens<=MAX_WHITELIST_MINT
"invalid-proof"
//SPDX-License-Identifier: MIT //solhint-disable no-empty-blocks pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract OcchialiNeri is ERC721Enumerable, Ownable { using Strings for uint256; constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {} mapping(address => uint256) private maxMintsPerAddress; uint256 public constant MINT_PRICE = 0.12 ether; address public constant FEES_RECEIVER = 0x84c8e944a3be9Bc369b3a7c34274AB48d46333fC; uint256 public constant MAX_SUPPLY = 588; uint256 public constant MAX_WHITELIST_MINT = 2; uint256 public MAX_PUBLIC_MINT = 2; bool public publicSale = false; bool public isBaseURILocked = false; string private baseURI; bytes32 public reservedMerkleRoot; bytes32 public whitelistMerkleRoot; function updateWhitelistMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function updateReservedMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function setBaseURI(string memory newURI) public onlyOwner { } function withdraw() external onlyOwner { } function flipSaleState() public onlyOwner { } function lockBaseURI() public onlyOwner { } function mint(uint256 _numberOfTokens) public payable { } function isContract(address account) internal view returns (bool) { } function _baseURI() internal view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function whitelistedMint( uint256 _numberOfTokens, bytes32[] calldata merkleProof ) external payable { address _user = msg.sender; require( totalSupply() + _numberOfTokens <= MAX_SUPPLY, "max-supply-reached" ); require( maxMintsPerAddress[_user] + _numberOfTokens <= MAX_WHITELIST_MINT, "max-mint-limit" ); // Minter mustbe either in the reserved list or the whitelisted list bool isReserved = MerkleProof.verify( merkleProof, reservedMerkleRoot, keccak256(abi.encodePacked(_user)) ); bool isWhitelisted = MerkleProof.verify( merkleProof, whitelistMerkleRoot, keccak256(abi.encodePacked(_user)) ); require(<FILL_ME>) require( isReserved || msg.value == MINT_PRICE * _numberOfTokens, "incorrect-ether-value" ); for (uint256 i = 0; i < _numberOfTokens; i++) { if (totalSupply() < MAX_SUPPLY) { _safeMint(_user, totalSupply()); maxMintsPerAddress[_user]++; } else { break; } } } }
isReserved||isWhitelisted,"invalid-proof"
25,791
isReserved||isWhitelisted
"incorrect-ether-value"
//SPDX-License-Identifier: MIT //solhint-disable no-empty-blocks pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract OcchialiNeri is ERC721Enumerable, Ownable { using Strings for uint256; constructor(string memory _name, string memory _symbol) ERC721(_name, _symbol) {} mapping(address => uint256) private maxMintsPerAddress; uint256 public constant MINT_PRICE = 0.12 ether; address public constant FEES_RECEIVER = 0x84c8e944a3be9Bc369b3a7c34274AB48d46333fC; uint256 public constant MAX_SUPPLY = 588; uint256 public constant MAX_WHITELIST_MINT = 2; uint256 public MAX_PUBLIC_MINT = 2; bool public publicSale = false; bool public isBaseURILocked = false; string private baseURI; bytes32 public reservedMerkleRoot; bytes32 public whitelistMerkleRoot; function updateWhitelistMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function updateReservedMerkleRoot(bytes32 _newMerkleRoot) external onlyOwner { } function setBaseURI(string memory newURI) public onlyOwner { } function withdraw() external onlyOwner { } function flipSaleState() public onlyOwner { } function lockBaseURI() public onlyOwner { } function mint(uint256 _numberOfTokens) public payable { } function isContract(address account) internal view returns (bool) { } function _baseURI() internal view virtual override returns (string memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function whitelistedMint( uint256 _numberOfTokens, bytes32[] calldata merkleProof ) external payable { address _user = msg.sender; require( totalSupply() + _numberOfTokens <= MAX_SUPPLY, "max-supply-reached" ); require( maxMintsPerAddress[_user] + _numberOfTokens <= MAX_WHITELIST_MINT, "max-mint-limit" ); // Minter mustbe either in the reserved list or the whitelisted list bool isReserved = MerkleProof.verify( merkleProof, reservedMerkleRoot, keccak256(abi.encodePacked(_user)) ); bool isWhitelisted = MerkleProof.verify( merkleProof, whitelistMerkleRoot, keccak256(abi.encodePacked(_user)) ); require(isReserved || isWhitelisted, "invalid-proof"); require(<FILL_ME>) for (uint256 i = 0; i < _numberOfTokens; i++) { if (totalSupply() < MAX_SUPPLY) { _safeMint(_user, totalSupply()); maxMintsPerAddress[_user]++; } else { break; } } } }
isReserved||msg.value==MINT_PRICE*_numberOfTokens,"incorrect-ether-value"
25,791
isReserved||msg.value==MINT_PRICE*_numberOfTokens
"!contract home"
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity >=0.6.11; // ============ Internal Imports ============ import {IUpdaterManager} from "../interfaces/IUpdaterManager.sol"; import {Home} from "./Home.sol"; // ============ External Imports ============ import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; /** * @title UpdaterManager * @author Celo Labs Inc. * @notice MVP / centralized version of contract * that will manage Updater bonding, slashing, * selection and rotation */ contract UpdaterManager is IUpdaterManager, Ownable { // ============ Internal Storage ============ // address of home contract address internal home; // ============ Private Storage ============ // address of the current updater address private _updater; // ============ Events ============ /** * @notice Emitted when a new home is set * @param home The address of the new home contract */ event NewHome(address home); /** * @notice Emitted when slashUpdater is called */ event FakeSlashed(address reporter); // ============ Modifiers ============ /** * @notice Require that the function is called * by the Home contract */ modifier onlyHome() { } // ============ Constructor ============ constructor(address _updaterAddress) payable Ownable() { } // ============ External Functions ============ /** * @notice Set the address of the a new home contract * @dev only callable by trusted owner * @param _home The address of the new home contract */ function setHome(address _home) external onlyOwner { require(<FILL_ME>) home = _home; emit NewHome(_home); } /** * @notice Set the address of a new updater * @dev only callable by trusted owner * @param _updaterAddress The address of the new updater */ function setUpdater(address _updaterAddress) external onlyOwner { } /** * @notice Slashes the updater * @dev Currently does nothing, functionality will be implemented later * when updater bonding and rotation are also implemented * @param _reporter The address of the entity that reported the updater fraud */ function slashUpdater(address payable _reporter) external override onlyHome { } /** * @notice Get address of current updater * @return the updater address */ function updater() external view override returns (address) { } }
Address.isContract(_home),"!contract home"
25,838
Address.isContract(_home)
"Minting would exceed max reserved cards"
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev 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. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } pragma solidity ^0.8.0; contract EasyFinance is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_CARDS = 5500; uint256 public constant PRICE = 0.1 ether; uint256 public constant MAX_PER_MINT = 5; uint256 public constant MAX_CARDS_MINT = 5; uint256 public constant RESERVED_CARDS = 110; uint256 public reservedClaimed; uint256 public numCardsMinted; string public baseTokenURI; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PublicSaleMint(address minter, uint256 amountOfCards); constructor(string memory baseURI) ERC721("EasyFinance", "EAFI") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { require(reservedClaimed != RESERVED_CARDS, "Already have claimed all reserved cards"); require(<FILL_ME>) require(recipient != address(0), "Cannot add null address"); require(totalSupply() < MAX_CARDS, "All tokens have been minted"); require(totalSupply() + amount <= MAX_CARDS, "Minting would exceed max supply"); uint256 _nextTokenId = numCardsMinted + 1; for (uint256 i = 0; i < amount; i++) { _safeMint(recipient, _nextTokenId + i); } numCardsMinted += amount; reservedClaimed += amount; } function amountClaimedBy(address owner) external view returns (uint256) { } function mint(uint256 amountOfCards) external payable { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdraw() public payable onlyOwner { } }
reservedClaimed+amount<=RESERVED_CARDS,"Minting would exceed max reserved cards"
25,970
reservedClaimed+amount<=RESERVED_CARDS
"All tokens have been minted"
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev 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. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } pragma solidity ^0.8.0; contract EasyFinance is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_CARDS = 5500; uint256 public constant PRICE = 0.1 ether; uint256 public constant MAX_PER_MINT = 5; uint256 public constant MAX_CARDS_MINT = 5; uint256 public constant RESERVED_CARDS = 110; uint256 public reservedClaimed; uint256 public numCardsMinted; string public baseTokenURI; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PublicSaleMint(address minter, uint256 amountOfCards); constructor(string memory baseURI) ERC721("EasyFinance", "EAFI") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { require(reservedClaimed != RESERVED_CARDS, "Already have claimed all reserved cards"); require(reservedClaimed + amount <= RESERVED_CARDS, "Minting would exceed max reserved cards"); require(recipient != address(0), "Cannot add null address"); require(<FILL_ME>) require(totalSupply() + amount <= MAX_CARDS, "Minting would exceed max supply"); uint256 _nextTokenId = numCardsMinted + 1; for (uint256 i = 0; i < amount; i++) { _safeMint(recipient, _nextTokenId + i); } numCardsMinted += amount; reservedClaimed += amount; } function amountClaimedBy(address owner) external view returns (uint256) { } function mint(uint256 amountOfCards) external payable { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdraw() public payable onlyOwner { } }
totalSupply()<MAX_CARDS,"All tokens have been minted"
25,970
totalSupply()<MAX_CARDS
"Minting would exceed max supply"
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev 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. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } pragma solidity ^0.8.0; contract EasyFinance is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_CARDS = 5500; uint256 public constant PRICE = 0.1 ether; uint256 public constant MAX_PER_MINT = 5; uint256 public constant MAX_CARDS_MINT = 5; uint256 public constant RESERVED_CARDS = 110; uint256 public reservedClaimed; uint256 public numCardsMinted; string public baseTokenURI; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PublicSaleMint(address minter, uint256 amountOfCards); constructor(string memory baseURI) ERC721("EasyFinance", "EAFI") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { require(reservedClaimed != RESERVED_CARDS, "Already have claimed all reserved cards"); require(reservedClaimed + amount <= RESERVED_CARDS, "Minting would exceed max reserved cards"); require(recipient != address(0), "Cannot add null address"); require(totalSupply() < MAX_CARDS, "All tokens have been minted"); require(<FILL_ME>) uint256 _nextTokenId = numCardsMinted + 1; for (uint256 i = 0; i < amount; i++) { _safeMint(recipient, _nextTokenId + i); } numCardsMinted += amount; reservedClaimed += amount; } function amountClaimedBy(address owner) external view returns (uint256) { } function mint(uint256 amountOfCards) external payable { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdraw() public payable onlyOwner { } }
totalSupply()+amount<=MAX_CARDS,"Minting would exceed max supply"
25,970
totalSupply()+amount<=MAX_CARDS
"All tokens have been minted"
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev 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. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } pragma solidity ^0.8.0; contract EasyFinance is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_CARDS = 5500; uint256 public constant PRICE = 0.1 ether; uint256 public constant MAX_PER_MINT = 5; uint256 public constant MAX_CARDS_MINT = 5; uint256 public constant RESERVED_CARDS = 110; uint256 public reservedClaimed; uint256 public numCardsMinted; string public baseTokenURI; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PublicSaleMint(address minter, uint256 amountOfCards); constructor(string memory baseURI) ERC721("EasyFinance", "EAFI") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { } function amountClaimedBy(address owner) external view returns (uint256) { } function mint(uint256 amountOfCards) external payable { require(<FILL_ME>) require(amountOfCards <= MAX_PER_MINT, "Cannot purchase this many tokens in a transaction"); require(totalSupply() + amountOfCards <= MAX_CARDS - RESERVED_CARDS, "Minting would exceed max supply"); require(_totalClaimed[msg.sender] + amountOfCards <= MAX_CARDS_MINT, "Purchase exceeds max allowed per address"); require(amountOfCards > 0, "Must mint at least one card"); require(PRICE * amountOfCards == msg.value, "ETH amount is incorrect"); for (uint256 i = 0; i < amountOfCards; i++) { uint256 tokenId = numCardsMinted + 1; numCardsMinted += 1; _totalClaimed[msg.sender] += 1; _safeMint(msg.sender, tokenId); } emit PublicSaleMint(msg.sender, amountOfCards); } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdraw() public payable onlyOwner { } }
totalSupply()<MAX_CARDS-RESERVED_CARDS,"All tokens have been minted"
25,970
totalSupply()<MAX_CARDS-RESERVED_CARDS
"Minting would exceed max supply"
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev 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. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } pragma solidity ^0.8.0; contract EasyFinance is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_CARDS = 5500; uint256 public constant PRICE = 0.1 ether; uint256 public constant MAX_PER_MINT = 5; uint256 public constant MAX_CARDS_MINT = 5; uint256 public constant RESERVED_CARDS = 110; uint256 public reservedClaimed; uint256 public numCardsMinted; string public baseTokenURI; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PublicSaleMint(address minter, uint256 amountOfCards); constructor(string memory baseURI) ERC721("EasyFinance", "EAFI") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { } function amountClaimedBy(address owner) external view returns (uint256) { } function mint(uint256 amountOfCards) external payable { require(totalSupply() < MAX_CARDS - RESERVED_CARDS, "All tokens have been minted"); require(amountOfCards <= MAX_PER_MINT, "Cannot purchase this many tokens in a transaction"); require(<FILL_ME>) require(_totalClaimed[msg.sender] + amountOfCards <= MAX_CARDS_MINT, "Purchase exceeds max allowed per address"); require(amountOfCards > 0, "Must mint at least one card"); require(PRICE * amountOfCards == msg.value, "ETH amount is incorrect"); for (uint256 i = 0; i < amountOfCards; i++) { uint256 tokenId = numCardsMinted + 1; numCardsMinted += 1; _totalClaimed[msg.sender] += 1; _safeMint(msg.sender, tokenId); } emit PublicSaleMint(msg.sender, amountOfCards); } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdraw() public payable onlyOwner { } }
totalSupply()+amountOfCards<=MAX_CARDS-RESERVED_CARDS,"Minting would exceed max supply"
25,970
totalSupply()+amountOfCards<=MAX_CARDS-RESERVED_CARDS
"Purchase exceeds max allowed per address"
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev 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. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } pragma solidity ^0.8.0; contract EasyFinance is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_CARDS = 5500; uint256 public constant PRICE = 0.1 ether; uint256 public constant MAX_PER_MINT = 5; uint256 public constant MAX_CARDS_MINT = 5; uint256 public constant RESERVED_CARDS = 110; uint256 public reservedClaimed; uint256 public numCardsMinted; string public baseTokenURI; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PublicSaleMint(address minter, uint256 amountOfCards); constructor(string memory baseURI) ERC721("EasyFinance", "EAFI") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { } function amountClaimedBy(address owner) external view returns (uint256) { } function mint(uint256 amountOfCards) external payable { require(totalSupply() < MAX_CARDS - RESERVED_CARDS, "All tokens have been minted"); require(amountOfCards <= MAX_PER_MINT, "Cannot purchase this many tokens in a transaction"); require(totalSupply() + amountOfCards <= MAX_CARDS - RESERVED_CARDS, "Minting would exceed max supply"); require(<FILL_ME>) require(amountOfCards > 0, "Must mint at least one card"); require(PRICE * amountOfCards == msg.value, "ETH amount is incorrect"); for (uint256 i = 0; i < amountOfCards; i++) { uint256 tokenId = numCardsMinted + 1; numCardsMinted += 1; _totalClaimed[msg.sender] += 1; _safeMint(msg.sender, tokenId); } emit PublicSaleMint(msg.sender, amountOfCards); } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdraw() public payable onlyOwner { } }
_totalClaimed[msg.sender]+amountOfCards<=MAX_CARDS_MINT,"Purchase exceeds max allowed per address"
25,970
_totalClaimed[msg.sender]+amountOfCards<=MAX_CARDS_MINT
"ETH amount is incorrect"
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev 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. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } pragma solidity ^0.8.0; contract EasyFinance is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_CARDS = 5500; uint256 public constant PRICE = 0.1 ether; uint256 public constant MAX_PER_MINT = 5; uint256 public constant MAX_CARDS_MINT = 5; uint256 public constant RESERVED_CARDS = 110; uint256 public reservedClaimed; uint256 public numCardsMinted; string public baseTokenURI; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PublicSaleMint(address minter, uint256 amountOfCards); constructor(string memory baseURI) ERC721("EasyFinance", "EAFI") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { } function amountClaimedBy(address owner) external view returns (uint256) { } function mint(uint256 amountOfCards) external payable { require(totalSupply() < MAX_CARDS - RESERVED_CARDS, "All tokens have been minted"); require(amountOfCards <= MAX_PER_MINT, "Cannot purchase this many tokens in a transaction"); require(totalSupply() + amountOfCards <= MAX_CARDS - RESERVED_CARDS, "Minting would exceed max supply"); require(_totalClaimed[msg.sender] + amountOfCards <= MAX_CARDS_MINT, "Purchase exceeds max allowed per address"); require(amountOfCards > 0, "Must mint at least one card"); require(<FILL_ME>) for (uint256 i = 0; i < amountOfCards; i++) { uint256 tokenId = numCardsMinted + 1; numCardsMinted += 1; _totalClaimed[msg.sender] += 1; _safeMint(msg.sender, tokenId); } emit PublicSaleMint(msg.sender, amountOfCards); } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdraw() public payable onlyOwner { } }
PRICE*amountOfCards==msg.value,"ETH amount is incorrect"
25,970
PRICE*amountOfCards==msg.value
'Token URI is frozen'
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract BudRoyalty is ERC721, AccessControl, Ownable, Pausable{ bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); string private _baseTokenURI; bool private _isUriFrozen; uint public TOTAL_SUPPLY; using Counters for Counters.Counter; Counters.Counter tokenid; constructor( string memory NFTName, string memory NFTSymbol, string memory collectibleURI, address minter, uint _totalSupply ) ERC721(NFTName, NFTSymbol) { } modifier onlyAdmin() { } modifier onlyMinter() { } function _baseURI() internal view virtual override returns (string memory) { } function totalSupply() public view returns(uint){ } function setBaseURI(string memory _newBaseURI) public onlyAdmin{ require(<FILL_ME>) _baseTokenURI = _newBaseURI; } function freezeTokenURI() public onlyAdmin{ } function safeMint( address owner, uint qty ) public onlyMinter { } function currentCount() public view returns(uint) { } function pause() public onlyAdmin { } function unpause() public onlyAdmin { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, AccessControl) returns (bool) { } }
!_isUriFrozen,'Token URI is frozen'
25,995
!_isUriFrozen
"Ran out of quantity"
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract BudRoyalty is ERC721, AccessControl, Ownable, Pausable{ bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); string private _baseTokenURI; bool private _isUriFrozen; uint public TOTAL_SUPPLY; using Counters for Counters.Counter; Counters.Counter tokenid; constructor( string memory NFTName, string memory NFTSymbol, string memory collectibleURI, address minter, uint _totalSupply ) ERC721(NFTName, NFTSymbol) { } modifier onlyAdmin() { } modifier onlyMinter() { } function _baseURI() internal view virtual override returns (string memory) { } function totalSupply() public view returns(uint){ } function setBaseURI(string memory _newBaseURI) public onlyAdmin{ } function freezeTokenURI() public onlyAdmin{ } function safeMint( address owner, uint qty ) public onlyMinter { require(<FILL_ME>) for(uint i=0; i < qty; i++){ super._safeMint(owner, tokenid.current()); tokenid.increment(); } } function currentCount() public view returns(uint) { } function pause() public onlyAdmin { } function unpause() public onlyAdmin { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, AccessControl) returns (bool) { } }
tokenid.current()+qty<TOTAL_SUPPLY+1,"Ran out of quantity"
25,995
tokenid.current()+qty<TOTAL_SUPPLY+1
"Owner Invalid"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import "./CyberGorillas.sol"; import "./GrillaToken.sol"; import "./ERC721.sol"; import "./Strings.sol"; import "./RewardBoostProvider.sol"; import "./Ownable.sol"; /* ______ __ ______ _ ____ / ____/_ __/ /_ ___ _____/ ____/___ _____(_) / /___ ______ / / / / / / __ \/ _ \/ ___/ / __/ __ \/ ___/ / / / __ `/ ___/ / /___/ /_/ / /_/ / __/ / / /_/ / /_/ / / / / / / /_/ (__ ) \____/\__, /_.___/\___/_/ \____/\____/_/ /_/_/_/\__,_/____/ /____/ */ /// @title Cyber Gorillas Staking /// @author delta devs (https://twitter.com/deltadevelopers) contract CyberGorillasStaking is Ownable { /*/////////////////////////////////////////////////////////////// CONTRACT STORAGE //////////////////////////////////////////////////////////////*/ /// @notice An instance of the GRILLA token, paid out as staking reward. GrillaToken public rewardsToken; /// @notice An ERC721 instance of the Cyber Gorillas contract. ERC721 public gorillaContract; /// @notice An address slot for a future contract to allow users to withdraw their rewards from multiple staking contracts in one call. address public rewardAggregator; /// @notice The reward rate for staking a regular gorilla. /// @dev The reward rate is fixed to 10 * 1E18 GRILLA every 86400 seconds, 1157407407407400 per second. uint256 constant normalRate = (100 * 1E18) / uint256(1 days); /// @notice The reward rate for staking a genesis gorilla. /// @dev The reward rate is fixed to 15 * 1E18 GRILLA every 86400 seconds, 1736111111111110 per second. uint256 constant genesisRate = (150 * 1E18) / uint256(1 days); /*/////////////////////////////////////////////////////////////// GORILLA METADATA STORAGE //////////////////////////////////////////////////////////////*/ /// @notice Keeps track of which gorilla's have the genesis trait. mapping(uint256 => bool) private genesisTokens; /// @notice A list of reward boost providers. RewardBoostProvider[] rewardBoostProviders; /*/////////////////////////////////////////////////////////////// STAKING STORAGE //////////////////////////////////////////////////////////////*/ /// @notice Returns the owner of the specified gorilla. mapping(uint256 => address) public tokenToAddr; /// @notice Returns the reward amount for the specified address. mapping(address => uint256) public rewards; /// @notice Returns the number of normal gorillas staked by specified address. mapping(address => uint256) public _balancesNormal; /// @notice Returns the number of genesis gorillas staked by specified address. mapping(address => uint256) public _balancesGenesis; /// @notice Returns the start time of staking rewards accumulation for a specified address. /// @dev The UNIX timestamp in seconds in which staking rewards were last claimed. /// This is later compared with block.timestamp to calculate the accumulated staking rewards. mapping(address => uint256) public _updateTimes; /*/////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor(address _gorillaContract, address _rewardsToken) { } /*/////////////////////////////////////////////////////////////// SETTERS //////////////////////////////////////////////////////////////*/ /// @notice Allows the contract deployer to specify which gorillas are to be considered of type genesis. /// @param genesisIndexes An array of indexes specifying which gorillas are of type genesis. function uploadGenesisArray(uint256[] memory genesisIndexes) public onlyOwner { } /*/////////////////////////////////////////////////////////////// VIEWS //////////////////////////////////////////////////////////////*/ /// @notice Returns the accumulated staking rewards of the function caller. /// @return The amount of GRILLA earned while staking. function viewReward() public view returns (uint256) { } /// @notice Calculates the accumulated staking reward for the requested address. /// @param account The address of the staker. /// @return The amount of GRILLA earned while staking. function rewardDifferential(address account) public view returns (uint256) { } /// @notice Returns true if gorilla has the genesis trait, false otherwise. /// @return Whether the requested gorilla has the genesis trait. function isGenesis(uint256 tokenId) private view returns (bool) { } /// @notice Returns true if the requested address is staking at least one genesis gorilla, false otherwise. /// @return Whether the requested address is staking genesis gorillas. function isStakingGenesis(address account) public view returns (bool) { } /// @notice Returns true if the requested address is staking normal gorillas, false otherwise. /// @return Whether the requested address is staking normal gorillas. function isStakingNormal(address account) public view returns (bool) { } /// @notice Modifier which updates the timestamp of when a staker last withdrew staking rewards. /// @param account The address of the staker. modifier updateReward(address account) { } /// @notice Sets the reward aggregator. /// @param _rewardAggregator The address of the reward aggregation contract. function setRewardAggregator(address _rewardAggregator) public onlyOwner { } /// @notice Adds a reward booster. /// @param booster The address of the booster. function addRewardBoostProvider(address booster) public onlyOwner { } /// @notice Remove a specific reward booster at a specific index. /// @param index Index of the booster to remove. function removeRewardBoostProvider(uint256 index) public onlyOwner { } /*/////////////////////////////////////////////////////////////// STAKING LOGIC //////////////////////////////////////////////////////////////*/ // TODO: This function is only for testing, can be removed // REASONING: Nothing else calls it, and a user would not spend the gas // necessary in order to updateReward() function earned(address account) public updateReward(account) returns (uint256) { } /// @notice Allows a staker to withdraw their rewards. /// @return The amount of GRILLA earned from staking. function withdrawReward() public updateReward(msg.sender) returns (uint256) { } /// @notice Allows a contract to withdraw the rewards on behalf of a user. /// @return The amount of GRILLA earned from staking. function withdrawReward(address user) public updateReward(user) returns (uint256) { } /// @notice Allows a holder to stake a gorilla. /// @dev First checks whether the specified gorilla has the genesis trait. Updates balances accordingly. /// unchecked, because no arithmetic overflow is possible. /// @param _tokenId A specific gorilla, identified by its token ID. function stake(uint256 _tokenId) public updateReward(msg.sender) { } /// @notice Allows a staker to stake multiple gorillas at once. /// @param tokenIds An array of token IDs, representing multiple gorillas. function stakeMultiple(uint256[] memory tokenIds) public updateReward(msg.sender) { } /// @notice Allows a staker to unstake a staked gorilla. /// @param _tokenId A specific gorilla, identified by its token ID. function unstake(uint256 _tokenId) public updateReward(msg.sender) { require(<FILL_ME>) bool isGen = isGenesis(_tokenId); unchecked { if (isGen) { _balancesGenesis[msg.sender]--; } else { _balancesNormal[msg.sender]--; } } delete tokenToAddr[_tokenId]; gorillaContract.transferFrom(address(this), msg.sender, _tokenId); } /// @notice Allows a staker to unstake multiple gorillas at once. /// @param tokenIds An array of token IDs, representing multiple gorillas. function unstakeMultiple(uint256[] memory tokenIds) public updateReward(msg.sender) { } }
tokenToAddr[_tokenId]==msg.sender,"Owner Invalid"
26,009
tokenToAddr[_tokenId]==msg.sender
"Access denied."
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import './BaseToken.sol'; import './ABDKMath64x64.sol'; contract Files is BaseToken { using ABDKMath64x64 for int128; enum EntryKind { NONE, DOWNLOADS, LINK, CATEGORY } uint256 constant LINK_KIND_LINK = 0; uint256 constant LINK_KIND_MESSAGE = 1; string public name; uint8 public decimals; string public symbol; // 64.64 fixed point number int128 public salesOwnersShare = int128(1).divi(int128(10)); // 10% int128 public upvotesOwnersShare = int128(1).divi(int128(2)); // 50% int128 public uploadOwnersShare = int128(15).divi(int128(100)); // 15% int128 public buyerAffiliateShare = int128(1).divi(int128(10)); // 10% int128 public sellerAffiliateShare = int128(15).divi(int128(100)); // 15% uint maxId = 0; mapping (uint => EntryKind) entries; // to avoid categories with duplicate titles: mapping (string => mapping (string => uint)) categoryTitles; // locale => (title => id) mapping (string => address payable) nickAddresses; mapping (address => string) addressNicks; event SetOwner(address payable owner); // share is 64.64 fixed point number event SetSalesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUpvotesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUploadOwnerShare(int128 share); // share is 64.64 fixed point number event SetBuyerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetSellerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetNick(address payable indexed owner, string nick); event SetARWallet(address payable indexed owner, string arWallet); event SetAuthorInfo(address payable indexed owner, string link, string shortDescription, string description, string locale); event ItemCreated(uint indexed itemId); event SetItemOwner(uint indexed itemId, address payable indexed owner); event ItemUpdated(uint indexed itemId, ItemInfo info); event LinkUpdated(uint indexed linkId, string link, string title, string shortDescription, string description, string locale, uint256 indexed linkKind); event ItemCoverUpdated(uint indexed itemId, uint indexed version, bytes cover, uint width, uint height); event ItemFilesUpdated(uint indexed itemId, string format, uint indexed version, bytes hash); event SetLastItemVersion(uint indexed itemId, uint version); event CategoryCreated(uint256 indexed categoryId, address indexed owner); // zero owner - no owner event CategoryUpdated(uint256 indexed categoryId, string title, string locale); event OwnedCategoryUpdated(uint256 indexed categoryId, string title, string shortDescription, string description, string locale, address indexed owner); event ChildParentVote(uint child, uint parent, int256 value, int256 featureLevel, bool primary); // Vote is primary if it's an owner's vote. event Pay(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); event Donate(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); address payable public founder; mapping (uint => address payable) public itemOwners; mapping (uint => mapping (uint => int256)) private childParentVotes; mapping (uint => uint256) public pricesETH; mapping (uint => uint256) public pricesAR; constructor(address payable _founder, uint256 _initialBalance) public { } // Owners // function setOwner(address payable _founder) external { } // _share is 64.64 fixed point number function setSalesOwnersShare(int128 _share) external { } function setUpvotesOwnersShare(int128 _share) external { } function setUploadOwnersShare(int128 _share) external { } function setBuyerAffiliateShare(int128 _share) external { } function setSellerAffiliateShare(int128 _share) external { } function setItemOwner(uint _itemId, address payable _owner) external { require(<FILL_ME>) itemOwners[_itemId] = _owner; emit SetItemOwner(_itemId, _owner); } // Wallets // function setARWallet(string calldata _arWallet) external { } // TODO: Test. function setNick(string calldata _nick) external { } function setAuthorInfo(string calldata _link, string calldata _shortDescription, string calldata _description, string calldata _locale) external { } // Items // struct ItemInfo { string title; string shortDescription; string description; uint256 priceETH; uint256 priceAR; string locale; string license; } function createItem(ItemInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateItem(uint _itemId, ItemInfo calldata _info) external { } struct LinkInfo { string link; string title; string shortDescription; string description; string locale; uint256 linkKind; } function createLink(LinkInfo calldata _info, bool _owned, address payable _affiliate) external returns (uint) { } // Can be used for spam. function updateLink(uint _linkId, LinkInfo calldata _info) external { } function updateItemCover(uint _itemId, uint _version, bytes calldata _cover, uint _width, uint _height) external { } function uploadFile(uint _itemId, uint _version, string calldata _format, bytes calldata _hash) external { } function setLastItemVersion(uint _itemId, uint _version) external { } function pay(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } function donate(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } // Categories // function createCategory(string calldata _title, string calldata _locale, address payable _affiliate) external returns (uint) { } struct OwnedCategoryInfo { string title; string shortDescription; string description; string locale; } function createOwnedCategory(OwnedCategoryInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateOwnedCategory(uint _categoryId, OwnedCategoryInfo calldata _info) external { } // Voting // function voteChildParent(uint _child, uint _parent, bool _yes, address payable _affiliate) external payable { } function voteForOwnChild(uint _child, uint _parent) external payable { } // _value > 0 - present function setMyChildParent(uint _child, uint _parent, int256 _value, int256 _featureLevel) external { } function getChildParentVotes(uint _child, uint _parent) external view returns (int256) { } // PST // uint256 totalDividends = 0; uint256 totalDividendsPaid = 0; // actually paid sum mapping(address => uint256) lastTotalDivedends; // the value of totalDividends after the last payment to an address function _dividendsOwing(address _account) internal view returns(uint256) { } function dividendsOwing(address _account) external view returns(uint256) { } function withdrawProfit() external { } function payToShareholders(uint256 _amount, address _author) internal { } // Affiliates // mapping (address => address payable) affiliates; // Last affiliate wins. function setAffiliate(address payable _affiliate) internal { } }
itemOwners[_itemId]==msg.sender,"Access denied."
26,089
itemOwners[_itemId]==msg.sender
"Nick taken."
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import './BaseToken.sol'; import './ABDKMath64x64.sol'; contract Files is BaseToken { using ABDKMath64x64 for int128; enum EntryKind { NONE, DOWNLOADS, LINK, CATEGORY } uint256 constant LINK_KIND_LINK = 0; uint256 constant LINK_KIND_MESSAGE = 1; string public name; uint8 public decimals; string public symbol; // 64.64 fixed point number int128 public salesOwnersShare = int128(1).divi(int128(10)); // 10% int128 public upvotesOwnersShare = int128(1).divi(int128(2)); // 50% int128 public uploadOwnersShare = int128(15).divi(int128(100)); // 15% int128 public buyerAffiliateShare = int128(1).divi(int128(10)); // 10% int128 public sellerAffiliateShare = int128(15).divi(int128(100)); // 15% uint maxId = 0; mapping (uint => EntryKind) entries; // to avoid categories with duplicate titles: mapping (string => mapping (string => uint)) categoryTitles; // locale => (title => id) mapping (string => address payable) nickAddresses; mapping (address => string) addressNicks; event SetOwner(address payable owner); // share is 64.64 fixed point number event SetSalesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUpvotesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUploadOwnerShare(int128 share); // share is 64.64 fixed point number event SetBuyerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetSellerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetNick(address payable indexed owner, string nick); event SetARWallet(address payable indexed owner, string arWallet); event SetAuthorInfo(address payable indexed owner, string link, string shortDescription, string description, string locale); event ItemCreated(uint indexed itemId); event SetItemOwner(uint indexed itemId, address payable indexed owner); event ItemUpdated(uint indexed itemId, ItemInfo info); event LinkUpdated(uint indexed linkId, string link, string title, string shortDescription, string description, string locale, uint256 indexed linkKind); event ItemCoverUpdated(uint indexed itemId, uint indexed version, bytes cover, uint width, uint height); event ItemFilesUpdated(uint indexed itemId, string format, uint indexed version, bytes hash); event SetLastItemVersion(uint indexed itemId, uint version); event CategoryCreated(uint256 indexed categoryId, address indexed owner); // zero owner - no owner event CategoryUpdated(uint256 indexed categoryId, string title, string locale); event OwnedCategoryUpdated(uint256 indexed categoryId, string title, string shortDescription, string description, string locale, address indexed owner); event ChildParentVote(uint child, uint parent, int256 value, int256 featureLevel, bool primary); // Vote is primary if it's an owner's vote. event Pay(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); event Donate(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); address payable public founder; mapping (uint => address payable) public itemOwners; mapping (uint => mapping (uint => int256)) private childParentVotes; mapping (uint => uint256) public pricesETH; mapping (uint => uint256) public pricesAR; constructor(address payable _founder, uint256 _initialBalance) public { } // Owners // function setOwner(address payable _founder) external { } // _share is 64.64 fixed point number function setSalesOwnersShare(int128 _share) external { } function setUpvotesOwnersShare(int128 _share) external { } function setUploadOwnersShare(int128 _share) external { } function setBuyerAffiliateShare(int128 _share) external { } function setSellerAffiliateShare(int128 _share) external { } function setItemOwner(uint _itemId, address payable _owner) external { } // Wallets // function setARWallet(string calldata _arWallet) external { } // TODO: Test. function setNick(string calldata _nick) external { require(<FILL_ME>) nickAddresses[addressNicks[msg.sender]] = address(0); nickAddresses[_nick] = msg.sender; addressNicks[msg.sender] = _nick; emit SetNick(msg.sender, _nick); } function setAuthorInfo(string calldata _link, string calldata _shortDescription, string calldata _description, string calldata _locale) external { } // Items // struct ItemInfo { string title; string shortDescription; string description; uint256 priceETH; uint256 priceAR; string locale; string license; } function createItem(ItemInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateItem(uint _itemId, ItemInfo calldata _info) external { } struct LinkInfo { string link; string title; string shortDescription; string description; string locale; uint256 linkKind; } function createLink(LinkInfo calldata _info, bool _owned, address payable _affiliate) external returns (uint) { } // Can be used for spam. function updateLink(uint _linkId, LinkInfo calldata _info) external { } function updateItemCover(uint _itemId, uint _version, bytes calldata _cover, uint _width, uint _height) external { } function uploadFile(uint _itemId, uint _version, string calldata _format, bytes calldata _hash) external { } function setLastItemVersion(uint _itemId, uint _version) external { } function pay(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } function donate(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } // Categories // function createCategory(string calldata _title, string calldata _locale, address payable _affiliate) external returns (uint) { } struct OwnedCategoryInfo { string title; string shortDescription; string description; string locale; } function createOwnedCategory(OwnedCategoryInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateOwnedCategory(uint _categoryId, OwnedCategoryInfo calldata _info) external { } // Voting // function voteChildParent(uint _child, uint _parent, bool _yes, address payable _affiliate) external payable { } function voteForOwnChild(uint _child, uint _parent) external payable { } // _value > 0 - present function setMyChildParent(uint _child, uint _parent, int256 _value, int256 _featureLevel) external { } function getChildParentVotes(uint _child, uint _parent) external view returns (int256) { } // PST // uint256 totalDividends = 0; uint256 totalDividendsPaid = 0; // actually paid sum mapping(address => uint256) lastTotalDivedends; // the value of totalDividends after the last payment to an address function _dividendsOwing(address _account) internal view returns(uint256) { } function dividendsOwing(address _account) external view returns(uint256) { } function withdrawProfit() external { } function payToShareholders(uint256 _amount, address _author) internal { } // Affiliates // mapping (address => address payable) affiliates; // Last affiliate wins. function setAffiliate(address payable _affiliate) internal { } }
nickAddresses[_nick]==address(0),"Nick taken."
26,089
nickAddresses[_nick]==address(0)
"Empty title."
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import './BaseToken.sol'; import './ABDKMath64x64.sol'; contract Files is BaseToken { using ABDKMath64x64 for int128; enum EntryKind { NONE, DOWNLOADS, LINK, CATEGORY } uint256 constant LINK_KIND_LINK = 0; uint256 constant LINK_KIND_MESSAGE = 1; string public name; uint8 public decimals; string public symbol; // 64.64 fixed point number int128 public salesOwnersShare = int128(1).divi(int128(10)); // 10% int128 public upvotesOwnersShare = int128(1).divi(int128(2)); // 50% int128 public uploadOwnersShare = int128(15).divi(int128(100)); // 15% int128 public buyerAffiliateShare = int128(1).divi(int128(10)); // 10% int128 public sellerAffiliateShare = int128(15).divi(int128(100)); // 15% uint maxId = 0; mapping (uint => EntryKind) entries; // to avoid categories with duplicate titles: mapping (string => mapping (string => uint)) categoryTitles; // locale => (title => id) mapping (string => address payable) nickAddresses; mapping (address => string) addressNicks; event SetOwner(address payable owner); // share is 64.64 fixed point number event SetSalesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUpvotesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUploadOwnerShare(int128 share); // share is 64.64 fixed point number event SetBuyerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetSellerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetNick(address payable indexed owner, string nick); event SetARWallet(address payable indexed owner, string arWallet); event SetAuthorInfo(address payable indexed owner, string link, string shortDescription, string description, string locale); event ItemCreated(uint indexed itemId); event SetItemOwner(uint indexed itemId, address payable indexed owner); event ItemUpdated(uint indexed itemId, ItemInfo info); event LinkUpdated(uint indexed linkId, string link, string title, string shortDescription, string description, string locale, uint256 indexed linkKind); event ItemCoverUpdated(uint indexed itemId, uint indexed version, bytes cover, uint width, uint height); event ItemFilesUpdated(uint indexed itemId, string format, uint indexed version, bytes hash); event SetLastItemVersion(uint indexed itemId, uint version); event CategoryCreated(uint256 indexed categoryId, address indexed owner); // zero owner - no owner event CategoryUpdated(uint256 indexed categoryId, string title, string locale); event OwnedCategoryUpdated(uint256 indexed categoryId, string title, string shortDescription, string description, string locale, address indexed owner); event ChildParentVote(uint child, uint parent, int256 value, int256 featureLevel, bool primary); // Vote is primary if it's an owner's vote. event Pay(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); event Donate(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); address payable public founder; mapping (uint => address payable) public itemOwners; mapping (uint => mapping (uint => int256)) private childParentVotes; mapping (uint => uint256) public pricesETH; mapping (uint => uint256) public pricesAR; constructor(address payable _founder, uint256 _initialBalance) public { } // Owners // function setOwner(address payable _founder) external { } // _share is 64.64 fixed point number function setSalesOwnersShare(int128 _share) external { } function setUpvotesOwnersShare(int128 _share) external { } function setUploadOwnersShare(int128 _share) external { } function setBuyerAffiliateShare(int128 _share) external { } function setSellerAffiliateShare(int128 _share) external { } function setItemOwner(uint _itemId, address payable _owner) external { } // Wallets // function setARWallet(string calldata _arWallet) external { } // TODO: Test. function setNick(string calldata _nick) external { } function setAuthorInfo(string calldata _link, string calldata _shortDescription, string calldata _description, string calldata _locale) external { } // Items // struct ItemInfo { string title; string shortDescription; string description; uint256 priceETH; uint256 priceAR; string locale; string license; } function createItem(ItemInfo calldata _info, address payable _affiliate) external returns (uint) { require(<FILL_ME>) setAffiliate(_affiliate); itemOwners[++maxId] = msg.sender; pricesETH[maxId] = _info.priceETH; pricesAR[maxId] = _info.priceAR; entries[maxId] = EntryKind.DOWNLOADS; emit ItemCreated(maxId); emit SetItemOwner(maxId, msg.sender); emit ItemUpdated(maxId, _info); return maxId; } function updateItem(uint _itemId, ItemInfo calldata _info) external { } struct LinkInfo { string link; string title; string shortDescription; string description; string locale; uint256 linkKind; } function createLink(LinkInfo calldata _info, bool _owned, address payable _affiliate) external returns (uint) { } // Can be used for spam. function updateLink(uint _linkId, LinkInfo calldata _info) external { } function updateItemCover(uint _itemId, uint _version, bytes calldata _cover, uint _width, uint _height) external { } function uploadFile(uint _itemId, uint _version, string calldata _format, bytes calldata _hash) external { } function setLastItemVersion(uint _itemId, uint _version) external { } function pay(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } function donate(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } // Categories // function createCategory(string calldata _title, string calldata _locale, address payable _affiliate) external returns (uint) { } struct OwnedCategoryInfo { string title; string shortDescription; string description; string locale; } function createOwnedCategory(OwnedCategoryInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateOwnedCategory(uint _categoryId, OwnedCategoryInfo calldata _info) external { } // Voting // function voteChildParent(uint _child, uint _parent, bool _yes, address payable _affiliate) external payable { } function voteForOwnChild(uint _child, uint _parent) external payable { } // _value > 0 - present function setMyChildParent(uint _child, uint _parent, int256 _value, int256 _featureLevel) external { } function getChildParentVotes(uint _child, uint _parent) external view returns (int256) { } // PST // uint256 totalDividends = 0; uint256 totalDividendsPaid = 0; // actually paid sum mapping(address => uint256) lastTotalDivedends; // the value of totalDividends after the last payment to an address function _dividendsOwing(address _account) internal view returns(uint256) { } function dividendsOwing(address _account) external view returns(uint256) { } function withdrawProfit() external { } function payToShareholders(uint256 _amount, address _author) internal { } // Affiliates // mapping (address => address payable) affiliates; // Last affiliate wins. function setAffiliate(address payable _affiliate) internal { } }
bytes(_info.title).length!=0,"Empty title."
26,089
bytes(_info.title).length!=0
"Item does not exist."
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import './BaseToken.sol'; import './ABDKMath64x64.sol'; contract Files is BaseToken { using ABDKMath64x64 for int128; enum EntryKind { NONE, DOWNLOADS, LINK, CATEGORY } uint256 constant LINK_KIND_LINK = 0; uint256 constant LINK_KIND_MESSAGE = 1; string public name; uint8 public decimals; string public symbol; // 64.64 fixed point number int128 public salesOwnersShare = int128(1).divi(int128(10)); // 10% int128 public upvotesOwnersShare = int128(1).divi(int128(2)); // 50% int128 public uploadOwnersShare = int128(15).divi(int128(100)); // 15% int128 public buyerAffiliateShare = int128(1).divi(int128(10)); // 10% int128 public sellerAffiliateShare = int128(15).divi(int128(100)); // 15% uint maxId = 0; mapping (uint => EntryKind) entries; // to avoid categories with duplicate titles: mapping (string => mapping (string => uint)) categoryTitles; // locale => (title => id) mapping (string => address payable) nickAddresses; mapping (address => string) addressNicks; event SetOwner(address payable owner); // share is 64.64 fixed point number event SetSalesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUpvotesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUploadOwnerShare(int128 share); // share is 64.64 fixed point number event SetBuyerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetSellerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetNick(address payable indexed owner, string nick); event SetARWallet(address payable indexed owner, string arWallet); event SetAuthorInfo(address payable indexed owner, string link, string shortDescription, string description, string locale); event ItemCreated(uint indexed itemId); event SetItemOwner(uint indexed itemId, address payable indexed owner); event ItemUpdated(uint indexed itemId, ItemInfo info); event LinkUpdated(uint indexed linkId, string link, string title, string shortDescription, string description, string locale, uint256 indexed linkKind); event ItemCoverUpdated(uint indexed itemId, uint indexed version, bytes cover, uint width, uint height); event ItemFilesUpdated(uint indexed itemId, string format, uint indexed version, bytes hash); event SetLastItemVersion(uint indexed itemId, uint version); event CategoryCreated(uint256 indexed categoryId, address indexed owner); // zero owner - no owner event CategoryUpdated(uint256 indexed categoryId, string title, string locale); event OwnedCategoryUpdated(uint256 indexed categoryId, string title, string shortDescription, string description, string locale, address indexed owner); event ChildParentVote(uint child, uint parent, int256 value, int256 featureLevel, bool primary); // Vote is primary if it's an owner's vote. event Pay(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); event Donate(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); address payable public founder; mapping (uint => address payable) public itemOwners; mapping (uint => mapping (uint => int256)) private childParentVotes; mapping (uint => uint256) public pricesETH; mapping (uint => uint256) public pricesAR; constructor(address payable _founder, uint256 _initialBalance) public { } // Owners // function setOwner(address payable _founder) external { } // _share is 64.64 fixed point number function setSalesOwnersShare(int128 _share) external { } function setUpvotesOwnersShare(int128 _share) external { } function setUploadOwnersShare(int128 _share) external { } function setBuyerAffiliateShare(int128 _share) external { } function setSellerAffiliateShare(int128 _share) external { } function setItemOwner(uint _itemId, address payable _owner) external { } // Wallets // function setARWallet(string calldata _arWallet) external { } // TODO: Test. function setNick(string calldata _nick) external { } function setAuthorInfo(string calldata _link, string calldata _shortDescription, string calldata _description, string calldata _locale) external { } // Items // struct ItemInfo { string title; string shortDescription; string description; uint256 priceETH; uint256 priceAR; string locale; string license; } function createItem(ItemInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateItem(uint _itemId, ItemInfo calldata _info) external { require(itemOwners[_itemId] == msg.sender, "Attempt to modify other's item."); require(<FILL_ME>) require(bytes(_info.title).length != 0, "Empty title."); pricesETH[_itemId] = _info.priceETH; pricesAR[_itemId] = _info.priceAR; emit ItemUpdated(_itemId, _info); } struct LinkInfo { string link; string title; string shortDescription; string description; string locale; uint256 linkKind; } function createLink(LinkInfo calldata _info, bool _owned, address payable _affiliate) external returns (uint) { } // Can be used for spam. function updateLink(uint _linkId, LinkInfo calldata _info) external { } function updateItemCover(uint _itemId, uint _version, bytes calldata _cover, uint _width, uint _height) external { } function uploadFile(uint _itemId, uint _version, string calldata _format, bytes calldata _hash) external { } function setLastItemVersion(uint _itemId, uint _version) external { } function pay(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } function donate(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } // Categories // function createCategory(string calldata _title, string calldata _locale, address payable _affiliate) external returns (uint) { } struct OwnedCategoryInfo { string title; string shortDescription; string description; string locale; } function createOwnedCategory(OwnedCategoryInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateOwnedCategory(uint _categoryId, OwnedCategoryInfo calldata _info) external { } // Voting // function voteChildParent(uint _child, uint _parent, bool _yes, address payable _affiliate) external payable { } function voteForOwnChild(uint _child, uint _parent) external payable { } // _value > 0 - present function setMyChildParent(uint _child, uint _parent, int256 _value, int256 _featureLevel) external { } function getChildParentVotes(uint _child, uint _parent) external view returns (int256) { } // PST // uint256 totalDividends = 0; uint256 totalDividendsPaid = 0; // actually paid sum mapping(address => uint256) lastTotalDivedends; // the value of totalDividends after the last payment to an address function _dividendsOwing(address _account) internal view returns(uint256) { } function dividendsOwing(address _account) external view returns(uint256) { } function withdrawProfit() external { } function payToShareholders(uint256 _amount, address _author) internal { } // Affiliates // mapping (address => address payable) affiliates; // Last affiliate wins. function setAffiliate(address payable _affiliate) internal { } }
entries[_itemId]==EntryKind.DOWNLOADS,"Item does not exist."
26,089
entries[_itemId]==EntryKind.DOWNLOADS
"Attempt to modify other's link."
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import './BaseToken.sol'; import './ABDKMath64x64.sol'; contract Files is BaseToken { using ABDKMath64x64 for int128; enum EntryKind { NONE, DOWNLOADS, LINK, CATEGORY } uint256 constant LINK_KIND_LINK = 0; uint256 constant LINK_KIND_MESSAGE = 1; string public name; uint8 public decimals; string public symbol; // 64.64 fixed point number int128 public salesOwnersShare = int128(1).divi(int128(10)); // 10% int128 public upvotesOwnersShare = int128(1).divi(int128(2)); // 50% int128 public uploadOwnersShare = int128(15).divi(int128(100)); // 15% int128 public buyerAffiliateShare = int128(1).divi(int128(10)); // 10% int128 public sellerAffiliateShare = int128(15).divi(int128(100)); // 15% uint maxId = 0; mapping (uint => EntryKind) entries; // to avoid categories with duplicate titles: mapping (string => mapping (string => uint)) categoryTitles; // locale => (title => id) mapping (string => address payable) nickAddresses; mapping (address => string) addressNicks; event SetOwner(address payable owner); // share is 64.64 fixed point number event SetSalesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUpvotesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUploadOwnerShare(int128 share); // share is 64.64 fixed point number event SetBuyerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetSellerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetNick(address payable indexed owner, string nick); event SetARWallet(address payable indexed owner, string arWallet); event SetAuthorInfo(address payable indexed owner, string link, string shortDescription, string description, string locale); event ItemCreated(uint indexed itemId); event SetItemOwner(uint indexed itemId, address payable indexed owner); event ItemUpdated(uint indexed itemId, ItemInfo info); event LinkUpdated(uint indexed linkId, string link, string title, string shortDescription, string description, string locale, uint256 indexed linkKind); event ItemCoverUpdated(uint indexed itemId, uint indexed version, bytes cover, uint width, uint height); event ItemFilesUpdated(uint indexed itemId, string format, uint indexed version, bytes hash); event SetLastItemVersion(uint indexed itemId, uint version); event CategoryCreated(uint256 indexed categoryId, address indexed owner); // zero owner - no owner event CategoryUpdated(uint256 indexed categoryId, string title, string locale); event OwnedCategoryUpdated(uint256 indexed categoryId, string title, string shortDescription, string description, string locale, address indexed owner); event ChildParentVote(uint child, uint parent, int256 value, int256 featureLevel, bool primary); // Vote is primary if it's an owner's vote. event Pay(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); event Donate(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); address payable public founder; mapping (uint => address payable) public itemOwners; mapping (uint => mapping (uint => int256)) private childParentVotes; mapping (uint => uint256) public pricesETH; mapping (uint => uint256) public pricesAR; constructor(address payable _founder, uint256 _initialBalance) public { } // Owners // function setOwner(address payable _founder) external { } // _share is 64.64 fixed point number function setSalesOwnersShare(int128 _share) external { } function setUpvotesOwnersShare(int128 _share) external { } function setUploadOwnersShare(int128 _share) external { } function setBuyerAffiliateShare(int128 _share) external { } function setSellerAffiliateShare(int128 _share) external { } function setItemOwner(uint _itemId, address payable _owner) external { } // Wallets // function setARWallet(string calldata _arWallet) external { } // TODO: Test. function setNick(string calldata _nick) external { } function setAuthorInfo(string calldata _link, string calldata _shortDescription, string calldata _description, string calldata _locale) external { } // Items // struct ItemInfo { string title; string shortDescription; string description; uint256 priceETH; uint256 priceAR; string locale; string license; } function createItem(ItemInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateItem(uint _itemId, ItemInfo calldata _info) external { } struct LinkInfo { string link; string title; string shortDescription; string description; string locale; uint256 linkKind; } function createLink(LinkInfo calldata _info, bool _owned, address payable _affiliate) external returns (uint) { } // Can be used for spam. function updateLink(uint _linkId, LinkInfo calldata _info) external { require(<FILL_ME>) // only owned links require(bytes(_info.title).length != 0, "Empty title."); require(entries[_linkId] == EntryKind.LINK, "Link does not exist."); emit LinkUpdated(_linkId, _info.link, _info.title, _info.shortDescription, _info.description, _info.locale, _info.linkKind); } function updateItemCover(uint _itemId, uint _version, bytes calldata _cover, uint _width, uint _height) external { } function uploadFile(uint _itemId, uint _version, string calldata _format, bytes calldata _hash) external { } function setLastItemVersion(uint _itemId, uint _version) external { } function pay(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } function donate(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } // Categories // function createCategory(string calldata _title, string calldata _locale, address payable _affiliate) external returns (uint) { } struct OwnedCategoryInfo { string title; string shortDescription; string description; string locale; } function createOwnedCategory(OwnedCategoryInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateOwnedCategory(uint _categoryId, OwnedCategoryInfo calldata _info) external { } // Voting // function voteChildParent(uint _child, uint _parent, bool _yes, address payable _affiliate) external payable { } function voteForOwnChild(uint _child, uint _parent) external payable { } // _value > 0 - present function setMyChildParent(uint _child, uint _parent, int256 _value, int256 _featureLevel) external { } function getChildParentVotes(uint _child, uint _parent) external view returns (int256) { } // PST // uint256 totalDividends = 0; uint256 totalDividendsPaid = 0; // actually paid sum mapping(address => uint256) lastTotalDivedends; // the value of totalDividends after the last payment to an address function _dividendsOwing(address _account) internal view returns(uint256) { } function dividendsOwing(address _account) external view returns(uint256) { } function withdrawProfit() external { } function payToShareholders(uint256 _amount, address _author) internal { } // Affiliates // mapping (address => address payable) affiliates; // Last affiliate wins. function setAffiliate(address payable _affiliate) internal { } }
itemOwners[_linkId]==msg.sender,"Attempt to modify other's link."
26,089
itemOwners[_linkId]==msg.sender
"Link does not exist."
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import './BaseToken.sol'; import './ABDKMath64x64.sol'; contract Files is BaseToken { using ABDKMath64x64 for int128; enum EntryKind { NONE, DOWNLOADS, LINK, CATEGORY } uint256 constant LINK_KIND_LINK = 0; uint256 constant LINK_KIND_MESSAGE = 1; string public name; uint8 public decimals; string public symbol; // 64.64 fixed point number int128 public salesOwnersShare = int128(1).divi(int128(10)); // 10% int128 public upvotesOwnersShare = int128(1).divi(int128(2)); // 50% int128 public uploadOwnersShare = int128(15).divi(int128(100)); // 15% int128 public buyerAffiliateShare = int128(1).divi(int128(10)); // 10% int128 public sellerAffiliateShare = int128(15).divi(int128(100)); // 15% uint maxId = 0; mapping (uint => EntryKind) entries; // to avoid categories with duplicate titles: mapping (string => mapping (string => uint)) categoryTitles; // locale => (title => id) mapping (string => address payable) nickAddresses; mapping (address => string) addressNicks; event SetOwner(address payable owner); // share is 64.64 fixed point number event SetSalesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUpvotesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUploadOwnerShare(int128 share); // share is 64.64 fixed point number event SetBuyerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetSellerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetNick(address payable indexed owner, string nick); event SetARWallet(address payable indexed owner, string arWallet); event SetAuthorInfo(address payable indexed owner, string link, string shortDescription, string description, string locale); event ItemCreated(uint indexed itemId); event SetItemOwner(uint indexed itemId, address payable indexed owner); event ItemUpdated(uint indexed itemId, ItemInfo info); event LinkUpdated(uint indexed linkId, string link, string title, string shortDescription, string description, string locale, uint256 indexed linkKind); event ItemCoverUpdated(uint indexed itemId, uint indexed version, bytes cover, uint width, uint height); event ItemFilesUpdated(uint indexed itemId, string format, uint indexed version, bytes hash); event SetLastItemVersion(uint indexed itemId, uint version); event CategoryCreated(uint256 indexed categoryId, address indexed owner); // zero owner - no owner event CategoryUpdated(uint256 indexed categoryId, string title, string locale); event OwnedCategoryUpdated(uint256 indexed categoryId, string title, string shortDescription, string description, string locale, address indexed owner); event ChildParentVote(uint child, uint parent, int256 value, int256 featureLevel, bool primary); // Vote is primary if it's an owner's vote. event Pay(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); event Donate(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); address payable public founder; mapping (uint => address payable) public itemOwners; mapping (uint => mapping (uint => int256)) private childParentVotes; mapping (uint => uint256) public pricesETH; mapping (uint => uint256) public pricesAR; constructor(address payable _founder, uint256 _initialBalance) public { } // Owners // function setOwner(address payable _founder) external { } // _share is 64.64 fixed point number function setSalesOwnersShare(int128 _share) external { } function setUpvotesOwnersShare(int128 _share) external { } function setUploadOwnersShare(int128 _share) external { } function setBuyerAffiliateShare(int128 _share) external { } function setSellerAffiliateShare(int128 _share) external { } function setItemOwner(uint _itemId, address payable _owner) external { } // Wallets // function setARWallet(string calldata _arWallet) external { } // TODO: Test. function setNick(string calldata _nick) external { } function setAuthorInfo(string calldata _link, string calldata _shortDescription, string calldata _description, string calldata _locale) external { } // Items // struct ItemInfo { string title; string shortDescription; string description; uint256 priceETH; uint256 priceAR; string locale; string license; } function createItem(ItemInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateItem(uint _itemId, ItemInfo calldata _info) external { } struct LinkInfo { string link; string title; string shortDescription; string description; string locale; uint256 linkKind; } function createLink(LinkInfo calldata _info, bool _owned, address payable _affiliate) external returns (uint) { } // Can be used for spam. function updateLink(uint _linkId, LinkInfo calldata _info) external { require(itemOwners[_linkId] == msg.sender, "Attempt to modify other's link."); // only owned links require(bytes(_info.title).length != 0, "Empty title."); require(<FILL_ME>) emit LinkUpdated(_linkId, _info.link, _info.title, _info.shortDescription, _info.description, _info.locale, _info.linkKind); } function updateItemCover(uint _itemId, uint _version, bytes calldata _cover, uint _width, uint _height) external { } function uploadFile(uint _itemId, uint _version, string calldata _format, bytes calldata _hash) external { } function setLastItemVersion(uint _itemId, uint _version) external { } function pay(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } function donate(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } // Categories // function createCategory(string calldata _title, string calldata _locale, address payable _affiliate) external returns (uint) { } struct OwnedCategoryInfo { string title; string shortDescription; string description; string locale; } function createOwnedCategory(OwnedCategoryInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateOwnedCategory(uint _categoryId, OwnedCategoryInfo calldata _info) external { } // Voting // function voteChildParent(uint _child, uint _parent, bool _yes, address payable _affiliate) external payable { } function voteForOwnChild(uint _child, uint _parent) external payable { } // _value > 0 - present function setMyChildParent(uint _child, uint _parent, int256 _value, int256 _featureLevel) external { } function getChildParentVotes(uint _child, uint _parent) external view returns (int256) { } // PST // uint256 totalDividends = 0; uint256 totalDividendsPaid = 0; // actually paid sum mapping(address => uint256) lastTotalDivedends; // the value of totalDividends after the last payment to an address function _dividendsOwing(address _account) internal view returns(uint256) { } function dividendsOwing(address _account) external view returns(uint256) { } function withdrawProfit() external { } function payToShareholders(uint256 _amount, address _author) internal { } // Affiliates // mapping (address => address payable) affiliates; // Last affiliate wins. function setAffiliate(address payable _affiliate) internal { } }
entries[_linkId]==EntryKind.LINK,"Link does not exist."
26,089
entries[_linkId]==EntryKind.LINK
"Paid too little."
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import './BaseToken.sol'; import './ABDKMath64x64.sol'; contract Files is BaseToken { using ABDKMath64x64 for int128; enum EntryKind { NONE, DOWNLOADS, LINK, CATEGORY } uint256 constant LINK_KIND_LINK = 0; uint256 constant LINK_KIND_MESSAGE = 1; string public name; uint8 public decimals; string public symbol; // 64.64 fixed point number int128 public salesOwnersShare = int128(1).divi(int128(10)); // 10% int128 public upvotesOwnersShare = int128(1).divi(int128(2)); // 50% int128 public uploadOwnersShare = int128(15).divi(int128(100)); // 15% int128 public buyerAffiliateShare = int128(1).divi(int128(10)); // 10% int128 public sellerAffiliateShare = int128(15).divi(int128(100)); // 15% uint maxId = 0; mapping (uint => EntryKind) entries; // to avoid categories with duplicate titles: mapping (string => mapping (string => uint)) categoryTitles; // locale => (title => id) mapping (string => address payable) nickAddresses; mapping (address => string) addressNicks; event SetOwner(address payable owner); // share is 64.64 fixed point number event SetSalesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUpvotesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUploadOwnerShare(int128 share); // share is 64.64 fixed point number event SetBuyerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetSellerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetNick(address payable indexed owner, string nick); event SetARWallet(address payable indexed owner, string arWallet); event SetAuthorInfo(address payable indexed owner, string link, string shortDescription, string description, string locale); event ItemCreated(uint indexed itemId); event SetItemOwner(uint indexed itemId, address payable indexed owner); event ItemUpdated(uint indexed itemId, ItemInfo info); event LinkUpdated(uint indexed linkId, string link, string title, string shortDescription, string description, string locale, uint256 indexed linkKind); event ItemCoverUpdated(uint indexed itemId, uint indexed version, bytes cover, uint width, uint height); event ItemFilesUpdated(uint indexed itemId, string format, uint indexed version, bytes hash); event SetLastItemVersion(uint indexed itemId, uint version); event CategoryCreated(uint256 indexed categoryId, address indexed owner); // zero owner - no owner event CategoryUpdated(uint256 indexed categoryId, string title, string locale); event OwnedCategoryUpdated(uint256 indexed categoryId, string title, string shortDescription, string description, string locale, address indexed owner); event ChildParentVote(uint child, uint parent, int256 value, int256 featureLevel, bool primary); // Vote is primary if it's an owner's vote. event Pay(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); event Donate(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); address payable public founder; mapping (uint => address payable) public itemOwners; mapping (uint => mapping (uint => int256)) private childParentVotes; mapping (uint => uint256) public pricesETH; mapping (uint => uint256) public pricesAR; constructor(address payable _founder, uint256 _initialBalance) public { } // Owners // function setOwner(address payable _founder) external { } // _share is 64.64 fixed point number function setSalesOwnersShare(int128 _share) external { } function setUpvotesOwnersShare(int128 _share) external { } function setUploadOwnersShare(int128 _share) external { } function setBuyerAffiliateShare(int128 _share) external { } function setSellerAffiliateShare(int128 _share) external { } function setItemOwner(uint _itemId, address payable _owner) external { } // Wallets // function setARWallet(string calldata _arWallet) external { } // TODO: Test. function setNick(string calldata _nick) external { } function setAuthorInfo(string calldata _link, string calldata _shortDescription, string calldata _description, string calldata _locale) external { } // Items // struct ItemInfo { string title; string shortDescription; string description; uint256 priceETH; uint256 priceAR; string locale; string license; } function createItem(ItemInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateItem(uint _itemId, ItemInfo calldata _info) external { } struct LinkInfo { string link; string title; string shortDescription; string description; string locale; uint256 linkKind; } function createLink(LinkInfo calldata _info, bool _owned, address payable _affiliate) external returns (uint) { } // Can be used for spam. function updateLink(uint _linkId, LinkInfo calldata _info) external { } function updateItemCover(uint _itemId, uint _version, bytes calldata _cover, uint _width, uint _height) external { } function uploadFile(uint _itemId, uint _version, string calldata _format, bytes calldata _hash) external { } function setLastItemVersion(uint _itemId, uint _version) external { } function pay(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { require(<FILL_ME>) require(entries[_itemId] == EntryKind.DOWNLOADS, "Item does not exist."); setAffiliate(_affiliate); uint256 _shareholdersShare = uint256(salesOwnersShare.muli(int256(msg.value))); address payable _author = itemOwners[_itemId]; payToShareholders(_shareholdersShare, _author); uint256 toAuthor = msg.value - _shareholdersShare; _author.transfer(toAuthor); emit Pay(msg.sender, itemOwners[_itemId], _itemId, toAuthor); } function donate(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } // Categories // function createCategory(string calldata _title, string calldata _locale, address payable _affiliate) external returns (uint) { } struct OwnedCategoryInfo { string title; string shortDescription; string description; string locale; } function createOwnedCategory(OwnedCategoryInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateOwnedCategory(uint _categoryId, OwnedCategoryInfo calldata _info) external { } // Voting // function voteChildParent(uint _child, uint _parent, bool _yes, address payable _affiliate) external payable { } function voteForOwnChild(uint _child, uint _parent) external payable { } // _value > 0 - present function setMyChildParent(uint _child, uint _parent, int256 _value, int256 _featureLevel) external { } function getChildParentVotes(uint _child, uint _parent) external view returns (int256) { } // PST // uint256 totalDividends = 0; uint256 totalDividendsPaid = 0; // actually paid sum mapping(address => uint256) lastTotalDivedends; // the value of totalDividends after the last payment to an address function _dividendsOwing(address _account) internal view returns(uint256) { } function dividendsOwing(address _account) external view returns(uint256) { } function withdrawProfit() external { } function payToShareholders(uint256 _amount, address _author) internal { } // Affiliates // mapping (address => address payable) affiliates; // Last affiliate wins. function setAffiliate(address payable _affiliate) internal { } }
pricesETH[_itemId]<=msg.value,"Paid too little."
26,089
pricesETH[_itemId]<=msg.value
"Empty title."
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import './BaseToken.sol'; import './ABDKMath64x64.sol'; contract Files is BaseToken { using ABDKMath64x64 for int128; enum EntryKind { NONE, DOWNLOADS, LINK, CATEGORY } uint256 constant LINK_KIND_LINK = 0; uint256 constant LINK_KIND_MESSAGE = 1; string public name; uint8 public decimals; string public symbol; // 64.64 fixed point number int128 public salesOwnersShare = int128(1).divi(int128(10)); // 10% int128 public upvotesOwnersShare = int128(1).divi(int128(2)); // 50% int128 public uploadOwnersShare = int128(15).divi(int128(100)); // 15% int128 public buyerAffiliateShare = int128(1).divi(int128(10)); // 10% int128 public sellerAffiliateShare = int128(15).divi(int128(100)); // 15% uint maxId = 0; mapping (uint => EntryKind) entries; // to avoid categories with duplicate titles: mapping (string => mapping (string => uint)) categoryTitles; // locale => (title => id) mapping (string => address payable) nickAddresses; mapping (address => string) addressNicks; event SetOwner(address payable owner); // share is 64.64 fixed point number event SetSalesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUpvotesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUploadOwnerShare(int128 share); // share is 64.64 fixed point number event SetBuyerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetSellerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetNick(address payable indexed owner, string nick); event SetARWallet(address payable indexed owner, string arWallet); event SetAuthorInfo(address payable indexed owner, string link, string shortDescription, string description, string locale); event ItemCreated(uint indexed itemId); event SetItemOwner(uint indexed itemId, address payable indexed owner); event ItemUpdated(uint indexed itemId, ItemInfo info); event LinkUpdated(uint indexed linkId, string link, string title, string shortDescription, string description, string locale, uint256 indexed linkKind); event ItemCoverUpdated(uint indexed itemId, uint indexed version, bytes cover, uint width, uint height); event ItemFilesUpdated(uint indexed itemId, string format, uint indexed version, bytes hash); event SetLastItemVersion(uint indexed itemId, uint version); event CategoryCreated(uint256 indexed categoryId, address indexed owner); // zero owner - no owner event CategoryUpdated(uint256 indexed categoryId, string title, string locale); event OwnedCategoryUpdated(uint256 indexed categoryId, string title, string shortDescription, string description, string locale, address indexed owner); event ChildParentVote(uint child, uint parent, int256 value, int256 featureLevel, bool primary); // Vote is primary if it's an owner's vote. event Pay(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); event Donate(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); address payable public founder; mapping (uint => address payable) public itemOwners; mapping (uint => mapping (uint => int256)) private childParentVotes; mapping (uint => uint256) public pricesETH; mapping (uint => uint256) public pricesAR; constructor(address payable _founder, uint256 _initialBalance) public { } // Owners // function setOwner(address payable _founder) external { } // _share is 64.64 fixed point number function setSalesOwnersShare(int128 _share) external { } function setUpvotesOwnersShare(int128 _share) external { } function setUploadOwnersShare(int128 _share) external { } function setBuyerAffiliateShare(int128 _share) external { } function setSellerAffiliateShare(int128 _share) external { } function setItemOwner(uint _itemId, address payable _owner) external { } // Wallets // function setARWallet(string calldata _arWallet) external { } // TODO: Test. function setNick(string calldata _nick) external { } function setAuthorInfo(string calldata _link, string calldata _shortDescription, string calldata _description, string calldata _locale) external { } // Items // struct ItemInfo { string title; string shortDescription; string description; uint256 priceETH; uint256 priceAR; string locale; string license; } function createItem(ItemInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateItem(uint _itemId, ItemInfo calldata _info) external { } struct LinkInfo { string link; string title; string shortDescription; string description; string locale; uint256 linkKind; } function createLink(LinkInfo calldata _info, bool _owned, address payable _affiliate) external returns (uint) { } // Can be used for spam. function updateLink(uint _linkId, LinkInfo calldata _info) external { } function updateItemCover(uint _itemId, uint _version, bytes calldata _cover, uint _width, uint _height) external { } function uploadFile(uint _itemId, uint _version, string calldata _format, bytes calldata _hash) external { } function setLastItemVersion(uint _itemId, uint _version) external { } function pay(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } function donate(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } // Categories // function createCategory(string calldata _title, string calldata _locale, address payable _affiliate) external returns (uint) { require(<FILL_ME>) setAffiliate(_affiliate); ++maxId; uint _id = categoryTitles[_locale][_title]; if(_id != 0) return _id; else categoryTitles[_locale][_title] = maxId; entries[maxId] = EntryKind.CATEGORY; // Yes, issue _owner two times, for faster information retrieval emit CategoryCreated(maxId, address(0)); emit CategoryUpdated(maxId, _title, _locale); return maxId; } struct OwnedCategoryInfo { string title; string shortDescription; string description; string locale; } function createOwnedCategory(OwnedCategoryInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateOwnedCategory(uint _categoryId, OwnedCategoryInfo calldata _info) external { } // Voting // function voteChildParent(uint _child, uint _parent, bool _yes, address payable _affiliate) external payable { } function voteForOwnChild(uint _child, uint _parent) external payable { } // _value > 0 - present function setMyChildParent(uint _child, uint _parent, int256 _value, int256 _featureLevel) external { } function getChildParentVotes(uint _child, uint _parent) external view returns (int256) { } // PST // uint256 totalDividends = 0; uint256 totalDividendsPaid = 0; // actually paid sum mapping(address => uint256) lastTotalDivedends; // the value of totalDividends after the last payment to an address function _dividendsOwing(address _account) internal view returns(uint256) { } function dividendsOwing(address _account) external view returns(uint256) { } function withdrawProfit() external { } function payToShareholders(uint256 _amount, address _author) internal { } // Affiliates // mapping (address => address payable) affiliates; // Last affiliate wins. function setAffiliate(address payable _affiliate) internal { } }
bytes(_title).length!=0,"Empty title."
26,089
bytes(_title).length!=0
"Access denied."
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import './BaseToken.sol'; import './ABDKMath64x64.sol'; contract Files is BaseToken { using ABDKMath64x64 for int128; enum EntryKind { NONE, DOWNLOADS, LINK, CATEGORY } uint256 constant LINK_KIND_LINK = 0; uint256 constant LINK_KIND_MESSAGE = 1; string public name; uint8 public decimals; string public symbol; // 64.64 fixed point number int128 public salesOwnersShare = int128(1).divi(int128(10)); // 10% int128 public upvotesOwnersShare = int128(1).divi(int128(2)); // 50% int128 public uploadOwnersShare = int128(15).divi(int128(100)); // 15% int128 public buyerAffiliateShare = int128(1).divi(int128(10)); // 10% int128 public sellerAffiliateShare = int128(15).divi(int128(100)); // 15% uint maxId = 0; mapping (uint => EntryKind) entries; // to avoid categories with duplicate titles: mapping (string => mapping (string => uint)) categoryTitles; // locale => (title => id) mapping (string => address payable) nickAddresses; mapping (address => string) addressNicks; event SetOwner(address payable owner); // share is 64.64 fixed point number event SetSalesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUpvotesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUploadOwnerShare(int128 share); // share is 64.64 fixed point number event SetBuyerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetSellerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetNick(address payable indexed owner, string nick); event SetARWallet(address payable indexed owner, string arWallet); event SetAuthorInfo(address payable indexed owner, string link, string shortDescription, string description, string locale); event ItemCreated(uint indexed itemId); event SetItemOwner(uint indexed itemId, address payable indexed owner); event ItemUpdated(uint indexed itemId, ItemInfo info); event LinkUpdated(uint indexed linkId, string link, string title, string shortDescription, string description, string locale, uint256 indexed linkKind); event ItemCoverUpdated(uint indexed itemId, uint indexed version, bytes cover, uint width, uint height); event ItemFilesUpdated(uint indexed itemId, string format, uint indexed version, bytes hash); event SetLastItemVersion(uint indexed itemId, uint version); event CategoryCreated(uint256 indexed categoryId, address indexed owner); // zero owner - no owner event CategoryUpdated(uint256 indexed categoryId, string title, string locale); event OwnedCategoryUpdated(uint256 indexed categoryId, string title, string shortDescription, string description, string locale, address indexed owner); event ChildParentVote(uint child, uint parent, int256 value, int256 featureLevel, bool primary); // Vote is primary if it's an owner's vote. event Pay(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); event Donate(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); address payable public founder; mapping (uint => address payable) public itemOwners; mapping (uint => mapping (uint => int256)) private childParentVotes; mapping (uint => uint256) public pricesETH; mapping (uint => uint256) public pricesAR; constructor(address payable _founder, uint256 _initialBalance) public { } // Owners // function setOwner(address payable _founder) external { } // _share is 64.64 fixed point number function setSalesOwnersShare(int128 _share) external { } function setUpvotesOwnersShare(int128 _share) external { } function setUploadOwnersShare(int128 _share) external { } function setBuyerAffiliateShare(int128 _share) external { } function setSellerAffiliateShare(int128 _share) external { } function setItemOwner(uint _itemId, address payable _owner) external { } // Wallets // function setARWallet(string calldata _arWallet) external { } // TODO: Test. function setNick(string calldata _nick) external { } function setAuthorInfo(string calldata _link, string calldata _shortDescription, string calldata _description, string calldata _locale) external { } // Items // struct ItemInfo { string title; string shortDescription; string description; uint256 priceETH; uint256 priceAR; string locale; string license; } function createItem(ItemInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateItem(uint _itemId, ItemInfo calldata _info) external { } struct LinkInfo { string link; string title; string shortDescription; string description; string locale; uint256 linkKind; } function createLink(LinkInfo calldata _info, bool _owned, address payable _affiliate) external returns (uint) { } // Can be used for spam. function updateLink(uint _linkId, LinkInfo calldata _info) external { } function updateItemCover(uint _itemId, uint _version, bytes calldata _cover, uint _width, uint _height) external { } function uploadFile(uint _itemId, uint _version, string calldata _format, bytes calldata _hash) external { } function setLastItemVersion(uint _itemId, uint _version) external { } function pay(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } function donate(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } // Categories // function createCategory(string calldata _title, string calldata _locale, address payable _affiliate) external returns (uint) { } struct OwnedCategoryInfo { string title; string shortDescription; string description; string locale; } function createOwnedCategory(OwnedCategoryInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateOwnedCategory(uint _categoryId, OwnedCategoryInfo calldata _info) external { require(<FILL_ME>) require(entries[_categoryId] == EntryKind.CATEGORY, "Must be a category."); emit OwnedCategoryUpdated(_categoryId, _info.title, _info.shortDescription, _info.description, _info.locale, msg.sender); } // Voting // function voteChildParent(uint _child, uint _parent, bool _yes, address payable _affiliate) external payable { } function voteForOwnChild(uint _child, uint _parent) external payable { } // _value > 0 - present function setMyChildParent(uint _child, uint _parent, int256 _value, int256 _featureLevel) external { } function getChildParentVotes(uint _child, uint _parent) external view returns (int256) { } // PST // uint256 totalDividends = 0; uint256 totalDividendsPaid = 0; // actually paid sum mapping(address => uint256) lastTotalDivedends; // the value of totalDividends after the last payment to an address function _dividendsOwing(address _account) internal view returns(uint256) { } function dividendsOwing(address _account) external view returns(uint256) { } function withdrawProfit() external { } function payToShareholders(uint256 _amount, address _author) internal { } // Affiliates // mapping (address => address payable) affiliates; // Last affiliate wins. function setAffiliate(address payable _affiliate) internal { } }
itemOwners[_categoryId]==msg.sender,"Access denied."
26,089
itemOwners[_categoryId]==msg.sender
"Must be a category."
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import './BaseToken.sol'; import './ABDKMath64x64.sol'; contract Files is BaseToken { using ABDKMath64x64 for int128; enum EntryKind { NONE, DOWNLOADS, LINK, CATEGORY } uint256 constant LINK_KIND_LINK = 0; uint256 constant LINK_KIND_MESSAGE = 1; string public name; uint8 public decimals; string public symbol; // 64.64 fixed point number int128 public salesOwnersShare = int128(1).divi(int128(10)); // 10% int128 public upvotesOwnersShare = int128(1).divi(int128(2)); // 50% int128 public uploadOwnersShare = int128(15).divi(int128(100)); // 15% int128 public buyerAffiliateShare = int128(1).divi(int128(10)); // 10% int128 public sellerAffiliateShare = int128(15).divi(int128(100)); // 15% uint maxId = 0; mapping (uint => EntryKind) entries; // to avoid categories with duplicate titles: mapping (string => mapping (string => uint)) categoryTitles; // locale => (title => id) mapping (string => address payable) nickAddresses; mapping (address => string) addressNicks; event SetOwner(address payable owner); // share is 64.64 fixed point number event SetSalesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUpvotesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUploadOwnerShare(int128 share); // share is 64.64 fixed point number event SetBuyerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetSellerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetNick(address payable indexed owner, string nick); event SetARWallet(address payable indexed owner, string arWallet); event SetAuthorInfo(address payable indexed owner, string link, string shortDescription, string description, string locale); event ItemCreated(uint indexed itemId); event SetItemOwner(uint indexed itemId, address payable indexed owner); event ItemUpdated(uint indexed itemId, ItemInfo info); event LinkUpdated(uint indexed linkId, string link, string title, string shortDescription, string description, string locale, uint256 indexed linkKind); event ItemCoverUpdated(uint indexed itemId, uint indexed version, bytes cover, uint width, uint height); event ItemFilesUpdated(uint indexed itemId, string format, uint indexed version, bytes hash); event SetLastItemVersion(uint indexed itemId, uint version); event CategoryCreated(uint256 indexed categoryId, address indexed owner); // zero owner - no owner event CategoryUpdated(uint256 indexed categoryId, string title, string locale); event OwnedCategoryUpdated(uint256 indexed categoryId, string title, string shortDescription, string description, string locale, address indexed owner); event ChildParentVote(uint child, uint parent, int256 value, int256 featureLevel, bool primary); // Vote is primary if it's an owner's vote. event Pay(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); event Donate(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); address payable public founder; mapping (uint => address payable) public itemOwners; mapping (uint => mapping (uint => int256)) private childParentVotes; mapping (uint => uint256) public pricesETH; mapping (uint => uint256) public pricesAR; constructor(address payable _founder, uint256 _initialBalance) public { } // Owners // function setOwner(address payable _founder) external { } // _share is 64.64 fixed point number function setSalesOwnersShare(int128 _share) external { } function setUpvotesOwnersShare(int128 _share) external { } function setUploadOwnersShare(int128 _share) external { } function setBuyerAffiliateShare(int128 _share) external { } function setSellerAffiliateShare(int128 _share) external { } function setItemOwner(uint _itemId, address payable _owner) external { } // Wallets // function setARWallet(string calldata _arWallet) external { } // TODO: Test. function setNick(string calldata _nick) external { } function setAuthorInfo(string calldata _link, string calldata _shortDescription, string calldata _description, string calldata _locale) external { } // Items // struct ItemInfo { string title; string shortDescription; string description; uint256 priceETH; uint256 priceAR; string locale; string license; } function createItem(ItemInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateItem(uint _itemId, ItemInfo calldata _info) external { } struct LinkInfo { string link; string title; string shortDescription; string description; string locale; uint256 linkKind; } function createLink(LinkInfo calldata _info, bool _owned, address payable _affiliate) external returns (uint) { } // Can be used for spam. function updateLink(uint _linkId, LinkInfo calldata _info) external { } function updateItemCover(uint _itemId, uint _version, bytes calldata _cover, uint _width, uint _height) external { } function uploadFile(uint _itemId, uint _version, string calldata _format, bytes calldata _hash) external { } function setLastItemVersion(uint _itemId, uint _version) external { } function pay(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } function donate(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } // Categories // function createCategory(string calldata _title, string calldata _locale, address payable _affiliate) external returns (uint) { } struct OwnedCategoryInfo { string title; string shortDescription; string description; string locale; } function createOwnedCategory(OwnedCategoryInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateOwnedCategory(uint _categoryId, OwnedCategoryInfo calldata _info) external { require(itemOwners[_categoryId] == msg.sender, "Access denied."); require(<FILL_ME>) emit OwnedCategoryUpdated(_categoryId, _info.title, _info.shortDescription, _info.description, _info.locale, msg.sender); } // Voting // function voteChildParent(uint _child, uint _parent, bool _yes, address payable _affiliate) external payable { } function voteForOwnChild(uint _child, uint _parent) external payable { } // _value > 0 - present function setMyChildParent(uint _child, uint _parent, int256 _value, int256 _featureLevel) external { } function getChildParentVotes(uint _child, uint _parent) external view returns (int256) { } // PST // uint256 totalDividends = 0; uint256 totalDividendsPaid = 0; // actually paid sum mapping(address => uint256) lastTotalDivedends; // the value of totalDividends after the last payment to an address function _dividendsOwing(address _account) internal view returns(uint256) { } function dividendsOwing(address _account) external view returns(uint256) { } function withdrawProfit() external { } function payToShareholders(uint256 _amount, address _author) internal { } // Affiliates // mapping (address => address payable) affiliates; // Last affiliate wins. function setAffiliate(address payable _affiliate) internal { } }
entries[_categoryId]==EntryKind.CATEGORY,"Must be a category."
26,089
entries[_categoryId]==EntryKind.CATEGORY
"Child does not exist."
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import './BaseToken.sol'; import './ABDKMath64x64.sol'; contract Files is BaseToken { using ABDKMath64x64 for int128; enum EntryKind { NONE, DOWNLOADS, LINK, CATEGORY } uint256 constant LINK_KIND_LINK = 0; uint256 constant LINK_KIND_MESSAGE = 1; string public name; uint8 public decimals; string public symbol; // 64.64 fixed point number int128 public salesOwnersShare = int128(1).divi(int128(10)); // 10% int128 public upvotesOwnersShare = int128(1).divi(int128(2)); // 50% int128 public uploadOwnersShare = int128(15).divi(int128(100)); // 15% int128 public buyerAffiliateShare = int128(1).divi(int128(10)); // 10% int128 public sellerAffiliateShare = int128(15).divi(int128(100)); // 15% uint maxId = 0; mapping (uint => EntryKind) entries; // to avoid categories with duplicate titles: mapping (string => mapping (string => uint)) categoryTitles; // locale => (title => id) mapping (string => address payable) nickAddresses; mapping (address => string) addressNicks; event SetOwner(address payable owner); // share is 64.64 fixed point number event SetSalesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUpvotesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUploadOwnerShare(int128 share); // share is 64.64 fixed point number event SetBuyerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetSellerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetNick(address payable indexed owner, string nick); event SetARWallet(address payable indexed owner, string arWallet); event SetAuthorInfo(address payable indexed owner, string link, string shortDescription, string description, string locale); event ItemCreated(uint indexed itemId); event SetItemOwner(uint indexed itemId, address payable indexed owner); event ItemUpdated(uint indexed itemId, ItemInfo info); event LinkUpdated(uint indexed linkId, string link, string title, string shortDescription, string description, string locale, uint256 indexed linkKind); event ItemCoverUpdated(uint indexed itemId, uint indexed version, bytes cover, uint width, uint height); event ItemFilesUpdated(uint indexed itemId, string format, uint indexed version, bytes hash); event SetLastItemVersion(uint indexed itemId, uint version); event CategoryCreated(uint256 indexed categoryId, address indexed owner); // zero owner - no owner event CategoryUpdated(uint256 indexed categoryId, string title, string locale); event OwnedCategoryUpdated(uint256 indexed categoryId, string title, string shortDescription, string description, string locale, address indexed owner); event ChildParentVote(uint child, uint parent, int256 value, int256 featureLevel, bool primary); // Vote is primary if it's an owner's vote. event Pay(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); event Donate(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); address payable public founder; mapping (uint => address payable) public itemOwners; mapping (uint => mapping (uint => int256)) private childParentVotes; mapping (uint => uint256) public pricesETH; mapping (uint => uint256) public pricesAR; constructor(address payable _founder, uint256 _initialBalance) public { } // Owners // function setOwner(address payable _founder) external { } // _share is 64.64 fixed point number function setSalesOwnersShare(int128 _share) external { } function setUpvotesOwnersShare(int128 _share) external { } function setUploadOwnersShare(int128 _share) external { } function setBuyerAffiliateShare(int128 _share) external { } function setSellerAffiliateShare(int128 _share) external { } function setItemOwner(uint _itemId, address payable _owner) external { } // Wallets // function setARWallet(string calldata _arWallet) external { } // TODO: Test. function setNick(string calldata _nick) external { } function setAuthorInfo(string calldata _link, string calldata _shortDescription, string calldata _description, string calldata _locale) external { } // Items // struct ItemInfo { string title; string shortDescription; string description; uint256 priceETH; uint256 priceAR; string locale; string license; } function createItem(ItemInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateItem(uint _itemId, ItemInfo calldata _info) external { } struct LinkInfo { string link; string title; string shortDescription; string description; string locale; uint256 linkKind; } function createLink(LinkInfo calldata _info, bool _owned, address payable _affiliate) external returns (uint) { } // Can be used for spam. function updateLink(uint _linkId, LinkInfo calldata _info) external { } function updateItemCover(uint _itemId, uint _version, bytes calldata _cover, uint _width, uint _height) external { } function uploadFile(uint _itemId, uint _version, string calldata _format, bytes calldata _hash) external { } function setLastItemVersion(uint _itemId, uint _version) external { } function pay(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } function donate(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } // Categories // function createCategory(string calldata _title, string calldata _locale, address payable _affiliate) external returns (uint) { } struct OwnedCategoryInfo { string title; string shortDescription; string description; string locale; } function createOwnedCategory(OwnedCategoryInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateOwnedCategory(uint _categoryId, OwnedCategoryInfo calldata _info) external { } // Voting // function voteChildParent(uint _child, uint _parent, bool _yes, address payable _affiliate) external payable { require(<FILL_ME>) require(entries[_parent] == EntryKind.CATEGORY, "Must be a category."); setAffiliate(_affiliate); int256 _value = _yes ? int256(msg.value) : -int256(msg.value); if(_value == 0) return; // We don't want to pollute the events with zero votes. int256 _newValue = childParentVotes[_child][_parent] + _value; childParentVotes[_child][_parent] = _newValue; address payable _owner = itemOwners[_child]; if(_yes && _owner != address(0)) { uint256 _shareholdersShare = uint256(upvotesOwnersShare.muli(int256(msg.value))); payToShareholders(_shareholdersShare, _owner); _owner.transfer(msg.value - _shareholdersShare); } else payToShareholders(msg.value, address(0)); emit ChildParentVote(_child, _parent, _newValue, 0, false); } function voteForOwnChild(uint _child, uint _parent) external payable { } // _value > 0 - present function setMyChildParent(uint _child, uint _parent, int256 _value, int256 _featureLevel) external { } function getChildParentVotes(uint _child, uint _parent) external view returns (int256) { } // PST // uint256 totalDividends = 0; uint256 totalDividendsPaid = 0; // actually paid sum mapping(address => uint256) lastTotalDivedends; // the value of totalDividends after the last payment to an address function _dividendsOwing(address _account) internal view returns(uint256) { } function dividendsOwing(address _account) external view returns(uint256) { } function withdrawProfit() external { } function payToShareholders(uint256 _amount, address _author) internal { } // Affiliates // mapping (address => address payable) affiliates; // Last affiliate wins. function setAffiliate(address payable _affiliate) internal { } }
entries[_child]!=EntryKind.NONE,"Child does not exist."
26,089
entries[_child]!=EntryKind.NONE
"Must be a category."
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import './BaseToken.sol'; import './ABDKMath64x64.sol'; contract Files is BaseToken { using ABDKMath64x64 for int128; enum EntryKind { NONE, DOWNLOADS, LINK, CATEGORY } uint256 constant LINK_KIND_LINK = 0; uint256 constant LINK_KIND_MESSAGE = 1; string public name; uint8 public decimals; string public symbol; // 64.64 fixed point number int128 public salesOwnersShare = int128(1).divi(int128(10)); // 10% int128 public upvotesOwnersShare = int128(1).divi(int128(2)); // 50% int128 public uploadOwnersShare = int128(15).divi(int128(100)); // 15% int128 public buyerAffiliateShare = int128(1).divi(int128(10)); // 10% int128 public sellerAffiliateShare = int128(15).divi(int128(100)); // 15% uint maxId = 0; mapping (uint => EntryKind) entries; // to avoid categories with duplicate titles: mapping (string => mapping (string => uint)) categoryTitles; // locale => (title => id) mapping (string => address payable) nickAddresses; mapping (address => string) addressNicks; event SetOwner(address payable owner); // share is 64.64 fixed point number event SetSalesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUpvotesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUploadOwnerShare(int128 share); // share is 64.64 fixed point number event SetBuyerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetSellerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetNick(address payable indexed owner, string nick); event SetARWallet(address payable indexed owner, string arWallet); event SetAuthorInfo(address payable indexed owner, string link, string shortDescription, string description, string locale); event ItemCreated(uint indexed itemId); event SetItemOwner(uint indexed itemId, address payable indexed owner); event ItemUpdated(uint indexed itemId, ItemInfo info); event LinkUpdated(uint indexed linkId, string link, string title, string shortDescription, string description, string locale, uint256 indexed linkKind); event ItemCoverUpdated(uint indexed itemId, uint indexed version, bytes cover, uint width, uint height); event ItemFilesUpdated(uint indexed itemId, string format, uint indexed version, bytes hash); event SetLastItemVersion(uint indexed itemId, uint version); event CategoryCreated(uint256 indexed categoryId, address indexed owner); // zero owner - no owner event CategoryUpdated(uint256 indexed categoryId, string title, string locale); event OwnedCategoryUpdated(uint256 indexed categoryId, string title, string shortDescription, string description, string locale, address indexed owner); event ChildParentVote(uint child, uint parent, int256 value, int256 featureLevel, bool primary); // Vote is primary if it's an owner's vote. event Pay(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); event Donate(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); address payable public founder; mapping (uint => address payable) public itemOwners; mapping (uint => mapping (uint => int256)) private childParentVotes; mapping (uint => uint256) public pricesETH; mapping (uint => uint256) public pricesAR; constructor(address payable _founder, uint256 _initialBalance) public { } // Owners // function setOwner(address payable _founder) external { } // _share is 64.64 fixed point number function setSalesOwnersShare(int128 _share) external { } function setUpvotesOwnersShare(int128 _share) external { } function setUploadOwnersShare(int128 _share) external { } function setBuyerAffiliateShare(int128 _share) external { } function setSellerAffiliateShare(int128 _share) external { } function setItemOwner(uint _itemId, address payable _owner) external { } // Wallets // function setARWallet(string calldata _arWallet) external { } // TODO: Test. function setNick(string calldata _nick) external { } function setAuthorInfo(string calldata _link, string calldata _shortDescription, string calldata _description, string calldata _locale) external { } // Items // struct ItemInfo { string title; string shortDescription; string description; uint256 priceETH; uint256 priceAR; string locale; string license; } function createItem(ItemInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateItem(uint _itemId, ItemInfo calldata _info) external { } struct LinkInfo { string link; string title; string shortDescription; string description; string locale; uint256 linkKind; } function createLink(LinkInfo calldata _info, bool _owned, address payable _affiliate) external returns (uint) { } // Can be used for spam. function updateLink(uint _linkId, LinkInfo calldata _info) external { } function updateItemCover(uint _itemId, uint _version, bytes calldata _cover, uint _width, uint _height) external { } function uploadFile(uint _itemId, uint _version, string calldata _format, bytes calldata _hash) external { } function setLastItemVersion(uint _itemId, uint _version) external { } function pay(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } function donate(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } // Categories // function createCategory(string calldata _title, string calldata _locale, address payable _affiliate) external returns (uint) { } struct OwnedCategoryInfo { string title; string shortDescription; string description; string locale; } function createOwnedCategory(OwnedCategoryInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateOwnedCategory(uint _categoryId, OwnedCategoryInfo calldata _info) external { } // Voting // function voteChildParent(uint _child, uint _parent, bool _yes, address payable _affiliate) external payable { require(entries[_child] != EntryKind.NONE, "Child does not exist."); require(<FILL_ME>) setAffiliate(_affiliate); int256 _value = _yes ? int256(msg.value) : -int256(msg.value); if(_value == 0) return; // We don't want to pollute the events with zero votes. int256 _newValue = childParentVotes[_child][_parent] + _value; childParentVotes[_child][_parent] = _newValue; address payable _owner = itemOwners[_child]; if(_yes && _owner != address(0)) { uint256 _shareholdersShare = uint256(upvotesOwnersShare.muli(int256(msg.value))); payToShareholders(_shareholdersShare, _owner); _owner.transfer(msg.value - _shareholdersShare); } else payToShareholders(msg.value, address(0)); emit ChildParentVote(_child, _parent, _newValue, 0, false); } function voteForOwnChild(uint _child, uint _parent) external payable { } // _value > 0 - present function setMyChildParent(uint _child, uint _parent, int256 _value, int256 _featureLevel) external { } function getChildParentVotes(uint _child, uint _parent) external view returns (int256) { } // PST // uint256 totalDividends = 0; uint256 totalDividendsPaid = 0; // actually paid sum mapping(address => uint256) lastTotalDivedends; // the value of totalDividends after the last payment to an address function _dividendsOwing(address _account) internal view returns(uint256) { } function dividendsOwing(address _account) external view returns(uint256) { } function withdrawProfit() external { } function payToShareholders(uint256 _amount, address _author) internal { } // Affiliates // mapping (address => address payable) affiliates; // Last affiliate wins. function setAffiliate(address payable _affiliate) internal { } }
entries[_parent]==EntryKind.CATEGORY,"Must be a category."
26,089
entries[_parent]==EntryKind.CATEGORY
"Access denied."
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import './BaseToken.sol'; import './ABDKMath64x64.sol'; contract Files is BaseToken { using ABDKMath64x64 for int128; enum EntryKind { NONE, DOWNLOADS, LINK, CATEGORY } uint256 constant LINK_KIND_LINK = 0; uint256 constant LINK_KIND_MESSAGE = 1; string public name; uint8 public decimals; string public symbol; // 64.64 fixed point number int128 public salesOwnersShare = int128(1).divi(int128(10)); // 10% int128 public upvotesOwnersShare = int128(1).divi(int128(2)); // 50% int128 public uploadOwnersShare = int128(15).divi(int128(100)); // 15% int128 public buyerAffiliateShare = int128(1).divi(int128(10)); // 10% int128 public sellerAffiliateShare = int128(15).divi(int128(100)); // 15% uint maxId = 0; mapping (uint => EntryKind) entries; // to avoid categories with duplicate titles: mapping (string => mapping (string => uint)) categoryTitles; // locale => (title => id) mapping (string => address payable) nickAddresses; mapping (address => string) addressNicks; event SetOwner(address payable owner); // share is 64.64 fixed point number event SetSalesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUpvotesOwnerShare(int128 share); // share is 64.64 fixed point number event SetUploadOwnerShare(int128 share); // share is 64.64 fixed point number event SetBuyerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetSellerAffiliateShare(int128 share); // share is 64.64 fixed point number event SetNick(address payable indexed owner, string nick); event SetARWallet(address payable indexed owner, string arWallet); event SetAuthorInfo(address payable indexed owner, string link, string shortDescription, string description, string locale); event ItemCreated(uint indexed itemId); event SetItemOwner(uint indexed itemId, address payable indexed owner); event ItemUpdated(uint indexed itemId, ItemInfo info); event LinkUpdated(uint indexed linkId, string link, string title, string shortDescription, string description, string locale, uint256 indexed linkKind); event ItemCoverUpdated(uint indexed itemId, uint indexed version, bytes cover, uint width, uint height); event ItemFilesUpdated(uint indexed itemId, string format, uint indexed version, bytes hash); event SetLastItemVersion(uint indexed itemId, uint version); event CategoryCreated(uint256 indexed categoryId, address indexed owner); // zero owner - no owner event CategoryUpdated(uint256 indexed categoryId, string title, string locale); event OwnedCategoryUpdated(uint256 indexed categoryId, string title, string shortDescription, string description, string locale, address indexed owner); event ChildParentVote(uint child, uint parent, int256 value, int256 featureLevel, bool primary); // Vote is primary if it's an owner's vote. event Pay(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); event Donate(address indexed payer, address indexed payee, uint indexed itemId, uint256 value); address payable public founder; mapping (uint => address payable) public itemOwners; mapping (uint => mapping (uint => int256)) private childParentVotes; mapping (uint => uint256) public pricesETH; mapping (uint => uint256) public pricesAR; constructor(address payable _founder, uint256 _initialBalance) public { } // Owners // function setOwner(address payable _founder) external { } // _share is 64.64 fixed point number function setSalesOwnersShare(int128 _share) external { } function setUpvotesOwnersShare(int128 _share) external { } function setUploadOwnersShare(int128 _share) external { } function setBuyerAffiliateShare(int128 _share) external { } function setSellerAffiliateShare(int128 _share) external { } function setItemOwner(uint _itemId, address payable _owner) external { } // Wallets // function setARWallet(string calldata _arWallet) external { } // TODO: Test. function setNick(string calldata _nick) external { } function setAuthorInfo(string calldata _link, string calldata _shortDescription, string calldata _description, string calldata _locale) external { } // Items // struct ItemInfo { string title; string shortDescription; string description; uint256 priceETH; uint256 priceAR; string locale; string license; } function createItem(ItemInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateItem(uint _itemId, ItemInfo calldata _info) external { } struct LinkInfo { string link; string title; string shortDescription; string description; string locale; uint256 linkKind; } function createLink(LinkInfo calldata _info, bool _owned, address payable _affiliate) external returns (uint) { } // Can be used for spam. function updateLink(uint _linkId, LinkInfo calldata _info) external { } function updateItemCover(uint _itemId, uint _version, bytes calldata _cover, uint _width, uint _height) external { } function uploadFile(uint _itemId, uint _version, string calldata _format, bytes calldata _hash) external { } function setLastItemVersion(uint _itemId, uint _version) external { } function pay(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } function donate(uint _itemId, address payable _affiliate) external payable returns (bytes memory) { } // Categories // function createCategory(string calldata _title, string calldata _locale, address payable _affiliate) external returns (uint) { } struct OwnedCategoryInfo { string title; string shortDescription; string description; string locale; } function createOwnedCategory(OwnedCategoryInfo calldata _info, address payable _affiliate) external returns (uint) { } function updateOwnedCategory(uint _categoryId, OwnedCategoryInfo calldata _info) external { } // Voting // function voteChildParent(uint _child, uint _parent, bool _yes, address payable _affiliate) external payable { } function voteForOwnChild(uint _child, uint _parent) external payable { } // _value > 0 - present function setMyChildParent(uint _child, uint _parent, int256 _value, int256 _featureLevel) external { require(entries[_child] != EntryKind.NONE, "Child does not exist."); require(entries[_parent] == EntryKind.CATEGORY, "Must be a category."); require(<FILL_ME>) emit ChildParentVote(_child, _parent, _value, _featureLevel, true); } function getChildParentVotes(uint _child, uint _parent) external view returns (int256) { } // PST // uint256 totalDividends = 0; uint256 totalDividendsPaid = 0; // actually paid sum mapping(address => uint256) lastTotalDivedends; // the value of totalDividends after the last payment to an address function _dividendsOwing(address _account) internal view returns(uint256) { } function dividendsOwing(address _account) external view returns(uint256) { } function withdrawProfit() external { } function payToShareholders(uint256 _amount, address _author) internal { } // Affiliates // mapping (address => address payable) affiliates; // Last affiliate wins. function setAffiliate(address payable _affiliate) internal { } }
itemOwners[_parent]==msg.sender,"Access denied."
26,089
itemOwners[_parent]==msg.sender
"can't add more tokens"
pragma solidity ^0.7.0; // SPDX-License-Identifier: MIT OR Apache-2.0 import "./ReentrancyGuard.sol"; import "./Governance.sol"; import "./ITrustedTransfarableERC20.sol"; import "./Utils.sol"; /// @title Token Governance Contract /// @author Matter Labs /// @notice Contract is used to allow anyone to add new ERC20 tokens to zkSync given sufficient payment contract TokenGovernance is ReentrancyGuard { /// @notice Token lister added or removed (see `tokenLister`) event TokenListerUpdate(address indexed tokenLister, bool isActive); /// @notice Listing fee token set event ListingFeeTokenUpdate(ITrustedTransfarableERC20 indexed newListingFeeToken, uint256 newListingFee); /// @notice Listing fee set event ListingFeeUpdate(uint256 newListingFee); /// @notice Maximum number of listed tokens updated event ListingCapUpdate(uint16 newListingCap); /// @notice The treasury (the account which will receive the fee) was updated event TreasuryUpdate(address newTreasury); /// @notice zkSync governance contract Governance public governance; /// @notice Token used to collect listing fee for addition of new token to zkSync network ITrustedTransfarableERC20 public listingFeeToken; /// @notice Token listing fee uint256 public listingFee; /// @notice Max number of tokens that can be listed using this contract uint16 public listingCap; /// @notice Addresses that can list tokens without fee mapping(address => bool) public tokenLister; /// @notice Address that collects listing payments address public treasury; constructor( Governance _governance, ITrustedTransfarableERC20 _listingFeeToken, uint256 _listingFee, uint16 _listingCap, address _treasury ) { } /// @notice Adds new ERC20 token to zkSync network. /// @notice If caller is not present in the `tokenLister` map payment of `listingFee` in `listingFeeToken` should be made. /// @notice NOTE: before calling this function make sure to approve `listingFeeToken` transfer for this contract. function addToken(address _token) external nonReentrant { require(_token != address(0), "z1"); // Token should have a non-zero address require(_token != 0xaBEA9132b05A70803a4E85094fD0e1800777fBEF, "z2"); // Address of the token cannot be the same as the address of the main zksync contract require(<FILL_ME>) // Impossible to add more tokens using this contract if (!tokenLister[msg.sender] && listingFee > 0) { // Collect fees bool feeTransferOk = listingFeeToken.transferFrom(msg.sender, treasury, listingFee); require(feeTransferOk, "fee transfer failed"); // Failed to receive payment for token addition. } governance.addToken(_token); } /// Governance functions (this contract is governed by zkSync governor) /// @notice Set new listing token and fee /// @notice Can be called only by zkSync governor function setListingFeeToken(ITrustedTransfarableERC20 _newListingFeeToken, uint256 _newListingFee) external { } /// @notice Set new listing fee /// @notice Can be called only by zkSync governor function setListingFee(uint256 _newListingFee) external { } /// @notice Enable or disable token lister. If enabled new tokens can be added by that address without payment /// @notice Can be called only by zkSync governor function setLister(address _listerAddress, bool _active) external { } /// @notice Change maximum amount of tokens that can be listed using this method /// @notice Can be called only by zkSync governor function setListingCap(uint16 _newListingCap) external { } /// @notice Change address that collects payments for listing tokens. /// @notice Can be called only by zkSync governor function setTreasury(address _newTreasury) external { } }
governance.totalTokens()<listingCap,"can't add more tokens"
26,091
governance.totalTokens()<listingCap
'IndexedUniswapRouterBurner: INVALID_PATH'
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; pragma experimental ABIEncoderV2; import "@uniswap/lib/contracts/libraries/TransferHelper.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IERC20.sol"; import "@uniswap/v2-periphery/contracts/interfaces/IWETH.sol"; import "@indexed-finance/indexed-core/contracts/interfaces/IIndexPool.sol"; import "./libraries/UniswapV2Library.sol"; import "./BMath.sol"; contract IndexedUniswapRouterBurner is BMath { address public immutable factory; address public immutable weth; constructor(address factory_, address weth_) public { } receive() external payable { } // requires the initial amount to have already been sent to the first pair function _swap(uint[] memory amounts, address[] memory path, address recipient) internal { } /** * @dev Redeems `poolAmountIn` pool tokens for the first token in `path` * and swaps it to at least `minAmountOut` of the last token in `path`. * * @param indexPool Address of the index pool to burn tokens from. * @param poolAmountIn Amount of pool tokens to burn. * @param path Array of tokens to swap using the Uniswap router. * @param minAmountOut Amount of last token in `path` that must be received to not revert. * @return amountOut Amount of output tokens received. */ function burnExactAndSwapForTokens( address indexPool, uint poolAmountIn, address[] calldata path, uint minAmountOut ) external returns (uint amountOut) { } /** * @dev Redeems `poolAmountIn` pool tokens for the first token in `path` * and swaps it to at least `minAmountOut` ether. * * @param indexPool Address of the index pool to burn tokens from. * @param poolAmountIn Amount of pool tokens to burn. * @param path Array of tokens to swap using the Uniswap router. * @param minAmountOut Amount of ether that must be received to not revert. * @return amountOut Amount of ether received. */ function burnExactAndSwapForETH( address indexPool, uint poolAmountIn, address[] calldata path, uint minAmountOut ) external returns (uint amountOut) { require(<FILL_ME>) amountOut = _burnExactAndSwap( indexPool, poolAmountIn, path, minAmountOut, address(this) ); IWETH(weth).withdraw(amountOut); TransferHelper.safeTransferETH(msg.sender, amountOut); } function _burnExactAndSwap( address indexPool, uint poolAmountIn, address[] memory path, uint minAmountOut, address recipient ) internal returns (uint amountOut) { } /** * @dev Redeems up to `poolAmountInMax` pool tokens for the first token in `path` * and swaps it to exactly `tokenAmountOut` of the last token in `path`. * * @param indexPool Address of the index pool to burn tokens from. * @param poolAmountInMax Maximum amount of pool tokens to burn. * @param path Array of tokens to swap using the Uniswap router. * @param tokenAmountOut Amount of last token in `path` to receive. * @return poolAmountIn Amount of pool tokens burned. */ function burnAndSwapForExactTokens( address indexPool, uint poolAmountInMax, address[] calldata path, uint tokenAmountOut ) external returns (uint poolAmountIn) { } /** * @dev Redeems up to `poolAmountInMax` pool tokens for the first token in `path` * and swaps it to exactly `ethAmountOut` ether. * * @param indexPool Address of the index pool to burn tokens from. * @param poolAmountInMax Maximum amount of pool tokens to burn. * @param path Array of tokens to swap using the Uniswap router. * @param ethAmountOut Amount of eth to receive. * @return poolAmountIn Amount of pool tokens burned. */ function burnAndSwapForExactETH( address indexPool, uint poolAmountInMax, address[] calldata path, uint ethAmountOut ) external returns (uint poolAmountIn) { } function _burnAndSwapForExact( address indexPool, uint poolAmountInMax, address[] memory path, uint tokenAmountOut, address recipient ) internal returns (uint poolAmountIn) { } /** * @dev Burns `poolAmountOut` for all the underlying tokens in a pool, then * swaps each of them on Uniswap for at least `minAmountOut` of `tokenOut`. * * Up to one intermediary token may be provided in `intermediaries` for each * underlying token in the index pool. * * If a null address is provided as an intermediary, the input token will be * swapped directly for the output token. */ function burnForAllTokensAndSwapForTokens( address indexPool, uint256[] calldata minAmountsOut, address[] calldata intermediaries, uint256 poolAmountIn, address tokenOut, uint256 minAmountOut ) external returns (uint256 amountOutTotal) { } /** * @dev Burns `poolAmountOut` for all the underlying tokens in a pool, then * swaps each of them on Uniswap for at least `minAmountOut` ether. * * Up to one intermediary token may be provided in `intermediaries` for each * underlying token in the index pool. * * If a null address is provided as an intermediary, the input token will be * swapped directly for the output token. */ function burnForAllTokensAndSwapForETH( address indexPool, uint256[] calldata minAmountsOut, address[] calldata intermediaries, uint256 poolAmountIn, uint256 minAmountOut ) external returns (uint amountOutTotal) { } function _burnForAllTokensAndSwap( address indexPool, address tokenOut, uint256[] calldata minAmountsOut, address[] calldata intermediaries, uint256 poolAmountIn, uint256 minAmountOut, address recipient ) internal returns (uint amountOutTotal) { } function _getSwapAmountsForExit( address tokenIn, address intermediate, address tokenOut, address[] memory path ) internal view returns (uint[] memory amounts) { } }
path[path.length-1]==weth,'IndexedUniswapRouterBurner: INVALID_PATH'
26,154
path[path.length-1]==weth
"Minting would exceed max supply of Crypto Humans"
pragma solidity ^0.8.0; contract CryptoHuman is ERC721, Ownable { uint256 public START_TIMESTAMP = 1630936800; uint256 public MAX_HUMANS = 8000; using SafeMath for uint256; using Counters for Counters.Counter; uint256 public totalSupply; uint256 private RESERVED = 100; uint256 private _reserved; string private __baseURI = "https://www.cryptohuman.co/token/"; constructor() ERC721("Crypto Human", "CH") {} function canMint() public view returns (bool) { } function mintHuman() public { require(<FILL_ME>) mint(totalSupply + 1); } function reserveHumans() public onlyOwner { } function mint(uint256 tokenId) internal { } function _baseURI() internal view override returns (string memory) { } function setBaseUri(string memory uri) public onlyOwner { } }
canMint(),"Minting would exceed max supply of Crypto Humans"
26,229
canMint()
"Reserved amount already minted"
pragma solidity ^0.8.0; contract CryptoHuman is ERC721, Ownable { uint256 public START_TIMESTAMP = 1630936800; uint256 public MAX_HUMANS = 8000; using SafeMath for uint256; using Counters for Counters.Counter; uint256 public totalSupply; uint256 private RESERVED = 100; uint256 private _reserved; string private __baseURI = "https://www.cryptohuman.co/token/"; constructor() ERC721("Crypto Human", "CH") {} function canMint() public view returns (bool) { } function mintHuman() public { } function reserveHumans() public onlyOwner { require(<FILL_ME>) require(totalSupply.add(25) <= MAX_HUMANS, "Minting would exceed max supply of Crypto Humans"); uint256 supply = totalSupply; uint i; for (i = 0; i < 25; i++) { mint(supply + 1); supply = supply + 1; _reserved = _reserved + 1; } } function mint(uint256 tokenId) internal { } function _baseURI() internal view override returns (string memory) { } function setBaseUri(string memory uri) public onlyOwner { } }
_reserved.add(25)<=RESERVED,"Reserved amount already minted"
26,229
_reserved.add(25)<=RESERVED
"Minting would exceed max supply of Crypto Humans"
pragma solidity ^0.8.0; contract CryptoHuman is ERC721, Ownable { uint256 public START_TIMESTAMP = 1630936800; uint256 public MAX_HUMANS = 8000; using SafeMath for uint256; using Counters for Counters.Counter; uint256 public totalSupply; uint256 private RESERVED = 100; uint256 private _reserved; string private __baseURI = "https://www.cryptohuman.co/token/"; constructor() ERC721("Crypto Human", "CH") {} function canMint() public view returns (bool) { } function mintHuman() public { } function reserveHumans() public onlyOwner { require(_reserved.add(25) <= RESERVED, "Reserved amount already minted"); require(<FILL_ME>) uint256 supply = totalSupply; uint i; for (i = 0; i < 25; i++) { mint(supply + 1); supply = supply + 1; _reserved = _reserved + 1; } } function mint(uint256 tokenId) internal { } function _baseURI() internal view override returns (string memory) { } function setBaseUri(string memory uri) public onlyOwner { } }
totalSupply.add(25)<=MAX_HUMANS,"Minting would exceed max supply of Crypto Humans"
26,229
totalSupply.add(25)<=MAX_HUMANS
null
pragma solidity ^0.4.23; contract EIP20Interface { uint256 public totalSupply; uint256 public decimals; function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract OwnableContract { address superOwner; constructor() public { } modifier onlyOwner() { } function viewSuperOwner() public view returns (address owner) { } function changeOwner(address newOwner) onlyOwner public { } } contract BlockableContract is OwnableContract{ bool public blockedContract; constructor() public { } modifier contractActive() { require(<FILL_ME>) _; } function doBlockContract() onlyOwner public { } function unBlockContract() onlyOwner public { } } contract Hodl is BlockableContract{ struct Safe{ uint256 id; address user; address tokenAddress; uint256 amount; uint256 time; } /** * @dev safes variables */ mapping( address => uint256[]) public _userSafes; mapping( uint256 => Safe) private _safes; uint256 private _currentIndex; mapping( address => uint256) public _totalSaved; /** * @dev owner variables */ uint256 public comission; //0..100 mapping( address => uint256) private _systemReserves; address[] public _listedReserves; /** * constructor */ constructor() public { } // F1 - fallback function to receive donation eth // function () public payable { } // F2 - how many safes has the user // function GetUserSafesLength(address a) public view returns (uint256 length) { } // F3 - how many tokens are reserved for owner as comission // function GetReserveAmount(address tokenAddress) public view returns (uint256 amount){ } // F4 - returns safe's values' // function Getsafe(uint256 _id) public view returns (uint256 id, address user, address tokenAddress, uint256 amount, uint256 time) { } // F5 - add new hodl safe (ETH) // function HodlEth(uint256 time) public contractActive payable { } // F6 add new hodl safe (ERC20 token) // function ClaimHodlToken(address tokenAddress, uint256 amount, uint256 time) public contractActive { } // F7 - user, claim back a hodl safe // function UserRetireHodl(uint256 id) public { } // F8 - private retire hodl safe action // function RetireHodl(uint256 id) private { } // F9 - private pay eth to address // function PayEth(address user, uint256 amount) private { } // F10 - private pay token to address // function PayToken(address user, address tokenAddress, uint256 amount) private{ } // F11 - store comission from unfinished hodl // function StoreComission(address tokenAddress, uint256 amount) private { } // F12 - delete safe values in storage // function DeleteSafe(Safe s) private { } // F13 // OWNER - owner retire hodl safe // function OwnerRetireHodl(uint256 id) public onlyOwner { } // F14 - owner, change comission value // function ChangeComission(uint256 newComission) onlyOwner public { } // F15 - owner withdraw eth reserved from comissions // function WithdrawReserve(address tokenAddress) onlyOwner public { } // F16 - owner withdraw token reserved from comission // function WithdrawAllReserves() onlyOwner public { } // F17 - owner remove free eth // function WithdrawSpecialEth(uint256 amount) onlyOwner public { } // F18 - owner remove free token // function WithdrawSpecialToken(address tokenAddress, uint256 amount) onlyOwner public { } //AUX - @dev Multiplies two numbers, throws on overflow. // function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } }
!blockedContract
26,264
!blockedContract
null
pragma solidity ^0.4.23; contract EIP20Interface { uint256 public totalSupply; uint256 public decimals; function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract OwnableContract { address superOwner; constructor() public { } modifier onlyOwner() { } function viewSuperOwner() public view returns (address owner) { } function changeOwner(address newOwner) onlyOwner public { } } contract BlockableContract is OwnableContract{ bool public blockedContract; constructor() public { } modifier contractActive() { } function doBlockContract() onlyOwner public { } function unBlockContract() onlyOwner public { } } contract Hodl is BlockableContract{ struct Safe{ uint256 id; address user; address tokenAddress; uint256 amount; uint256 time; } /** * @dev safes variables */ mapping( address => uint256[]) public _userSafes; mapping( uint256 => Safe) private _safes; uint256 private _currentIndex; mapping( address => uint256) public _totalSaved; /** * @dev owner variables */ uint256 public comission; //0..100 mapping( address => uint256) private _systemReserves; address[] public _listedReserves; /** * constructor */ constructor() public { } // F1 - fallback function to receive donation eth // function () public payable { } // F2 - how many safes has the user // function GetUserSafesLength(address a) public view returns (uint256 length) { } // F3 - how many tokens are reserved for owner as comission // function GetReserveAmount(address tokenAddress) public view returns (uint256 amount){ } // F4 - returns safe's values' // function Getsafe(uint256 _id) public view returns (uint256 id, address user, address tokenAddress, uint256 amount, uint256 time) { } // F5 - add new hodl safe (ETH) // function HodlEth(uint256 time) public contractActive payable { } // F6 add new hodl safe (ERC20 token) // function ClaimHodlToken(address tokenAddress, uint256 amount, uint256 time) public contractActive { } // F7 - user, claim back a hodl safe // function UserRetireHodl(uint256 id) public { } // F8 - private retire hodl safe action // function RetireHodl(uint256 id) private { } // F9 - private pay eth to address // function PayEth(address user, uint256 amount) private { } // F10 - private pay token to address // function PayToken(address user, address tokenAddress, uint256 amount) private{ EIP20Interface token = EIP20Interface(tokenAddress); require(<FILL_ME>) token.transfer(user, amount); } // F11 - store comission from unfinished hodl // function StoreComission(address tokenAddress, uint256 amount) private { } // F12 - delete safe values in storage // function DeleteSafe(Safe s) private { } // F13 // OWNER - owner retire hodl safe // function OwnerRetireHodl(uint256 id) public onlyOwner { } // F14 - owner, change comission value // function ChangeComission(uint256 newComission) onlyOwner public { } // F15 - owner withdraw eth reserved from comissions // function WithdrawReserve(address tokenAddress) onlyOwner public { } // F16 - owner withdraw token reserved from comission // function WithdrawAllReserves() onlyOwner public { } // F17 - owner remove free eth // function WithdrawSpecialEth(uint256 amount) onlyOwner public { } // F18 - owner remove free token // function WithdrawSpecialToken(address tokenAddress, uint256 amount) onlyOwner public { } //AUX - @dev Multiplies two numbers, throws on overflow. // function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } }
token.balanceOf(address(this))>=amount
26,264
token.balanceOf(address(this))>=amount
null
pragma solidity ^0.4.23; contract EIP20Interface { uint256 public totalSupply; uint256 public decimals; function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract OwnableContract { address superOwner; constructor() public { } modifier onlyOwner() { } function viewSuperOwner() public view returns (address owner) { } function changeOwner(address newOwner) onlyOwner public { } } contract BlockableContract is OwnableContract{ bool public blockedContract; constructor() public { } modifier contractActive() { } function doBlockContract() onlyOwner public { } function unBlockContract() onlyOwner public { } } contract Hodl is BlockableContract{ struct Safe{ uint256 id; address user; address tokenAddress; uint256 amount; uint256 time; } /** * @dev safes variables */ mapping( address => uint256[]) public _userSafes; mapping( uint256 => Safe) private _safes; uint256 private _currentIndex; mapping( address => uint256) public _totalSaved; /** * @dev owner variables */ uint256 public comission; //0..100 mapping( address => uint256) private _systemReserves; address[] public _listedReserves; /** * constructor */ constructor() public { } // F1 - fallback function to receive donation eth // function () public payable { } // F2 - how many safes has the user // function GetUserSafesLength(address a) public view returns (uint256 length) { } // F3 - how many tokens are reserved for owner as comission // function GetReserveAmount(address tokenAddress) public view returns (uint256 amount){ } // F4 - returns safe's values' // function Getsafe(uint256 _id) public view returns (uint256 id, address user, address tokenAddress, uint256 amount, uint256 time) { } // F5 - add new hodl safe (ETH) // function HodlEth(uint256 time) public contractActive payable { } // F6 add new hodl safe (ERC20 token) // function ClaimHodlToken(address tokenAddress, uint256 amount, uint256 time) public contractActive { } // F7 - user, claim back a hodl safe // function UserRetireHodl(uint256 id) public { } // F8 - private retire hodl safe action // function RetireHodl(uint256 id) private { } // F9 - private pay eth to address // function PayEth(address user, uint256 amount) private { } // F10 - private pay token to address // function PayToken(address user, address tokenAddress, uint256 amount) private{ } // F11 - store comission from unfinished hodl // function StoreComission(address tokenAddress, uint256 amount) private { } // F12 - delete safe values in storage // function DeleteSafe(Safe s) private { } // F13 // OWNER - owner retire hodl safe // function OwnerRetireHodl(uint256 id) public onlyOwner { } // F14 - owner, change comission value // function ChangeComission(uint256 newComission) onlyOwner public { } // F15 - owner withdraw eth reserved from comissions // function WithdrawReserve(address tokenAddress) onlyOwner public { require(<FILL_ME>) uint256 amount = _systemReserves[tokenAddress]; _systemReserves[tokenAddress] = 0; EIP20Interface token = EIP20Interface(tokenAddress); require(token.balanceOf(address(this)) >= amount); token.transfer(msg.sender, amount); } // F16 - owner withdraw token reserved from comission // function WithdrawAllReserves() onlyOwner public { } // F17 - owner remove free eth // function WithdrawSpecialEth(uint256 amount) onlyOwner public { } // F18 - owner remove free token // function WithdrawSpecialToken(address tokenAddress, uint256 amount) onlyOwner public { } //AUX - @dev Multiplies two numbers, throws on overflow. // function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } }
_systemReserves[tokenAddress]>0
26,264
_systemReserves[tokenAddress]>0
"invalid addr"
//SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental SMTChecker; import "./ERC20If.sol"; import "./Ownable.sol"; import "./CanReclaimToken.sol"; import "./SafeMathLib.sol"; contract MTokenWrap is Ownable, CanReclaimToken { using SafeMath for uint256; ERC20If public mtoken; string public nativeCoinType; address public mtokenRepository; uint256 public wrapSeq; mapping(bytes32 => uint256) public wrapSeqMap; // bool public checkSignature = true; uint256 constant rate_precision = 1e10; // function _checkSignature(bool _b) public onlyOwner { // checkSignature = _b; // } function _mtokenRepositorySet(address newMtokenRepository) public onlyOwner { require(<FILL_ME>) mtokenRepository = newMtokenRepository; } function wrapHash(string memory nativeCoinAddress, string memory nativeTxId) public pure returns (bytes32) { } event SETUP( address _mtoken, string _nativeCoinType, address _mtokenRepository ); function setup( address _mtoken, string memory _nativeCoinType, address _mtokenRepository, address _initOwner ) public returns ( //onlyOwner 一次setup,不鉴权了 bool ) { } function uintToString(uint256 _i) public pure returns (string memory) { } function toHexString(bytes memory data) public pure returns (string memory) { } function toHexString(address account) public pure returns (string memory) { } function calcMTokenAmount( uint256 amt, uint256 fee, uint256 rate ) public pure returns (uint256) { } function encode( address receiveMTokenAddress, string memory nativeCoinAddress, uint256 amt, uint256 fee, uint256 rate, uint64 deadline //TODO 暂时设置为public ) public view returns (bytes memory) { } function personalMessage(bytes memory _msg) public pure returns (bytes memory) { } function recoverPersonalSignature( bytes32 r, bytes32 s, uint8 v, bytes memory text ) public pure returns (address) { } function wrap( address ethAccount, address receiveMTokenAddress, string memory nativeCoinAddress, string memory nativeTxId, uint256 amt, uint256 fee, uint256 rate, uint64 deadline, bytes32 r, bytes32 s, uint8 v ) public onlyOwner returns (bool) { } event WRAP_EVENT( uint256 indexed wrapSeq, address ethAccount, address receiveMTokenAddress, string nativeCoinAddress, string nativeTxId, uint256 amt, uint256 fee, uint256 rate, uint64 deadline, bytes32 r, bytes32 s, uint8 v ); }
newMtokenRepository!=(address)(0),"invalid addr"
26,293
newMtokenRepository!=(address)(0)
"wrap dup."
//SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental SMTChecker; import "./ERC20If.sol"; import "./Ownable.sol"; import "./CanReclaimToken.sol"; import "./SafeMathLib.sol"; contract MTokenWrap is Ownable, CanReclaimToken { using SafeMath for uint256; ERC20If public mtoken; string public nativeCoinType; address public mtokenRepository; uint256 public wrapSeq; mapping(bytes32 => uint256) public wrapSeqMap; // bool public checkSignature = true; uint256 constant rate_precision = 1e10; // function _checkSignature(bool _b) public onlyOwner { // checkSignature = _b; // } function _mtokenRepositorySet(address newMtokenRepository) public onlyOwner { } function wrapHash(string memory nativeCoinAddress, string memory nativeTxId) public pure returns (bytes32) { } event SETUP( address _mtoken, string _nativeCoinType, address _mtokenRepository ); function setup( address _mtoken, string memory _nativeCoinType, address _mtokenRepository, address _initOwner ) public returns ( //onlyOwner 一次setup,不鉴权了 bool ) { } function uintToString(uint256 _i) public pure returns (string memory) { } function toHexString(bytes memory data) public pure returns (string memory) { } function toHexString(address account) public pure returns (string memory) { } function calcMTokenAmount( uint256 amt, uint256 fee, uint256 rate ) public pure returns (uint256) { } function encode( address receiveMTokenAddress, string memory nativeCoinAddress, uint256 amt, uint256 fee, uint256 rate, uint64 deadline //TODO 暂时设置为public ) public view returns (bytes memory) { } function personalMessage(bytes memory _msg) public pure returns (bytes memory) { } function recoverPersonalSignature( bytes32 r, bytes32 s, uint8 v, bytes memory text ) public pure returns (address) { } function wrap( address ethAccount, address receiveMTokenAddress, string memory nativeCoinAddress, string memory nativeTxId, uint256 amt, uint256 fee, uint256 rate, uint64 deadline, bytes32 r, bytes32 s, uint8 v ) public onlyOwner returns (bool) { uint256 mtokenAmount = calcMTokenAmount(amt, fee, rate); // if (checkSignature) { bytes memory text = encode( receiveMTokenAddress, nativeCoinAddress, amt, fee, rate, deadline ); address addr = recoverPersonalSignature(r, s, v, text); require(addr == ethAccount, "invalid signature"); } require(<FILL_ME>) wrapSeqMap[wrapHash(nativeCoinAddress, nativeTxId)] = wrapSeq; wrapSeq = wrapSeq + 1; require( mtoken.transferFrom( mtokenRepository, receiveMTokenAddress, mtokenAmount ), "transferFrom failed" ); emit WRAP_EVENT( wrapSeq, ethAccount, receiveMTokenAddress, nativeCoinAddress, nativeTxId, amt,fee,rate, deadline, r, s, v ); return true; } event WRAP_EVENT( uint256 indexed wrapSeq, address ethAccount, address receiveMTokenAddress, string nativeCoinAddress, string nativeTxId, uint256 amt, uint256 fee, uint256 rate, uint64 deadline, bytes32 r, bytes32 s, uint8 v ); }
wrapSeqMap[wrapHash(nativeCoinAddress,nativeTxId)]<=0,"wrap dup."
26,293
wrapSeqMap[wrapHash(nativeCoinAddress,nativeTxId)]<=0
"transferFrom failed"
//SPDX-License-Identifier: MIT pragma solidity ^0.7.0; pragma experimental SMTChecker; import "./ERC20If.sol"; import "./Ownable.sol"; import "./CanReclaimToken.sol"; import "./SafeMathLib.sol"; contract MTokenWrap is Ownable, CanReclaimToken { using SafeMath for uint256; ERC20If public mtoken; string public nativeCoinType; address public mtokenRepository; uint256 public wrapSeq; mapping(bytes32 => uint256) public wrapSeqMap; // bool public checkSignature = true; uint256 constant rate_precision = 1e10; // function _checkSignature(bool _b) public onlyOwner { // checkSignature = _b; // } function _mtokenRepositorySet(address newMtokenRepository) public onlyOwner { } function wrapHash(string memory nativeCoinAddress, string memory nativeTxId) public pure returns (bytes32) { } event SETUP( address _mtoken, string _nativeCoinType, address _mtokenRepository ); function setup( address _mtoken, string memory _nativeCoinType, address _mtokenRepository, address _initOwner ) public returns ( //onlyOwner 一次setup,不鉴权了 bool ) { } function uintToString(uint256 _i) public pure returns (string memory) { } function toHexString(bytes memory data) public pure returns (string memory) { } function toHexString(address account) public pure returns (string memory) { } function calcMTokenAmount( uint256 amt, uint256 fee, uint256 rate ) public pure returns (uint256) { } function encode( address receiveMTokenAddress, string memory nativeCoinAddress, uint256 amt, uint256 fee, uint256 rate, uint64 deadline //TODO 暂时设置为public ) public view returns (bytes memory) { } function personalMessage(bytes memory _msg) public pure returns (bytes memory) { } function recoverPersonalSignature( bytes32 r, bytes32 s, uint8 v, bytes memory text ) public pure returns (address) { } function wrap( address ethAccount, address receiveMTokenAddress, string memory nativeCoinAddress, string memory nativeTxId, uint256 amt, uint256 fee, uint256 rate, uint64 deadline, bytes32 r, bytes32 s, uint8 v ) public onlyOwner returns (bool) { uint256 mtokenAmount = calcMTokenAmount(amt, fee, rate); // if (checkSignature) { bytes memory text = encode( receiveMTokenAddress, nativeCoinAddress, amt, fee, rate, deadline ); address addr = recoverPersonalSignature(r, s, v, text); require(addr == ethAccount, "invalid signature"); } require( wrapSeqMap[wrapHash(nativeCoinAddress, nativeTxId)] <= 0, "wrap dup." ); wrapSeqMap[wrapHash(nativeCoinAddress, nativeTxId)] = wrapSeq; wrapSeq = wrapSeq + 1; require(<FILL_ME>) emit WRAP_EVENT( wrapSeq, ethAccount, receiveMTokenAddress, nativeCoinAddress, nativeTxId, amt,fee,rate, deadline, r, s, v ); return true; } event WRAP_EVENT( uint256 indexed wrapSeq, address ethAccount, address receiveMTokenAddress, string nativeCoinAddress, string nativeTxId, uint256 amt, uint256 fee, uint256 rate, uint64 deadline, bytes32 r, bytes32 s, uint8 v ); }
mtoken.transferFrom(mtokenRepository,receiveMTokenAddress,mtokenAmount),"transferFrom failed"
26,293
mtoken.transferFrom(mtokenRepository,receiveMTokenAddress,mtokenAmount)
null
pragma solidity ^0.4.23; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ApproveAndCallFallBack * @dev Contract function to receive approval and execute function in one call */ contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public; } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ 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); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { } /** * Token owner can approve for `spender` to transferFrom(...) `tokens` * from the token owner's account. The `spender` contract function * `receiveApproval(...)` is then executed */ function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) { } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { } } contract CappedToken is MintableToken { uint256 public cap; constructor(uint256 _cap) public { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } contract PausableToken is StandardToken, Pausable { mapping (address => bool) public frozenAccount; event FrozenFunds(address target, bool frozen); function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { } /** * @dev Function to batch send tokens * @param _receivers The addresses that will receive the tokens. * @param _value The amount of tokens to send. */ function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) { require(!frozenAccount[msg.sender]); uint cnt = _receivers.length; uint256 amount = uint256(cnt).mul(_value); require(cnt > 0 && cnt <= 500); require(_value > 0 && balances[msg.sender] >= amount); balances[msg.sender] = balances[msg.sender].sub(amount); for (uint i = 0; i < cnt; i++) { require(<FILL_ME>) balances[_receivers[i]] = balances[_receivers[i]].add(_value); emit Transfer(msg.sender, _receivers[i], _value); } return true; } /** * @dev Function to batch send tokens * @param _receivers The addresses that will receive the tokens. * @param _values The array of amount to send. */ function batchTransferValues(address[] _receivers, uint256[] _values) public whenNotPaused returns (bool) { } /** * @dev Function to batch freeze accounts * @param _addresses The addresses that will be frozen/unfrozen. * @param _freeze To freeze or not. */ function batchFreeze(address[] _addresses, bool _freeze) onlyOwner public { } } contract JalaToken is CappedToken, PausableToken { string public constant name = "JALA"; string public constant symbol = "JALA"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 1 * 10000 * 10000 * (10 ** uint256(decimals)); uint256 public constant MAX_SUPPLY = 10 * 10000 * 10000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() CappedToken(MAX_SUPPLY) public { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint whenNotPaused public returns (bool) { } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint whenNotPaused public returns (bool) { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner whenNotPaused public { } /** * The fallback function. */ function() payable public { } /** * Owner can transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { } }
_receivers[i]!=0x0
26,340
_receivers[i]!=0x0
null
pragma solidity ^0.4.23; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ApproveAndCallFallBack * @dev Contract function to receive approval and execute function in one call */ contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public; } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ 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); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { } /** * Token owner can approve for `spender` to transferFrom(...) `tokens` * from the token owner's account. The `spender` contract function * `receiveApproval(...)` is then executed */ function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) { } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { } } contract CappedToken is MintableToken { uint256 public cap; constructor(uint256 _cap) public { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } contract PausableToken is StandardToken, Pausable { mapping (address => bool) public frozenAccount; event FrozenFunds(address target, bool frozen); function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { } /** * @dev Function to batch send tokens * @param _receivers The addresses that will receive the tokens. * @param _value The amount of tokens to send. */ function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) { } /** * @dev Function to batch send tokens * @param _receivers The addresses that will receive the tokens. * @param _values The array of amount to send. */ function batchTransferValues(address[] _receivers, uint256[] _values) public whenNotPaused returns (bool) { require(!frozenAccount[msg.sender]); uint cnt = _receivers.length; require(cnt == _values.length); require(cnt > 0 && cnt <= 500); uint256 amount = 0; for (uint i = 0; i < cnt; i++) { require(<FILL_ME>) amount = amount.add(_values[i]); } require(balances[msg.sender] >= amount); balances[msg.sender] = balances[msg.sender].sub(amount); for (uint j = 0; j < cnt; j++) { require (_receivers[j] != 0x0); balances[_receivers[j]] = balances[_receivers[j]].add(_values[j]); emit Transfer(msg.sender, _receivers[j], _values[j]); } return true; } /** * @dev Function to batch freeze accounts * @param _addresses The addresses that will be frozen/unfrozen. * @param _freeze To freeze or not. */ function batchFreeze(address[] _addresses, bool _freeze) onlyOwner public { } } contract JalaToken is CappedToken, PausableToken { string public constant name = "JALA"; string public constant symbol = "JALA"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 1 * 10000 * 10000 * (10 ** uint256(decimals)); uint256 public constant MAX_SUPPLY = 10 * 10000 * 10000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() CappedToken(MAX_SUPPLY) public { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint whenNotPaused public returns (bool) { } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint whenNotPaused public returns (bool) { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner whenNotPaused public { } /** * The fallback function. */ function() payable public { } /** * Owner can transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { } }
_values[i]!=0
26,340
_values[i]!=0
null
pragma solidity ^0.4.23; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ApproveAndCallFallBack * @dev Contract function to receive approval and execute function in one call */ contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public; } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ 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); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { } /** * Token owner can approve for `spender` to transferFrom(...) `tokens` * from the token owner's account. The `spender` contract function * `receiveApproval(...)` is then executed */ function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) { } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { } } contract CappedToken is MintableToken { uint256 public cap; constructor(uint256 _cap) public { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } contract PausableToken is StandardToken, Pausable { mapping (address => bool) public frozenAccount; event FrozenFunds(address target, bool frozen); function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { } /** * @dev Function to batch send tokens * @param _receivers The addresses that will receive the tokens. * @param _value The amount of tokens to send. */ function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) { } /** * @dev Function to batch send tokens * @param _receivers The addresses that will receive the tokens. * @param _values The array of amount to send. */ function batchTransferValues(address[] _receivers, uint256[] _values) public whenNotPaused returns (bool) { require(!frozenAccount[msg.sender]); uint cnt = _receivers.length; require(cnt == _values.length); require(cnt > 0 && cnt <= 500); uint256 amount = 0; for (uint i = 0; i < cnt; i++) { require (_values[i] != 0); amount = amount.add(_values[i]); } require(<FILL_ME>) balances[msg.sender] = balances[msg.sender].sub(amount); for (uint j = 0; j < cnt; j++) { require (_receivers[j] != 0x0); balances[_receivers[j]] = balances[_receivers[j]].add(_values[j]); emit Transfer(msg.sender, _receivers[j], _values[j]); } return true; } /** * @dev Function to batch freeze accounts * @param _addresses The addresses that will be frozen/unfrozen. * @param _freeze To freeze or not. */ function batchFreeze(address[] _addresses, bool _freeze) onlyOwner public { } } contract JalaToken is CappedToken, PausableToken { string public constant name = "JALA"; string public constant symbol = "JALA"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 1 * 10000 * 10000 * (10 ** uint256(decimals)); uint256 public constant MAX_SUPPLY = 10 * 10000 * 10000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() CappedToken(MAX_SUPPLY) public { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint whenNotPaused public returns (bool) { } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint whenNotPaused public returns (bool) { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner whenNotPaused public { } /** * The fallback function. */ function() payable public { } /** * Owner can transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { } }
balances[msg.sender]>=amount
26,340
balances[msg.sender]>=amount
null
pragma solidity ^0.4.23; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ApproveAndCallFallBack * @dev Contract function to receive approval and execute function in one call */ contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public; } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ 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); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { } /** * Token owner can approve for `spender` to transferFrom(...) `tokens` * from the token owner's account. The `spender` contract function * `receiveApproval(...)` is then executed */ function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) { } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { } } contract CappedToken is MintableToken { uint256 public cap; constructor(uint256 _cap) public { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } contract PausableToken is StandardToken, Pausable { mapping (address => bool) public frozenAccount; event FrozenFunds(address target, bool frozen); function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { } /** * @dev Function to batch send tokens * @param _receivers The addresses that will receive the tokens. * @param _value The amount of tokens to send. */ function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) { } /** * @dev Function to batch send tokens * @param _receivers The addresses that will receive the tokens. * @param _values The array of amount to send. */ function batchTransferValues(address[] _receivers, uint256[] _values) public whenNotPaused returns (bool) { require(!frozenAccount[msg.sender]); uint cnt = _receivers.length; require(cnt == _values.length); require(cnt > 0 && cnt <= 500); uint256 amount = 0; for (uint i = 0; i < cnt; i++) { require (_values[i] != 0); amount = amount.add(_values[i]); } require(balances[msg.sender] >= amount); balances[msg.sender] = balances[msg.sender].sub(amount); for (uint j = 0; j < cnt; j++) { require(<FILL_ME>) balances[_receivers[j]] = balances[_receivers[j]].add(_values[j]); emit Transfer(msg.sender, _receivers[j], _values[j]); } return true; } /** * @dev Function to batch freeze accounts * @param _addresses The addresses that will be frozen/unfrozen. * @param _freeze To freeze or not. */ function batchFreeze(address[] _addresses, bool _freeze) onlyOwner public { } } contract JalaToken is CappedToken, PausableToken { string public constant name = "JALA"; string public constant symbol = "JALA"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 1 * 10000 * 10000 * (10 ** uint256(decimals)); uint256 public constant MAX_SUPPLY = 10 * 10000 * 10000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() CappedToken(MAX_SUPPLY) public { } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint whenNotPaused public returns (bool) { } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint whenNotPaused public returns (bool) { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner whenNotPaused public { } /** * The fallback function. */ function() payable public { } /** * Owner can transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { } }
_receivers[j]!=0x0
26,340
_receivers[j]!=0x0
null
pragma solidity 0.4.23; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address internal owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } function isOwner() public view returns (bool) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ 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); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping(address => mapping(address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { } } /// @title Token /// @author Jose Perez - <[email protected]> /// @notice ERC20 token /// @dev The contract allows to perform a number of token sales in different periods in time. /// allowing participants in previous token sales to transfer tokens to other accounts. /// Additionally, token locking logic for KYC/AML compliance checking is supported. contract Token is StandardToken, Ownable { using SafeMath for uint256; string public constant name = "EGB"; string public constant symbol = "EGB"; uint256 public constant decimals = 9; // Using same number of decimal figures as ETH (i.e. 18). uint256 public constant TOKEN_UNIT = 10 ** uint256(decimals); // Maximum number of tokens in circulation uint256 public constant MAX_TOKEN_SUPPLY = 1000000000 * TOKEN_UNIT; // Maximum size of the batch functions input arrays. uint256 public constant MAX_BATCH_SIZE = 400; // address public assigner; // The address allowed to assign or mint tokens during token sale. address public locker; // The address allowed to lock/unlock addresses. mapping(address => bool) public locked; // If true, address' tokens cannot be transferred. mapping(address => bool) public alwLockTx; mapping(address => TxRecord[]) public txRecordPerAddress; mapping(address => uint) public chainStartIdxPerAddress; mapping(address => uint) public chainEndIdxPerAddress; struct TxRecord { uint amount; uint releaseTime; uint nextIdx; uint prevIdx; } event Lock(address indexed addr); event Unlock(address indexed addr); event Assign(address indexed to, uint256 amount); event LockerTransferred(address indexed previousLocker, address indexed newLocker); // event AssignerTransferred(address indexed previousAssigner, address indexed newAssigner); /// @dev Constructor that initializes the contract. constructor() public { } /// @dev Throws if called by any account other than the locker. modifier onlyLocker() { } function isLocker() public view returns (bool) { } /// @dev Allows the current owner to change the locker. /// @param _newLocker The address of the new locker. /// @return True if the operation was successful. function transferLocker(address _newLocker) external onlyOwner returns (bool) { } function alwLT(address _address, bool _enable) public onlyLocker returns (bool) { } function alwLTBatches(address[] _addresses, bool _enable) external onlyLocker returns (bool) { } /// @dev Locks an address. A locked address cannot transfer its tokens or other addresses' tokens out. /// Only addresses participating in the current token sale can be locked. /// Only the locker account can lock addresses and only during the token sale. /// @param _address address The address to lock. /// @return True if the operation was successful. function lockAddress(address _address) public onlyLocker returns (bool) { require(<FILL_ME>) locked[_address] = true; emit Lock(_address); return true; } /// @dev Unlocks an address so that its owner can transfer tokens out again. /// Addresses can be unlocked any time. Only the locker account can unlock addresses /// @param _address address The address to unlock. /// @return True if the operation was successful. function unlockAddress(address _address) public onlyLocker returns (bool) { } /// @dev Locks several addresses in one single call. /// @param _addresses address[] The addresses to lock. /// @return True if the operation was successful. function lockInBatches(address[] _addresses) external onlyLocker returns (bool) { } /// @dev Unlocks several addresses in one single call. /// @param _addresses address[] The addresses to unlock. /// @return True if the operation was successful. function unlockInBatches(address[] _addresses) external onlyLocker returns (bool) { } /// @dev Checks whether or not the given address is locked. /// @param _address address The address to be checked. /// @return Boolean indicating whether or not the address is locked. function isLocked(address _address) external view returns (bool) { } function transfer(address _to, uint256 _value) public returns (bool) { } function transferL(address _to, uint256 _value, uint256 lTime) public returns (bool) { } function getRecordInfo(address addr, uint256 index) external onlyOwner view returns (uint, uint, uint, uint) { } function delr(address _address, uint256 index) public onlyOwner returns (bool) { } function resetTime(address _address, uint256 index, uint256 lTime) external onlyOwner returns (bool) { } function payop(address _from, uint needTakeout) private { } function recop(address _to, uint256 _value, uint256 lTime) private { } function transferFT(address _from, address _to, uint256 _value, uint256 lTime) private returns (bool) { } function txRecordCount(address add) public onlyOwner view returns (uint){ } /// @dev Transfers tokens from one address to another. It prevents transferring tokens if the caller is locked or /// if the allowed address is locked. /// Locked addresses can receive tokens. /// Current token sale's addresses cannot receive or send tokens until the token sale ends. /// @param _from address The address to transfer tokens from. /// @param _to address The address to transfer tokens to. /// @param _value The number of tokens to be transferred. function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } function kill() onlyOwner { } }
!locked[_address]
26,362
!locked[_address]
null
pragma solidity 0.4.23; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address internal owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } function isOwner() public view returns (bool) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ 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); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping(address => mapping(address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { } } /// @title Token /// @author Jose Perez - <[email protected]> /// @notice ERC20 token /// @dev The contract allows to perform a number of token sales in different periods in time. /// allowing participants in previous token sales to transfer tokens to other accounts. /// Additionally, token locking logic for KYC/AML compliance checking is supported. contract Token is StandardToken, Ownable { using SafeMath for uint256; string public constant name = "EGB"; string public constant symbol = "EGB"; uint256 public constant decimals = 9; // Using same number of decimal figures as ETH (i.e. 18). uint256 public constant TOKEN_UNIT = 10 ** uint256(decimals); // Maximum number of tokens in circulation uint256 public constant MAX_TOKEN_SUPPLY = 1000000000 * TOKEN_UNIT; // Maximum size of the batch functions input arrays. uint256 public constant MAX_BATCH_SIZE = 400; // address public assigner; // The address allowed to assign or mint tokens during token sale. address public locker; // The address allowed to lock/unlock addresses. mapping(address => bool) public locked; // If true, address' tokens cannot be transferred. mapping(address => bool) public alwLockTx; mapping(address => TxRecord[]) public txRecordPerAddress; mapping(address => uint) public chainStartIdxPerAddress; mapping(address => uint) public chainEndIdxPerAddress; struct TxRecord { uint amount; uint releaseTime; uint nextIdx; uint prevIdx; } event Lock(address indexed addr); event Unlock(address indexed addr); event Assign(address indexed to, uint256 amount); event LockerTransferred(address indexed previousLocker, address indexed newLocker); // event AssignerTransferred(address indexed previousAssigner, address indexed newAssigner); /// @dev Constructor that initializes the contract. constructor() public { } /// @dev Throws if called by any account other than the locker. modifier onlyLocker() { } function isLocker() public view returns (bool) { } /// @dev Allows the current owner to change the locker. /// @param _newLocker The address of the new locker. /// @return True if the operation was successful. function transferLocker(address _newLocker) external onlyOwner returns (bool) { } function alwLT(address _address, bool _enable) public onlyLocker returns (bool) { } function alwLTBatches(address[] _addresses, bool _enable) external onlyLocker returns (bool) { } /// @dev Locks an address. A locked address cannot transfer its tokens or other addresses' tokens out. /// Only addresses participating in the current token sale can be locked. /// Only the locker account can lock addresses and only during the token sale. /// @param _address address The address to lock. /// @return True if the operation was successful. function lockAddress(address _address) public onlyLocker returns (bool) { } /// @dev Unlocks an address so that its owner can transfer tokens out again. /// Addresses can be unlocked any time. Only the locker account can unlock addresses /// @param _address address The address to unlock. /// @return True if the operation was successful. function unlockAddress(address _address) public onlyLocker returns (bool) { require(<FILL_ME>) locked[_address] = false; emit Unlock(_address); return true; } /// @dev Locks several addresses in one single call. /// @param _addresses address[] The addresses to lock. /// @return True if the operation was successful. function lockInBatches(address[] _addresses) external onlyLocker returns (bool) { } /// @dev Unlocks several addresses in one single call. /// @param _addresses address[] The addresses to unlock. /// @return True if the operation was successful. function unlockInBatches(address[] _addresses) external onlyLocker returns (bool) { } /// @dev Checks whether or not the given address is locked. /// @param _address address The address to be checked. /// @return Boolean indicating whether or not the address is locked. function isLocked(address _address) external view returns (bool) { } function transfer(address _to, uint256 _value) public returns (bool) { } function transferL(address _to, uint256 _value, uint256 lTime) public returns (bool) { } function getRecordInfo(address addr, uint256 index) external onlyOwner view returns (uint, uint, uint, uint) { } function delr(address _address, uint256 index) public onlyOwner returns (bool) { } function resetTime(address _address, uint256 index, uint256 lTime) external onlyOwner returns (bool) { } function payop(address _from, uint needTakeout) private { } function recop(address _to, uint256 _value, uint256 lTime) private { } function transferFT(address _from, address _to, uint256 _value, uint256 lTime) private returns (bool) { } function txRecordCount(address add) public onlyOwner view returns (uint){ } /// @dev Transfers tokens from one address to another. It prevents transferring tokens if the caller is locked or /// if the allowed address is locked. /// Locked addresses can receive tokens. /// Current token sale's addresses cannot receive or send tokens until the token sale ends. /// @param _from address The address to transfer tokens from. /// @param _to address The address to transfer tokens to. /// @param _value The number of tokens to be transferred. function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } function kill() onlyOwner { } }
locked[_address]
26,362
locked[_address]
null
pragma solidity 0.4.23; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address internal owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } function isOwner() public view returns (bool) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ 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); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping(address => mapping(address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { } } /// @title Token /// @author Jose Perez - <[email protected]> /// @notice ERC20 token /// @dev The contract allows to perform a number of token sales in different periods in time. /// allowing participants in previous token sales to transfer tokens to other accounts. /// Additionally, token locking logic for KYC/AML compliance checking is supported. contract Token is StandardToken, Ownable { using SafeMath for uint256; string public constant name = "EGB"; string public constant symbol = "EGB"; uint256 public constant decimals = 9; // Using same number of decimal figures as ETH (i.e. 18). uint256 public constant TOKEN_UNIT = 10 ** uint256(decimals); // Maximum number of tokens in circulation uint256 public constant MAX_TOKEN_SUPPLY = 1000000000 * TOKEN_UNIT; // Maximum size of the batch functions input arrays. uint256 public constant MAX_BATCH_SIZE = 400; // address public assigner; // The address allowed to assign or mint tokens during token sale. address public locker; // The address allowed to lock/unlock addresses. mapping(address => bool) public locked; // If true, address' tokens cannot be transferred. mapping(address => bool) public alwLockTx; mapping(address => TxRecord[]) public txRecordPerAddress; mapping(address => uint) public chainStartIdxPerAddress; mapping(address => uint) public chainEndIdxPerAddress; struct TxRecord { uint amount; uint releaseTime; uint nextIdx; uint prevIdx; } event Lock(address indexed addr); event Unlock(address indexed addr); event Assign(address indexed to, uint256 amount); event LockerTransferred(address indexed previousLocker, address indexed newLocker); // event AssignerTransferred(address indexed previousAssigner, address indexed newAssigner); /// @dev Constructor that initializes the contract. constructor() public { } /// @dev Throws if called by any account other than the locker. modifier onlyLocker() { } function isLocker() public view returns (bool) { } /// @dev Allows the current owner to change the locker. /// @param _newLocker The address of the new locker. /// @return True if the operation was successful. function transferLocker(address _newLocker) external onlyOwner returns (bool) { } function alwLT(address _address, bool _enable) public onlyLocker returns (bool) { } function alwLTBatches(address[] _addresses, bool _enable) external onlyLocker returns (bool) { } /// @dev Locks an address. A locked address cannot transfer its tokens or other addresses' tokens out. /// Only addresses participating in the current token sale can be locked. /// Only the locker account can lock addresses and only during the token sale. /// @param _address address The address to lock. /// @return True if the operation was successful. function lockAddress(address _address) public onlyLocker returns (bool) { } /// @dev Unlocks an address so that its owner can transfer tokens out again. /// Addresses can be unlocked any time. Only the locker account can unlock addresses /// @param _address address The address to unlock. /// @return True if the operation was successful. function unlockAddress(address _address) public onlyLocker returns (bool) { } /// @dev Locks several addresses in one single call. /// @param _addresses address[] The addresses to lock. /// @return True if the operation was successful. function lockInBatches(address[] _addresses) external onlyLocker returns (bool) { } /// @dev Unlocks several addresses in one single call. /// @param _addresses address[] The addresses to unlock. /// @return True if the operation was successful. function unlockInBatches(address[] _addresses) external onlyLocker returns (bool) { } /// @dev Checks whether or not the given address is locked. /// @param _address address The address to be checked. /// @return Boolean indicating whether or not the address is locked. function isLocked(address _address) external view returns (bool) { } function transfer(address _to, uint256 _value) public returns (bool) { } function transferL(address _to, uint256 _value, uint256 lTime) public returns (bool) { require(<FILL_ME>) require(!locked[msg.sender]); require(_to != address(0)); return transferFT(msg.sender, _to, _value, lTime); } function getRecordInfo(address addr, uint256 index) external onlyOwner view returns (uint, uint, uint, uint) { } function delr(address _address, uint256 index) public onlyOwner returns (bool) { } function resetTime(address _address, uint256 index, uint256 lTime) external onlyOwner returns (bool) { } function payop(address _from, uint needTakeout) private { } function recop(address _to, uint256 _value, uint256 lTime) private { } function transferFT(address _from, address _to, uint256 _value, uint256 lTime) private returns (bool) { } function txRecordCount(address add) public onlyOwner view returns (uint){ } /// @dev Transfers tokens from one address to another. It prevents transferring tokens if the caller is locked or /// if the allowed address is locked. /// Locked addresses can receive tokens. /// Current token sale's addresses cannot receive or send tokens until the token sale ends. /// @param _from address The address to transfer tokens from. /// @param _to address The address to transfer tokens to. /// @param _value The number of tokens to be transferred. function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } function kill() onlyOwner { } }
alwLockTx[msg.sender]
26,362
alwLockTx[msg.sender]
"Max supply exceeded!"
// SPDX-License-Identifier: MIT /* Adzuki is entirely copy-pasting images from Azuki: 1. Half of the mint fee is immediately given to the holder of the same NFT ID of Azuki collection. 2. All copyrights of Adzuki and its royalty are attributed to the holder of the same NFT ID of Azuki collection. 3. Top 1000 is free, so the mint fee for those holders will be distributed after the mint is completed. 4. Just like Azuki, Adzuki uses ERC721A to save gas. Azuki: https://www.azuki.com Adzuki: https://adzuki.art */ pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "./ERC721A.sol"; contract Adzuki is Ownable, ERC721A, ReentrancyGuard { uint256 public constant MAX_MINT_AMOUNT_PER_TX = 100; uint256 public constant MAX_SUPPLY = 10000; uint256 public constant PRICE = 0.05 ether; uint256 public constant AZUKI_FEE = PRICE / 2; // 0.025 ether uint256 public constant FREE_AMOUNT = 1000; address public azuki = 0xED5AF388653567Af2F388E6224dC7C4b3241C544; constructor() ERC721A("Adzuki", "ADZUKI", MAX_MINT_AMOUNT_PER_TX, MAX_SUPPLY) {} function _baseURI() internal pure override returns (string memory) { } function mint(uint256 amount) public payable { require(amount > 0 && amount <= MAX_MINT_AMOUNT_PER_TX, "Invalid mint amount!"); require(<FILL_ME>) require(msg.value == PRICE * amount, "Insufficient funds!"); uint256 tokenId = totalSupply(); for (uint256 i = 0; i < amount; i++) { address azukiOwner = IERC721(azuki).ownerOf(tokenId); azukiOwner.call{value: AZUKI_FEE}(""); // ignore, Not all is success tokenId++; } _safeMint(msg.sender, amount); } function freeMint(uint256 amount) public { } function withdraw() public onlyOwner nonReentrant { } function getOwnershipData(uint256 tokenId) external view returns (TokenOwnership memory) { } function royaltyInfo(uint256 tokenId, uint256 salePrice) external view virtual override returns (address, uint256) { } }
totalSupply()+amount<=MAX_SUPPLY,"Max supply exceeded!"
26,388
totalSupply()+amount<=MAX_SUPPLY
"No free"
// SPDX-License-Identifier: MIT /* Adzuki is entirely copy-pasting images from Azuki: 1. Half of the mint fee is immediately given to the holder of the same NFT ID of Azuki collection. 2. All copyrights of Adzuki and its royalty are attributed to the holder of the same NFT ID of Azuki collection. 3. Top 1000 is free, so the mint fee for those holders will be distributed after the mint is completed. 4. Just like Azuki, Adzuki uses ERC721A to save gas. Azuki: https://www.azuki.com Adzuki: https://adzuki.art */ pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "./ERC721A.sol"; contract Adzuki is Ownable, ERC721A, ReentrancyGuard { uint256 public constant MAX_MINT_AMOUNT_PER_TX = 100; uint256 public constant MAX_SUPPLY = 10000; uint256 public constant PRICE = 0.05 ether; uint256 public constant AZUKI_FEE = PRICE / 2; // 0.025 ether uint256 public constant FREE_AMOUNT = 1000; address public azuki = 0xED5AF388653567Af2F388E6224dC7C4b3241C544; constructor() ERC721A("Adzuki", "ADZUKI", MAX_MINT_AMOUNT_PER_TX, MAX_SUPPLY) {} function _baseURI() internal pure override returns (string memory) { } function mint(uint256 amount) public payable { } function freeMint(uint256 amount) public { require(<FILL_ME>) require(amount > 0 && amount <= MAX_MINT_AMOUNT_PER_TX, "Invalid mint amount!"); require(totalSupply() + amount <= MAX_SUPPLY, "Max supply exceeded!"); _safeMint(msg.sender, amount); } function withdraw() public onlyOwner nonReentrant { } function getOwnershipData(uint256 tokenId) external view returns (TokenOwnership memory) { } function royaltyInfo(uint256 tokenId, uint256 salePrice) external view virtual override returns (address, uint256) { } }
totalSupply()<FREE_AMOUNT,"No free"
26,388
totalSupply()<FREE_AMOUNT
'not controller'
/* * Copyright (C) 2020-2021 The Wolfpack * This file is part of wolves.finance - https://github.com/wolvesofwallstreet/wolves.finance * * SPDX-License-Identifier: Apache-2.0 * See the file LICENSES/README.md for more information. */ pragma solidity >=0.6.0 <0.8.0; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; import '@openzeppelin/contracts/math/SafeMath.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/utils/ReentrancyGuard.sol'; import './interfaces/IController.sol'; import './interfaces/IFarm.sol'; import './interfaces/IStakeFarm.sol'; import '../../interfaces/uniswap/IUniswapV2Pair.sol'; contract UniV2StakeFarm is IFarm, IStakeFarm, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; /* ========== STATE VARIABLES ========== */ IUniswapV2Pair public stakingToken; uint256 public override periodFinish = 0; uint256 public rewardRate = 0; uint256 public rewardsDuration = 7 days; uint256 public lastUpdateTime; uint256 public rewardPerTokenStored; uint256 private availableRewards; mapping(address => uint256) public userRewardPerTokenPaid; mapping(address => uint256) public rewards; // TODO: Remove next 2 lines after dapp launch (special reward condition) mapping(address => uint256) private firstStakeTime; uint256 private constant ETH_LIMIT = 2e17; uint256 private _totalSupply; mapping(address => uint256) private _balances; // Unique name of this farm instance, used in controller string private _farmName; // Uniswap route to get price for token 0 in pair IUniswapV2Pair public immutable route; // The address of the controller IController public controller; // The direction of the uniswap pairs uint8 public pairDirection; /* ========== CONSTRUCTOR ========== */ constructor( address _owner, string memory _name, address _stakingToken, address _rewardToken, address _controller, address _route ) { } /* ========== VIEWS ========== */ function farmName() external view override returns (string memory) { } function totalSupply() external view returns (uint256) { } function balanceOf(address account) external view returns (uint256) { } function lastTimeRewardApplicable() public view returns (uint256) { } function rewardPerToken() public view returns (uint256) { } function earned(address account) public view returns (uint256) { } function getRewardForDuration() external view returns (uint256) { } function getUIData(address _user) external view returns (uint256[9] memory) { } /* ========== MUTATIVE FUNCTIONS ========== */ function stake(uint256 amount) external override nonReentrant updateReward(msg.sender) { } function unstake(uint256 amount) public override nonReentrant updateReward(msg.sender) { } function transfer(address recipient, uint256 amount) external override updateReward(msg.sender) updateReward(recipient) { } function getReward() public override nonReentrant updateReward(msg.sender) { } function exit() external override { } /* ========== RESTRICTED FUNCTIONS ========== */ function setController(address newController) external override onlyController { } function notifyRewardAmount(uint256 reward) external override onlyController updateReward(address(0)) { } // We don't have any rebalancing here // solhint-disable-next-line no-empty-blocks function rebalance() external override onlyController {} // Added to support recovering LP Rewards from other systems to be distributed to holders function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner { } function setRewardsDuration(uint256 _rewardsDuration) external override onlyOwner { } /* ========== PRIVATE ========== */ function _ethAmount(uint256 amountToken) private view returns (uint256) { } /** * @dev Returns the reserves in order: ETH -> Token, ETH/stable */ function _getTokenUiData() internal view returns ( uint112, uint112, uint256 ) { } /* ========== MODIFIERS ========== */ modifier onlyController { require(<FILL_ME>) _; } modifier updateReward(address account) { } /* ========== EVENTS ========== */ event RewardAdded(uint256 reward); event Staked(address indexed user, uint256 amount); event Unstaked(address indexed user, uint256 amount); event Transfered(address indexed from, address indexed to, uint256 amount); event RewardPaid(address indexed user, uint256 reward); event RewardsDurationUpdated(uint256 newDuration); event Recovered(address token, uint256 amount); event ControllerChanged(address newController); }
_msgSender()==address(controller),'not controller'
26,504
_msgSender()==address(controller)
"Must have allowance to transfer tokens"
//SPDX-License-Identifier: Unlicense pragma solidity ^0.6.8; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../../interfaces/uniswap/IV2Router.sol"; import "../../interfaces/uniswap/IPairFactory.sol"; import "../../interfaces/uniswap/IPair.sol"; import "@nomiclabs/buidler/console.sol"; contract MockRouter is IV2Router { using SafeMath for uint256; using SafeMath for uint; IPairFactory factory; constructor(IPairFactory fac) public { } function addLiquidity(IERC20 tokenA, uint aAmount, IERC20 tokenB, uint bAmount) external override returns (address) { require(<FILL_ME>) require(tokenB.allowance(msg.sender, address(this)) >= bAmount, "Must have allowance to transfer tokens"); IPair pair = IPair(factory.createPair(address(tokenA), address(tokenB))); tokenA.transferFrom(msg.sender, address(pair), aAmount); tokenB.transferFrom(msg.sender, address(pair), bAmount); (uint amount0, uint amount1) = address(tokenA) > address(tokenB) ? (bAmount,aAmount) : (aAmount,bAmount); pair.addLiquid(amount0, amount1); } function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external view override returns (uint amount) { } function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external view override returns (uint amount) { } }
tokenA.allowance(msg.sender,address(this))>=aAmount,"Must have allowance to transfer tokens"
26,538
tokenA.allowance(msg.sender,address(this))>=aAmount
"Must have allowance to transfer tokens"
//SPDX-License-Identifier: Unlicense pragma solidity ^0.6.8; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../../interfaces/uniswap/IV2Router.sol"; import "../../interfaces/uniswap/IPairFactory.sol"; import "../../interfaces/uniswap/IPair.sol"; import "@nomiclabs/buidler/console.sol"; contract MockRouter is IV2Router { using SafeMath for uint256; using SafeMath for uint; IPairFactory factory; constructor(IPairFactory fac) public { } function addLiquidity(IERC20 tokenA, uint aAmount, IERC20 tokenB, uint bAmount) external override returns (address) { require(tokenA.allowance(msg.sender, address(this)) >= aAmount, "Must have allowance to transfer tokens"); require(<FILL_ME>) IPair pair = IPair(factory.createPair(address(tokenA), address(tokenB))); tokenA.transferFrom(msg.sender, address(pair), aAmount); tokenB.transferFrom(msg.sender, address(pair), bAmount); (uint amount0, uint amount1) = address(tokenA) > address(tokenB) ? (bAmount,aAmount) : (aAmount,bAmount); pair.addLiquid(amount0, amount1); } function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external view override returns (uint amount) { } function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external view override returns (uint amount) { } }
tokenB.allowance(msg.sender,address(this))>=bAmount,"Must have allowance to transfer tokens"
26,538
tokenB.allowance(msg.sender,address(this))>=bAmount
"User not whitelisted !"
/** * @dev {ERC721} token, including: * * - ability for holders to burn (destroy) their tokens * - a minter role that allows for token minting (creation) * - a pauser role that allows to stop all token transfers * - token ID and URI autogeneration * * This contract uses {AccessControl} to lock permissioned functions using the * different roles - head to its documentation for details. * * The account that deploys the contract will be granted the minter and pauser * roles, as well as the default admin role, which will let it grant both minter * and pauser roles to other accounts. */ contract NonFungibleToken is Context, AccessControl, ERC721 { using Counters for Counters.Counter; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); address public owner; bool public whitelistingEnabled = false; bool public mintingEnabled = false; uint256 public maxPerWallet = 100; Counters.Counter private _tokenIdTracker; /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_ROLE` to the * account that deploys the contract. * * Token URIs will be autogenerated based on `baseURI` and their token IDs. * See {ERC721-tokenURI}. */ constructor(string memory name, string memory symbol, string memory baseURI) public ERC721(name, symbol) { } function setURI(string memory baseURI) public virtual { } function setMaxPerWallet(uint256 _maxPerWallet) public virtual { } function setOwner(address _owner) public virtual { } function toggleMinting(bool _bool) public virtual { } function toggleWhitelisting(bool _toggle) public virtual { } function Whitelist(address[] memory _beneficiaries) external { } function bulkMint(address[] memory _beneficiaries) external { } function contractURI() public view returns (string memory) { } /** * @dev Creates a new token for `to`. Its token ID will be automatically * assigned (and available on the emitted {IERC721-Transfer} event), and the token * URI autogenerated based on the base URI passed at construction. * * See {ERC721-_mint}. * * Requirements: * * - the caller must have the `MINTER_ROLE`. */ function mint(address to) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), "NonFungibleToken: must have minter role to mint"); require(<FILL_ME>) require(mintingEnabled, "Minting not enabled !"); // We cannot just use balanceOf to create the new tokenId because tokens // can be burned (destroyed), so we need a separate counter. _mint(to, _tokenIdTracker.current() + 1); _tokenIdTracker.increment(); require(balanceOf(to) <= maxPerWallet, "Max NFTs reached by wallet"); } }
whitelists[to]||!whitelistingEnabled,"User not whitelisted !"
26,551
whitelists[to]||!whitelistingEnabled
"Max NFTs reached by wallet"
/** * @dev {ERC721} token, including: * * - ability for holders to burn (destroy) their tokens * - a minter role that allows for token minting (creation) * - a pauser role that allows to stop all token transfers * - token ID and URI autogeneration * * This contract uses {AccessControl} to lock permissioned functions using the * different roles - head to its documentation for details. * * The account that deploys the contract will be granted the minter and pauser * roles, as well as the default admin role, which will let it grant both minter * and pauser roles to other accounts. */ contract NonFungibleToken is Context, AccessControl, ERC721 { using Counters for Counters.Counter; bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); address public owner; bool public whitelistingEnabled = false; bool public mintingEnabled = false; uint256 public maxPerWallet = 100; Counters.Counter private _tokenIdTracker; /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_ROLE` to the * account that deploys the contract. * * Token URIs will be autogenerated based on `baseURI` and their token IDs. * See {ERC721-tokenURI}. */ constructor(string memory name, string memory symbol, string memory baseURI) public ERC721(name, symbol) { } function setURI(string memory baseURI) public virtual { } function setMaxPerWallet(uint256 _maxPerWallet) public virtual { } function setOwner(address _owner) public virtual { } function toggleMinting(bool _bool) public virtual { } function toggleWhitelisting(bool _toggle) public virtual { } function Whitelist(address[] memory _beneficiaries) external { } function bulkMint(address[] memory _beneficiaries) external { } function contractURI() public view returns (string memory) { } /** * @dev Creates a new token for `to`. Its token ID will be automatically * assigned (and available on the emitted {IERC721-Transfer} event), and the token * URI autogenerated based on the base URI passed at construction. * * See {ERC721-_mint}. * * Requirements: * * - the caller must have the `MINTER_ROLE`. */ function mint(address to) public virtual { require(hasRole(MINTER_ROLE, _msgSender()), "NonFungibleToken: must have minter role to mint"); require(whitelists[to] || ! whitelistingEnabled, "User not whitelisted !"); require(mintingEnabled, "Minting not enabled !"); // We cannot just use balanceOf to create the new tokenId because tokens // can be burned (destroyed), so we need a separate counter. _mint(to, _tokenIdTracker.current() + 1); _tokenIdTracker.increment(); require(<FILL_ME>) } }
balanceOf(to)<=maxPerWallet,"Max NFTs reached by wallet"
26,551
balanceOf(to)<=maxPerWallet
"Seeder::getSeedSafe: got 0 value seed"
// SPDX-License-Identifier: MIT /// @title RaidParty Randomness and Seeder V2 /** * ___ _ _ ___ _ * | _ \__ _(_)__| | _ \__ _ _ _| |_ _ _ * | / _` | / _` | _/ _` | '_| _| || | * |_|_\__,_|_\__,_|_| \__,_|_| \__|\_, | * |__/ */ pragma solidity ^0.8.0; import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol"; import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "./SeedStorage.sol"; import "./RequestStorage.sol"; import "../interfaces/ISeeder.sol"; import "../lib/Randomness.sol"; contract SeederV2 is VRFConsumerBaseV2, AccessControlEnumerable, ISeeder { VRFCoordinatorV2Interface private immutable _coordinator; LinkTokenInterface private immutable _linkToken; bytes32 private immutable _keyHash; ISeeder private immutable _seederV1; SeedStorage private immutable _seedStorage; RequestStorage private immutable _requestStorage; bytes32 public constant INTERNAL_CALLER_ROLE = keccak256("INTERNAL_CALLER_ROLE"); uint32 private constant CALLBACK_GAS_LIMIT = 100000; uint32 private constant NUM_WORDS = 1; uint16 private constant REQUEST_CONFIRMATIONS = 3; uint256 private _fee; uint256 private _lastBatchTimestamp; uint256 private _batchCadence; uint256 private _batch; uint64 private _subscriptionId; constructor( uint64 subscriptionId, address link, address coordinator, bytes32 keyHash, uint256 batch, address seederv1, address seedStorage, address requestStorage, address admin, uint256 batchCadence ) VRFConsumerBaseV2(coordinator) { } /** PUBLIC */ // Returns a seed or 0 if not yet seeded function getSeed(address origin, uint256 identifier) external view override returns (uint256) { } function getSeedSafe(address origin, uint256 identifier) external view override returns (uint256) { if (_isPreMigration(origin, identifier)) { return _seederV1.getSeedSafe(origin, identifier); } Randomness.SeedData memory data = _getData(origin, identifier); uint256 randomness; if (data.batch == 0) { randomness = _seedStorage.getRandomness(data.randomnessId); } else { randomness = _seedStorage.getRandomness( _requestStorage.getRequestIdFromBatch(data.batch) ); } require(<FILL_ME>) return uint256(keccak256(abi.encode(origin, identifier, randomness))); } // Returns current batch function getBatch() external view returns (uint256) { } // Returns req for a given batch function getReqByBatch(uint256 batch) external view returns (bytes32) { } function setFee(uint256 fee) external onlyRole(DEFAULT_ADMIN_ROLE) { } function getFee() external view returns (uint256) { } function withdraw() external onlyRole(DEFAULT_ADMIN_ROLE) { } function isSeeded(address origin, uint256 identifier) public view override returns (bool) { } // getIdentifiers returns a list of seeded identifiers for a given randomness id, assumes ordered identifier function getIdentifiers( bytes32 randomnessId, address origin, uint256 startIdx, uint256 count ) external view returns (uint256[] memory) { } function getIdReferenceCount( bytes32 randomnessId, address origin, uint256 startIdx ) external view returns (uint256) { } // Requests randomness, limited only to internal callers which must maintain distinct id's function requestSeed(uint256 identifier) external override onlyRole(INTERNAL_CALLER_ROLE) { } // executeRequestMulti batch executes requests from the queue function executeRequestMulti() external { } // Executes a single request function executeRequest(address origin, uint256 identifier) external payable { } function getSubscriptionId() external view returns (uint64) { } function setBatchCadence(uint256 batchCadence) external onlyRole(DEFAULT_ADMIN_ROLE) { } function setSubscriptionId(uint64 subscriptionId) external onlyRole(DEFAULT_ADMIN_ROLE) { } function getNextAvailableBatch() external view returns (uint256) { } function getData(address origin, uint256 identifier) external view returns (Randomness.SeedData memory) { } /** INTERNAL */ function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { } /** MIGRATION */ function _getData(address origin, uint256 identifier) internal view returns (Randomness.SeedData memory) { } // TODO: Fixme for mainnet / testnet function _isPreMigration(address origin, uint256 identifier) internal pure returns (bool) { } }
(data.randomnessId!=0||_requestStorage.getRequestIdFromBatch(data.batch)!=0)&&randomness!=0,"Seeder::getSeedSafe: got 0 value seed"
26,623
(data.randomnessId!=0||_requestStorage.getRequestIdFromBatch(data.batch)!=0)&&randomness!=0
"Seeder::executeRequestMulti: Batch cadence not passed"
// SPDX-License-Identifier: MIT /// @title RaidParty Randomness and Seeder V2 /** * ___ _ _ ___ _ * | _ \__ _(_)__| | _ \__ _ _ _| |_ _ _ * | / _` | / _` | _/ _` | '_| _| || | * |_|_\__,_|_\__,_|_| \__,_|_| \__|\_, | * |__/ */ pragma solidity ^0.8.0; import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol"; import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "./SeedStorage.sol"; import "./RequestStorage.sol"; import "../interfaces/ISeeder.sol"; import "../lib/Randomness.sol"; contract SeederV2 is VRFConsumerBaseV2, AccessControlEnumerable, ISeeder { VRFCoordinatorV2Interface private immutable _coordinator; LinkTokenInterface private immutable _linkToken; bytes32 private immutable _keyHash; ISeeder private immutable _seederV1; SeedStorage private immutable _seedStorage; RequestStorage private immutable _requestStorage; bytes32 public constant INTERNAL_CALLER_ROLE = keccak256("INTERNAL_CALLER_ROLE"); uint32 private constant CALLBACK_GAS_LIMIT = 100000; uint32 private constant NUM_WORDS = 1; uint16 private constant REQUEST_CONFIRMATIONS = 3; uint256 private _fee; uint256 private _lastBatchTimestamp; uint256 private _batchCadence; uint256 private _batch; uint64 private _subscriptionId; constructor( uint64 subscriptionId, address link, address coordinator, bytes32 keyHash, uint256 batch, address seederv1, address seedStorage, address requestStorage, address admin, uint256 batchCadence ) VRFConsumerBaseV2(coordinator) { } /** PUBLIC */ // Returns a seed or 0 if not yet seeded function getSeed(address origin, uint256 identifier) external view override returns (uint256) { } function getSeedSafe(address origin, uint256 identifier) external view override returns (uint256) { } // Returns current batch function getBatch() external view returns (uint256) { } // Returns req for a given batch function getReqByBatch(uint256 batch) external view returns (bytes32) { } function setFee(uint256 fee) external onlyRole(DEFAULT_ADMIN_ROLE) { } function getFee() external view returns (uint256) { } function withdraw() external onlyRole(DEFAULT_ADMIN_ROLE) { } function isSeeded(address origin, uint256 identifier) public view override returns (bool) { } // getIdentifiers returns a list of seeded identifiers for a given randomness id, assumes ordered identifier function getIdentifiers( bytes32 randomnessId, address origin, uint256 startIdx, uint256 count ) external view returns (uint256[] memory) { } function getIdReferenceCount( bytes32 randomnessId, address origin, uint256 startIdx ) external view returns (uint256) { } // Requests randomness, limited only to internal callers which must maintain distinct id's function requestSeed(uint256 identifier) external override onlyRole(INTERNAL_CALLER_ROLE) { } // executeRequestMulti batch executes requests from the queue function executeRequestMulti() external { require(<FILL_ME>) _lastBatchTimestamp = block.timestamp; uint256 linkReqID = _coordinator.requestRandomWords( _keyHash, _subscriptionId, REQUEST_CONFIRMATIONS, CALLBACK_GAS_LIMIT, NUM_WORDS ); _requestStorage.setBatchRequestId(_batch, bytes32(linkReqID)); unchecked { _batch += 1; } } // Executes a single request function executeRequest(address origin, uint256 identifier) external payable { } function getSubscriptionId() external view returns (uint64) { } function setBatchCadence(uint256 batchCadence) external onlyRole(DEFAULT_ADMIN_ROLE) { } function setSubscriptionId(uint64 subscriptionId) external onlyRole(DEFAULT_ADMIN_ROLE) { } function getNextAvailableBatch() external view returns (uint256) { } function getData(address origin, uint256 identifier) external view returns (Randomness.SeedData memory) { } /** INTERNAL */ function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { } /** MIGRATION */ function _getData(address origin, uint256 identifier) internal view returns (Randomness.SeedData memory) { } // TODO: Fixme for mainnet / testnet function _isPreMigration(address origin, uint256 identifier) internal pure returns (bool) { } }
_lastBatchTimestamp+_batchCadence<=block.timestamp,"Seeder::executeRequestMulti: Batch cadence not passed"
26,623
_lastBatchTimestamp+_batchCadence<=block.timestamp
"Seeder::executeRequest: Pre-migration requests may not be manually executed"
// SPDX-License-Identifier: MIT /// @title RaidParty Randomness and Seeder V2 /** * ___ _ _ ___ _ * | _ \__ _(_)__| | _ \__ _ _ _| |_ _ _ * | / _` | / _` | _/ _` | '_| _| || | * |_|_\__,_|_\__,_|_| \__,_|_| \__|\_, | * |__/ */ pragma solidity ^0.8.0; import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol"; import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "./SeedStorage.sol"; import "./RequestStorage.sol"; import "../interfaces/ISeeder.sol"; import "../lib/Randomness.sol"; contract SeederV2 is VRFConsumerBaseV2, AccessControlEnumerable, ISeeder { VRFCoordinatorV2Interface private immutable _coordinator; LinkTokenInterface private immutable _linkToken; bytes32 private immutable _keyHash; ISeeder private immutable _seederV1; SeedStorage private immutable _seedStorage; RequestStorage private immutable _requestStorage; bytes32 public constant INTERNAL_CALLER_ROLE = keccak256("INTERNAL_CALLER_ROLE"); uint32 private constant CALLBACK_GAS_LIMIT = 100000; uint32 private constant NUM_WORDS = 1; uint16 private constant REQUEST_CONFIRMATIONS = 3; uint256 private _fee; uint256 private _lastBatchTimestamp; uint256 private _batchCadence; uint256 private _batch; uint64 private _subscriptionId; constructor( uint64 subscriptionId, address link, address coordinator, bytes32 keyHash, uint256 batch, address seederv1, address seedStorage, address requestStorage, address admin, uint256 batchCadence ) VRFConsumerBaseV2(coordinator) { } /** PUBLIC */ // Returns a seed or 0 if not yet seeded function getSeed(address origin, uint256 identifier) external view override returns (uint256) { } function getSeedSafe(address origin, uint256 identifier) external view override returns (uint256) { } // Returns current batch function getBatch() external view returns (uint256) { } // Returns req for a given batch function getReqByBatch(uint256 batch) external view returns (bytes32) { } function setFee(uint256 fee) external onlyRole(DEFAULT_ADMIN_ROLE) { } function getFee() external view returns (uint256) { } function withdraw() external onlyRole(DEFAULT_ADMIN_ROLE) { } function isSeeded(address origin, uint256 identifier) public view override returns (bool) { } // getIdentifiers returns a list of seeded identifiers for a given randomness id, assumes ordered identifier function getIdentifiers( bytes32 randomnessId, address origin, uint256 startIdx, uint256 count ) external view returns (uint256[] memory) { } function getIdReferenceCount( bytes32 randomnessId, address origin, uint256 startIdx ) external view returns (uint256) { } // Requests randomness, limited only to internal callers which must maintain distinct id's function requestSeed(uint256 identifier) external override onlyRole(INTERNAL_CALLER_ROLE) { } // executeRequestMulti batch executes requests from the queue function executeRequestMulti() external { } // Executes a single request function executeRequest(address origin, uint256 identifier) external payable { require(<FILL_ME>) Randomness.SeedData memory data = _getData(origin, identifier); require( _lastBatchTimestamp + _batchCadence > block.timestamp, "Seeder::executeRequest: Cannot seed individually during batch seeding" ); require( data.randomnessId == 0 && _requestStorage.getRequestIdFromBatch(data.batch) == 0, "Seeder::executeRequest: Seed already generated" ); require( data.batch != 0, "Seeder::executeRequest: Seed not yet requested" ); require( msg.value == _fee, "Seeder::executeRequest: Transaction value does not match expected fee" ); uint256 linkReqID = _coordinator.requestRandomWords( _keyHash, _subscriptionId, REQUEST_CONFIRMATIONS, CALLBACK_GAS_LIMIT, NUM_WORDS ); _requestStorage.updateRequest(origin, identifier, bytes32(linkReqID)); } function getSubscriptionId() external view returns (uint64) { } function setBatchCadence(uint256 batchCadence) external onlyRole(DEFAULT_ADMIN_ROLE) { } function setSubscriptionId(uint64 subscriptionId) external onlyRole(DEFAULT_ADMIN_ROLE) { } function getNextAvailableBatch() external view returns (uint256) { } function getData(address origin, uint256 identifier) external view returns (Randomness.SeedData memory) { } /** INTERNAL */ function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { } /** MIGRATION */ function _getData(address origin, uint256 identifier) internal view returns (Randomness.SeedData memory) { } // TODO: Fixme for mainnet / testnet function _isPreMigration(address origin, uint256 identifier) internal pure returns (bool) { } }
!_isPreMigration(origin,identifier),"Seeder::executeRequest: Pre-migration requests may not be manually executed"
26,623
!_isPreMigration(origin,identifier)
"Seeder::executeRequest: Cannot seed individually during batch seeding"
// SPDX-License-Identifier: MIT /// @title RaidParty Randomness and Seeder V2 /** * ___ _ _ ___ _ * | _ \__ _(_)__| | _ \__ _ _ _| |_ _ _ * | / _` | / _` | _/ _` | '_| _| || | * |_|_\__,_|_\__,_|_| \__,_|_| \__|\_, | * |__/ */ pragma solidity ^0.8.0; import "@chainlink/contracts/src/v0.8/interfaces/LinkTokenInterface.sol"; import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol"; import "@chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "./SeedStorage.sol"; import "./RequestStorage.sol"; import "../interfaces/ISeeder.sol"; import "../lib/Randomness.sol"; contract SeederV2 is VRFConsumerBaseV2, AccessControlEnumerable, ISeeder { VRFCoordinatorV2Interface private immutable _coordinator; LinkTokenInterface private immutable _linkToken; bytes32 private immutable _keyHash; ISeeder private immutable _seederV1; SeedStorage private immutable _seedStorage; RequestStorage private immutable _requestStorage; bytes32 public constant INTERNAL_CALLER_ROLE = keccak256("INTERNAL_CALLER_ROLE"); uint32 private constant CALLBACK_GAS_LIMIT = 100000; uint32 private constant NUM_WORDS = 1; uint16 private constant REQUEST_CONFIRMATIONS = 3; uint256 private _fee; uint256 private _lastBatchTimestamp; uint256 private _batchCadence; uint256 private _batch; uint64 private _subscriptionId; constructor( uint64 subscriptionId, address link, address coordinator, bytes32 keyHash, uint256 batch, address seederv1, address seedStorage, address requestStorage, address admin, uint256 batchCadence ) VRFConsumerBaseV2(coordinator) { } /** PUBLIC */ // Returns a seed or 0 if not yet seeded function getSeed(address origin, uint256 identifier) external view override returns (uint256) { } function getSeedSafe(address origin, uint256 identifier) external view override returns (uint256) { } // Returns current batch function getBatch() external view returns (uint256) { } // Returns req for a given batch function getReqByBatch(uint256 batch) external view returns (bytes32) { } function setFee(uint256 fee) external onlyRole(DEFAULT_ADMIN_ROLE) { } function getFee() external view returns (uint256) { } function withdraw() external onlyRole(DEFAULT_ADMIN_ROLE) { } function isSeeded(address origin, uint256 identifier) public view override returns (bool) { } // getIdentifiers returns a list of seeded identifiers for a given randomness id, assumes ordered identifier function getIdentifiers( bytes32 randomnessId, address origin, uint256 startIdx, uint256 count ) external view returns (uint256[] memory) { } function getIdReferenceCount( bytes32 randomnessId, address origin, uint256 startIdx ) external view returns (uint256) { } // Requests randomness, limited only to internal callers which must maintain distinct id's function requestSeed(uint256 identifier) external override onlyRole(INTERNAL_CALLER_ROLE) { } // executeRequestMulti batch executes requests from the queue function executeRequestMulti() external { } // Executes a single request function executeRequest(address origin, uint256 identifier) external payable { require( !_isPreMigration(origin, identifier), "Seeder::executeRequest: Pre-migration requests may not be manually executed" ); Randomness.SeedData memory data = _getData(origin, identifier); require(<FILL_ME>) require( data.randomnessId == 0 && _requestStorage.getRequestIdFromBatch(data.batch) == 0, "Seeder::executeRequest: Seed already generated" ); require( data.batch != 0, "Seeder::executeRequest: Seed not yet requested" ); require( msg.value == _fee, "Seeder::executeRequest: Transaction value does not match expected fee" ); uint256 linkReqID = _coordinator.requestRandomWords( _keyHash, _subscriptionId, REQUEST_CONFIRMATIONS, CALLBACK_GAS_LIMIT, NUM_WORDS ); _requestStorage.updateRequest(origin, identifier, bytes32(linkReqID)); } function getSubscriptionId() external view returns (uint64) { } function setBatchCadence(uint256 batchCadence) external onlyRole(DEFAULT_ADMIN_ROLE) { } function setSubscriptionId(uint64 subscriptionId) external onlyRole(DEFAULT_ADMIN_ROLE) { } function getNextAvailableBatch() external view returns (uint256) { } function getData(address origin, uint256 identifier) external view returns (Randomness.SeedData memory) { } /** INTERNAL */ function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal override { } /** MIGRATION */ function _getData(address origin, uint256 identifier) internal view returns (Randomness.SeedData memory) { } // TODO: Fixme for mainnet / testnet function _isPreMigration(address origin, uint256 identifier) internal pure returns (bool) { } }
_lastBatchTimestamp+_batchCadence>block.timestamp,"Seeder::executeRequest: Cannot seed individually during batch seeding"
26,623
_lastBatchTimestamp+_batchCadence>block.timestamp
null
pragma solidity 0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } interface ERC20 { function transfer (address _beneficiary, uint256 _tokenAmount) external returns (bool); function transferFromICO(address _to, uint256 _value) external returns(bool); function balanceOf(address who) external view returns (uint256); } contract Ownable { address public owner; constructor() public { } modifier onlyOwner() { } } /********************************************************************************************************************* * @dev see https://github.com/ethereum/EIPs/issues/20 */ /*************************************************************************************************************/ contract WhalesburgCrowdsale is Ownable { using SafeMath for uint256; ERC20 public token; address public constant multisig = 0x5dc5c66eb90dd8c4be285164ca9ea442faa1c2e8; address constant bounty = 0x96abf0420cffe408ba6bb16699f6748bef01b02b; address constant privateInvestors = 0x44eedeecc2a6f5f763a18e8876576b29a856d03a; address developers = 0x8e23cd7ce780e55ace7309b398336443b408c9d4; address constant founders = 0xd7dadf6149FF75f76f36423CAD1E24c81847E85d; uint256 public startICO = 1528041600; // Sunday, 03-Jun-18 16:00:00 UTC uint256 public endICO = 1530633600; // Tuesday, 03-Jul-18 16:00:00 UTC uint256 constant privateSaleTokens = 46988857; uint256 constant foundersReserve = 10000000; uint256 constant developmentReserve = 20500000; uint256 constant bountyReserve = 3500000; uint256 public individualRoundCap = 1250000000000000000; uint256 public constant hardCap = 1365000067400000000000; // 1365.0000674 ether uint256 public investors; uint256 public constant buyPrice = 71800000000000; // 0.0000718 Ether bool public isFinalized = false; bool public distribute = false; uint256 public weisRaised; mapping (address => bool) public onChain; mapping (address => bool) whitelist; mapping (address => uint256) public moneySpent; address[] tokenHolders; event Finalized(); event Authorized(address wlCandidate, uint256 timestamp); event Revoked(address wlCandidate, uint256 timestamp); constructor(ERC20 _token) public { } function setVestingAddress(address _newDevPool) public onlyOwner { } function distributionTokens() public onlyOwner { require(<FILL_ME>) token.transferFromICO(bounty, bountyReserve*1e18); token.transferFromICO(privateInvestors, privateSaleTokens*1e18); token.transferFromICO(developers, developmentReserve*1e18); token.transferFromICO(founders, foundersReserve*1e18); distribute = true; } /******************-- WhiteList --***************************/ function authorize(address _beneficiary) public onlyOwner { } function addManyAuthorizeToWhitelist(address[] _beneficiaries) public onlyOwner { } function revoke(address _beneficiary) public onlyOwner { } function isWhitelisted(address who) public view returns(bool) { } function finalize() onlyOwner public { } /***************************--Payable --*********************************************/ function () public payable { } function currentSaleLimit() private { } function sell(address _investor, uint256 amount) private { } }
!distribute
26,627
!distribute
null
pragma solidity 0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } interface ERC20 { function transfer (address _beneficiary, uint256 _tokenAmount) external returns (bool); function transferFromICO(address _to, uint256 _value) external returns(bool); function balanceOf(address who) external view returns (uint256); } contract Ownable { address public owner; constructor() public { } modifier onlyOwner() { } } /********************************************************************************************************************* * @dev see https://github.com/ethereum/EIPs/issues/20 */ /*************************************************************************************************************/ contract WhalesburgCrowdsale is Ownable { using SafeMath for uint256; ERC20 public token; address public constant multisig = 0x5dc5c66eb90dd8c4be285164ca9ea442faa1c2e8; address constant bounty = 0x96abf0420cffe408ba6bb16699f6748bef01b02b; address constant privateInvestors = 0x44eedeecc2a6f5f763a18e8876576b29a856d03a; address developers = 0x8e23cd7ce780e55ace7309b398336443b408c9d4; address constant founders = 0xd7dadf6149FF75f76f36423CAD1E24c81847E85d; uint256 public startICO = 1528041600; // Sunday, 03-Jun-18 16:00:00 UTC uint256 public endICO = 1530633600; // Tuesday, 03-Jul-18 16:00:00 UTC uint256 constant privateSaleTokens = 46988857; uint256 constant foundersReserve = 10000000; uint256 constant developmentReserve = 20500000; uint256 constant bountyReserve = 3500000; uint256 public individualRoundCap = 1250000000000000000; uint256 public constant hardCap = 1365000067400000000000; // 1365.0000674 ether uint256 public investors; uint256 public constant buyPrice = 71800000000000; // 0.0000718 Ether bool public isFinalized = false; bool public distribute = false; uint256 public weisRaised; mapping (address => bool) public onChain; mapping (address => bool) whitelist; mapping (address => uint256) public moneySpent; address[] tokenHolders; event Finalized(); event Authorized(address wlCandidate, uint256 timestamp); event Revoked(address wlCandidate, uint256 timestamp); constructor(ERC20 _token) public { } function setVestingAddress(address _newDevPool) public onlyOwner { } function distributionTokens() public onlyOwner { } /******************-- WhiteList --***************************/ function authorize(address _beneficiary) public onlyOwner { require(_beneficiary != address(0x0)); require(<FILL_ME>) whitelist[_beneficiary] = true; emit Authorized(_beneficiary, now); } function addManyAuthorizeToWhitelist(address[] _beneficiaries) public onlyOwner { } function revoke(address _beneficiary) public onlyOwner { } function isWhitelisted(address who) public view returns(bool) { } function finalize() onlyOwner public { } /***************************--Payable --*********************************************/ function () public payable { } function currentSaleLimit() private { } function sell(address _investor, uint256 amount) private { } }
!isWhitelisted(_beneficiary)
26,627
!isWhitelisted(_beneficiary)
null
pragma solidity 0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } interface ERC20 { function transfer (address _beneficiary, uint256 _tokenAmount) external returns (bool); function transferFromICO(address _to, uint256 _value) external returns(bool); function balanceOf(address who) external view returns (uint256); } contract Ownable { address public owner; constructor() public { } modifier onlyOwner() { } } /********************************************************************************************************************* * @dev see https://github.com/ethereum/EIPs/issues/20 */ /*************************************************************************************************************/ contract WhalesburgCrowdsale is Ownable { using SafeMath for uint256; ERC20 public token; address public constant multisig = 0x5dc5c66eb90dd8c4be285164ca9ea442faa1c2e8; address constant bounty = 0x96abf0420cffe408ba6bb16699f6748bef01b02b; address constant privateInvestors = 0x44eedeecc2a6f5f763a18e8876576b29a856d03a; address developers = 0x8e23cd7ce780e55ace7309b398336443b408c9d4; address constant founders = 0xd7dadf6149FF75f76f36423CAD1E24c81847E85d; uint256 public startICO = 1528041600; // Sunday, 03-Jun-18 16:00:00 UTC uint256 public endICO = 1530633600; // Tuesday, 03-Jul-18 16:00:00 UTC uint256 constant privateSaleTokens = 46988857; uint256 constant foundersReserve = 10000000; uint256 constant developmentReserve = 20500000; uint256 constant bountyReserve = 3500000; uint256 public individualRoundCap = 1250000000000000000; uint256 public constant hardCap = 1365000067400000000000; // 1365.0000674 ether uint256 public investors; uint256 public constant buyPrice = 71800000000000; // 0.0000718 Ether bool public isFinalized = false; bool public distribute = false; uint256 public weisRaised; mapping (address => bool) public onChain; mapping (address => bool) whitelist; mapping (address => uint256) public moneySpent; address[] tokenHolders; event Finalized(); event Authorized(address wlCandidate, uint256 timestamp); event Revoked(address wlCandidate, uint256 timestamp); constructor(ERC20 _token) public { } function setVestingAddress(address _newDevPool) public onlyOwner { } function distributionTokens() public onlyOwner { } /******************-- WhiteList --***************************/ function authorize(address _beneficiary) public onlyOwner { } function addManyAuthorizeToWhitelist(address[] _beneficiaries) public onlyOwner { } function revoke(address _beneficiary) public onlyOwner { } function isWhitelisted(address who) public view returns(bool) { } function finalize() onlyOwner public { require(<FILL_ME>) require(now >= endICO || weisRaised >= hardCap); emit Finalized(); isFinalized = true; token.transferFromICO(owner, token.balanceOf(this)); } /***************************--Payable --*********************************************/ function () public payable { } function currentSaleLimit() private { } function sell(address _investor, uint256 amount) private { } }
!isFinalized
26,627
!isFinalized
null
pragma solidity 0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } interface ERC20 { function transfer (address _beneficiary, uint256 _tokenAmount) external returns (bool); function transferFromICO(address _to, uint256 _value) external returns(bool); function balanceOf(address who) external view returns (uint256); } contract Ownable { address public owner; constructor() public { } modifier onlyOwner() { } } /********************************************************************************************************************* * @dev see https://github.com/ethereum/EIPs/issues/20 */ /*************************************************************************************************************/ contract WhalesburgCrowdsale is Ownable { using SafeMath for uint256; ERC20 public token; address public constant multisig = 0x5dc5c66eb90dd8c4be285164ca9ea442faa1c2e8; address constant bounty = 0x96abf0420cffe408ba6bb16699f6748bef01b02b; address constant privateInvestors = 0x44eedeecc2a6f5f763a18e8876576b29a856d03a; address developers = 0x8e23cd7ce780e55ace7309b398336443b408c9d4; address constant founders = 0xd7dadf6149FF75f76f36423CAD1E24c81847E85d; uint256 public startICO = 1528041600; // Sunday, 03-Jun-18 16:00:00 UTC uint256 public endICO = 1530633600; // Tuesday, 03-Jul-18 16:00:00 UTC uint256 constant privateSaleTokens = 46988857; uint256 constant foundersReserve = 10000000; uint256 constant developmentReserve = 20500000; uint256 constant bountyReserve = 3500000; uint256 public individualRoundCap = 1250000000000000000; uint256 public constant hardCap = 1365000067400000000000; // 1365.0000674 ether uint256 public investors; uint256 public constant buyPrice = 71800000000000; // 0.0000718 Ether bool public isFinalized = false; bool public distribute = false; uint256 public weisRaised; mapping (address => bool) public onChain; mapping (address => bool) whitelist; mapping (address => uint256) public moneySpent; address[] tokenHolders; event Finalized(); event Authorized(address wlCandidate, uint256 timestamp); event Revoked(address wlCandidate, uint256 timestamp); constructor(ERC20 _token) public { } function setVestingAddress(address _newDevPool) public onlyOwner { } function distributionTokens() public onlyOwner { } /******************-- WhiteList --***************************/ function authorize(address _beneficiary) public onlyOwner { } function addManyAuthorizeToWhitelist(address[] _beneficiaries) public onlyOwner { } function revoke(address _beneficiary) public onlyOwner { } function isWhitelisted(address who) public view returns(bool) { } function finalize() onlyOwner public { } /***************************--Payable --*********************************************/ function () public payable { if(isWhitelisted(msg.sender)) { require(now >= startICO && now < endICO); currentSaleLimit(); moneySpent[msg.sender] = moneySpent[msg.sender].add(msg.value); require(<FILL_ME>) sell(msg.sender, msg.value); weisRaised = weisRaised.add(msg.value); require(weisRaised <= hardCap); multisig.transfer(msg.value); } else { revert(); } } function currentSaleLimit() private { } function sell(address _investor, uint256 amount) private { } }
moneySpent[msg.sender]<=individualRoundCap
26,627
moneySpent[msg.sender]<=individualRoundCap
null
pragma solidity 0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ 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); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { } } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer(ERC20Basic token, address to, uint256 value) internal { } function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal { } function safeApprove(ERC20 token, address spender, uint256 value) internal { } } contract Owned { address public owner; constructor() public { } modifier onlyOwner { } } /** * @title TokenVesting * @dev A token holder contract that can release its token balance gradually like a * typical vesting scheme, with a cliff and vesting period. Optionally revocable by the * owner. */ contract TokenVesting is Owned { using SafeMath for uint256; using SafeERC20 for ERC20Basic; event Released(uint256 amount); event Revoked(); // beneficiary of tokens after they are released address public beneficiary; uint256 public cliff; uint256 public start; uint256 public duration; bool public revocable; mapping (address => uint256) public released; mapping (address => bool) public revoked; address internal ownerShip; /** * @dev Creates a vesting contract that vests its balance of any ERC20 token to the * _beneficiary, gradually in a linear fashion until _start + _duration. By then all * of the balance will have vested. * @param _beneficiary address of the beneficiary to whom vested tokens are transferred * @param _cliff duration in seconds of the cliff in which tokens will begin to vest * @param _start the time (as Unix time) at which point vesting starts * @param _duration duration in seconds of the period in which the tokens will vest * @param _revocable whether the vesting is revocable or not */ constructor( address _beneficiary, uint256 _start, uint256 _cliff, uint256 _duration, bool _revocable, address _realOwner ) public { } /** * @notice Transfers vested tokens to beneficiary. * @param token ERC20 token which is being vested */ function release(ERC20Basic token) public { } /** * @notice Allows the owner to revoke the vesting. Tokens already vested * remain in the contract, the rest are returned to the owner. * @param token ERC20 token which is being vested */ function revoke(ERC20Basic token) public onlyOwner { } /** * @dev Calculates the amount that has already vested but hasn't been released yet. * @param token ERC20 token which is being vested */ function releasableAmount(ERC20Basic token) public view returns (uint256) { } /** * @dev Calculates the amount that has already vested. * @param token ERC20 token which is being vested */ function vestedAmount(ERC20Basic token) public view returns (uint256) { } } /** * @title TokenVault * @dev TokenVault is a token holder contract that will allow a * beneficiary to spend the tokens from some function of a specified ERC20 token */ contract TokenVault { using SafeERC20 for ERC20; // ERC20 token contract being held ERC20 public token; constructor(ERC20 _token) public { } /** * @notice Allow the token itself to send tokens * using transferFrom(). */ function fillUpAllowance() public { } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { } } contract WKA_Token is BurnableToken, Owned { string public constant name = "World Kungfu Association"; string public constant symbol = "WKA"; uint8 public constant decimals = 18; /// Maximum tokens to be allocated (10. billion WKA) uint256 public constant HARD_CAP = 10000000000 * 10**uint256(decimals); /// This address will be used to distribute the team, advisors and reserve tokens address public saleTokensAddress; /// This vault is used to keep the Founders, Advisors and Partners tokens TokenVault public reserveTokensVault; /// Date when the vesting for regular users starts uint64 public date15Dec2018 = 1544832000; uint64 public lock90Days = 7776000; uint64 public unlock100Days = 8640000; /// Store the vesting contract addresses for each sale contributor mapping(address => address) public vestingOf; constructor(address _saleTokensAddress) public payable { } /// @dev Create a ReserveTokenVault function createReserveTokensVault() external onlyOwner { } /// @dev Create a TokenVault and fill with the specified newly minted tokens function createTokenVault(uint256 tokens) internal onlyOwner returns (TokenVault) { } // @dev create specified number of tokens and transfer to destination function createTokens(uint256 _tokens, address _destination) internal onlyOwner { } /// @dev vest the sale contributor tokens function vestTokensDetail( address _beneficiary, uint256 _start, uint256 _cliff, uint256 _duration, bool _revocable, uint256 _tokensAmount) external onlyOwner { require(_beneficiary != address(0)); uint256 tokensAmount = _tokensAmount * 10**uint256(decimals); if(vestingOf[_beneficiary] == 0x0) { TokenVesting vesting = new TokenVesting(_beneficiary, _start, _cliff, _duration, _revocable, owner); vestingOf[_beneficiary] = address(vesting); } require(<FILL_ME>) } /// @dev vest the sale contributor tokens for 100 days, 1% gradual release with 3 month cliff function vestTokens(address _beneficiary, uint256 _tokensAmount) external onlyOwner { } /// @dev releases vested tokens for the caller's own address function releaseVestedTokens() external { } /// @dev releases vested tokens for the specified address. /// Can be called by anyone for any address. function releaseVestedTokensFor(address _owner) public { } /// @dev check the vested balance for an address function lockedBalanceOf(address _owner) public view returns (uint256) { } /// @dev check the locked but releaseable balance of an owner function releaseableBalanceOf(address _owner) public view returns (uint256) { } /// @dev revoke vested tokens for the specified address. /// Tokens already vested remain in the contract, the rest are returned to the owner. function revokeVestedTokensFor(address _owner) public onlyOwner { } }
this.transferFrom(reserveTokensVault,vestingOf[_beneficiary],tokensAmount)
26,706
this.transferFrom(reserveTokensVault,vestingOf[_beneficiary],tokensAmount)
"isList failed"
// SPDX-License-Identifier:APACHE-2.0 /* * Taken from https://github.com/hamdiallam/Solidity-RLP */ /* solhint-disable */ pragma solidity ^0.7.6; library RLPReader { uint8 constant STRING_SHORT_START = 0x80; uint8 constant STRING_LONG_START = 0xb8; uint8 constant LIST_SHORT_START = 0xc0; uint8 constant LIST_LONG_START = 0xf8; uint8 constant WORD_SIZE = 32; struct RLPItem { uint len; uint memPtr; } using RLPReader for bytes; using RLPReader for uint; using RLPReader for RLPReader.RLPItem; // helper function to decode rlp encoded legacy ethereum transaction /* * @param rawTransaction RLP encoded legacy ethereum transaction rlp([nonce, gasPrice, gasLimit, to, value, data])) * @return tuple (nonce,gasPrice,gasLimit,to,value,data) */ function decodeLegacyTransaction(bytes calldata rawTransaction) internal pure returns (uint, uint, uint, address, uint, bytes memory){ } /* * @param rawTransaction format: 0x01 || rlp([chainId, nonce, gasPrice, gasLimit, to, value, data, access_list])) * @return tuple (nonce,gasPrice,gasLimit,to,value,data) */ function decodeTransactionType1(bytes calldata rawTransaction) internal pure returns (uint, uint, uint, address, uint, bytes memory){ } /* * @param item RLP encoded bytes */ function toRlpItem(bytes memory item) internal pure returns (RLPItem memory) { } /* * @param item RLP encoded list in bytes */ function toList(RLPItem memory item) internal pure returns (RLPItem[] memory result) { require(<FILL_ME>) uint items = numItems(item); result = new RLPItem[](items); uint memPtr = item.memPtr + _payloadOffset(item.memPtr); uint dataLen; for (uint i = 0; i < items; i++) { dataLen = _itemLength(memPtr); result[i] = RLPItem(dataLen, memPtr); memPtr = memPtr + dataLen; } } /* * Helpers */ // @return indicator whether encoded payload is a list. negate this function call for isData. function isList(RLPItem memory item) internal pure returns (bool) { } // @return number of payload items inside an encoded list. function numItems(RLPItem memory item) internal pure returns (uint) { } // @return entire rlp item byte length function _itemLength(uint memPtr) internal pure returns (uint len) { } // @return number of bytes until the data function _payloadOffset(uint memPtr) internal pure returns (uint) { } /** RLPItem conversions into data types **/ // @returns raw rlp encoding in bytes function toRlpBytes(RLPItem memory item) internal pure returns (bytes memory) { } function toBoolean(RLPItem memory item) internal pure returns (bool) { } function toAddress(RLPItem memory item) internal pure returns (address) { } function toUint(RLPItem memory item) internal pure returns (uint) { } function toBytes(RLPItem memory item) internal pure returns (bytes memory) { } /* * @param src Pointer to source * @param dest Pointer to destination * @param len Amount of memory to copy from the source */ function copy(uint src, uint dest, uint len) internal pure { } }
isList(item),"isList failed"
26,733
isList(item)
'CS: transaction value exceeds maximal value in usd'
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import './Structs.sol'; import './PriceFeedClient.sol'; contract Crowdsale is Ownable, ReentrancyGuard, Pausable { using PriceFeedClient for AggregatorV3Interface; using SafeERC20 for IERC20; // ======================================== // State variables // ======================================== uint8 internal constant ETH_DECIMALS = 18; uint256 internal constant USD_PRICE = 100000000; // Constant contract configuration CrowdsaleBaseConfig internal config; // Amount of tokens sold during SALE phase // and not yet claimed uint256 public locked; // Amounts of tokens each address bought // and that are not yet claimed mapping(address => uint256) public balance; // Amounts of tokens each address bought mapping(address => uint256) public maxBalance; // Events event Buy(address indexed from, uint256 indexed value); event Claim(address indexed from, uint256 indexed value); // ======================================== // Constructor // ======================================== constructor(CrowdsaleBaseConfig memory _config) { } // ======================================== // Main functions // ======================================== // Transfer ETH and receive tokens in exchange receive() external payable { } // Transfer Stablecoin and receive tokens in exchange function buyForUSD(uint256 value) external { } // Main function for buying tokens for both ETH and stable coins function _buy(uint256 value, bool stable) internal nonReentrant onlySalePhase whenNotPaused { require(value != 0, 'CS: transaction value is zero'); // match payment decimals uint8 decimals = stable ? config.USDDecimals : ETH_DECIMALS; // Fetch current price for ETH or use 1 for stablecoins uint256 price = stable ? USD_PRICE : _currentEthPrice(); // Make sure tx value does not exceed max value in USD require(<FILL_ME>) // Calculate how many tokens to send in exchange uint256 tokens = _calculateTokenAmount( value, price, config.rate, config.tokenDecimals, decimals ); // Stop if there is nothing to send require(tokens > 0, 'CS: token amount is zero'); // Make sure there is enough tokens on contract address // and that is does not use tokens owned by previous buyers uint256 availableTokens = _tokenBalance() - locked; require(availableTokens >= tokens, 'CS: not enough tokens on sale'); // If stablecoin is used, transfer coins from buyer to crowdsale if (stable) { config.USD.safeTransferFrom(msg.sender, address(this), value); } // Update balances balance[msg.sender] += tokens; maxBalance[msg.sender] += tokens; locked += tokens; emit Buy(msg.sender, tokens); } // Claim tokens in vesting stages function claim(uint256 value) external nonReentrant onlyVestingPhase whenNotPaused { } // ======================================== // Public views // ======================================== // Fetch configuration object function configuration() external view returns (CrowdsaleBaseConfig memory) { } // Fetch current price from price feed function currentEthPrice() external view returns (uint256) { } function tokenBalance() external view returns (uint256) { } // Amount of unlocked tokens on contract function freeBalance() external view returns (uint256) { } // What percent of tokens can be claim at current time function unlockedPercentage() external view returns (uint256) { } // How many tokens can be bought for selected ETH value function calculateTokenAmountForETH(uint256 value) external view returns (uint256) { } // How many tokens can be bought for selected ETH value function calculateTokenAmountForUSD(uint256 value) external view returns (uint256) { } // What tx value of ETH is needed to buy selected amount of tokens function calculatePaymentForETH(uint256 tokens) external view returns (uint256) { } // What value of USD is needed to buy selected amount of tokens function calculatePaymentForUSD(uint256 tokens) external view returns (uint256) { } // Maximal amount of tokens user can claim at current time function maxTokensToUnlock(address sender) external view returns (uint256) { } // ======================================== // Owner utilities // ======================================== // Used to send ETH to contract from owner function fund() external payable onlyOwner {} // Use to withdraw eth function transferEth(address payable to, uint256 value) external onlyOwner { } // Owner function used to withdraw tokens // Disallows to claim tokens belonging to other addresses function transferToken(address to, uint256 value) external onlyOwner { } // OWner utility function // Use in case other token is send to contract address function transferOtherToken( IERC20 otherToken, address to, uint256 value ) external onlyOwner { } // OWner utility function function pause() external onlyOwner { } // OWner utility function function unpause() external onlyOwner { } // ======================================== // Internals // ======================================== function _tokenBalance() internal view returns (uint256) { } function _freeBalance() internal view returns (uint256) { } function _currentEthPrice() internal view returns (uint256) { } function _maxTokensToUnlock(address sender) internal view returns (uint256) { } function _calculateTokenAmount( uint256 value, uint256 price, uint256 rate, uint8 tokenDecimals, uint8 paymentDecimals ) internal pure returns (uint256) { } function _calculatePayment( uint256 tokens, uint256 price, uint256 rate, uint8 tokenDecimals, uint8 paymentDecimals ) internal pure returns (uint256) { } function _toUsd( uint256 value, uint256 price, uint8 paymentDecimals ) internal pure returns (uint256) { } function _calculateMaxTokensToUnlock( uint256 _balance, uint256 _maxBalance, uint256 _percentage ) internal pure returns (uint256) { } function _calculateUnlockedPercentage(Stage[] memory stages, uint256 currentTimestamp) internal pure returns (uint256) { } // Copy array of structs from storage to memory function _configuration() internal view returns (CrowdsaleBaseConfig memory) { } // Copy array of structs from memory to storage function _initializeConfig(CrowdsaleBaseConfig memory _config) internal { } // ======================================== // Modifiers // ======================================== // Phase guard modifier onlySalePhase() { } // Phase guard modifier onlyVestingPhase() { } }
_toUsd(value,price,decimals)<=config.maxUsdValue,'CS: transaction value exceeds maximal value in usd'
26,754
_toUsd(value,price,decimals)<=config.maxUsdValue
'CS: sender has 0 tokens'
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import './Structs.sol'; import './PriceFeedClient.sol'; contract Crowdsale is Ownable, ReentrancyGuard, Pausable { using PriceFeedClient for AggregatorV3Interface; using SafeERC20 for IERC20; // ======================================== // State variables // ======================================== uint8 internal constant ETH_DECIMALS = 18; uint256 internal constant USD_PRICE = 100000000; // Constant contract configuration CrowdsaleBaseConfig internal config; // Amount of tokens sold during SALE phase // and not yet claimed uint256 public locked; // Amounts of tokens each address bought // and that are not yet claimed mapping(address => uint256) public balance; // Amounts of tokens each address bought mapping(address => uint256) public maxBalance; // Events event Buy(address indexed from, uint256 indexed value); event Claim(address indexed from, uint256 indexed value); // ======================================== // Constructor // ======================================== constructor(CrowdsaleBaseConfig memory _config) { } // ======================================== // Main functions // ======================================== // Transfer ETH and receive tokens in exchange receive() external payable { } // Transfer Stablecoin and receive tokens in exchange function buyForUSD(uint256 value) external { } // Main function for buying tokens for both ETH and stable coins function _buy(uint256 value, bool stable) internal nonReentrant onlySalePhase whenNotPaused { } // Claim tokens in vesting stages function claim(uint256 value) external nonReentrant onlyVestingPhase whenNotPaused { require(<FILL_ME>) require(balance[msg.sender] >= value, 'CS: not enough tokens'); // Disallow to claim more tokens than current unlocked percentage // Ex Allow to claim 50% of tokens after 3 months require(value <= _maxTokensToUnlock(msg.sender), 'CS: value exceeds unlocked percentage'); // Transfer tokens to user config.token.safeTransfer(msg.sender, value); // Update balances balance[msg.sender] -= value; locked -= value; emit Claim(msg.sender, value); } // ======================================== // Public views // ======================================== // Fetch configuration object function configuration() external view returns (CrowdsaleBaseConfig memory) { } // Fetch current price from price feed function currentEthPrice() external view returns (uint256) { } function tokenBalance() external view returns (uint256) { } // Amount of unlocked tokens on contract function freeBalance() external view returns (uint256) { } // What percent of tokens can be claim at current time function unlockedPercentage() external view returns (uint256) { } // How many tokens can be bought for selected ETH value function calculateTokenAmountForETH(uint256 value) external view returns (uint256) { } // How many tokens can be bought for selected ETH value function calculateTokenAmountForUSD(uint256 value) external view returns (uint256) { } // What tx value of ETH is needed to buy selected amount of tokens function calculatePaymentForETH(uint256 tokens) external view returns (uint256) { } // What value of USD is needed to buy selected amount of tokens function calculatePaymentForUSD(uint256 tokens) external view returns (uint256) { } // Maximal amount of tokens user can claim at current time function maxTokensToUnlock(address sender) external view returns (uint256) { } // ======================================== // Owner utilities // ======================================== // Used to send ETH to contract from owner function fund() external payable onlyOwner {} // Use to withdraw eth function transferEth(address payable to, uint256 value) external onlyOwner { } // Owner function used to withdraw tokens // Disallows to claim tokens belonging to other addresses function transferToken(address to, uint256 value) external onlyOwner { } // OWner utility function // Use in case other token is send to contract address function transferOtherToken( IERC20 otherToken, address to, uint256 value ) external onlyOwner { } // OWner utility function function pause() external onlyOwner { } // OWner utility function function unpause() external onlyOwner { } // ======================================== // Internals // ======================================== function _tokenBalance() internal view returns (uint256) { } function _freeBalance() internal view returns (uint256) { } function _currentEthPrice() internal view returns (uint256) { } function _maxTokensToUnlock(address sender) internal view returns (uint256) { } function _calculateTokenAmount( uint256 value, uint256 price, uint256 rate, uint8 tokenDecimals, uint8 paymentDecimals ) internal pure returns (uint256) { } function _calculatePayment( uint256 tokens, uint256 price, uint256 rate, uint8 tokenDecimals, uint8 paymentDecimals ) internal pure returns (uint256) { } function _toUsd( uint256 value, uint256 price, uint8 paymentDecimals ) internal pure returns (uint256) { } function _calculateMaxTokensToUnlock( uint256 _balance, uint256 _maxBalance, uint256 _percentage ) internal pure returns (uint256) { } function _calculateUnlockedPercentage(Stage[] memory stages, uint256 currentTimestamp) internal pure returns (uint256) { } // Copy array of structs from storage to memory function _configuration() internal view returns (CrowdsaleBaseConfig memory) { } // Copy array of structs from memory to storage function _initializeConfig(CrowdsaleBaseConfig memory _config) internal { } // ======================================== // Modifiers // ======================================== // Phase guard modifier onlySalePhase() { } // Phase guard modifier onlyVestingPhase() { } }
balance[msg.sender]!=0,'CS: sender has 0 tokens'
26,754
balance[msg.sender]!=0
'CS: not enough tokens'
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import './Structs.sol'; import './PriceFeedClient.sol'; contract Crowdsale is Ownable, ReentrancyGuard, Pausable { using PriceFeedClient for AggregatorV3Interface; using SafeERC20 for IERC20; // ======================================== // State variables // ======================================== uint8 internal constant ETH_DECIMALS = 18; uint256 internal constant USD_PRICE = 100000000; // Constant contract configuration CrowdsaleBaseConfig internal config; // Amount of tokens sold during SALE phase // and not yet claimed uint256 public locked; // Amounts of tokens each address bought // and that are not yet claimed mapping(address => uint256) public balance; // Amounts of tokens each address bought mapping(address => uint256) public maxBalance; // Events event Buy(address indexed from, uint256 indexed value); event Claim(address indexed from, uint256 indexed value); // ======================================== // Constructor // ======================================== constructor(CrowdsaleBaseConfig memory _config) { } // ======================================== // Main functions // ======================================== // Transfer ETH and receive tokens in exchange receive() external payable { } // Transfer Stablecoin and receive tokens in exchange function buyForUSD(uint256 value) external { } // Main function for buying tokens for both ETH and stable coins function _buy(uint256 value, bool stable) internal nonReentrant onlySalePhase whenNotPaused { } // Claim tokens in vesting stages function claim(uint256 value) external nonReentrant onlyVestingPhase whenNotPaused { require(balance[msg.sender] != 0, 'CS: sender has 0 tokens'); require(<FILL_ME>) // Disallow to claim more tokens than current unlocked percentage // Ex Allow to claim 50% of tokens after 3 months require(value <= _maxTokensToUnlock(msg.sender), 'CS: value exceeds unlocked percentage'); // Transfer tokens to user config.token.safeTransfer(msg.sender, value); // Update balances balance[msg.sender] -= value; locked -= value; emit Claim(msg.sender, value); } // ======================================== // Public views // ======================================== // Fetch configuration object function configuration() external view returns (CrowdsaleBaseConfig memory) { } // Fetch current price from price feed function currentEthPrice() external view returns (uint256) { } function tokenBalance() external view returns (uint256) { } // Amount of unlocked tokens on contract function freeBalance() external view returns (uint256) { } // What percent of tokens can be claim at current time function unlockedPercentage() external view returns (uint256) { } // How many tokens can be bought for selected ETH value function calculateTokenAmountForETH(uint256 value) external view returns (uint256) { } // How many tokens can be bought for selected ETH value function calculateTokenAmountForUSD(uint256 value) external view returns (uint256) { } // What tx value of ETH is needed to buy selected amount of tokens function calculatePaymentForETH(uint256 tokens) external view returns (uint256) { } // What value of USD is needed to buy selected amount of tokens function calculatePaymentForUSD(uint256 tokens) external view returns (uint256) { } // Maximal amount of tokens user can claim at current time function maxTokensToUnlock(address sender) external view returns (uint256) { } // ======================================== // Owner utilities // ======================================== // Used to send ETH to contract from owner function fund() external payable onlyOwner {} // Use to withdraw eth function transferEth(address payable to, uint256 value) external onlyOwner { } // Owner function used to withdraw tokens // Disallows to claim tokens belonging to other addresses function transferToken(address to, uint256 value) external onlyOwner { } // OWner utility function // Use in case other token is send to contract address function transferOtherToken( IERC20 otherToken, address to, uint256 value ) external onlyOwner { } // OWner utility function function pause() external onlyOwner { } // OWner utility function function unpause() external onlyOwner { } // ======================================== // Internals // ======================================== function _tokenBalance() internal view returns (uint256) { } function _freeBalance() internal view returns (uint256) { } function _currentEthPrice() internal view returns (uint256) { } function _maxTokensToUnlock(address sender) internal view returns (uint256) { } function _calculateTokenAmount( uint256 value, uint256 price, uint256 rate, uint8 tokenDecimals, uint8 paymentDecimals ) internal pure returns (uint256) { } function _calculatePayment( uint256 tokens, uint256 price, uint256 rate, uint8 tokenDecimals, uint8 paymentDecimals ) internal pure returns (uint256) { } function _toUsd( uint256 value, uint256 price, uint8 paymentDecimals ) internal pure returns (uint256) { } function _calculateMaxTokensToUnlock( uint256 _balance, uint256 _maxBalance, uint256 _percentage ) internal pure returns (uint256) { } function _calculateUnlockedPercentage(Stage[] memory stages, uint256 currentTimestamp) internal pure returns (uint256) { } // Copy array of structs from storage to memory function _configuration() internal view returns (CrowdsaleBaseConfig memory) { } // Copy array of structs from memory to storage function _initializeConfig(CrowdsaleBaseConfig memory _config) internal { } // ======================================== // Modifiers // ======================================== // Phase guard modifier onlySalePhase() { } // Phase guard modifier onlyVestingPhase() { } }
balance[msg.sender]>=value,'CS: not enough tokens'
26,754
balance[msg.sender]>=value
null
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev 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. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } pragma solidity >=0.7.0 <0.9.0; contract GINE is ERC721Enumerable, Ownable { using Strings for uint256; string baseURI; string public baseExtension = ".json"; uint256 public cost = 0.0311 ether; uint256 public maxSupply = 11111; uint256 public maxMintAmount = 7; bool public paused = false; bool public minthasrun = false; bool public revealed = false; string public notRevealedUri; constructor( string memory _name, string memory _symbol, string memory _initBaseURI, string memory _initNotRevealedUri ) ERC721(_name, _symbol) { } // internal function _baseURI() internal view virtual override returns (string memory) { } // public function mint(uint256 _mintAmount) public payable { uint256 supply = totalSupply(); require(!paused); require(_mintAmount > 0); require(_mintAmount <= maxMintAmount); require(supply + _mintAmount <= maxSupply); require(<FILL_ME>) if (msg.sender != owner()) { require(msg.value >= cost * _mintAmount); } for (uint256 i = 1; i <= _mintAmount; i++) { _safeMint(msg.sender, supply + i); // Wait... is he really doing this ?? uint256 _currenttokenid = supply + i; if (_currenttokenid % 11 == 0) { // console.log("woop woop this NFT number " + _currenttokenid + " is an 11th NFT, therefor it is FREE"); // double check there is no attempt to send back more than was originally send in if (cost <= msg.value){ minthasrun = true; // you really going to re-entrancy on my first contact ? (bool success, ) = payable(msg.sender).call{value: cost}(""); minthasrun = false; // send back the Unit cost in eth to msg.sender require(success, "Failed to return Ether"); } } } } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } //only owner function reveal() public onlyOwner { } function setCost(uint256 _newCost) public onlyOwner { } function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner { } function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function setBaseExtension(string memory _newBaseExtension) public onlyOwner { } function pause(bool _state) public onlyOwner { } function mintrun(bool _mintrun) public onlyOwner { } function withdraw() public payable onlyOwner { } }
!minthasrun
26,860
!minthasrun
"Contract must not be paused"
pragma solidity ^0.4.18; /** * The ClubTokenController is a replaceable endpoint for minting and unminting ClubToken.sol */ contract ClubTokenController is BancorFormula, Admin, Ownable { event Buy(address buyer, uint256 tokens, uint256 value, uint256 poolBalance, uint256 tokenSupply); event Sell(address seller, uint256 tokens, uint256 value, uint256 poolBalance, uint256 tokenSupply); bool public paused; address public clubToken; address public simpleCloversMarket; address public curationMarket; address public support; /* uint256 public poolBalance; */ uint256 public virtualSupply; uint256 public virtualBalance; uint32 public reserveRatio; // represented in ppm, 1-1000000 constructor(address _clubToken) public { } function () public payable { } modifier notPaused() { require(<FILL_ME>) _; } function poolBalance() public constant returns(uint256) { } /** * @dev gets the amount of tokens returned from spending Eth * @param buyValue The amount of Eth to be spent * @return A uint256 representing the amount of tokens gained in exchange for the Eth. */ function getBuy(uint256 buyValue) public constant returns(uint256) { } /** * @dev gets the amount of Eth returned from selling tokens * @param sellAmount The amount of tokens to be sold * @return A uint256 representing the amount of Eth gained in exchange for the tokens. */ function getSell(uint256 sellAmount) public constant returns(uint256) { } function updatePaused(bool _paused) public onlyOwner { } /** * @dev updates the Reserve Ratio variable * @param _reserveRatio The reserve ratio that determines the curve * @return A boolean representing whether or not the update was successful. */ function updateReserveRatio(uint32 _reserveRatio) public onlyOwner returns(bool){ } /** * @dev updates the Virtual Supply variable * @param _virtualSupply The virtual supply of tokens used for calculating buys and sells * @return A boolean representing whether or not the update was successful. */ function updateVirtualSupply(uint256 _virtualSupply) public onlyOwner returns(bool){ } /** * @dev updates the Virtual Balance variable * @param _virtualBalance The virtual balance of the contract used for calculating buys and sells * @return A boolean representing whether or not the update was successful. */ function updateVirtualBalance(uint256 _virtualBalance) public onlyOwner returns(bool){ } /** * @dev updates the poolBalance * @param _poolBalance The eth balance of ClubToken.sol * @return A boolean representing whether or not the update was successful. */ /* function updatePoolBalance(uint256 _poolBalance) public onlyOwner returns(bool){ poolBalance = _poolBalance; return true; } */ /** * @dev updates the SimpleCloversMarket address * @param _simpleCloversMarket The address of the simpleCloversMarket * @return A boolean representing whether or not the update was successful. */ function updateSimpleCloversMarket(address _simpleCloversMarket) public onlyOwner returns(bool){ } /** * @dev updates the CurationMarket address * @param _curationMarket The address of the curationMarket * @return A boolean representing whether or not the update was successful. */ function updateCurationMarket(address _curationMarket) public onlyOwner returns(bool){ } /** * @dev updates the Support address * @param _support The address of the Support * @return A boolean representing whether or not the update was successful. */ function updateSupport(address _support) public onlyOwner returns(bool){ } /** * @dev donate Donate Eth to the poolBalance without increasing the totalSupply */ function donate() public payable { } function burn(address from, uint256 amount) public { } function transferFrom(address from, address to, uint256 amount) public { } /** * @dev buy Buy ClubTokens with Eth * @param buyer The address that should receive the new tokens */ function buy(address buyer) public payable notPaused returns(bool) { } /** * @dev sell Sell ClubTokens for Eth * @param sellAmount The amount of tokens to sell */ function sell(uint256 sellAmount) public notPaused returns(bool) { } }
!paused||owner==msg.sender||admins[tx.origin],"Contract must not be paused"
26,939
!paused||owner==msg.sender||admins[tx.origin]
null
pragma solidity ^0.4.18; /** * The ClubTokenController is a replaceable endpoint for minting and unminting ClubToken.sol */ contract ClubTokenController is BancorFormula, Admin, Ownable { event Buy(address buyer, uint256 tokens, uint256 value, uint256 poolBalance, uint256 tokenSupply); event Sell(address seller, uint256 tokens, uint256 value, uint256 poolBalance, uint256 tokenSupply); bool public paused; address public clubToken; address public simpleCloversMarket; address public curationMarket; address public support; /* uint256 public poolBalance; */ uint256 public virtualSupply; uint256 public virtualBalance; uint32 public reserveRatio; // represented in ppm, 1-1000000 constructor(address _clubToken) public { } function () public payable { } modifier notPaused() { } function poolBalance() public constant returns(uint256) { } /** * @dev gets the amount of tokens returned from spending Eth * @param buyValue The amount of Eth to be spent * @return A uint256 representing the amount of tokens gained in exchange for the Eth. */ function getBuy(uint256 buyValue) public constant returns(uint256) { } /** * @dev gets the amount of Eth returned from selling tokens * @param sellAmount The amount of tokens to be sold * @return A uint256 representing the amount of Eth gained in exchange for the tokens. */ function getSell(uint256 sellAmount) public constant returns(uint256) { } function updatePaused(bool _paused) public onlyOwner { } /** * @dev updates the Reserve Ratio variable * @param _reserveRatio The reserve ratio that determines the curve * @return A boolean representing whether or not the update was successful. */ function updateReserveRatio(uint32 _reserveRatio) public onlyOwner returns(bool){ } /** * @dev updates the Virtual Supply variable * @param _virtualSupply The virtual supply of tokens used for calculating buys and sells * @return A boolean representing whether or not the update was successful. */ function updateVirtualSupply(uint256 _virtualSupply) public onlyOwner returns(bool){ } /** * @dev updates the Virtual Balance variable * @param _virtualBalance The virtual balance of the contract used for calculating buys and sells * @return A boolean representing whether or not the update was successful. */ function updateVirtualBalance(uint256 _virtualBalance) public onlyOwner returns(bool){ } /** * @dev updates the poolBalance * @param _poolBalance The eth balance of ClubToken.sol * @return A boolean representing whether or not the update was successful. */ /* function updatePoolBalance(uint256 _poolBalance) public onlyOwner returns(bool){ poolBalance = _poolBalance; return true; } */ /** * @dev updates the SimpleCloversMarket address * @param _simpleCloversMarket The address of the simpleCloversMarket * @return A boolean representing whether or not the update was successful. */ function updateSimpleCloversMarket(address _simpleCloversMarket) public onlyOwner returns(bool){ } /** * @dev updates the CurationMarket address * @param _curationMarket The address of the curationMarket * @return A boolean representing whether or not the update was successful. */ function updateCurationMarket(address _curationMarket) public onlyOwner returns(bool){ } /** * @dev updates the Support address * @param _support The address of the Support * @return A boolean representing whether or not the update was successful. */ function updateSupport(address _support) public onlyOwner returns(bool){ } /** * @dev donate Donate Eth to the poolBalance without increasing the totalSupply */ function donate() public payable { } function burn(address from, uint256 amount) public { } function transferFrom(address from, address to, uint256 amount) public { } /** * @dev buy Buy ClubTokens with Eth * @param buyer The address that should receive the new tokens */ function buy(address buyer) public payable notPaused returns(bool) { require(msg.value > 0); uint256 tokens = getBuy(msg.value); require(tokens > 0); require(<FILL_ME>) /* poolBalance = safeAdd(poolBalance, msg.value); */ clubToken.transfer(msg.value); emit Buy(buyer, tokens, msg.value, poolBalance(), ClubToken(clubToken).totalSupply()); } /** * @dev sell Sell ClubTokens for Eth * @param sellAmount The amount of tokens to sell */ function sell(uint256 sellAmount) public notPaused returns(bool) { } }
ClubToken(clubToken).mint(buyer,tokens)
26,939
ClubToken(clubToken).mint(buyer,tokens)
null
pragma solidity ^0.4.18; /** * The ClubTokenController is a replaceable endpoint for minting and unminting ClubToken.sol */ contract ClubTokenController is BancorFormula, Admin, Ownable { event Buy(address buyer, uint256 tokens, uint256 value, uint256 poolBalance, uint256 tokenSupply); event Sell(address seller, uint256 tokens, uint256 value, uint256 poolBalance, uint256 tokenSupply); bool public paused; address public clubToken; address public simpleCloversMarket; address public curationMarket; address public support; /* uint256 public poolBalance; */ uint256 public virtualSupply; uint256 public virtualBalance; uint32 public reserveRatio; // represented in ppm, 1-1000000 constructor(address _clubToken) public { } function () public payable { } modifier notPaused() { } function poolBalance() public constant returns(uint256) { } /** * @dev gets the amount of tokens returned from spending Eth * @param buyValue The amount of Eth to be spent * @return A uint256 representing the amount of tokens gained in exchange for the Eth. */ function getBuy(uint256 buyValue) public constant returns(uint256) { } /** * @dev gets the amount of Eth returned from selling tokens * @param sellAmount The amount of tokens to be sold * @return A uint256 representing the amount of Eth gained in exchange for the tokens. */ function getSell(uint256 sellAmount) public constant returns(uint256) { } function updatePaused(bool _paused) public onlyOwner { } /** * @dev updates the Reserve Ratio variable * @param _reserveRatio The reserve ratio that determines the curve * @return A boolean representing whether or not the update was successful. */ function updateReserveRatio(uint32 _reserveRatio) public onlyOwner returns(bool){ } /** * @dev updates the Virtual Supply variable * @param _virtualSupply The virtual supply of tokens used for calculating buys and sells * @return A boolean representing whether or not the update was successful. */ function updateVirtualSupply(uint256 _virtualSupply) public onlyOwner returns(bool){ } /** * @dev updates the Virtual Balance variable * @param _virtualBalance The virtual balance of the contract used for calculating buys and sells * @return A boolean representing whether or not the update was successful. */ function updateVirtualBalance(uint256 _virtualBalance) public onlyOwner returns(bool){ } /** * @dev updates the poolBalance * @param _poolBalance The eth balance of ClubToken.sol * @return A boolean representing whether or not the update was successful. */ /* function updatePoolBalance(uint256 _poolBalance) public onlyOwner returns(bool){ poolBalance = _poolBalance; return true; } */ /** * @dev updates the SimpleCloversMarket address * @param _simpleCloversMarket The address of the simpleCloversMarket * @return A boolean representing whether or not the update was successful. */ function updateSimpleCloversMarket(address _simpleCloversMarket) public onlyOwner returns(bool){ } /** * @dev updates the CurationMarket address * @param _curationMarket The address of the curationMarket * @return A boolean representing whether or not the update was successful. */ function updateCurationMarket(address _curationMarket) public onlyOwner returns(bool){ } /** * @dev updates the Support address * @param _support The address of the Support * @return A boolean representing whether or not the update was successful. */ function updateSupport(address _support) public onlyOwner returns(bool){ } /** * @dev donate Donate Eth to the poolBalance without increasing the totalSupply */ function donate() public payable { } function burn(address from, uint256 amount) public { } function transferFrom(address from, address to, uint256 amount) public { } /** * @dev buy Buy ClubTokens with Eth * @param buyer The address that should receive the new tokens */ function buy(address buyer) public payable notPaused returns(bool) { } /** * @dev sell Sell ClubTokens for Eth * @param sellAmount The amount of tokens to sell */ function sell(uint256 sellAmount) public notPaused returns(bool) { require(sellAmount > 0); require(<FILL_ME>) uint256 saleReturn = getSell(sellAmount); require(saleReturn > 0); require(saleReturn <= poolBalance()); require(saleReturn <= clubToken.balance); ClubToken(clubToken).burn(msg.sender, sellAmount); /* poolBalance = safeSub(poolBalance, saleReturn); */ ClubToken(clubToken).moveEth(msg.sender, saleReturn); emit Sell(msg.sender, sellAmount, saleReturn, poolBalance(), ClubToken(clubToken).totalSupply()); } }
ClubToken(clubToken).balanceOf(msg.sender)>=sellAmount
26,939
ClubToken(clubToken).balanceOf(msg.sender)>=sellAmount
"claimed too many"
//SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.7.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; contract MannysGame is ERC721, Ownable { using SafeMath for uint256; uint16[] mannys; bool public mintActive = true; bool public goldMannyMinted = false; bool public gameWon = false; uint256 public gameStart; address public gameWinner; mapping(address => uint) public claimedPerWallet; uint256 public constant price = 0.1 ether; address public constant mannyWallet = 0xF3A45Ee798fc560CE080d143D12312185f84aa72; address public constant vaultWallet = 0x65861c79fA4249ACc971C229eB52f80A3eDEDedc; constructor() public ERC721("mannys.game", "MNYGME") { } function mint(uint numberOfTokens) public payable { require(mintActive == true, "mint is not active rn.."); require(tx.origin == msg.sender, "dont get Seven'd"); require(numberOfTokens > 0, "mint more lol"); require(numberOfTokens <= 16, "dont be greedy smh"); require(numberOfTokens <= mannys.length, "no more tokens sry"); require(<FILL_ME>) require(msg.value >= price.mul(numberOfTokens), "more eth pls"); // mint a random manny for (uint i = 0; i < numberOfTokens; i++) { uint256 randManny = getRandom(mannys); _safeMint(msg.sender, randManny); claimedPerWallet[msg.sender] += 1; } uint mannyCut = msg.value * 40 / 100; payable(mannyWallet).transfer(mannyCut); } function getRandom(uint16[] storage _arr) private returns (uint256) { } /** * @dev Pseudo-random number generator * if you're able to exploit this you probably deserve to win TBH */ function _getRandomNumber(uint16[] storage _arr) private view returns (uint256) { } function tokensByOwner(address _owner) external view returns(uint16[] memory) { } function mintGoldManny() public { } function winTheGame() public { } // admin function setBaseURI(string memory baseURI) public onlyOwner { } function setMintActive(bool _mintActive) public onlyOwner { } function withdraw() public onlyOwner { } }
claimedPerWallet[msg.sender]+numberOfTokens<=64,"claimed too many"
27,038
claimedPerWallet[msg.sender]+numberOfTokens<=64
"have not acquired the golden manny, smh..."
//SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.7.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; contract MannysGame is ERC721, Ownable { using SafeMath for uint256; uint16[] mannys; bool public mintActive = true; bool public goldMannyMinted = false; bool public gameWon = false; uint256 public gameStart; address public gameWinner; mapping(address => uint) public claimedPerWallet; uint256 public constant price = 0.1 ether; address public constant mannyWallet = 0xF3A45Ee798fc560CE080d143D12312185f84aa72; address public constant vaultWallet = 0x65861c79fA4249ACc971C229eB52f80A3eDEDedc; constructor() public ERC721("mannys.game", "MNYGME") { } function mint(uint numberOfTokens) public payable { } function getRandom(uint16[] storage _arr) private returns (uint256) { } /** * @dev Pseudo-random number generator * if you're able to exploit this you probably deserve to win TBH */ function _getRandomNumber(uint16[] storage _arr) private view returns (uint256) { } function tokensByOwner(address _owner) external view returns(uint16[] memory) { } function mintGoldManny() public { } function winTheGame() public { require(gameWon == false, "game has already been won, gg"); require(<FILL_ME>) msg.sender.transfer(address(this).balance); gameWon = true; gameWinner = msg.sender; } // admin function setBaseURI(string memory baseURI) public onlyOwner { } function setMintActive(bool _mintActive) public onlyOwner { } function withdraw() public onlyOwner { } }
this.ownerOf(404)==msg.sender,"have not acquired the golden manny, smh..."
27,038
this.ownerOf(404)==msg.sender
"TOS01"
/** * @title Tokensale * @dev Tokensale contract * * @author Cyril Lapinte - <[email protected]> * * @notice Copyright © 2016 - 2018 Mt Pelerin Group SA - All Rights Reserved * @notice Please refer to the top of this file for the license. * * Error messages * TOS01: It must be before the sale is opened * TOS02: Sale must be open * TOS03: It must be before the sale is closed * TOS04: It must be after the sale is closed * TOS05: No data must be sent while sending ETH * TOS06: Share Purchase Agreement Hashes must match * TOS07: User/Investor must exist * TOS08: SPA must be accepted before any ETH investment * TOS09: Cannot update schedule once started * TOS10: Investor must exist * TOS11: Cannot allocate more tokens than available supply * TOS12: Length of InvestorIds and amounts arguments must match * TOS13: Investor must exist * TOS14: Must refund ETH unspent * TOS15: Must withdraw ETH to vaultETH * TOS16: Cannot invest onchain and offchain at the same time * TOS17: A ETHCHF rate must exist to invest * TOS18: User must be valid * TOS19: Cannot invest if no tokens are available * TOS20: Investment is below the minimal investment * TOS21: Cannot unspend more CHF than BASE_TOKEN_PRICE_CHF * TOS22: Token transfer must be successful */ contract Tokensale is ITokensale, Authority, Pausable { using SafeMath for uint256; uint32[5] contributionLimits = [ 5000, 500000, 1500000, 10000000, 25000000 ]; /* General sale details */ ERC20 public token; address public vaultETH; address public vaultERC20; IUserRegistry public userRegistry; IRatesProvider public ratesProvider; uint256 public minimalBalance = MINIMAL_BALANCE; bytes32 public sharePurchaseAgreementHash; uint256 public startAt = 4102441200; uint256 public endAt = 4102441200; uint256 public raisedETH; uint256 public raisedCHF; uint256 public totalRaisedCHF; uint256 public totalUnspentETH; uint256 public totalRefundedETH; uint256 public allocatedTokens; struct Investor { uint256 unspentETH; uint256 investedCHF; bool acceptedSPA; uint256 allocations; uint256 tokens; } mapping(uint256 => Investor) investors; mapping(uint256 => uint256) investorLimits; uint256 public investorCount; /** * @dev Throws unless before sale opening */ modifier beforeSaleIsOpened { require(<FILL_ME>) _; } /** * @dev Throws if sale is not open */ modifier saleIsOpened { } /** * @dev Throws once the sale is closed */ modifier beforeSaleIsClosed { } /** * @dev constructor */ constructor( ERC20 _token, IUserRegistry _userRegistry, IRatesProvider _ratesProvider, address _vaultERC20, address _vaultETH ) public { } /** * @dev fallback function */ function () external payable { } /** * @dev returns the token sold */ function token() public view returns (ERC20) { } /** * @dev returns the vault use to */ function vaultETH() public view returns (address) { } /** * @dev returns the vault to receive ETH */ function vaultERC20() public view returns (address) { } function userRegistry() public view returns (IUserRegistry) { } function ratesProvider() public view returns (IRatesProvider) { } function sharePurchaseAgreementHash() public view returns (bytes32) { } /* Sale status */ function startAt() public view returns (uint256) { } function endAt() public view returns (uint256) { } function raisedETH() public view returns (uint256) { } function raisedCHF() public view returns (uint256) { } function totalRaisedCHF() public view returns (uint256) { } function totalUnspentETH() public view returns (uint256) { } function totalRefundedETH() public view returns (uint256) { } function availableSupply() public view returns (uint256) { } /* Investor specific attributes */ function investorUnspentETH(uint256 _investorId) public view returns (uint256) { } function investorInvestedCHF(uint256 _investorId) public view returns (uint256) { } function investorAcceptedSPA(uint256 _investorId) public view returns (bool) { } function investorAllocations(uint256 _investorId) public view returns (uint256) { } function investorTokens(uint256 _investorId) public view returns (uint256) { } function investorCount() public view returns (uint256) { } function investorLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev get minimak auto withdraw threshold */ function minimalAutoWithdraw() public view returns (uint256) { } /** * @dev get minimal balance to maintain in contract */ function minimalBalance() public view returns (uint256) { } /** * @dev get base price in CHF cents */ function basePriceCHFCent() public view returns (uint256) { } /** * @dev contribution limit based on kyc level */ function contributionLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev update minimal balance to be kept in contract */ function updateMinimalBalance(uint256 _minimalBalance) public returns (uint256) { } /** * @dev define investor limit */ function updateInvestorLimits(uint256[] _investorIds, uint256 _limit) public returns (uint256) { } /* Share Purchase Agreement */ /** * @dev define SPA */ function defineSPA(bytes32 _sharePurchaseAgreementHash) public onlyOwner returns (bool) { } /** * @dev Accept SPA and invest if msg.value > 0 */ function acceptSPA(bytes32 _sharePurchaseAgreementHash) public beforeSaleIsClosed payable returns (bool) { } /* Investment */ function investETH() public saleIsOpened whenNotPaused payable { } /** * @dev add off chain investment */ function addOffChainInvestment(address _investor, uint256 _amountCHF) public onlyAuthority { } /* Schedule */ /** * @dev update schedule */ function updateSchedule(uint256 _startAt, uint256 _endAt) public onlyAuthority beforeSaleIsOpened { } /* Allocations admin */ /** * @dev allocate */ function allocateTokens(address _investor, uint256 _amount) public onlyAuthority beforeSaleIsClosed returns (bool) { } /** * @dev allocate many */ function allocateManyTokens(address[] _investors, uint256[] _amounts) public onlyAuthority beforeSaleIsClosed returns (bool) { } /* ETH administration */ /** * @dev fund ETH */ function fundETH() public payable onlyAuthority { } /** * @dev refund unspent ETH many */ function refundManyUnspentETH(address[] _receivers) public onlyAuthority { } /** * @dev refund unspent ETH */ function refundUnspentETH(address _receiver) public onlyAuthority { } /** * @dev withdraw ETH funds */ function withdrawETHFunds() public onlyAuthority { } /** * @dev withdraw all ETH funds */ function withdrawAllETHFunds() public onlyAuthority { } /** * @dev allowed token investment */ function allowedTokenInvestment( uint256 _investorId, uint256 _contributionCHF) public view returns (uint256) { } /** * @dev withdraw ETH funds internal */ function withdrawETHFundsInternal() internal { } /** * @dev invest internal */ function investInternal( address _investor, uint256 _amountETH, uint256 _amountCHF) private { } /* Util */ /** * @dev current time */ function currentTime() private view returns (uint256) { } }
currentTime()<startAt,"TOS01"
27,116
currentTime()<startAt
"TOS02"
/** * @title Tokensale * @dev Tokensale contract * * @author Cyril Lapinte - <[email protected]> * * @notice Copyright © 2016 - 2018 Mt Pelerin Group SA - All Rights Reserved * @notice Please refer to the top of this file for the license. * * Error messages * TOS01: It must be before the sale is opened * TOS02: Sale must be open * TOS03: It must be before the sale is closed * TOS04: It must be after the sale is closed * TOS05: No data must be sent while sending ETH * TOS06: Share Purchase Agreement Hashes must match * TOS07: User/Investor must exist * TOS08: SPA must be accepted before any ETH investment * TOS09: Cannot update schedule once started * TOS10: Investor must exist * TOS11: Cannot allocate more tokens than available supply * TOS12: Length of InvestorIds and amounts arguments must match * TOS13: Investor must exist * TOS14: Must refund ETH unspent * TOS15: Must withdraw ETH to vaultETH * TOS16: Cannot invest onchain and offchain at the same time * TOS17: A ETHCHF rate must exist to invest * TOS18: User must be valid * TOS19: Cannot invest if no tokens are available * TOS20: Investment is below the minimal investment * TOS21: Cannot unspend more CHF than BASE_TOKEN_PRICE_CHF * TOS22: Token transfer must be successful */ contract Tokensale is ITokensale, Authority, Pausable { using SafeMath for uint256; uint32[5] contributionLimits = [ 5000, 500000, 1500000, 10000000, 25000000 ]; /* General sale details */ ERC20 public token; address public vaultETH; address public vaultERC20; IUserRegistry public userRegistry; IRatesProvider public ratesProvider; uint256 public minimalBalance = MINIMAL_BALANCE; bytes32 public sharePurchaseAgreementHash; uint256 public startAt = 4102441200; uint256 public endAt = 4102441200; uint256 public raisedETH; uint256 public raisedCHF; uint256 public totalRaisedCHF; uint256 public totalUnspentETH; uint256 public totalRefundedETH; uint256 public allocatedTokens; struct Investor { uint256 unspentETH; uint256 investedCHF; bool acceptedSPA; uint256 allocations; uint256 tokens; } mapping(uint256 => Investor) investors; mapping(uint256 => uint256) investorLimits; uint256 public investorCount; /** * @dev Throws unless before sale opening */ modifier beforeSaleIsOpened { } /** * @dev Throws if sale is not open */ modifier saleIsOpened { require(<FILL_ME>) _; } /** * @dev Throws once the sale is closed */ modifier beforeSaleIsClosed { } /** * @dev constructor */ constructor( ERC20 _token, IUserRegistry _userRegistry, IRatesProvider _ratesProvider, address _vaultERC20, address _vaultETH ) public { } /** * @dev fallback function */ function () external payable { } /** * @dev returns the token sold */ function token() public view returns (ERC20) { } /** * @dev returns the vault use to */ function vaultETH() public view returns (address) { } /** * @dev returns the vault to receive ETH */ function vaultERC20() public view returns (address) { } function userRegistry() public view returns (IUserRegistry) { } function ratesProvider() public view returns (IRatesProvider) { } function sharePurchaseAgreementHash() public view returns (bytes32) { } /* Sale status */ function startAt() public view returns (uint256) { } function endAt() public view returns (uint256) { } function raisedETH() public view returns (uint256) { } function raisedCHF() public view returns (uint256) { } function totalRaisedCHF() public view returns (uint256) { } function totalUnspentETH() public view returns (uint256) { } function totalRefundedETH() public view returns (uint256) { } function availableSupply() public view returns (uint256) { } /* Investor specific attributes */ function investorUnspentETH(uint256 _investorId) public view returns (uint256) { } function investorInvestedCHF(uint256 _investorId) public view returns (uint256) { } function investorAcceptedSPA(uint256 _investorId) public view returns (bool) { } function investorAllocations(uint256 _investorId) public view returns (uint256) { } function investorTokens(uint256 _investorId) public view returns (uint256) { } function investorCount() public view returns (uint256) { } function investorLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev get minimak auto withdraw threshold */ function minimalAutoWithdraw() public view returns (uint256) { } /** * @dev get minimal balance to maintain in contract */ function minimalBalance() public view returns (uint256) { } /** * @dev get base price in CHF cents */ function basePriceCHFCent() public view returns (uint256) { } /** * @dev contribution limit based on kyc level */ function contributionLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev update minimal balance to be kept in contract */ function updateMinimalBalance(uint256 _minimalBalance) public returns (uint256) { } /** * @dev define investor limit */ function updateInvestorLimits(uint256[] _investorIds, uint256 _limit) public returns (uint256) { } /* Share Purchase Agreement */ /** * @dev define SPA */ function defineSPA(bytes32 _sharePurchaseAgreementHash) public onlyOwner returns (bool) { } /** * @dev Accept SPA and invest if msg.value > 0 */ function acceptSPA(bytes32 _sharePurchaseAgreementHash) public beforeSaleIsClosed payable returns (bool) { } /* Investment */ function investETH() public saleIsOpened whenNotPaused payable { } /** * @dev add off chain investment */ function addOffChainInvestment(address _investor, uint256 _amountCHF) public onlyAuthority { } /* Schedule */ /** * @dev update schedule */ function updateSchedule(uint256 _startAt, uint256 _endAt) public onlyAuthority beforeSaleIsOpened { } /* Allocations admin */ /** * @dev allocate */ function allocateTokens(address _investor, uint256 _amount) public onlyAuthority beforeSaleIsClosed returns (bool) { } /** * @dev allocate many */ function allocateManyTokens(address[] _investors, uint256[] _amounts) public onlyAuthority beforeSaleIsClosed returns (bool) { } /* ETH administration */ /** * @dev fund ETH */ function fundETH() public payable onlyAuthority { } /** * @dev refund unspent ETH many */ function refundManyUnspentETH(address[] _receivers) public onlyAuthority { } /** * @dev refund unspent ETH */ function refundUnspentETH(address _receiver) public onlyAuthority { } /** * @dev withdraw ETH funds */ function withdrawETHFunds() public onlyAuthority { } /** * @dev withdraw all ETH funds */ function withdrawAllETHFunds() public onlyAuthority { } /** * @dev allowed token investment */ function allowedTokenInvestment( uint256 _investorId, uint256 _contributionCHF) public view returns (uint256) { } /** * @dev withdraw ETH funds internal */ function withdrawETHFundsInternal() internal { } /** * @dev invest internal */ function investInternal( address _investor, uint256 _amountETH, uint256 _amountCHF) private { } /* Util */ /** * @dev current time */ function currentTime() private view returns (uint256) { } }
currentTime()>=startAt&&currentTime()<=endAt,"TOS02"
27,116
currentTime()>=startAt&&currentTime()<=endAt
"TOS03"
/** * @title Tokensale * @dev Tokensale contract * * @author Cyril Lapinte - <[email protected]> * * @notice Copyright © 2016 - 2018 Mt Pelerin Group SA - All Rights Reserved * @notice Please refer to the top of this file for the license. * * Error messages * TOS01: It must be before the sale is opened * TOS02: Sale must be open * TOS03: It must be before the sale is closed * TOS04: It must be after the sale is closed * TOS05: No data must be sent while sending ETH * TOS06: Share Purchase Agreement Hashes must match * TOS07: User/Investor must exist * TOS08: SPA must be accepted before any ETH investment * TOS09: Cannot update schedule once started * TOS10: Investor must exist * TOS11: Cannot allocate more tokens than available supply * TOS12: Length of InvestorIds and amounts arguments must match * TOS13: Investor must exist * TOS14: Must refund ETH unspent * TOS15: Must withdraw ETH to vaultETH * TOS16: Cannot invest onchain and offchain at the same time * TOS17: A ETHCHF rate must exist to invest * TOS18: User must be valid * TOS19: Cannot invest if no tokens are available * TOS20: Investment is below the minimal investment * TOS21: Cannot unspend more CHF than BASE_TOKEN_PRICE_CHF * TOS22: Token transfer must be successful */ contract Tokensale is ITokensale, Authority, Pausable { using SafeMath for uint256; uint32[5] contributionLimits = [ 5000, 500000, 1500000, 10000000, 25000000 ]; /* General sale details */ ERC20 public token; address public vaultETH; address public vaultERC20; IUserRegistry public userRegistry; IRatesProvider public ratesProvider; uint256 public minimalBalance = MINIMAL_BALANCE; bytes32 public sharePurchaseAgreementHash; uint256 public startAt = 4102441200; uint256 public endAt = 4102441200; uint256 public raisedETH; uint256 public raisedCHF; uint256 public totalRaisedCHF; uint256 public totalUnspentETH; uint256 public totalRefundedETH; uint256 public allocatedTokens; struct Investor { uint256 unspentETH; uint256 investedCHF; bool acceptedSPA; uint256 allocations; uint256 tokens; } mapping(uint256 => Investor) investors; mapping(uint256 => uint256) investorLimits; uint256 public investorCount; /** * @dev Throws unless before sale opening */ modifier beforeSaleIsOpened { } /** * @dev Throws if sale is not open */ modifier saleIsOpened { } /** * @dev Throws once the sale is closed */ modifier beforeSaleIsClosed { require(<FILL_ME>) _; } /** * @dev constructor */ constructor( ERC20 _token, IUserRegistry _userRegistry, IRatesProvider _ratesProvider, address _vaultERC20, address _vaultETH ) public { } /** * @dev fallback function */ function () external payable { } /** * @dev returns the token sold */ function token() public view returns (ERC20) { } /** * @dev returns the vault use to */ function vaultETH() public view returns (address) { } /** * @dev returns the vault to receive ETH */ function vaultERC20() public view returns (address) { } function userRegistry() public view returns (IUserRegistry) { } function ratesProvider() public view returns (IRatesProvider) { } function sharePurchaseAgreementHash() public view returns (bytes32) { } /* Sale status */ function startAt() public view returns (uint256) { } function endAt() public view returns (uint256) { } function raisedETH() public view returns (uint256) { } function raisedCHF() public view returns (uint256) { } function totalRaisedCHF() public view returns (uint256) { } function totalUnspentETH() public view returns (uint256) { } function totalRefundedETH() public view returns (uint256) { } function availableSupply() public view returns (uint256) { } /* Investor specific attributes */ function investorUnspentETH(uint256 _investorId) public view returns (uint256) { } function investorInvestedCHF(uint256 _investorId) public view returns (uint256) { } function investorAcceptedSPA(uint256 _investorId) public view returns (bool) { } function investorAllocations(uint256 _investorId) public view returns (uint256) { } function investorTokens(uint256 _investorId) public view returns (uint256) { } function investorCount() public view returns (uint256) { } function investorLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev get minimak auto withdraw threshold */ function minimalAutoWithdraw() public view returns (uint256) { } /** * @dev get minimal balance to maintain in contract */ function minimalBalance() public view returns (uint256) { } /** * @dev get base price in CHF cents */ function basePriceCHFCent() public view returns (uint256) { } /** * @dev contribution limit based on kyc level */ function contributionLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev update minimal balance to be kept in contract */ function updateMinimalBalance(uint256 _minimalBalance) public returns (uint256) { } /** * @dev define investor limit */ function updateInvestorLimits(uint256[] _investorIds, uint256 _limit) public returns (uint256) { } /* Share Purchase Agreement */ /** * @dev define SPA */ function defineSPA(bytes32 _sharePurchaseAgreementHash) public onlyOwner returns (bool) { } /** * @dev Accept SPA and invest if msg.value > 0 */ function acceptSPA(bytes32 _sharePurchaseAgreementHash) public beforeSaleIsClosed payable returns (bool) { } /* Investment */ function investETH() public saleIsOpened whenNotPaused payable { } /** * @dev add off chain investment */ function addOffChainInvestment(address _investor, uint256 _amountCHF) public onlyAuthority { } /* Schedule */ /** * @dev update schedule */ function updateSchedule(uint256 _startAt, uint256 _endAt) public onlyAuthority beforeSaleIsOpened { } /* Allocations admin */ /** * @dev allocate */ function allocateTokens(address _investor, uint256 _amount) public onlyAuthority beforeSaleIsClosed returns (bool) { } /** * @dev allocate many */ function allocateManyTokens(address[] _investors, uint256[] _amounts) public onlyAuthority beforeSaleIsClosed returns (bool) { } /* ETH administration */ /** * @dev fund ETH */ function fundETH() public payable onlyAuthority { } /** * @dev refund unspent ETH many */ function refundManyUnspentETH(address[] _receivers) public onlyAuthority { } /** * @dev refund unspent ETH */ function refundUnspentETH(address _receiver) public onlyAuthority { } /** * @dev withdraw ETH funds */ function withdrawETHFunds() public onlyAuthority { } /** * @dev withdraw all ETH funds */ function withdrawAllETHFunds() public onlyAuthority { } /** * @dev allowed token investment */ function allowedTokenInvestment( uint256 _investorId, uint256 _contributionCHF) public view returns (uint256) { } /** * @dev withdraw ETH funds internal */ function withdrawETHFundsInternal() internal { } /** * @dev invest internal */ function investInternal( address _investor, uint256 _amountETH, uint256 _amountCHF) private { } /* Util */ /** * @dev current time */ function currentTime() private view returns (uint256) { } }
currentTime()<=endAt,"TOS03"
27,116
currentTime()<=endAt
"TOS14"
/** * @title Tokensale * @dev Tokensale contract * * @author Cyril Lapinte - <[email protected]> * * @notice Copyright © 2016 - 2018 Mt Pelerin Group SA - All Rights Reserved * @notice Please refer to the top of this file for the license. * * Error messages * TOS01: It must be before the sale is opened * TOS02: Sale must be open * TOS03: It must be before the sale is closed * TOS04: It must be after the sale is closed * TOS05: No data must be sent while sending ETH * TOS06: Share Purchase Agreement Hashes must match * TOS07: User/Investor must exist * TOS08: SPA must be accepted before any ETH investment * TOS09: Cannot update schedule once started * TOS10: Investor must exist * TOS11: Cannot allocate more tokens than available supply * TOS12: Length of InvestorIds and amounts arguments must match * TOS13: Investor must exist * TOS14: Must refund ETH unspent * TOS15: Must withdraw ETH to vaultETH * TOS16: Cannot invest onchain and offchain at the same time * TOS17: A ETHCHF rate must exist to invest * TOS18: User must be valid * TOS19: Cannot invest if no tokens are available * TOS20: Investment is below the minimal investment * TOS21: Cannot unspend more CHF than BASE_TOKEN_PRICE_CHF * TOS22: Token transfer must be successful */ contract Tokensale is ITokensale, Authority, Pausable { using SafeMath for uint256; uint32[5] contributionLimits = [ 5000, 500000, 1500000, 10000000, 25000000 ]; /* General sale details */ ERC20 public token; address public vaultETH; address public vaultERC20; IUserRegistry public userRegistry; IRatesProvider public ratesProvider; uint256 public minimalBalance = MINIMAL_BALANCE; bytes32 public sharePurchaseAgreementHash; uint256 public startAt = 4102441200; uint256 public endAt = 4102441200; uint256 public raisedETH; uint256 public raisedCHF; uint256 public totalRaisedCHF; uint256 public totalUnspentETH; uint256 public totalRefundedETH; uint256 public allocatedTokens; struct Investor { uint256 unspentETH; uint256 investedCHF; bool acceptedSPA; uint256 allocations; uint256 tokens; } mapping(uint256 => Investor) investors; mapping(uint256 => uint256) investorLimits; uint256 public investorCount; /** * @dev Throws unless before sale opening */ modifier beforeSaleIsOpened { } /** * @dev Throws if sale is not open */ modifier saleIsOpened { } /** * @dev Throws once the sale is closed */ modifier beforeSaleIsClosed { } /** * @dev constructor */ constructor( ERC20 _token, IUserRegistry _userRegistry, IRatesProvider _ratesProvider, address _vaultERC20, address _vaultETH ) public { } /** * @dev fallback function */ function () external payable { } /** * @dev returns the token sold */ function token() public view returns (ERC20) { } /** * @dev returns the vault use to */ function vaultETH() public view returns (address) { } /** * @dev returns the vault to receive ETH */ function vaultERC20() public view returns (address) { } function userRegistry() public view returns (IUserRegistry) { } function ratesProvider() public view returns (IRatesProvider) { } function sharePurchaseAgreementHash() public view returns (bytes32) { } /* Sale status */ function startAt() public view returns (uint256) { } function endAt() public view returns (uint256) { } function raisedETH() public view returns (uint256) { } function raisedCHF() public view returns (uint256) { } function totalRaisedCHF() public view returns (uint256) { } function totalUnspentETH() public view returns (uint256) { } function totalRefundedETH() public view returns (uint256) { } function availableSupply() public view returns (uint256) { } /* Investor specific attributes */ function investorUnspentETH(uint256 _investorId) public view returns (uint256) { } function investorInvestedCHF(uint256 _investorId) public view returns (uint256) { } function investorAcceptedSPA(uint256 _investorId) public view returns (bool) { } function investorAllocations(uint256 _investorId) public view returns (uint256) { } function investorTokens(uint256 _investorId) public view returns (uint256) { } function investorCount() public view returns (uint256) { } function investorLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev get minimak auto withdraw threshold */ function minimalAutoWithdraw() public view returns (uint256) { } /** * @dev get minimal balance to maintain in contract */ function minimalBalance() public view returns (uint256) { } /** * @dev get base price in CHF cents */ function basePriceCHFCent() public view returns (uint256) { } /** * @dev contribution limit based on kyc level */ function contributionLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev update minimal balance to be kept in contract */ function updateMinimalBalance(uint256 _minimalBalance) public returns (uint256) { } /** * @dev define investor limit */ function updateInvestorLimits(uint256[] _investorIds, uint256 _limit) public returns (uint256) { } /* Share Purchase Agreement */ /** * @dev define SPA */ function defineSPA(bytes32 _sharePurchaseAgreementHash) public onlyOwner returns (bool) { } /** * @dev Accept SPA and invest if msg.value > 0 */ function acceptSPA(bytes32 _sharePurchaseAgreementHash) public beforeSaleIsClosed payable returns (bool) { } /* Investment */ function investETH() public saleIsOpened whenNotPaused payable { } /** * @dev add off chain investment */ function addOffChainInvestment(address _investor, uint256 _amountCHF) public onlyAuthority { } /* Schedule */ /** * @dev update schedule */ function updateSchedule(uint256 _startAt, uint256 _endAt) public onlyAuthority beforeSaleIsOpened { } /* Allocations admin */ /** * @dev allocate */ function allocateTokens(address _investor, uint256 _amount) public onlyAuthority beforeSaleIsClosed returns (bool) { } /** * @dev allocate many */ function allocateManyTokens(address[] _investors, uint256[] _amounts) public onlyAuthority beforeSaleIsClosed returns (bool) { } /* ETH administration */ /** * @dev fund ETH */ function fundETH() public payable onlyAuthority { } /** * @dev refund unspent ETH many */ function refundManyUnspentETH(address[] _receivers) public onlyAuthority { } /** * @dev refund unspent ETH */ function refundUnspentETH(address _receiver) public onlyAuthority { uint256 investorId = userRegistry.userId(_receiver); require(investorId != 0, "TOS13"); Investor storage investor = investors[investorId]; if (investor.unspentETH > 0) { // solium-disable-next-line security/no-send require(<FILL_ME>) totalRefundedETH = totalRefundedETH.add(investor.unspentETH); emit WithdrawETH(_receiver, investor.unspentETH); totalUnspentETH = totalUnspentETH.sub(investor.unspentETH); investor.unspentETH = 0; } } /** * @dev withdraw ETH funds */ function withdrawETHFunds() public onlyAuthority { } /** * @dev withdraw all ETH funds */ function withdrawAllETHFunds() public onlyAuthority { } /** * @dev allowed token investment */ function allowedTokenInvestment( uint256 _investorId, uint256 _contributionCHF) public view returns (uint256) { } /** * @dev withdraw ETH funds internal */ function withdrawETHFundsInternal() internal { } /** * @dev invest internal */ function investInternal( address _investor, uint256 _amountETH, uint256 _amountCHF) private { } /* Util */ /** * @dev current time */ function currentTime() private view returns (uint256) { } }
_receiver.send(investor.unspentETH),"TOS14"
27,116
_receiver.send(investor.unspentETH)
"TOS15"
/** * @title Tokensale * @dev Tokensale contract * * @author Cyril Lapinte - <[email protected]> * * @notice Copyright © 2016 - 2018 Mt Pelerin Group SA - All Rights Reserved * @notice Please refer to the top of this file for the license. * * Error messages * TOS01: It must be before the sale is opened * TOS02: Sale must be open * TOS03: It must be before the sale is closed * TOS04: It must be after the sale is closed * TOS05: No data must be sent while sending ETH * TOS06: Share Purchase Agreement Hashes must match * TOS07: User/Investor must exist * TOS08: SPA must be accepted before any ETH investment * TOS09: Cannot update schedule once started * TOS10: Investor must exist * TOS11: Cannot allocate more tokens than available supply * TOS12: Length of InvestorIds and amounts arguments must match * TOS13: Investor must exist * TOS14: Must refund ETH unspent * TOS15: Must withdraw ETH to vaultETH * TOS16: Cannot invest onchain and offchain at the same time * TOS17: A ETHCHF rate must exist to invest * TOS18: User must be valid * TOS19: Cannot invest if no tokens are available * TOS20: Investment is below the minimal investment * TOS21: Cannot unspend more CHF than BASE_TOKEN_PRICE_CHF * TOS22: Token transfer must be successful */ contract Tokensale is ITokensale, Authority, Pausable { using SafeMath for uint256; uint32[5] contributionLimits = [ 5000, 500000, 1500000, 10000000, 25000000 ]; /* General sale details */ ERC20 public token; address public vaultETH; address public vaultERC20; IUserRegistry public userRegistry; IRatesProvider public ratesProvider; uint256 public minimalBalance = MINIMAL_BALANCE; bytes32 public sharePurchaseAgreementHash; uint256 public startAt = 4102441200; uint256 public endAt = 4102441200; uint256 public raisedETH; uint256 public raisedCHF; uint256 public totalRaisedCHF; uint256 public totalUnspentETH; uint256 public totalRefundedETH; uint256 public allocatedTokens; struct Investor { uint256 unspentETH; uint256 investedCHF; bool acceptedSPA; uint256 allocations; uint256 tokens; } mapping(uint256 => Investor) investors; mapping(uint256 => uint256) investorLimits; uint256 public investorCount; /** * @dev Throws unless before sale opening */ modifier beforeSaleIsOpened { } /** * @dev Throws if sale is not open */ modifier saleIsOpened { } /** * @dev Throws once the sale is closed */ modifier beforeSaleIsClosed { } /** * @dev constructor */ constructor( ERC20 _token, IUserRegistry _userRegistry, IRatesProvider _ratesProvider, address _vaultERC20, address _vaultETH ) public { } /** * @dev fallback function */ function () external payable { } /** * @dev returns the token sold */ function token() public view returns (ERC20) { } /** * @dev returns the vault use to */ function vaultETH() public view returns (address) { } /** * @dev returns the vault to receive ETH */ function vaultERC20() public view returns (address) { } function userRegistry() public view returns (IUserRegistry) { } function ratesProvider() public view returns (IRatesProvider) { } function sharePurchaseAgreementHash() public view returns (bytes32) { } /* Sale status */ function startAt() public view returns (uint256) { } function endAt() public view returns (uint256) { } function raisedETH() public view returns (uint256) { } function raisedCHF() public view returns (uint256) { } function totalRaisedCHF() public view returns (uint256) { } function totalUnspentETH() public view returns (uint256) { } function totalRefundedETH() public view returns (uint256) { } function availableSupply() public view returns (uint256) { } /* Investor specific attributes */ function investorUnspentETH(uint256 _investorId) public view returns (uint256) { } function investorInvestedCHF(uint256 _investorId) public view returns (uint256) { } function investorAcceptedSPA(uint256 _investorId) public view returns (bool) { } function investorAllocations(uint256 _investorId) public view returns (uint256) { } function investorTokens(uint256 _investorId) public view returns (uint256) { } function investorCount() public view returns (uint256) { } function investorLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev get minimak auto withdraw threshold */ function minimalAutoWithdraw() public view returns (uint256) { } /** * @dev get minimal balance to maintain in contract */ function minimalBalance() public view returns (uint256) { } /** * @dev get base price in CHF cents */ function basePriceCHFCent() public view returns (uint256) { } /** * @dev contribution limit based on kyc level */ function contributionLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev update minimal balance to be kept in contract */ function updateMinimalBalance(uint256 _minimalBalance) public returns (uint256) { } /** * @dev define investor limit */ function updateInvestorLimits(uint256[] _investorIds, uint256 _limit) public returns (uint256) { } /* Share Purchase Agreement */ /** * @dev define SPA */ function defineSPA(bytes32 _sharePurchaseAgreementHash) public onlyOwner returns (bool) { } /** * @dev Accept SPA and invest if msg.value > 0 */ function acceptSPA(bytes32 _sharePurchaseAgreementHash) public beforeSaleIsClosed payable returns (bool) { } /* Investment */ function investETH() public saleIsOpened whenNotPaused payable { } /** * @dev add off chain investment */ function addOffChainInvestment(address _investor, uint256 _amountCHF) public onlyAuthority { } /* Schedule */ /** * @dev update schedule */ function updateSchedule(uint256 _startAt, uint256 _endAt) public onlyAuthority beforeSaleIsOpened { } /* Allocations admin */ /** * @dev allocate */ function allocateTokens(address _investor, uint256 _amount) public onlyAuthority beforeSaleIsClosed returns (bool) { } /** * @dev allocate many */ function allocateManyTokens(address[] _investors, uint256[] _amounts) public onlyAuthority beforeSaleIsClosed returns (bool) { } /* ETH administration */ /** * @dev fund ETH */ function fundETH() public payable onlyAuthority { } /** * @dev refund unspent ETH many */ function refundManyUnspentETH(address[] _receivers) public onlyAuthority { } /** * @dev refund unspent ETH */ function refundUnspentETH(address _receiver) public onlyAuthority { } /** * @dev withdraw ETH funds */ function withdrawETHFunds() public onlyAuthority { } /** * @dev withdraw all ETH funds */ function withdrawAllETHFunds() public onlyAuthority { uint256 balance = address(this).balance; // solium-disable-next-line security/no-send require(<FILL_ME>) emit WithdrawETH(vaultETH, balance); } /** * @dev allowed token investment */ function allowedTokenInvestment( uint256 _investorId, uint256 _contributionCHF) public view returns (uint256) { } /** * @dev withdraw ETH funds internal */ function withdrawETHFundsInternal() internal { } /** * @dev invest internal */ function investInternal( address _investor, uint256 _amountETH, uint256 _amountCHF) private { } /* Util */ /** * @dev current time */ function currentTime() private view returns (uint256) { } }
vaultETH.send(balance),"TOS15"
27,116
vaultETH.send(balance)
"TOS15"
/** * @title Tokensale * @dev Tokensale contract * * @author Cyril Lapinte - <[email protected]> * * @notice Copyright © 2016 - 2018 Mt Pelerin Group SA - All Rights Reserved * @notice Please refer to the top of this file for the license. * * Error messages * TOS01: It must be before the sale is opened * TOS02: Sale must be open * TOS03: It must be before the sale is closed * TOS04: It must be after the sale is closed * TOS05: No data must be sent while sending ETH * TOS06: Share Purchase Agreement Hashes must match * TOS07: User/Investor must exist * TOS08: SPA must be accepted before any ETH investment * TOS09: Cannot update schedule once started * TOS10: Investor must exist * TOS11: Cannot allocate more tokens than available supply * TOS12: Length of InvestorIds and amounts arguments must match * TOS13: Investor must exist * TOS14: Must refund ETH unspent * TOS15: Must withdraw ETH to vaultETH * TOS16: Cannot invest onchain and offchain at the same time * TOS17: A ETHCHF rate must exist to invest * TOS18: User must be valid * TOS19: Cannot invest if no tokens are available * TOS20: Investment is below the minimal investment * TOS21: Cannot unspend more CHF than BASE_TOKEN_PRICE_CHF * TOS22: Token transfer must be successful */ contract Tokensale is ITokensale, Authority, Pausable { using SafeMath for uint256; uint32[5] contributionLimits = [ 5000, 500000, 1500000, 10000000, 25000000 ]; /* General sale details */ ERC20 public token; address public vaultETH; address public vaultERC20; IUserRegistry public userRegistry; IRatesProvider public ratesProvider; uint256 public minimalBalance = MINIMAL_BALANCE; bytes32 public sharePurchaseAgreementHash; uint256 public startAt = 4102441200; uint256 public endAt = 4102441200; uint256 public raisedETH; uint256 public raisedCHF; uint256 public totalRaisedCHF; uint256 public totalUnspentETH; uint256 public totalRefundedETH; uint256 public allocatedTokens; struct Investor { uint256 unspentETH; uint256 investedCHF; bool acceptedSPA; uint256 allocations; uint256 tokens; } mapping(uint256 => Investor) investors; mapping(uint256 => uint256) investorLimits; uint256 public investorCount; /** * @dev Throws unless before sale opening */ modifier beforeSaleIsOpened { } /** * @dev Throws if sale is not open */ modifier saleIsOpened { } /** * @dev Throws once the sale is closed */ modifier beforeSaleIsClosed { } /** * @dev constructor */ constructor( ERC20 _token, IUserRegistry _userRegistry, IRatesProvider _ratesProvider, address _vaultERC20, address _vaultETH ) public { } /** * @dev fallback function */ function () external payable { } /** * @dev returns the token sold */ function token() public view returns (ERC20) { } /** * @dev returns the vault use to */ function vaultETH() public view returns (address) { } /** * @dev returns the vault to receive ETH */ function vaultERC20() public view returns (address) { } function userRegistry() public view returns (IUserRegistry) { } function ratesProvider() public view returns (IRatesProvider) { } function sharePurchaseAgreementHash() public view returns (bytes32) { } /* Sale status */ function startAt() public view returns (uint256) { } function endAt() public view returns (uint256) { } function raisedETH() public view returns (uint256) { } function raisedCHF() public view returns (uint256) { } function totalRaisedCHF() public view returns (uint256) { } function totalUnspentETH() public view returns (uint256) { } function totalRefundedETH() public view returns (uint256) { } function availableSupply() public view returns (uint256) { } /* Investor specific attributes */ function investorUnspentETH(uint256 _investorId) public view returns (uint256) { } function investorInvestedCHF(uint256 _investorId) public view returns (uint256) { } function investorAcceptedSPA(uint256 _investorId) public view returns (bool) { } function investorAllocations(uint256 _investorId) public view returns (uint256) { } function investorTokens(uint256 _investorId) public view returns (uint256) { } function investorCount() public view returns (uint256) { } function investorLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev get minimak auto withdraw threshold */ function minimalAutoWithdraw() public view returns (uint256) { } /** * @dev get minimal balance to maintain in contract */ function minimalBalance() public view returns (uint256) { } /** * @dev get base price in CHF cents */ function basePriceCHFCent() public view returns (uint256) { } /** * @dev contribution limit based on kyc level */ function contributionLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev update minimal balance to be kept in contract */ function updateMinimalBalance(uint256 _minimalBalance) public returns (uint256) { } /** * @dev define investor limit */ function updateInvestorLimits(uint256[] _investorIds, uint256 _limit) public returns (uint256) { } /* Share Purchase Agreement */ /** * @dev define SPA */ function defineSPA(bytes32 _sharePurchaseAgreementHash) public onlyOwner returns (bool) { } /** * @dev Accept SPA and invest if msg.value > 0 */ function acceptSPA(bytes32 _sharePurchaseAgreementHash) public beforeSaleIsClosed payable returns (bool) { } /* Investment */ function investETH() public saleIsOpened whenNotPaused payable { } /** * @dev add off chain investment */ function addOffChainInvestment(address _investor, uint256 _amountCHF) public onlyAuthority { } /* Schedule */ /** * @dev update schedule */ function updateSchedule(uint256 _startAt, uint256 _endAt) public onlyAuthority beforeSaleIsOpened { } /* Allocations admin */ /** * @dev allocate */ function allocateTokens(address _investor, uint256 _amount) public onlyAuthority beforeSaleIsClosed returns (bool) { } /** * @dev allocate many */ function allocateManyTokens(address[] _investors, uint256[] _amounts) public onlyAuthority beforeSaleIsClosed returns (bool) { } /* ETH administration */ /** * @dev fund ETH */ function fundETH() public payable onlyAuthority { } /** * @dev refund unspent ETH many */ function refundManyUnspentETH(address[] _receivers) public onlyAuthority { } /** * @dev refund unspent ETH */ function refundUnspentETH(address _receiver) public onlyAuthority { } /** * @dev withdraw ETH funds */ function withdrawETHFunds() public onlyAuthority { } /** * @dev withdraw all ETH funds */ function withdrawAllETHFunds() public onlyAuthority { } /** * @dev allowed token investment */ function allowedTokenInvestment( uint256 _investorId, uint256 _contributionCHF) public view returns (uint256) { } /** * @dev withdraw ETH funds internal */ function withdrawETHFundsInternal() internal { uint256 balance = address(this).balance; if (balance > totalUnspentETH && balance > minimalBalance) { uint256 amount = balance.sub(minimalBalance); // solium-disable-next-line security/no-send require(<FILL_ME>) emit WithdrawETH(vaultETH, amount); } } /** * @dev invest internal */ function investInternal( address _investor, uint256 _amountETH, uint256 _amountCHF) private { } /* Util */ /** * @dev current time */ function currentTime() private view returns (uint256) { } }
vaultETH.send(amount),"TOS15"
27,116
vaultETH.send(amount)
"TOS17"
/** * @title Tokensale * @dev Tokensale contract * * @author Cyril Lapinte - <[email protected]> * * @notice Copyright © 2016 - 2018 Mt Pelerin Group SA - All Rights Reserved * @notice Please refer to the top of this file for the license. * * Error messages * TOS01: It must be before the sale is opened * TOS02: Sale must be open * TOS03: It must be before the sale is closed * TOS04: It must be after the sale is closed * TOS05: No data must be sent while sending ETH * TOS06: Share Purchase Agreement Hashes must match * TOS07: User/Investor must exist * TOS08: SPA must be accepted before any ETH investment * TOS09: Cannot update schedule once started * TOS10: Investor must exist * TOS11: Cannot allocate more tokens than available supply * TOS12: Length of InvestorIds and amounts arguments must match * TOS13: Investor must exist * TOS14: Must refund ETH unspent * TOS15: Must withdraw ETH to vaultETH * TOS16: Cannot invest onchain and offchain at the same time * TOS17: A ETHCHF rate must exist to invest * TOS18: User must be valid * TOS19: Cannot invest if no tokens are available * TOS20: Investment is below the minimal investment * TOS21: Cannot unspend more CHF than BASE_TOKEN_PRICE_CHF * TOS22: Token transfer must be successful */ contract Tokensale is ITokensale, Authority, Pausable { using SafeMath for uint256; uint32[5] contributionLimits = [ 5000, 500000, 1500000, 10000000, 25000000 ]; /* General sale details */ ERC20 public token; address public vaultETH; address public vaultERC20; IUserRegistry public userRegistry; IRatesProvider public ratesProvider; uint256 public minimalBalance = MINIMAL_BALANCE; bytes32 public sharePurchaseAgreementHash; uint256 public startAt = 4102441200; uint256 public endAt = 4102441200; uint256 public raisedETH; uint256 public raisedCHF; uint256 public totalRaisedCHF; uint256 public totalUnspentETH; uint256 public totalRefundedETH; uint256 public allocatedTokens; struct Investor { uint256 unspentETH; uint256 investedCHF; bool acceptedSPA; uint256 allocations; uint256 tokens; } mapping(uint256 => Investor) investors; mapping(uint256 => uint256) investorLimits; uint256 public investorCount; /** * @dev Throws unless before sale opening */ modifier beforeSaleIsOpened { } /** * @dev Throws if sale is not open */ modifier saleIsOpened { } /** * @dev Throws once the sale is closed */ modifier beforeSaleIsClosed { } /** * @dev constructor */ constructor( ERC20 _token, IUserRegistry _userRegistry, IRatesProvider _ratesProvider, address _vaultERC20, address _vaultETH ) public { } /** * @dev fallback function */ function () external payable { } /** * @dev returns the token sold */ function token() public view returns (ERC20) { } /** * @dev returns the vault use to */ function vaultETH() public view returns (address) { } /** * @dev returns the vault to receive ETH */ function vaultERC20() public view returns (address) { } function userRegistry() public view returns (IUserRegistry) { } function ratesProvider() public view returns (IRatesProvider) { } function sharePurchaseAgreementHash() public view returns (bytes32) { } /* Sale status */ function startAt() public view returns (uint256) { } function endAt() public view returns (uint256) { } function raisedETH() public view returns (uint256) { } function raisedCHF() public view returns (uint256) { } function totalRaisedCHF() public view returns (uint256) { } function totalUnspentETH() public view returns (uint256) { } function totalRefundedETH() public view returns (uint256) { } function availableSupply() public view returns (uint256) { } /* Investor specific attributes */ function investorUnspentETH(uint256 _investorId) public view returns (uint256) { } function investorInvestedCHF(uint256 _investorId) public view returns (uint256) { } function investorAcceptedSPA(uint256 _investorId) public view returns (bool) { } function investorAllocations(uint256 _investorId) public view returns (uint256) { } function investorTokens(uint256 _investorId) public view returns (uint256) { } function investorCount() public view returns (uint256) { } function investorLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev get minimak auto withdraw threshold */ function minimalAutoWithdraw() public view returns (uint256) { } /** * @dev get minimal balance to maintain in contract */ function minimalBalance() public view returns (uint256) { } /** * @dev get base price in CHF cents */ function basePriceCHFCent() public view returns (uint256) { } /** * @dev contribution limit based on kyc level */ function contributionLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev update minimal balance to be kept in contract */ function updateMinimalBalance(uint256 _minimalBalance) public returns (uint256) { } /** * @dev define investor limit */ function updateInvestorLimits(uint256[] _investorIds, uint256 _limit) public returns (uint256) { } /* Share Purchase Agreement */ /** * @dev define SPA */ function defineSPA(bytes32 _sharePurchaseAgreementHash) public onlyOwner returns (bool) { } /** * @dev Accept SPA and invest if msg.value > 0 */ function acceptSPA(bytes32 _sharePurchaseAgreementHash) public beforeSaleIsClosed payable returns (bool) { } /* Investment */ function investETH() public saleIsOpened whenNotPaused payable { } /** * @dev add off chain investment */ function addOffChainInvestment(address _investor, uint256 _amountCHF) public onlyAuthority { } /* Schedule */ /** * @dev update schedule */ function updateSchedule(uint256 _startAt, uint256 _endAt) public onlyAuthority beforeSaleIsOpened { } /* Allocations admin */ /** * @dev allocate */ function allocateTokens(address _investor, uint256 _amount) public onlyAuthority beforeSaleIsClosed returns (bool) { } /** * @dev allocate many */ function allocateManyTokens(address[] _investors, uint256[] _amounts) public onlyAuthority beforeSaleIsClosed returns (bool) { } /* ETH administration */ /** * @dev fund ETH */ function fundETH() public payable onlyAuthority { } /** * @dev refund unspent ETH many */ function refundManyUnspentETH(address[] _receivers) public onlyAuthority { } /** * @dev refund unspent ETH */ function refundUnspentETH(address _receiver) public onlyAuthority { } /** * @dev withdraw ETH funds */ function withdrawETHFunds() public onlyAuthority { } /** * @dev withdraw all ETH funds */ function withdrawAllETHFunds() public onlyAuthority { } /** * @dev allowed token investment */ function allowedTokenInvestment( uint256 _investorId, uint256 _contributionCHF) public view returns (uint256) { } /** * @dev withdraw ETH funds internal */ function withdrawETHFundsInternal() internal { } /** * @dev invest internal */ function investInternal( address _investor, uint256 _amountETH, uint256 _amountCHF) private { // investment with _amountETH is decentralized // investment with _amountCHF is centralized // They are mutually exclusive bool isInvesting = ( _amountETH != 0 && _amountCHF == 0 ) || ( _amountETH == 0 && _amountCHF != 0 ); require(isInvesting, "TOS16"); require(<FILL_ME>) uint256 investorId = userRegistry.userId(_investor); require(userRegistry.isValid(investorId), "TOS18"); Investor storage investor = investors[investorId]; uint256 contributionCHF = ratesProvider.convertWEIToCHFCent( investor.unspentETH); if (_amountETH > 0) { contributionCHF = contributionCHF.add( ratesProvider.convertWEIToCHFCent(_amountETH)); } if (_amountCHF > 0) { contributionCHF = contributionCHF.add(_amountCHF); } uint256 tokens = allowedTokenInvestment(investorId, contributionCHF); require(tokens != 0, "TOS19"); /** Calculating unspentETH value **/ uint256 investedCHF = tokens.mul(BASE_PRICE_CHF_CENT); uint256 unspentContributionCHF = contributionCHF.sub(investedCHF); uint256 unspentETH = 0; if (unspentContributionCHF != 0) { if (_amountCHF > 0) { // Prevent CHF investment LARGER than available supply // from creating a too large and dangerous unspentETH value require(unspentContributionCHF < BASE_PRICE_CHF_CENT, "TOS21"); } unspentETH = ratesProvider.convertCHFCentToWEI( unspentContributionCHF); } /** Spent ETH **/ uint256 spentETH = 0; if (investor.unspentETH == unspentETH) { spentETH = _amountETH; } else { uint256 unspentETHDiff = (unspentETH > investor.unspentETH) ? unspentETH.sub(investor.unspentETH) : investor.unspentETH.sub(unspentETH); if (_amountCHF > 0) { if (unspentETH < investor.unspentETH) { spentETH = unspentETHDiff; } // if unspentETH > investor.unspentETH // then CHF has been converted into ETH // and no ETH were spent } if (_amountETH > 0) { spentETH = (unspentETH > investor.unspentETH) ? _amountETH.sub(unspentETHDiff) : _amountETH.add(unspentETHDiff); } } totalUnspentETH = totalUnspentETH.sub( investor.unspentETH).add(unspentETH); investor.unspentETH = unspentETH; investor.investedCHF = investor.investedCHF.add(investedCHF); investor.tokens = investor.tokens.add(tokens); raisedCHF = raisedCHF.add(_amountCHF); raisedETH = raisedETH.add(spentETH); totalRaisedCHF = totalRaisedCHF.add(investedCHF); allocatedTokens = allocatedTokens.sub(investor.allocations); investor.allocations = (investor.allocations > tokens) ? investor.allocations.sub(tokens) : 0; allocatedTokens = allocatedTokens.add(investor.allocations); require( token.transferFrom(vaultERC20, _investor, tokens), "TOS22"); if (spentETH > 0) { emit ChangeETHCHF( _investor, spentETH, ratesProvider.convertWEIToCHFCent(spentETH), ratesProvider.rateWEIPerCHFCent()); } emit Investment(investorId, investedCHF); } /* Util */ /** * @dev current time */ function currentTime() private view returns (uint256) { } }
ratesProvider.rateWEIPerCHFCent()!=0,"TOS17"
27,116
ratesProvider.rateWEIPerCHFCent()!=0
"TOS18"
/** * @title Tokensale * @dev Tokensale contract * * @author Cyril Lapinte - <[email protected]> * * @notice Copyright © 2016 - 2018 Mt Pelerin Group SA - All Rights Reserved * @notice Please refer to the top of this file for the license. * * Error messages * TOS01: It must be before the sale is opened * TOS02: Sale must be open * TOS03: It must be before the sale is closed * TOS04: It must be after the sale is closed * TOS05: No data must be sent while sending ETH * TOS06: Share Purchase Agreement Hashes must match * TOS07: User/Investor must exist * TOS08: SPA must be accepted before any ETH investment * TOS09: Cannot update schedule once started * TOS10: Investor must exist * TOS11: Cannot allocate more tokens than available supply * TOS12: Length of InvestorIds and amounts arguments must match * TOS13: Investor must exist * TOS14: Must refund ETH unspent * TOS15: Must withdraw ETH to vaultETH * TOS16: Cannot invest onchain and offchain at the same time * TOS17: A ETHCHF rate must exist to invest * TOS18: User must be valid * TOS19: Cannot invest if no tokens are available * TOS20: Investment is below the minimal investment * TOS21: Cannot unspend more CHF than BASE_TOKEN_PRICE_CHF * TOS22: Token transfer must be successful */ contract Tokensale is ITokensale, Authority, Pausable { using SafeMath for uint256; uint32[5] contributionLimits = [ 5000, 500000, 1500000, 10000000, 25000000 ]; /* General sale details */ ERC20 public token; address public vaultETH; address public vaultERC20; IUserRegistry public userRegistry; IRatesProvider public ratesProvider; uint256 public minimalBalance = MINIMAL_BALANCE; bytes32 public sharePurchaseAgreementHash; uint256 public startAt = 4102441200; uint256 public endAt = 4102441200; uint256 public raisedETH; uint256 public raisedCHF; uint256 public totalRaisedCHF; uint256 public totalUnspentETH; uint256 public totalRefundedETH; uint256 public allocatedTokens; struct Investor { uint256 unspentETH; uint256 investedCHF; bool acceptedSPA; uint256 allocations; uint256 tokens; } mapping(uint256 => Investor) investors; mapping(uint256 => uint256) investorLimits; uint256 public investorCount; /** * @dev Throws unless before sale opening */ modifier beforeSaleIsOpened { } /** * @dev Throws if sale is not open */ modifier saleIsOpened { } /** * @dev Throws once the sale is closed */ modifier beforeSaleIsClosed { } /** * @dev constructor */ constructor( ERC20 _token, IUserRegistry _userRegistry, IRatesProvider _ratesProvider, address _vaultERC20, address _vaultETH ) public { } /** * @dev fallback function */ function () external payable { } /** * @dev returns the token sold */ function token() public view returns (ERC20) { } /** * @dev returns the vault use to */ function vaultETH() public view returns (address) { } /** * @dev returns the vault to receive ETH */ function vaultERC20() public view returns (address) { } function userRegistry() public view returns (IUserRegistry) { } function ratesProvider() public view returns (IRatesProvider) { } function sharePurchaseAgreementHash() public view returns (bytes32) { } /* Sale status */ function startAt() public view returns (uint256) { } function endAt() public view returns (uint256) { } function raisedETH() public view returns (uint256) { } function raisedCHF() public view returns (uint256) { } function totalRaisedCHF() public view returns (uint256) { } function totalUnspentETH() public view returns (uint256) { } function totalRefundedETH() public view returns (uint256) { } function availableSupply() public view returns (uint256) { } /* Investor specific attributes */ function investorUnspentETH(uint256 _investorId) public view returns (uint256) { } function investorInvestedCHF(uint256 _investorId) public view returns (uint256) { } function investorAcceptedSPA(uint256 _investorId) public view returns (bool) { } function investorAllocations(uint256 _investorId) public view returns (uint256) { } function investorTokens(uint256 _investorId) public view returns (uint256) { } function investorCount() public view returns (uint256) { } function investorLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev get minimak auto withdraw threshold */ function minimalAutoWithdraw() public view returns (uint256) { } /** * @dev get minimal balance to maintain in contract */ function minimalBalance() public view returns (uint256) { } /** * @dev get base price in CHF cents */ function basePriceCHFCent() public view returns (uint256) { } /** * @dev contribution limit based on kyc level */ function contributionLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev update minimal balance to be kept in contract */ function updateMinimalBalance(uint256 _minimalBalance) public returns (uint256) { } /** * @dev define investor limit */ function updateInvestorLimits(uint256[] _investorIds, uint256 _limit) public returns (uint256) { } /* Share Purchase Agreement */ /** * @dev define SPA */ function defineSPA(bytes32 _sharePurchaseAgreementHash) public onlyOwner returns (bool) { } /** * @dev Accept SPA and invest if msg.value > 0 */ function acceptSPA(bytes32 _sharePurchaseAgreementHash) public beforeSaleIsClosed payable returns (bool) { } /* Investment */ function investETH() public saleIsOpened whenNotPaused payable { } /** * @dev add off chain investment */ function addOffChainInvestment(address _investor, uint256 _amountCHF) public onlyAuthority { } /* Schedule */ /** * @dev update schedule */ function updateSchedule(uint256 _startAt, uint256 _endAt) public onlyAuthority beforeSaleIsOpened { } /* Allocations admin */ /** * @dev allocate */ function allocateTokens(address _investor, uint256 _amount) public onlyAuthority beforeSaleIsClosed returns (bool) { } /** * @dev allocate many */ function allocateManyTokens(address[] _investors, uint256[] _amounts) public onlyAuthority beforeSaleIsClosed returns (bool) { } /* ETH administration */ /** * @dev fund ETH */ function fundETH() public payable onlyAuthority { } /** * @dev refund unspent ETH many */ function refundManyUnspentETH(address[] _receivers) public onlyAuthority { } /** * @dev refund unspent ETH */ function refundUnspentETH(address _receiver) public onlyAuthority { } /** * @dev withdraw ETH funds */ function withdrawETHFunds() public onlyAuthority { } /** * @dev withdraw all ETH funds */ function withdrawAllETHFunds() public onlyAuthority { } /** * @dev allowed token investment */ function allowedTokenInvestment( uint256 _investorId, uint256 _contributionCHF) public view returns (uint256) { } /** * @dev withdraw ETH funds internal */ function withdrawETHFundsInternal() internal { } /** * @dev invest internal */ function investInternal( address _investor, uint256 _amountETH, uint256 _amountCHF) private { // investment with _amountETH is decentralized // investment with _amountCHF is centralized // They are mutually exclusive bool isInvesting = ( _amountETH != 0 && _amountCHF == 0 ) || ( _amountETH == 0 && _amountCHF != 0 ); require(isInvesting, "TOS16"); require(ratesProvider.rateWEIPerCHFCent() != 0, "TOS17"); uint256 investorId = userRegistry.userId(_investor); require(<FILL_ME>) Investor storage investor = investors[investorId]; uint256 contributionCHF = ratesProvider.convertWEIToCHFCent( investor.unspentETH); if (_amountETH > 0) { contributionCHF = contributionCHF.add( ratesProvider.convertWEIToCHFCent(_amountETH)); } if (_amountCHF > 0) { contributionCHF = contributionCHF.add(_amountCHF); } uint256 tokens = allowedTokenInvestment(investorId, contributionCHF); require(tokens != 0, "TOS19"); /** Calculating unspentETH value **/ uint256 investedCHF = tokens.mul(BASE_PRICE_CHF_CENT); uint256 unspentContributionCHF = contributionCHF.sub(investedCHF); uint256 unspentETH = 0; if (unspentContributionCHF != 0) { if (_amountCHF > 0) { // Prevent CHF investment LARGER than available supply // from creating a too large and dangerous unspentETH value require(unspentContributionCHF < BASE_PRICE_CHF_CENT, "TOS21"); } unspentETH = ratesProvider.convertCHFCentToWEI( unspentContributionCHF); } /** Spent ETH **/ uint256 spentETH = 0; if (investor.unspentETH == unspentETH) { spentETH = _amountETH; } else { uint256 unspentETHDiff = (unspentETH > investor.unspentETH) ? unspentETH.sub(investor.unspentETH) : investor.unspentETH.sub(unspentETH); if (_amountCHF > 0) { if (unspentETH < investor.unspentETH) { spentETH = unspentETHDiff; } // if unspentETH > investor.unspentETH // then CHF has been converted into ETH // and no ETH were spent } if (_amountETH > 0) { spentETH = (unspentETH > investor.unspentETH) ? _amountETH.sub(unspentETHDiff) : _amountETH.add(unspentETHDiff); } } totalUnspentETH = totalUnspentETH.sub( investor.unspentETH).add(unspentETH); investor.unspentETH = unspentETH; investor.investedCHF = investor.investedCHF.add(investedCHF); investor.tokens = investor.tokens.add(tokens); raisedCHF = raisedCHF.add(_amountCHF); raisedETH = raisedETH.add(spentETH); totalRaisedCHF = totalRaisedCHF.add(investedCHF); allocatedTokens = allocatedTokens.sub(investor.allocations); investor.allocations = (investor.allocations > tokens) ? investor.allocations.sub(tokens) : 0; allocatedTokens = allocatedTokens.add(investor.allocations); require( token.transferFrom(vaultERC20, _investor, tokens), "TOS22"); if (spentETH > 0) { emit ChangeETHCHF( _investor, spentETH, ratesProvider.convertWEIToCHFCent(spentETH), ratesProvider.rateWEIPerCHFCent()); } emit Investment(investorId, investedCHF); } /* Util */ /** * @dev current time */ function currentTime() private view returns (uint256) { } }
userRegistry.isValid(investorId),"TOS18"
27,116
userRegistry.isValid(investorId)
"TOS22"
/** * @title Tokensale * @dev Tokensale contract * * @author Cyril Lapinte - <[email protected]> * * @notice Copyright © 2016 - 2018 Mt Pelerin Group SA - All Rights Reserved * @notice Please refer to the top of this file for the license. * * Error messages * TOS01: It must be before the sale is opened * TOS02: Sale must be open * TOS03: It must be before the sale is closed * TOS04: It must be after the sale is closed * TOS05: No data must be sent while sending ETH * TOS06: Share Purchase Agreement Hashes must match * TOS07: User/Investor must exist * TOS08: SPA must be accepted before any ETH investment * TOS09: Cannot update schedule once started * TOS10: Investor must exist * TOS11: Cannot allocate more tokens than available supply * TOS12: Length of InvestorIds and amounts arguments must match * TOS13: Investor must exist * TOS14: Must refund ETH unspent * TOS15: Must withdraw ETH to vaultETH * TOS16: Cannot invest onchain and offchain at the same time * TOS17: A ETHCHF rate must exist to invest * TOS18: User must be valid * TOS19: Cannot invest if no tokens are available * TOS20: Investment is below the minimal investment * TOS21: Cannot unspend more CHF than BASE_TOKEN_PRICE_CHF * TOS22: Token transfer must be successful */ contract Tokensale is ITokensale, Authority, Pausable { using SafeMath for uint256; uint32[5] contributionLimits = [ 5000, 500000, 1500000, 10000000, 25000000 ]; /* General sale details */ ERC20 public token; address public vaultETH; address public vaultERC20; IUserRegistry public userRegistry; IRatesProvider public ratesProvider; uint256 public minimalBalance = MINIMAL_BALANCE; bytes32 public sharePurchaseAgreementHash; uint256 public startAt = 4102441200; uint256 public endAt = 4102441200; uint256 public raisedETH; uint256 public raisedCHF; uint256 public totalRaisedCHF; uint256 public totalUnspentETH; uint256 public totalRefundedETH; uint256 public allocatedTokens; struct Investor { uint256 unspentETH; uint256 investedCHF; bool acceptedSPA; uint256 allocations; uint256 tokens; } mapping(uint256 => Investor) investors; mapping(uint256 => uint256) investorLimits; uint256 public investorCount; /** * @dev Throws unless before sale opening */ modifier beforeSaleIsOpened { } /** * @dev Throws if sale is not open */ modifier saleIsOpened { } /** * @dev Throws once the sale is closed */ modifier beforeSaleIsClosed { } /** * @dev constructor */ constructor( ERC20 _token, IUserRegistry _userRegistry, IRatesProvider _ratesProvider, address _vaultERC20, address _vaultETH ) public { } /** * @dev fallback function */ function () external payable { } /** * @dev returns the token sold */ function token() public view returns (ERC20) { } /** * @dev returns the vault use to */ function vaultETH() public view returns (address) { } /** * @dev returns the vault to receive ETH */ function vaultERC20() public view returns (address) { } function userRegistry() public view returns (IUserRegistry) { } function ratesProvider() public view returns (IRatesProvider) { } function sharePurchaseAgreementHash() public view returns (bytes32) { } /* Sale status */ function startAt() public view returns (uint256) { } function endAt() public view returns (uint256) { } function raisedETH() public view returns (uint256) { } function raisedCHF() public view returns (uint256) { } function totalRaisedCHF() public view returns (uint256) { } function totalUnspentETH() public view returns (uint256) { } function totalRefundedETH() public view returns (uint256) { } function availableSupply() public view returns (uint256) { } /* Investor specific attributes */ function investorUnspentETH(uint256 _investorId) public view returns (uint256) { } function investorInvestedCHF(uint256 _investorId) public view returns (uint256) { } function investorAcceptedSPA(uint256 _investorId) public view returns (bool) { } function investorAllocations(uint256 _investorId) public view returns (uint256) { } function investorTokens(uint256 _investorId) public view returns (uint256) { } function investorCount() public view returns (uint256) { } function investorLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev get minimak auto withdraw threshold */ function minimalAutoWithdraw() public view returns (uint256) { } /** * @dev get minimal balance to maintain in contract */ function minimalBalance() public view returns (uint256) { } /** * @dev get base price in CHF cents */ function basePriceCHFCent() public view returns (uint256) { } /** * @dev contribution limit based on kyc level */ function contributionLimit(uint256 _investorId) public view returns (uint256) { } /** * @dev update minimal balance to be kept in contract */ function updateMinimalBalance(uint256 _minimalBalance) public returns (uint256) { } /** * @dev define investor limit */ function updateInvestorLimits(uint256[] _investorIds, uint256 _limit) public returns (uint256) { } /* Share Purchase Agreement */ /** * @dev define SPA */ function defineSPA(bytes32 _sharePurchaseAgreementHash) public onlyOwner returns (bool) { } /** * @dev Accept SPA and invest if msg.value > 0 */ function acceptSPA(bytes32 _sharePurchaseAgreementHash) public beforeSaleIsClosed payable returns (bool) { } /* Investment */ function investETH() public saleIsOpened whenNotPaused payable { } /** * @dev add off chain investment */ function addOffChainInvestment(address _investor, uint256 _amountCHF) public onlyAuthority { } /* Schedule */ /** * @dev update schedule */ function updateSchedule(uint256 _startAt, uint256 _endAt) public onlyAuthority beforeSaleIsOpened { } /* Allocations admin */ /** * @dev allocate */ function allocateTokens(address _investor, uint256 _amount) public onlyAuthority beforeSaleIsClosed returns (bool) { } /** * @dev allocate many */ function allocateManyTokens(address[] _investors, uint256[] _amounts) public onlyAuthority beforeSaleIsClosed returns (bool) { } /* ETH administration */ /** * @dev fund ETH */ function fundETH() public payable onlyAuthority { } /** * @dev refund unspent ETH many */ function refundManyUnspentETH(address[] _receivers) public onlyAuthority { } /** * @dev refund unspent ETH */ function refundUnspentETH(address _receiver) public onlyAuthority { } /** * @dev withdraw ETH funds */ function withdrawETHFunds() public onlyAuthority { } /** * @dev withdraw all ETH funds */ function withdrawAllETHFunds() public onlyAuthority { } /** * @dev allowed token investment */ function allowedTokenInvestment( uint256 _investorId, uint256 _contributionCHF) public view returns (uint256) { } /** * @dev withdraw ETH funds internal */ function withdrawETHFundsInternal() internal { } /** * @dev invest internal */ function investInternal( address _investor, uint256 _amountETH, uint256 _amountCHF) private { // investment with _amountETH is decentralized // investment with _amountCHF is centralized // They are mutually exclusive bool isInvesting = ( _amountETH != 0 && _amountCHF == 0 ) || ( _amountETH == 0 && _amountCHF != 0 ); require(isInvesting, "TOS16"); require(ratesProvider.rateWEIPerCHFCent() != 0, "TOS17"); uint256 investorId = userRegistry.userId(_investor); require(userRegistry.isValid(investorId), "TOS18"); Investor storage investor = investors[investorId]; uint256 contributionCHF = ratesProvider.convertWEIToCHFCent( investor.unspentETH); if (_amountETH > 0) { contributionCHF = contributionCHF.add( ratesProvider.convertWEIToCHFCent(_amountETH)); } if (_amountCHF > 0) { contributionCHF = contributionCHF.add(_amountCHF); } uint256 tokens = allowedTokenInvestment(investorId, contributionCHF); require(tokens != 0, "TOS19"); /** Calculating unspentETH value **/ uint256 investedCHF = tokens.mul(BASE_PRICE_CHF_CENT); uint256 unspentContributionCHF = contributionCHF.sub(investedCHF); uint256 unspentETH = 0; if (unspentContributionCHF != 0) { if (_amountCHF > 0) { // Prevent CHF investment LARGER than available supply // from creating a too large and dangerous unspentETH value require(unspentContributionCHF < BASE_PRICE_CHF_CENT, "TOS21"); } unspentETH = ratesProvider.convertCHFCentToWEI( unspentContributionCHF); } /** Spent ETH **/ uint256 spentETH = 0; if (investor.unspentETH == unspentETH) { spentETH = _amountETH; } else { uint256 unspentETHDiff = (unspentETH > investor.unspentETH) ? unspentETH.sub(investor.unspentETH) : investor.unspentETH.sub(unspentETH); if (_amountCHF > 0) { if (unspentETH < investor.unspentETH) { spentETH = unspentETHDiff; } // if unspentETH > investor.unspentETH // then CHF has been converted into ETH // and no ETH were spent } if (_amountETH > 0) { spentETH = (unspentETH > investor.unspentETH) ? _amountETH.sub(unspentETHDiff) : _amountETH.add(unspentETHDiff); } } totalUnspentETH = totalUnspentETH.sub( investor.unspentETH).add(unspentETH); investor.unspentETH = unspentETH; investor.investedCHF = investor.investedCHF.add(investedCHF); investor.tokens = investor.tokens.add(tokens); raisedCHF = raisedCHF.add(_amountCHF); raisedETH = raisedETH.add(spentETH); totalRaisedCHF = totalRaisedCHF.add(investedCHF); allocatedTokens = allocatedTokens.sub(investor.allocations); investor.allocations = (investor.allocations > tokens) ? investor.allocations.sub(tokens) : 0; allocatedTokens = allocatedTokens.add(investor.allocations); require(<FILL_ME>) if (spentETH > 0) { emit ChangeETHCHF( _investor, spentETH, ratesProvider.convertWEIToCHFCent(spentETH), ratesProvider.rateWEIPerCHFCent()); } emit Investment(investorId, investedCHF); } /* Util */ /** * @dev current time */ function currentTime() private view returns (uint256) { } }
token.transferFrom(vaultERC20,_investor,tokens),"TOS22"
27,116
token.transferFrom(vaultERC20,_investor,tokens)
"Cannot notify until previous reward session is completed"
pragma solidity ^0.5.0; library Math { function max(uint256 a, uint256 b) internal pure returns (uint256) { } function min(uint256 a, uint256 b) internal pure returns (uint256) { } function average(uint256 a, uint256 b) internal pure returns (uint256) { } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } contract Context { constructor() internal {} function _msgSender() internal view returns (address payable) { } function _msgData() internal view returns (bytes memory) { } } contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() internal { } function owner() public view returns (address) { } modifier onlyOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function _transferOwnership(address newOwner) internal { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library Address { function isContract(address account) internal view returns (bool) { } function toPayable(address account) internal pure returns (address payable) { } function sendValue(address payable recipient, uint256 amount) internal { } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { } function safeApprove( IERC20 token, address spender, uint256 value ) internal { } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { } function callOptionalReturn(IERC20 token, bytes memory data) private { } } contract LPTokenWrapper is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 public BUND_ETH = IERC20(0xEd86244cd91f4072C7c5b7F8Ec3A2E97EA31B693); // LP Token Here uint256 private _totalSupply; mapping(address => uint256) private _balances; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function stake(uint256 amount) public { } function withdraw(uint256 amount) public { } } contract StakeBUND_LP is LPTokenWrapper { IERC20 public bundNFT = IERC20(0x92B3367515a7D2dF838c2ccD9F5e1Fc07D977C20); // Reward Token Here uint256 public constant duration = 30 days; uint256 public starttime = 1614749400; //-----| Starts immediately after deploy |----- uint256 public periodFinish = 0; uint256 public rewardRate = 0; uint256 public lastUpdateTime; uint256 public rewardPerTokenStored; bool firstNotify; uint256 rewardAmount = 0; mapping(address => uint256) public userRewardPerTokenPaid; mapping(address => uint256) public rewards; event RewardAdded(uint256 reward); event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event Rewarded(address indexed from, address indexed to, uint256 value); modifier checkStart() { } modifier updateReward(address account) { } function lastTimeRewardApplicable() public view returns (uint256) { } function rewardPerToken() public view returns (uint256) { } function earned(address account) public view returns (uint256) { } function stake(uint256 amount) public updateReward(msg.sender) checkStart { } function withdraw(uint256 amount) public updateReward(msg.sender) { } // withdraw stake and get rewards at once function exit() external { } function getReward() public updateReward(msg.sender){ } function permitNotifyReward() public view returns (bool) { } function notifyRewardRate(uint256 _reward) public updateReward(address(0)) onlyOwner{ require(<FILL_ME>) rewardRate = _reward.div(duration); firstNotify = true; lastUpdateTime = block.timestamp; starttime = block.timestamp; periodFinish = block.timestamp.add(duration); } }
permitNotifyReward()==true||firstNotify==false,"Cannot notify until previous reward session is completed"
27,184
permitNotifyReward()==true||firstNotify==false
"SKU does not exist in catalog"
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract ComicBoxel is ERC721, ERC721Burnable, Ownable { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private _tokenIds; event RoyaltyPaid(string sku, address artist, uint256 royalty); //catalog item struct Item { string sku; uint256 price; string metadataURI; address artist; uint8 royaltiesPercentage; uint16 quantity; uint16 left; } mapping(string => Item) _catalog; mapping(uint256 => string) _tokenIdToSku; mapping(string => uint256[]) _skuToTokenIds; string private baseURI = ""; string private _contractURI = ""; constructor(string memory name, string memory symbol, string memory newBaseURI, string memory newContractURI) ERC721(name, symbol) { } /** Mint */ function buyBoxel(string memory sku) public payable { Item memory item = _catalog[sku]; require(<FILL_ME>) require(item.left > 0, "No NFTs left for this SKU"); require(msg.value >= item.price, "Insufficient ETH sent for Boxel"); //create a new token _tokenIds.increment(); uint256 tokenId = _tokenIds.current(); //mint a new token _safeMint(msg.sender, tokenId); //pay royalties to artist payRoyalties(item); //decrease number of items left item.left = item.left - 1; _catalog[sku] = item; //save token->sku _tokenIdToSku[tokenId] = sku; //save sku->token _skuToTokenIds[sku].push(tokenId); } function payRoyalties(Item memory item) private { } /** URI functions */ function getBaseURI() public view onlyOwner returns (string memory) { } function setBaseURI(string memory newBaseURI) public onlyOwner { } function contractURI() public view returns (string memory) { } function setContractURI(string memory newContractURI) public onlyOwner { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } /** Catalog functions */ function addItem(Item memory item) public onlyOwner { } function addItems(Item[] memory items) public onlyOwner { } //to deactivate an item, remove it's metadata function deactivateItem(string memory sku) public onlyOwner { } function getItemBySku(string memory sku) public view onlyOwner returns(Item memory) { } function getItemByTokenId(uint256 tokenId) public view onlyOwner returns(Item memory) { } function getSkuByTokenId(uint256 tokenId) public view onlyOwner returns (string memory) { } function getTokenIdsBySku(string memory sku) public view onlyOwner returns (uint256[] memory) { } /** Withdraw funds */ function withdraw() public onlyOwner { } }
bytes(item.sku).length!=0,"SKU does not exist in catalog"
27,222
bytes(item.sku).length!=0
"SKU not found for token ID"
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract ComicBoxel is ERC721, ERC721Burnable, Ownable { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private _tokenIds; event RoyaltyPaid(string sku, address artist, uint256 royalty); //catalog item struct Item { string sku; uint256 price; string metadataURI; address artist; uint8 royaltiesPercentage; uint16 quantity; uint16 left; } mapping(string => Item) _catalog; mapping(uint256 => string) _tokenIdToSku; mapping(string => uint256[]) _skuToTokenIds; string private baseURI = ""; string private _contractURI = ""; constructor(string memory name, string memory symbol, string memory newBaseURI, string memory newContractURI) ERC721(name, symbol) { } /** Mint */ function buyBoxel(string memory sku) public payable { } function payRoyalties(Item memory item) private { } /** URI functions */ function getBaseURI() public view onlyOwner returns (string memory) { } function setBaseURI(string memory newBaseURI) public onlyOwner { } function contractURI() public view returns (string memory) { } function setContractURI(string memory newContractURI) public onlyOwner { } function tokenURI(uint256 tokenId) public view override returns (string memory) { require(_exists(tokenId), "Token with this ID does not exist"); string memory sku = _tokenIdToSku[tokenId]; require(<FILL_ME>) Item memory item = _catalog[sku]; return string(abi.encodePacked(baseURI, item.metadataURI)); } /** Catalog functions */ function addItem(Item memory item) public onlyOwner { } function addItems(Item[] memory items) public onlyOwner { } //to deactivate an item, remove it's metadata function deactivateItem(string memory sku) public onlyOwner { } function getItemBySku(string memory sku) public view onlyOwner returns(Item memory) { } function getItemByTokenId(uint256 tokenId) public view onlyOwner returns(Item memory) { } function getSkuByTokenId(uint256 tokenId) public view onlyOwner returns (string memory) { } function getTokenIdsBySku(string memory sku) public view onlyOwner returns (uint256[] memory) { } /** Withdraw funds */ function withdraw() public onlyOwner { } }
bytes(sku).length!=0,"SKU not found for token ID"
27,222
bytes(sku).length!=0
"SKU can not be empty"
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract ComicBoxel is ERC721, ERC721Burnable, Ownable { using SafeMath for uint256; using Counters for Counters.Counter; Counters.Counter private _tokenIds; event RoyaltyPaid(string sku, address artist, uint256 royalty); //catalog item struct Item { string sku; uint256 price; string metadataURI; address artist; uint8 royaltiesPercentage; uint16 quantity; uint16 left; } mapping(string => Item) _catalog; mapping(uint256 => string) _tokenIdToSku; mapping(string => uint256[]) _skuToTokenIds; string private baseURI = ""; string private _contractURI = ""; constructor(string memory name, string memory symbol, string memory newBaseURI, string memory newContractURI) ERC721(name, symbol) { } /** Mint */ function buyBoxel(string memory sku) public payable { } function payRoyalties(Item memory item) private { } /** URI functions */ function getBaseURI() public view onlyOwner returns (string memory) { } function setBaseURI(string memory newBaseURI) public onlyOwner { } function contractURI() public view returns (string memory) { } function setContractURI(string memory newContractURI) public onlyOwner { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } /** Catalog functions */ function addItem(Item memory item) public onlyOwner { } function addItems(Item[] memory items) public onlyOwner { for(uint i = 0; i < items.length; i++) { require(<FILL_ME>) _catalog[items[i].sku] = items[i]; } } //to deactivate an item, remove it's metadata function deactivateItem(string memory sku) public onlyOwner { } function getItemBySku(string memory sku) public view onlyOwner returns(Item memory) { } function getItemByTokenId(uint256 tokenId) public view onlyOwner returns(Item memory) { } function getSkuByTokenId(uint256 tokenId) public view onlyOwner returns (string memory) { } function getTokenIdsBySku(string memory sku) public view onlyOwner returns (uint256[] memory) { } /** Withdraw funds */ function withdraw() public onlyOwner { } }
bytes(items[i].sku).length!=0,"SKU can not be empty"
27,222
bytes(items[i].sku).length!=0