comment
stringlengths
1
211
βŒ€
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
null
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { require (to != address(0x0)); require (tokenIndex <= TOTALSUPPLY); //gameDesignRules require(tokenIndexToAddress[tokenIndex.add(24).div(25).add(5000)] == address(0x0), "Already Mint");//gameDesignRules require(<FILL_ME>) //gameDesignRules if (isContract(to) > 0 && tokenIndex <= 5000) { if (tokenIndex != 0) { revert ("Cannot transfer pieces to a contract"); }} tokenIndexToAddress[tokenIndex] = to; emit Transfer(msg.sender, to , tokenIndex, 0); } function forceBuy(uint tokenIndex) payable public { } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { } }
tokenIndexToAddress[tokenIndex]==msg.sender
320,981
tokenIndexToAddress[tokenIndex]==msg.sender
null
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { require (tokenAssign >= 5000, "Not all claims are made!"); require (tokenIndex <= 5000); //gameDesignRules require(<FILL_ME>) //gameDesignRules require (tokenIndexToAddress[tokenIndex] != address(0x0)); //gameDesignRules require (tokenIndexToAddress[tokenIndex] != msg.sender); //gameDesignRules require (tokenIndexToAddress[tokenIndex.add(24).div(25).add(5000)] == address(0x0), "Already Mint");//gameDesignRules require (tokenIndex != 0); address forceSeller = tokenIndexToAddress[tokenIndex]; pendingWithdrawals[forceSeller] = pendingWithdrawals[forceSeller].add(msg.value.sub(msg.value.mul(6).div(100))); ownerCutTotalSupply = ownerCutTotalSupply.add(msg.value.mul(OWNERCUTPERCENTAGE).div(100)); prizeCutTotalSupply = prizeCutTotalSupply.add(msg.value.mul(PRIZECUTPERCENTAGE).div(100)); tokenIndexToAddress[tokenIndex] = msg.sender; emit SaleForced(tokenIndex, msg.value, forceSeller, msg.sender); } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { } }
msg.value==(forceBuyPrice)
320,981
msg.value==(forceBuyPrice)
null
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { require (tokenAssign >= 5000, "Not all claims are made!"); require (tokenIndex <= 5000); //gameDesignRules require (msg.value == (forceBuyPrice)); //gameDesignRules require(<FILL_ME>) //gameDesignRules require (tokenIndexToAddress[tokenIndex] != msg.sender); //gameDesignRules require (tokenIndexToAddress[tokenIndex.add(24).div(25).add(5000)] == address(0x0), "Already Mint");//gameDesignRules require (tokenIndex != 0); address forceSeller = tokenIndexToAddress[tokenIndex]; pendingWithdrawals[forceSeller] = pendingWithdrawals[forceSeller].add(msg.value.sub(msg.value.mul(6).div(100))); ownerCutTotalSupply = ownerCutTotalSupply.add(msg.value.mul(OWNERCUTPERCENTAGE).div(100)); prizeCutTotalSupply = prizeCutTotalSupply.add(msg.value.mul(PRIZECUTPERCENTAGE).div(100)); tokenIndexToAddress[tokenIndex] = msg.sender; emit SaleForced(tokenIndex, msg.value, forceSeller, msg.sender); } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { } }
tokenIndexToAddress[tokenIndex]!=address(0x0)
320,981
tokenIndexToAddress[tokenIndex]!=address(0x0)
null
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { require (tokenAssign >= 5000, "Not all claims are made!"); require (tokenIndex <= 5000); //gameDesignRules require (msg.value == (forceBuyPrice)); //gameDesignRules require (tokenIndexToAddress[tokenIndex] != address(0x0)); //gameDesignRules require(<FILL_ME>) //gameDesignRules require (tokenIndexToAddress[tokenIndex.add(24).div(25).add(5000)] == address(0x0), "Already Mint");//gameDesignRules require (tokenIndex != 0); address forceSeller = tokenIndexToAddress[tokenIndex]; pendingWithdrawals[forceSeller] = pendingWithdrawals[forceSeller].add(msg.value.sub(msg.value.mul(6).div(100))); ownerCutTotalSupply = ownerCutTotalSupply.add(msg.value.mul(OWNERCUTPERCENTAGE).div(100)); prizeCutTotalSupply = prizeCutTotalSupply.add(msg.value.mul(PRIZECUTPERCENTAGE).div(100)); tokenIndexToAddress[tokenIndex] = msg.sender; emit SaleForced(tokenIndex, msg.value, forceSeller, msg.sender); } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { } }
tokenIndexToAddress[tokenIndex]!=msg.sender
320,981
tokenIndexToAddress[tokenIndex]!=msg.sender
null
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { } function mintCPZ (uint familyId) public reentrancyGuard { require (tokenAssign >= 5000, "Not all claims are made!"); require(<FILL_ME>)//gameDesignRules uint proof = 0; for (uint i = 0; i < 25; i++) { if (tokenIndexToAddress[familyId * 25 - uint(i)] == msg.sender) {proof++;} } if (proof == 25) { forceBuyPrice += forceBuyInterval; tokenIndexToAddress[familyId.add(5000)] = msg.sender; pendingWithdrawals[msg.sender] = pendingWithdrawals[msg.sender].add(prizeCutTotalSupply.div(20)); emit Mint(msg.sender, familyId.add(5000), prizeCutTotalSupply.div(20), address(0x0)); prizeCutTotalSupply = prizeCutTotalSupply.sub(prizeCutTotalSupply.div(20)); } else {revert("You don't have all this familyId's puzzles"); }} /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { } }
tokenIndexToAddress[familyId.add(5000)]==address(0x0)
320,981
tokenIndexToAddress[familyId.add(5000)]==address(0x0)
"Trade offer was cancelled."
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { SignTrade memory trade = SignTrade(maker, makerWei, makerIds, taker, takerWei, takerIds, expiry); // Check for cancellation bytes32 hashCancel = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, hash(trade) )); require(<FILL_ME>) // Verify signature require(verify(trade.maker, trade, signature), "Signature not valid."); // Check for expiry require(block.timestamp < trade.expiry, "Trade offer expired."); // Only one side should ever have to pay, not both require(makerWei == 0 || takerWei == 0, "Only one side of trade must pay."); // At least one side should offer tokens require(makerIds.length > 0 || takerIds.length > 0, "One side must offer tokens."); // Make sure the maker has funded the trade require(pendingWithdrawals[trade.maker] >= trade.makerWei, "Maker does not have sufficient balance."); // Ensure the maker owns the maker tokens for (uint i = 0; i < trade.makerIds.length; i++) { require(tokenIndexToAddress[trade.makerIds[i]] == trade.maker, "At least one maker token doesn't belong to maker."); if (trade.makerIds[i] != 0) {require(tokenIndexToAddress[trade.makerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } // If the taker can be anybody, then there can be no taker tokens if (trade.taker == address(0)) { //// If taker not specified, then can't specify IDs //require(trade.takerIds.length == 0, "If trade is offered to anybody, cannot specify tokens from taker."); for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == msg.sender, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } else { // Ensure the taker owns the taker tokens for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == trade.taker, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } return true; } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { } }
cancelledTrade[hashCancel]==false,"Trade offer was cancelled."
320,981
cancelledTrade[hashCancel]==false
"Signature not valid."
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { SignTrade memory trade = SignTrade(maker, makerWei, makerIds, taker, takerWei, takerIds, expiry); // Check for cancellation bytes32 hashCancel = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, hash(trade) )); require(cancelledTrade[hashCancel] == false, "Trade offer was cancelled."); // Verify signature require(<FILL_ME>) // Check for expiry require(block.timestamp < trade.expiry, "Trade offer expired."); // Only one side should ever have to pay, not both require(makerWei == 0 || takerWei == 0, "Only one side of trade must pay."); // At least one side should offer tokens require(makerIds.length > 0 || takerIds.length > 0, "One side must offer tokens."); // Make sure the maker has funded the trade require(pendingWithdrawals[trade.maker] >= trade.makerWei, "Maker does not have sufficient balance."); // Ensure the maker owns the maker tokens for (uint i = 0; i < trade.makerIds.length; i++) { require(tokenIndexToAddress[trade.makerIds[i]] == trade.maker, "At least one maker token doesn't belong to maker."); if (trade.makerIds[i] != 0) {require(tokenIndexToAddress[trade.makerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } // If the taker can be anybody, then there can be no taker tokens if (trade.taker == address(0)) { //// If taker not specified, then can't specify IDs //require(trade.takerIds.length == 0, "If trade is offered to anybody, cannot specify tokens from taker."); for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == msg.sender, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } else { // Ensure the taker owns the taker tokens for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == trade.taker, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } return true; } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { } }
verify(trade.maker,trade,signature),"Signature not valid."
320,981
verify(trade.maker,trade,signature)
"Maker does not have sufficient balance."
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { SignTrade memory trade = SignTrade(maker, makerWei, makerIds, taker, takerWei, takerIds, expiry); // Check for cancellation bytes32 hashCancel = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, hash(trade) )); require(cancelledTrade[hashCancel] == false, "Trade offer was cancelled."); // Verify signature require(verify(trade.maker, trade, signature), "Signature not valid."); // Check for expiry require(block.timestamp < trade.expiry, "Trade offer expired."); // Only one side should ever have to pay, not both require(makerWei == 0 || takerWei == 0, "Only one side of trade must pay."); // At least one side should offer tokens require(makerIds.length > 0 || takerIds.length > 0, "One side must offer tokens."); // Make sure the maker has funded the trade require(<FILL_ME>) // Ensure the maker owns the maker tokens for (uint i = 0; i < trade.makerIds.length; i++) { require(tokenIndexToAddress[trade.makerIds[i]] == trade.maker, "At least one maker token doesn't belong to maker."); if (trade.makerIds[i] != 0) {require(tokenIndexToAddress[trade.makerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } // If the taker can be anybody, then there can be no taker tokens if (trade.taker == address(0)) { //// If taker not specified, then can't specify IDs //require(trade.takerIds.length == 0, "If trade is offered to anybody, cannot specify tokens from taker."); for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == msg.sender, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } else { // Ensure the taker owns the taker tokens for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == trade.taker, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } return true; } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { } }
pendingWithdrawals[trade.maker]>=trade.makerWei,"Maker does not have sufficient balance."
320,981
pendingWithdrawals[trade.maker]>=trade.makerWei
"At least one maker token doesn't belong to maker."
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { SignTrade memory trade = SignTrade(maker, makerWei, makerIds, taker, takerWei, takerIds, expiry); // Check for cancellation bytes32 hashCancel = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, hash(trade) )); require(cancelledTrade[hashCancel] == false, "Trade offer was cancelled."); // Verify signature require(verify(trade.maker, trade, signature), "Signature not valid."); // Check for expiry require(block.timestamp < trade.expiry, "Trade offer expired."); // Only one side should ever have to pay, not both require(makerWei == 0 || takerWei == 0, "Only one side of trade must pay."); // At least one side should offer tokens require(makerIds.length > 0 || takerIds.length > 0, "One side must offer tokens."); // Make sure the maker has funded the trade require(pendingWithdrawals[trade.maker] >= trade.makerWei, "Maker does not have sufficient balance."); // Ensure the maker owns the maker tokens for (uint i = 0; i < trade.makerIds.length; i++) { require(<FILL_ME>) if (trade.makerIds[i] != 0) {require(tokenIndexToAddress[trade.makerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } // If the taker can be anybody, then there can be no taker tokens if (trade.taker == address(0)) { //// If taker not specified, then can't specify IDs //require(trade.takerIds.length == 0, "If trade is offered to anybody, cannot specify tokens from taker."); for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == msg.sender, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } else { // Ensure the taker owns the taker tokens for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == trade.taker, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } return true; } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { } }
tokenIndexToAddress[trade.makerIds[i]]==trade.maker,"At least one maker token doesn't belong to maker."
320,981
tokenIndexToAddress[trade.makerIds[i]]==trade.maker
"Already Mint"
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { SignTrade memory trade = SignTrade(maker, makerWei, makerIds, taker, takerWei, takerIds, expiry); // Check for cancellation bytes32 hashCancel = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, hash(trade) )); require(cancelledTrade[hashCancel] == false, "Trade offer was cancelled."); // Verify signature require(verify(trade.maker, trade, signature), "Signature not valid."); // Check for expiry require(block.timestamp < trade.expiry, "Trade offer expired."); // Only one side should ever have to pay, not both require(makerWei == 0 || takerWei == 0, "Only one side of trade must pay."); // At least one side should offer tokens require(makerIds.length > 0 || takerIds.length > 0, "One side must offer tokens."); // Make sure the maker has funded the trade require(pendingWithdrawals[trade.maker] >= trade.makerWei, "Maker does not have sufficient balance."); // Ensure the maker owns the maker tokens for (uint i = 0; i < trade.makerIds.length; i++) { require(tokenIndexToAddress[trade.makerIds[i]] == trade.maker, "At least one maker token doesn't belong to maker."); if (trade.makerIds[i] != 0) {require(<FILL_ME>) } } // If the taker can be anybody, then there can be no taker tokens if (trade.taker == address(0)) { //// If taker not specified, then can't specify IDs //require(trade.takerIds.length == 0, "If trade is offered to anybody, cannot specify tokens from taker."); for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == msg.sender, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } else { // Ensure the taker owns the taker tokens for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == trade.taker, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } return true; } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { } }
tokenIndexToAddress[trade.makerIds[i].add(24).div(25).add(5000)]==address(0x0),"Already Mint"
320,981
tokenIndexToAddress[trade.makerIds[i].add(24).div(25).add(5000)]==address(0x0)
"At least one taker token doesn't belong to taker."
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { SignTrade memory trade = SignTrade(maker, makerWei, makerIds, taker, takerWei, takerIds, expiry); // Check for cancellation bytes32 hashCancel = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, hash(trade) )); require(cancelledTrade[hashCancel] == false, "Trade offer was cancelled."); // Verify signature require(verify(trade.maker, trade, signature), "Signature not valid."); // Check for expiry require(block.timestamp < trade.expiry, "Trade offer expired."); // Only one side should ever have to pay, not both require(makerWei == 0 || takerWei == 0, "Only one side of trade must pay."); // At least one side should offer tokens require(makerIds.length > 0 || takerIds.length > 0, "One side must offer tokens."); // Make sure the maker has funded the trade require(pendingWithdrawals[trade.maker] >= trade.makerWei, "Maker does not have sufficient balance."); // Ensure the maker owns the maker tokens for (uint i = 0; i < trade.makerIds.length; i++) { require(tokenIndexToAddress[trade.makerIds[i]] == trade.maker, "At least one maker token doesn't belong to maker."); if (trade.makerIds[i] != 0) {require(tokenIndexToAddress[trade.makerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } // If the taker can be anybody, then there can be no taker tokens if (trade.taker == address(0)) { //// If taker not specified, then can't specify IDs //require(trade.takerIds.length == 0, "If trade is offered to anybody, cannot specify tokens from taker."); for (uint i = 0; i < trade.takerIds.length; i++) { require(<FILL_ME>) if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } else { // Ensure the taker owns the taker tokens for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == trade.taker, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } return true; } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { } }
tokenIndexToAddress[trade.takerIds[i]]==msg.sender,"At least one taker token doesn't belong to taker."
320,981
tokenIndexToAddress[trade.takerIds[i]]==msg.sender
"Already Mint"
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { SignTrade memory trade = SignTrade(maker, makerWei, makerIds, taker, takerWei, takerIds, expiry); // Check for cancellation bytes32 hashCancel = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, hash(trade) )); require(cancelledTrade[hashCancel] == false, "Trade offer was cancelled."); // Verify signature require(verify(trade.maker, trade, signature), "Signature not valid."); // Check for expiry require(block.timestamp < trade.expiry, "Trade offer expired."); // Only one side should ever have to pay, not both require(makerWei == 0 || takerWei == 0, "Only one side of trade must pay."); // At least one side should offer tokens require(makerIds.length > 0 || takerIds.length > 0, "One side must offer tokens."); // Make sure the maker has funded the trade require(pendingWithdrawals[trade.maker] >= trade.makerWei, "Maker does not have sufficient balance."); // Ensure the maker owns the maker tokens for (uint i = 0; i < trade.makerIds.length; i++) { require(tokenIndexToAddress[trade.makerIds[i]] == trade.maker, "At least one maker token doesn't belong to maker."); if (trade.makerIds[i] != 0) {require(tokenIndexToAddress[trade.makerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } // If the taker can be anybody, then there can be no taker tokens if (trade.taker == address(0)) { //// If taker not specified, then can't specify IDs //require(trade.takerIds.length == 0, "If trade is offered to anybody, cannot specify tokens from taker."); for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == msg.sender, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(<FILL_ME>) } } } else { // Ensure the taker owns the taker tokens for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == trade.taker, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } return true; } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { } }
tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)]==address(0x0),"Already Mint"
320,981
tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)]==address(0x0)
"At least one taker token doesn't belong to taker."
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { SignTrade memory trade = SignTrade(maker, makerWei, makerIds, taker, takerWei, takerIds, expiry); // Check for cancellation bytes32 hashCancel = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, hash(trade) )); require(cancelledTrade[hashCancel] == false, "Trade offer was cancelled."); // Verify signature require(verify(trade.maker, trade, signature), "Signature not valid."); // Check for expiry require(block.timestamp < trade.expiry, "Trade offer expired."); // Only one side should ever have to pay, not both require(makerWei == 0 || takerWei == 0, "Only one side of trade must pay."); // At least one side should offer tokens require(makerIds.length > 0 || takerIds.length > 0, "One side must offer tokens."); // Make sure the maker has funded the trade require(pendingWithdrawals[trade.maker] >= trade.makerWei, "Maker does not have sufficient balance."); // Ensure the maker owns the maker tokens for (uint i = 0; i < trade.makerIds.length; i++) { require(tokenIndexToAddress[trade.makerIds[i]] == trade.maker, "At least one maker token doesn't belong to maker."); if (trade.makerIds[i] != 0) {require(tokenIndexToAddress[trade.makerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } // If the taker can be anybody, then there can be no taker tokens if (trade.taker == address(0)) { //// If taker not specified, then can't specify IDs //require(trade.takerIds.length == 0, "If trade is offered to anybody, cannot specify tokens from taker."); for (uint i = 0; i < trade.takerIds.length; i++) { require(tokenIndexToAddress[trade.takerIds[i]] == msg.sender, "At least one taker token doesn't belong to taker."); if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } else { // Ensure the taker owns the taker tokens for (uint i = 0; i < trade.takerIds.length; i++) { require(<FILL_ME>) if (trade.takerIds[i] != 0) {require(tokenIndexToAddress[trade.takerIds[i].add(24).div(25).add(5000)] == address(0x0), "Already Mint"); } } } return true; } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { } }
tokenIndexToAddress[trade.takerIds[i]]==trade.taker,"At least one taker token doesn't belong to taker."
320,981
tokenIndexToAddress[trade.takerIds[i]]==trade.taker
"Trade not valid."
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { require(msg.sender != maker, "Can't accept ones own trade."); SignTrade memory trade = SignTrade(maker, makerWei, makerIds, taker, takerWei, takerIds, expiry); if (msg.value > 0) { pendingWithdrawals[msg.sender] = pendingWithdrawals[msg.sender].add(msg.value); // emit Deposit(msg.sender, msg.value); } require(trade.taker == address(0) || trade.taker == msg.sender, "Not the recipient of this offer."); require(<FILL_ME>) require(pendingWithdrawals[msg.sender] >= trade.takerWei, "Insufficient funds to execute trade."); // Transfer ETH & Tax address weiEmitter; address weiReceiver; uint amountTrade; uint taxNumber; if (trade.makerWei > 0) { weiEmitter = trade.maker; weiReceiver = msg.sender; amountTrade = trade.makerWei; } else { weiEmitter = msg.sender; weiReceiver = trade.maker; amountTrade = trade.takerWei; } for (uint i = 0; i < takerIds.length; i++) { if (trade.takerIds[i] == 0 || trade.takerIds[i] >= 5001) { taxNumber = 1; } else { taxNumber = 2; } } for (uint i = 0; i < makerIds.length; i++) { if (trade.makerIds[i] == 0 || trade.makerIds[i] >= 5001) { taxNumber = 1; } else { taxNumber = 2; } } pendingWithdrawals[weiEmitter] = pendingWithdrawals[weiEmitter].sub(amountTrade); pendingWithdrawals[weiReceiver] = pendingWithdrawals[weiReceiver].add(amountTrade.sub(amountTrade.mul(3).mul(taxNumber).div(100))); ownerCutTotalSupply = ownerCutTotalSupply.add(amountTrade.mul(OWNERCUTPERCENTAGE).div(100)); prizeCutTotalSupply = prizeCutTotalSupply.add(amountTrade.mul(PRIZECUTPERCENTAGE).mul(taxNumber.sub(1)).div(100)); // Transfer maker ids to taker (msg.sender) for (uint i = 0; i < makerIds.length; i++) { tokenIndexToAddress[trade.makerIds[i]] = msg.sender; //transfertoken(msg.sender, makerIds[i]); } // Transfer taker ids to maker for (uint i = 0; i < takerIds.length; i++) { tokenIndexToAddress[trade.takerIds[i]] = maker; //transfertoken(maker, takerIds[i]); } // Prevent a replay attack on this offer bytes32 hashCancel = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, hash(trade) )); cancelledTrade[hashCancel] = true; emit Trade(trade.maker, trade.makerWei, trade.makerIds, msg.sender, trade.takerWei, trade.takerIds, expiry, signature); } }
tradeValid(maker,makerWei,makerIds,taker,takerWei,takerIds,expiry,signature),"Trade not valid."
320,981
tradeValid(maker,makerWei,makerIds,taker,takerWei,takerIds,expiry,signature)
"Insufficient funds to execute trade."
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* _____ _ _____ _ / ____| | | | __ \ | | | | _ __ _ _ _ __ | |_ ___ | |__) | _ _______| | ___ | | | '__| | | | '_ \| __/ _ \| ___/ | | |_ /_ / |/ _ \ | |____| | | |_| | |_) | || (_) | | | |_| |/ / / /| | __/ \_____|_| \__, | .__/ \__\___/|_| \__,_/___/___|_|\___| __/ | | |___/|_| by Macha and Wardesq */ /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IFundsDistributionTokenOptional { /** * @notice Deposits funds to this contract. * The deposited funds may be distributed to other accounts. */ function depositFunds() external payable; /** * @notice Returns the total amount of funds that have been deposited to this contract but not yet distributed. */ function undistributedFunds() external view returns(uint256); /** * @notice Returns the total amount of funds that have been distributed. */ function distributedFunds() external view returns(uint256); /** * @notice Distributes undistributed funds to accounts. */ function distributeFunds() external; /** * @notice Deposits and distributes funds to accounts. * @param from The source of the funds. */ function depositAndDistributeFunds(address from) external payable; /** * @dev This event MUST emit when funds are deposited to this contract. * @param by the address of the sender of who deposited funds. * @param fundsDeposited The amount of distributed funds. */ event FundsDeposited(address indexed by, uint256 fundsDeposited); } 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) { } } contract CryptoPuzzle { using Strings for uint256; using SafeMath for uint256; address public owner; string public name; string public symbol; uint8 public decimals; uint256 public TOTALSUPPLY; //uint internal nexttokenIndexToAssign; //bool internal alltokenAssigned = false; uint public tokenAssign; uint public tokenLinearClaim; uint public claimPrice; uint internal randNonce; uint256 public OWNERCUTPERCENTAGE = 3; uint256 public ownerCutTotalSupply; uint256 public PRIZECUTPERCENTAGE = 3; uint256 public prizeCutTotalSupply; uint public forceBuyPrice; uint public forceBuyInterval; bool public publicSale = false; uint public saleStartTime; uint public saleDuration; bool internal isLocked; //claim security : reentrancyGuard bool public marketPaused; bytes32 DOMAIN_SEPARATOR; bytes32 constant EIP712DOMAIN_TYPEHASH = keccak256( "EIP712Domain(string name,uint256 chainId,address verifyingContract)" ); bytes32 constant TRADE_TYPEHASH = keccak256( "SignTrade(address maker,uint256 makerWei,uint256[] makerIds,address taker,uint256 takerWei,uint256[] takerIds,uint256 expiry)" ); mapping(uint => address) public tokenIndexToAddress; mapping(address => uint) public pendingWithdrawals; mapping (bytes32 => bool) cancelledTrade; struct SignTrade { address maker; uint256 makerWei; uint256[] makerIds;// Its for trade NFT to NFT without ether ? address taker; uint256 takerWei; uint256[] takerIds;// Its for trade NFT to NFT without ether ? uint256 expiry; } struct EIP712Domain { string name; uint256 chainId; address verifyingContract; } event Assign(address indexed to, uint256 tokenIndex); event SaleForced(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Transfer(address indexed from, address indexed to, uint256 tokenIndex, uint value); event Claim(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Mint(address indexed to, uint256 tokenIndex, uint256 value, address indexed from); event Deposit(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Withdraw(uint indexed tokenIndex, uint value, address indexed from, address indexed to); event Trade(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry, bytes signature); event Store (uint8 NumberRobot, string indexed robotString); event TradeCancelled(address indexed maker, uint makerWei, uint[] makerIds, address indexed taker, uint takerWei, uint[] takerIds, uint expiry); IFundsDistributionTokenOptional a_contract_instance; constructor (address _a_contract_address) { } //////////////// /// Security /// //////////////// //If size > 0 => contract function isContract(address addr) internal view returns (uint32 size){ } modifier reentrancyGuard() { } function pauseMarket(bool _paused) external { } ////////////////// /// SSTORE NFT /// ////////////////// string public baseTokenURI; event BaseURIChanged(string baseURI); function _baseURI() internal view returns (string memory) { } function setBaseURI(string memory baseURI) public { } function tokenURI(uint256 tokenId) public view returns (string memory) { } //////////////// /// ERC 2222 /// //////////////// function stack() public payable reentrancyGuard { } //////////// /// Bank /// //////////// function deposit() public payable { } function withdraw() public reentrancyGuard { } /////////////////////////// /// CPZ gameDesignRules /// ////////////////////////// function startSale(uint _price, uint _forceBuyPrice, uint _forceBuyInterval, uint _saleDuration) external { } function getClaimPrice() public view returns (uint) { } function claimtoken() public reentrancyGuard payable returns(uint){ } function claimRandom(uint tokenClaimId) internal view returns (uint x) { } function claimLinear(uint tokenLinearClaimF) internal view returns (uint x) { } function transferToken(address to, uint tokenIndex) public { } function forceBuy(uint tokenIndex) payable public { } function mintCPZ (uint familyId) public reentrancyGuard { } /////////////////////////// /// Market with EIP 712 /// /////////////////////////// function hash(EIP712Domain memory eip712Domain) private pure returns (bytes32) { } function hash(SignTrade memory trade) private pure returns (bytes32) { } function verify(address signer, SignTrade memory trade, bytes memory signature) internal view returns (bool) { } function tradeValid(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) view public returns (bool) { } function cancelTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry) external { } function acceptTrade(address maker, uint256 makerWei, uint256[] memory makerIds, address taker, uint256 takerWei, uint256[] memory takerIds, uint256 expiry, bytes memory signature) external payable reentrancyGuard { require(msg.sender != maker, "Can't accept ones own trade."); SignTrade memory trade = SignTrade(maker, makerWei, makerIds, taker, takerWei, takerIds, expiry); if (msg.value > 0) { pendingWithdrawals[msg.sender] = pendingWithdrawals[msg.sender].add(msg.value); // emit Deposit(msg.sender, msg.value); } require(trade.taker == address(0) || trade.taker == msg.sender, "Not the recipient of this offer."); require(tradeValid(maker, makerWei, makerIds, taker, takerWei, takerIds, expiry, signature), "Trade not valid."); require(<FILL_ME>) // Transfer ETH & Tax address weiEmitter; address weiReceiver; uint amountTrade; uint taxNumber; if (trade.makerWei > 0) { weiEmitter = trade.maker; weiReceiver = msg.sender; amountTrade = trade.makerWei; } else { weiEmitter = msg.sender; weiReceiver = trade.maker; amountTrade = trade.takerWei; } for (uint i = 0; i < takerIds.length; i++) { if (trade.takerIds[i] == 0 || trade.takerIds[i] >= 5001) { taxNumber = 1; } else { taxNumber = 2; } } for (uint i = 0; i < makerIds.length; i++) { if (trade.makerIds[i] == 0 || trade.makerIds[i] >= 5001) { taxNumber = 1; } else { taxNumber = 2; } } pendingWithdrawals[weiEmitter] = pendingWithdrawals[weiEmitter].sub(amountTrade); pendingWithdrawals[weiReceiver] = pendingWithdrawals[weiReceiver].add(amountTrade.sub(amountTrade.mul(3).mul(taxNumber).div(100))); ownerCutTotalSupply = ownerCutTotalSupply.add(amountTrade.mul(OWNERCUTPERCENTAGE).div(100)); prizeCutTotalSupply = prizeCutTotalSupply.add(amountTrade.mul(PRIZECUTPERCENTAGE).mul(taxNumber.sub(1)).div(100)); // Transfer maker ids to taker (msg.sender) for (uint i = 0; i < makerIds.length; i++) { tokenIndexToAddress[trade.makerIds[i]] = msg.sender; //transfertoken(msg.sender, makerIds[i]); } // Transfer taker ids to maker for (uint i = 0; i < takerIds.length; i++) { tokenIndexToAddress[trade.takerIds[i]] = maker; //transfertoken(maker, takerIds[i]); } // Prevent a replay attack on this offer bytes32 hashCancel = keccak256(abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, hash(trade) )); cancelledTrade[hashCancel] = true; emit Trade(trade.maker, trade.makerWei, trade.makerIds, msg.sender, trade.takerWei, trade.takerIds, expiry, signature); } }
pendingWithdrawals[msg.sender]>=trade.takerWei,"Insufficient funds to execute trade."
320,981
pendingWithdrawals[msg.sender]>=trade.takerWei
null
pragma solidity ^0.4.15; /* @file * @title Coin * @version 1.2.1 */ contract Coin { string public constant symbol = "BTRC"; string public constant name = "BITUBER"; uint8 public constant decimals = 18; uint256 public _totalSupply = 0; uint256 public price = 1500; bool private workingState = false; bool private transferAllowed = false; address public owner; address private cur_coin; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => uint256) private etherClients; event FundsGot(address indexed _sender, uint256 _value); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event ContractEnabled(); event ContractDisabled(); event TransferEnabled(); event TransferDisabled(); event CurrentCoin(address coin); event Refund(address client, uint256 amount); event TokensSent(address client, uint256 amount); modifier onlyOwner { } modifier ownerAndCoin { require(<FILL_ME>) _; } modifier workingFlag { } modifier transferFlag { } function Coin() public payable { } function refund(address _client, uint256 _amount, uint256 _tokens) public workingFlag ownerAndCoin { } function kill() public onlyOwner { } function setCurrentCoin(address current) public onlyOwner workingFlag { } //work controller functions function enableContract() public onlyOwner { } function disableContract() public onlyOwner { } function contractState() public view returns (string state) { } //transfer controller functions function enableTransfer() public onlyOwner { } function disableTransfer() public onlyOwner { } function transferState() public view returns (string state) { } //token controller functions function generateTokens(address _client, uint256 _amount) public ownerAndCoin workingFlag { } function setPrice(uint256 _price) public onlyOwner { } function getPrice() public view returns (uint256 _price) { } //send ether function (working) function () public workingFlag payable { } function totalSupply() public constant workingFlag returns (uint256 totalsupply) { } //ERC20 Interface function balanceOf(address _owner) public constant workingFlag returns (uint256 balance) { } function transfer(address _to, uint256 _value) public workingFlag returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) public workingFlag returns (bool success) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { } }
(msg.sender==owner)||(msg.sender==cur_coin)
321,115
(msg.sender==owner)||(msg.sender==cur_coin)
null
contract HeroInfinityToken is ERC20, Ownable { using SafeMath for uint256; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private swapping; uint256 public launchTime; address public marketingWallet; address public devWallet; address public liquidityWallet; uint256 public maxTransactionAmount; uint256 public swapTokensAtAmount; uint256 public maxWallet; bool public limitsInEffect = true; bool public tradingActive = false; bool public swapEnabled = false; bool private gasLimitActive = true; uint256 private gasPriceLimit = 561 * 1 gwei; // do not allow over x gwei for launch // Anti-bot and anti-whale mappings and variables mapping(address => uint256) private _holderLastTransferTimestamp; // to hold last Transfers temporarily during launch mapping(address => uint256) presaleAmount; // Presale vesting uint256 airdropThreshold; bool public transferDelayEnabled = true; uint256 public buyTotalFees; uint256 public buyMarketingFee; uint256 public buyLiquidityFee; uint256 public buyDevFee; uint256 public sellTotalFees; uint256 public sellMarketingFee; uint256 public sellLiquidityFee; uint256 public sellDevFee; uint256 public tokensForMarketing; uint256 public tokensForLiquidity; uint256 public tokensForDev; /******************/ // exlcude from fees and max transaction amount mapping(address => bool) private _isExcludedFromFees; mapping(address => bool) public _isExcludedMaxTransactionAmount; // store addresses that a automatic market maker pairs. Any transfer *to* these addresses // could be subject to a maximum transfer amount mapping(address => bool) public automatedMarketMakerPairs; event UpdateUniswapV2Router( address indexed newAddress, address indexed oldAddress ); event ExcludeFromFees(address indexed account, bool isExcluded); event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value); event MarketingWalletUpdated( address indexed newWallet, address indexed oldWallet ); event DevWalletUpdated(address indexed newWallet, address indexed oldWallet); event LiquidityWalletUpdated( address indexed newWallet, address indexed oldWallet ); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); event OwnerForcedSwapBack(uint256 timestamp); constructor() ERC20("HeroInfinity Token", "HRI") {} function airdropAndLaunch( address newOwner, address router, uint256 liquidityAmount, uint256 airdropAmount, uint256 dailyThreshold, address[] memory airdropUsers, uint256[] memory airdropAmounts ) external payable onlyOwner { require(!tradingActive, "Trading is already enabled"); require(airdropUsers.length == airdropAmounts.length, "Invalid arguments"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair( address(this), _uniswapV2Router.WETH() ); excludeFromMaxTransaction(address(uniswapV2Pair), true); _setAutomatedMarketMakerPair(address(uniswapV2Pair), true); uint256 _buyMarketingFee = 6; uint256 _buyLiquidityFee = 4; uint256 _buyDevFee = 2; uint256 _sellMarketingFee = 8; uint256 _sellLiquidityFee = 14; uint256 _sellDevFee = 3; uint256 _totalSupply = 1 * 1e9 * 1e18; require(<FILL_ME>) // at least 0.05% release to presalers per day airdropThreshold = dailyThreshold; maxTransactionAmount = (_totalSupply * 30) / 10000; // 0.3% maxTransactionAmountTxn maxWallet = (_totalSupply * 100) / 10000; // 1% maxWallet swapTokensAtAmount = (_totalSupply * 5) / 10000; // 0.05% swap wallet buyMarketingFee = _buyMarketingFee; buyLiquidityFee = _buyLiquidityFee; buyDevFee = _buyDevFee; buyTotalFees = buyMarketingFee + buyLiquidityFee + buyDevFee; sellMarketingFee = _sellMarketingFee; sellLiquidityFee = _sellLiquidityFee; sellDevFee = _sellDevFee; sellTotalFees = sellMarketingFee + sellLiquidityFee + sellDevFee; marketingWallet = newOwner; devWallet = newOwner; liquidityWallet = newOwner; // exclude from paying fees or having max transaction amount excludeFromFees(owner(), true); excludeFromFees(newOwner, true); excludeFromFees(address(this), true); excludeFromFees(address(0xdead), true); excludeFromMaxTransaction(owner(), true); excludeFromMaxTransaction(newOwner, true); excludeFromMaxTransaction(address(this), true); excludeFromMaxTransaction(address(0xdead), true); _mint(address(this), liquidityAmount * 1e18); _mint(newOwner, _totalSupply - liquidityAmount * 1e18); // Add liquidity addLiquidity(liquidityAmount * 1e18, msg.value); uint256 totalAirdrops; //For airdrop, exclude temporary excludeFromFees(address(uniswapV2Pair), true); limitsInEffect = false; for (uint256 i; i < airdropUsers.length; ++i) { uint256 amount = airdropAmounts[i] * 1e18; address to = airdropUsers[i]; require(presaleAmount[to] == 0, "airdrop duplicated"); totalAirdrops += amount; _transfer(uniswapV2Pair, to, amount); presaleAmount[to] = amount; } excludeFromFees(address(uniswapV2Pair), false); limitsInEffect = true; require(totalAirdrops == airdropAmount * 1e18, "Wrong airdrop amount"); IUniswapV2Pair pairInstance = IUniswapV2Pair(uniswapV2Pair); pairInstance.sync(); enableTrading(); } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function decimals() public view virtual override returns (uint8) { } function totalSupply() public view virtual override returns (uint256) { } receive() external payable {} // once enabled, can never be turned off function enableTrading() private { } // remove limits after token is stable function removeLimits() external onlyOwner returns (bool) { } // disable Transfer delay - cannot be reenabled function disableTransferDelay() external onlyOwner returns (bool) { } // change the minimum amount of tokens to sell from fees function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool) { } function updateMaxAmount(uint256 newNum) external onlyOwner { } function excludeFromMaxTransaction(address updAds, bool isEx) public onlyOwner { } // only use to disable contract sales if absolutely necessary (emergency use only) function updateSwapEnabled(bool enabled) external onlyOwner { } function updateBuyFees( uint256 _marketingFee, uint256 _liquidityFee, uint256 _devFee ) external onlyOwner { } function updateSellFees( uint256 _marketingFee, uint256 _liquidityFee, uint256 _devFee ) external onlyOwner { } function excludeFromFees(address account, bool excluded) public onlyOwner { } function setAutomatedMarketMakerPair(address pair, bool value) public onlyOwner { } function _setAutomatedMarketMakerPair(address pair, bool value) private { } function updateMarketingWallet(address newMarketingWallet) external onlyOwner { } function updateDevWallet(address newDevWallet) external onlyOwner { } function updateliquidityWallet(address newWallet) external onlyOwner { } function isExcludedFromFees(address account) public view returns (bool) { } function checkVesting(address from) private { } function _transfer( address from, address to, uint256 amount ) internal override { } function swapTokensForEth(uint256 tokenAmount) private { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function swapBack() private { } // force Swap back if slippage above 49% for launch. fix router clog function forceSwapBack() external onlyOwner { } function withdrawDustToken(address _token, address _to) external onlyOwner returns (bool _sent) { } function withdrawDustETH(address _recipient) external onlyOwner { } }
dailyThreshold*1e18>(_totalSupply*5)/10000
321,184
dailyThreshold*1e18>(_totalSupply*5)/10000
"airdrop duplicated"
contract HeroInfinityToken is ERC20, Ownable { using SafeMath for uint256; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private swapping; uint256 public launchTime; address public marketingWallet; address public devWallet; address public liquidityWallet; uint256 public maxTransactionAmount; uint256 public swapTokensAtAmount; uint256 public maxWallet; bool public limitsInEffect = true; bool public tradingActive = false; bool public swapEnabled = false; bool private gasLimitActive = true; uint256 private gasPriceLimit = 561 * 1 gwei; // do not allow over x gwei for launch // Anti-bot and anti-whale mappings and variables mapping(address => uint256) private _holderLastTransferTimestamp; // to hold last Transfers temporarily during launch mapping(address => uint256) presaleAmount; // Presale vesting uint256 airdropThreshold; bool public transferDelayEnabled = true; uint256 public buyTotalFees; uint256 public buyMarketingFee; uint256 public buyLiquidityFee; uint256 public buyDevFee; uint256 public sellTotalFees; uint256 public sellMarketingFee; uint256 public sellLiquidityFee; uint256 public sellDevFee; uint256 public tokensForMarketing; uint256 public tokensForLiquidity; uint256 public tokensForDev; /******************/ // exlcude from fees and max transaction amount mapping(address => bool) private _isExcludedFromFees; mapping(address => bool) public _isExcludedMaxTransactionAmount; // store addresses that a automatic market maker pairs. Any transfer *to* these addresses // could be subject to a maximum transfer amount mapping(address => bool) public automatedMarketMakerPairs; event UpdateUniswapV2Router( address indexed newAddress, address indexed oldAddress ); event ExcludeFromFees(address indexed account, bool isExcluded); event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value); event MarketingWalletUpdated( address indexed newWallet, address indexed oldWallet ); event DevWalletUpdated(address indexed newWallet, address indexed oldWallet); event LiquidityWalletUpdated( address indexed newWallet, address indexed oldWallet ); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); event OwnerForcedSwapBack(uint256 timestamp); constructor() ERC20("HeroInfinity Token", "HRI") {} function airdropAndLaunch( address newOwner, address router, uint256 liquidityAmount, uint256 airdropAmount, uint256 dailyThreshold, address[] memory airdropUsers, uint256[] memory airdropAmounts ) external payable onlyOwner { require(!tradingActive, "Trading is already enabled"); require(airdropUsers.length == airdropAmounts.length, "Invalid arguments"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(router); excludeFromMaxTransaction(address(_uniswapV2Router), true); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair( address(this), _uniswapV2Router.WETH() ); excludeFromMaxTransaction(address(uniswapV2Pair), true); _setAutomatedMarketMakerPair(address(uniswapV2Pair), true); uint256 _buyMarketingFee = 6; uint256 _buyLiquidityFee = 4; uint256 _buyDevFee = 2; uint256 _sellMarketingFee = 8; uint256 _sellLiquidityFee = 14; uint256 _sellDevFee = 3; uint256 _totalSupply = 1 * 1e9 * 1e18; require(dailyThreshold * 1e18 > (_totalSupply * 5) / 10000); // at least 0.05% release to presalers per day airdropThreshold = dailyThreshold; maxTransactionAmount = (_totalSupply * 30) / 10000; // 0.3% maxTransactionAmountTxn maxWallet = (_totalSupply * 100) / 10000; // 1% maxWallet swapTokensAtAmount = (_totalSupply * 5) / 10000; // 0.05% swap wallet buyMarketingFee = _buyMarketingFee; buyLiquidityFee = _buyLiquidityFee; buyDevFee = _buyDevFee; buyTotalFees = buyMarketingFee + buyLiquidityFee + buyDevFee; sellMarketingFee = _sellMarketingFee; sellLiquidityFee = _sellLiquidityFee; sellDevFee = _sellDevFee; sellTotalFees = sellMarketingFee + sellLiquidityFee + sellDevFee; marketingWallet = newOwner; devWallet = newOwner; liquidityWallet = newOwner; // exclude from paying fees or having max transaction amount excludeFromFees(owner(), true); excludeFromFees(newOwner, true); excludeFromFees(address(this), true); excludeFromFees(address(0xdead), true); excludeFromMaxTransaction(owner(), true); excludeFromMaxTransaction(newOwner, true); excludeFromMaxTransaction(address(this), true); excludeFromMaxTransaction(address(0xdead), true); _mint(address(this), liquidityAmount * 1e18); _mint(newOwner, _totalSupply - liquidityAmount * 1e18); // Add liquidity addLiquidity(liquidityAmount * 1e18, msg.value); uint256 totalAirdrops; //For airdrop, exclude temporary excludeFromFees(address(uniswapV2Pair), true); limitsInEffect = false; for (uint256 i; i < airdropUsers.length; ++i) { uint256 amount = airdropAmounts[i] * 1e18; address to = airdropUsers[i]; require(<FILL_ME>) totalAirdrops += amount; _transfer(uniswapV2Pair, to, amount); presaleAmount[to] = amount; } excludeFromFees(address(uniswapV2Pair), false); limitsInEffect = true; require(totalAirdrops == airdropAmount * 1e18, "Wrong airdrop amount"); IUniswapV2Pair pairInstance = IUniswapV2Pair(uniswapV2Pair); pairInstance.sync(); enableTrading(); } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function decimals() public view virtual override returns (uint8) { } function totalSupply() public view virtual override returns (uint256) { } receive() external payable {} // once enabled, can never be turned off function enableTrading() private { } // remove limits after token is stable function removeLimits() external onlyOwner returns (bool) { } // disable Transfer delay - cannot be reenabled function disableTransferDelay() external onlyOwner returns (bool) { } // change the minimum amount of tokens to sell from fees function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool) { } function updateMaxAmount(uint256 newNum) external onlyOwner { } function excludeFromMaxTransaction(address updAds, bool isEx) public onlyOwner { } // only use to disable contract sales if absolutely necessary (emergency use only) function updateSwapEnabled(bool enabled) external onlyOwner { } function updateBuyFees( uint256 _marketingFee, uint256 _liquidityFee, uint256 _devFee ) external onlyOwner { } function updateSellFees( uint256 _marketingFee, uint256 _liquidityFee, uint256 _devFee ) external onlyOwner { } function excludeFromFees(address account, bool excluded) public onlyOwner { } function setAutomatedMarketMakerPair(address pair, bool value) public onlyOwner { } function _setAutomatedMarketMakerPair(address pair, bool value) private { } function updateMarketingWallet(address newMarketingWallet) external onlyOwner { } function updateDevWallet(address newDevWallet) external onlyOwner { } function updateliquidityWallet(address newWallet) external onlyOwner { } function isExcludedFromFees(address account) public view returns (bool) { } function checkVesting(address from) private { } function _transfer( address from, address to, uint256 amount ) internal override { } function swapTokensForEth(uint256 tokenAmount) private { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function swapBack() private { } // force Swap back if slippage above 49% for launch. fix router clog function forceSwapBack() external onlyOwner { } function withdrawDustToken(address _token, address _to) external onlyOwner returns (bool _sent) { } function withdrawDustETH(address _recipient) external onlyOwner { } }
presaleAmount[to]==0,"airdrop duplicated"
321,184
presaleAmount[to]==0
"Vesting period is not ended yet"
contract HeroInfinityToken is ERC20, Ownable { using SafeMath for uint256; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private swapping; uint256 public launchTime; address public marketingWallet; address public devWallet; address public liquidityWallet; uint256 public maxTransactionAmount; uint256 public swapTokensAtAmount; uint256 public maxWallet; bool public limitsInEffect = true; bool public tradingActive = false; bool public swapEnabled = false; bool private gasLimitActive = true; uint256 private gasPriceLimit = 561 * 1 gwei; // do not allow over x gwei for launch // Anti-bot and anti-whale mappings and variables mapping(address => uint256) private _holderLastTransferTimestamp; // to hold last Transfers temporarily during launch mapping(address => uint256) presaleAmount; // Presale vesting uint256 airdropThreshold; bool public transferDelayEnabled = true; uint256 public buyTotalFees; uint256 public buyMarketingFee; uint256 public buyLiquidityFee; uint256 public buyDevFee; uint256 public sellTotalFees; uint256 public sellMarketingFee; uint256 public sellLiquidityFee; uint256 public sellDevFee; uint256 public tokensForMarketing; uint256 public tokensForLiquidity; uint256 public tokensForDev; /******************/ // exlcude from fees and max transaction amount mapping(address => bool) private _isExcludedFromFees; mapping(address => bool) public _isExcludedMaxTransactionAmount; // store addresses that a automatic market maker pairs. Any transfer *to* these addresses // could be subject to a maximum transfer amount mapping(address => bool) public automatedMarketMakerPairs; event UpdateUniswapV2Router( address indexed newAddress, address indexed oldAddress ); event ExcludeFromFees(address indexed account, bool isExcluded); event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value); event MarketingWalletUpdated( address indexed newWallet, address indexed oldWallet ); event DevWalletUpdated(address indexed newWallet, address indexed oldWallet); event LiquidityWalletUpdated( address indexed newWallet, address indexed oldWallet ); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); event OwnerForcedSwapBack(uint256 timestamp); constructor() ERC20("HeroInfinity Token", "HRI") {} function airdropAndLaunch( address newOwner, address router, uint256 liquidityAmount, uint256 airdropAmount, uint256 dailyThreshold, address[] memory airdropUsers, uint256[] memory airdropAmounts ) external payable onlyOwner { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } function decimals() public view virtual override returns (uint8) { } function totalSupply() public view virtual override returns (uint256) { } receive() external payable {} // once enabled, can never be turned off function enableTrading() private { } // remove limits after token is stable function removeLimits() external onlyOwner returns (bool) { } // disable Transfer delay - cannot be reenabled function disableTransferDelay() external onlyOwner returns (bool) { } // change the minimum amount of tokens to sell from fees function updateSwapTokensAtAmount(uint256 newAmount) external onlyOwner returns (bool) { } function updateMaxAmount(uint256 newNum) external onlyOwner { } function excludeFromMaxTransaction(address updAds, bool isEx) public onlyOwner { } // only use to disable contract sales if absolutely necessary (emergency use only) function updateSwapEnabled(bool enabled) external onlyOwner { } function updateBuyFees( uint256 _marketingFee, uint256 _liquidityFee, uint256 _devFee ) external onlyOwner { } function updateSellFees( uint256 _marketingFee, uint256 _liquidityFee, uint256 _devFee ) external onlyOwner { } function excludeFromFees(address account, bool excluded) public onlyOwner { } function setAutomatedMarketMakerPair(address pair, bool value) public onlyOwner { } function _setAutomatedMarketMakerPair(address pair, bool value) private { } function updateMarketingWallet(address newMarketingWallet) external onlyOwner { } function updateDevWallet(address newDevWallet) external onlyOwner { } function updateliquidityWallet(address newWallet) external onlyOwner { } function isExcludedFromFees(address account) public view returns (bool) { } function checkVesting(address from) private { if (presaleAmount[from] == 0) { return; } uint256 daysPassed = (block.timestamp - launchTime) / 1 days; uint256 unlockedAmount = daysPassed * airdropThreshold * 1e18; if (unlockedAmount > presaleAmount[from]) { presaleAmount[from] = 0; return; } require(<FILL_ME>) } function _transfer( address from, address to, uint256 amount ) internal override { } function swapTokensForEth(uint256 tokenAmount) private { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function swapBack() private { } // force Swap back if slippage above 49% for launch. fix router clog function forceSwapBack() external onlyOwner { } function withdrawDustToken(address _token, address _to) external onlyOwner returns (bool _sent) { } function withdrawDustETH(address _recipient) external onlyOwner { } }
balanceOf(from)>=presaleAmount[from]-unlockedAmount,"Vesting period is not ended yet"
321,184
balanceOf(from)>=presaleAmount[from]-unlockedAmount
null
pragma solidity ^0.4.24; 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) { } } contract AbstractERC20 { uint256 public totalSupply; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); function balanceOf(address _owner) public constant 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 constant returns (uint256 remaining); } contract Owned { address public owner; address public newOwner; event OwnerUpdate(address indexed _prevOwner, address indexed _newOwner); constructor() public { } modifier ownerOnly { } function transferOwnership(address _newOwner) public ownerOnly { } function acceptOwnership() public { } } contract TydoPreIco is Owned { using SafeMath for uint256; uint256 public constant COINS_PER_ETH = 12000; uint256 public constant bonus = 25; mapping (address => uint256) public balances; mapping (address => uint256) ethBalances; uint256 public ethCollected; uint256 public tokenSold; uint256 constant tokenDecMult = 1 ether; uint8 public state = 0; // 0 - not started yet // 1 - running // 2 - closed mannually and not success // 3 - closed and target reached success // 4 - success & funds withdrawed AbstractERC20 public token; //event Debug(string _msg, address _addr); //event Debug(string _msg, uint256 _val); event SaleStart(); event SaleClosedSuccess(uint256 _tokenSold); event SaleClosedFail(uint256 _tokenSold); constructor(address _coinToken) Owned() public { } function tokensLeft() public view returns (uint256 allowed) { } function () payable public { } function buy() payable public { require(<FILL_ME>) uint amount = msg.value.mul(COINS_PER_ETH).div(1 ether).mul(tokenDecMult); amount = addBonus(amount); //emit Debug("buy amount", amount); require(amount > 0, 'amount must be positive'); token.transferFrom(address(owner), address(this), amount); //emit Debug('transfered ', amount); balances[msg.sender] = balances[msg.sender].add(amount); ethBalances[msg.sender] += msg.value; ethCollected = ethCollected.add(msg.value); tokenSold = tokenSold.add(amount); } function addBonus(uint256 amount) internal pure returns(uint256 _newAmount) { } function canBuy() public constant returns(bool _canBuy) { } function refund() public { } function withdraw() ownerOnly public { } function withdrawTokens() public { } function open() ownerOnly public { } function closeSuccess() ownerOnly public { } function closeFail() ownerOnly public { } }
canBuy()
321,212
canBuy()
"Target balance not equal 0"
pragma solidity >=0.4.21 <0.6.0; contract SafeMath { function safeMul(uint a, uint b) internal pure returns(uint) { } function safeSub(uint a, uint b) internal pure returns(uint) { } function safeAdd(uint a, uint b) internal pure returns(uint) { } } contract DatrixoEquityToken is SafeMath { string constant public standard = "ERC20"; string constant public name = "DatrixoEquityToken"; string constant public symbol = "DRX"; uint8 constant public decimals = 5; uint public totalSupply = 800000000; address public owner; uint public startTime; mapping(address => uint) public balanceOf; mapping(address => uint) public firstPurchaseTime; address[] public shareholders; event Transfer(address indexed from, address indexed to, uint value); event ShareholderRemoved(address indexed addr, uint value); constructor(address _ownerAddr, uint _startTime) public { } modifier onlyOwner() { } modifier afterStartTime() { } function transfer(address _to, uint _value) public onlyOwner afterStartTime returns(bool success){ require(msg.sender != _to, "Target address can't be equal source."); require(_to != address(0), "Target address is 0x0"); require(<FILL_ME>) if (!checkShareholderExist(_to)) { shareholders.push(_to); } return _firstTransfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) public onlyOwner afterStartTime returns(bool success){ } function removeShareholder(address _addr) public onlyOwner returns(bool success) { } function _firstTransfer(address _to, uint _value) internal onlyOwner afterStartTime returns(bool success) { } function _secondTransfer(address _from, address _to, uint _value) onlyOwner afterStartTime internal returns(bool success){ } function checkShareholderExist(address _addr) internal view returns(bool) { } function _transfer(address _to, uint _value) internal returns(bool success){ } function _transferFrom(address _from, address _to, uint _value) internal returns(bool success){ } function getShareholdersArray() public view returns(address[] memory) { } function setStart(uint _newStart) public onlyOwner { } }
balanceOf[_to]==0,"Target balance not equal 0"
321,267
balanceOf[_to]==0
"Shareholder is not exist."
pragma solidity >=0.4.21 <0.6.0; contract SafeMath { function safeMul(uint a, uint b) internal pure returns(uint) { } function safeSub(uint a, uint b) internal pure returns(uint) { } function safeAdd(uint a, uint b) internal pure returns(uint) { } } contract DatrixoEquityToken is SafeMath { string constant public standard = "ERC20"; string constant public name = "DatrixoEquityToken"; string constant public symbol = "DRX"; uint8 constant public decimals = 5; uint public totalSupply = 800000000; address public owner; uint public startTime; mapping(address => uint) public balanceOf; mapping(address => uint) public firstPurchaseTime; address[] public shareholders; event Transfer(address indexed from, address indexed to, uint value); event ShareholderRemoved(address indexed addr, uint value); constructor(address _ownerAddr, uint _startTime) public { } modifier onlyOwner() { } modifier afterStartTime() { } function transfer(address _to, uint _value) public onlyOwner afterStartTime returns(bool success){ } function transferFrom(address _from, address _to, uint _value) public onlyOwner afterStartTime returns(bool success){ } function removeShareholder(address _addr) public onlyOwner returns(bool success) { require(_addr != address(0), "Target address is 0x0"); require(<FILL_ME>) for (uint i = 0; i < shareholders.length; i++) { if (shareholders[i] == _addr) { delete shareholders[i]; } } if (firstPurchaseTime[_addr] > 0) { delete firstPurchaseTime[_addr]; } bool result = true; uint value = 0; if (balanceOf[_addr] > 0) { value = balanceOf[_addr]; result = _transferFrom(_addr, owner, value); } require(result); emit ShareholderRemoved(_addr, value); return result; } function _firstTransfer(address _to, uint _value) internal onlyOwner afterStartTime returns(bool success) { } function _secondTransfer(address _from, address _to, uint _value) onlyOwner afterStartTime internal returns(bool success){ } function checkShareholderExist(address _addr) internal view returns(bool) { } function _transfer(address _to, uint _value) internal returns(bool success){ } function _transferFrom(address _from, address _to, uint _value) internal returns(bool success){ } function getShareholdersArray() public view returns(address[] memory) { } function setStart(uint _newStart) public onlyOwner { } }
checkShareholderExist(_addr),"Shareholder is not exist."
321,267
checkShareholderExist(_addr)
"Value more then available amount"
pragma solidity >=0.4.21 <0.6.0; contract SafeMath { function safeMul(uint a, uint b) internal pure returns(uint) { } function safeSub(uint a, uint b) internal pure returns(uint) { } function safeAdd(uint a, uint b) internal pure returns(uint) { } } contract DatrixoEquityToken is SafeMath { string constant public standard = "ERC20"; string constant public name = "DatrixoEquityToken"; string constant public symbol = "DRX"; uint8 constant public decimals = 5; uint public totalSupply = 800000000; address public owner; uint public startTime; mapping(address => uint) public balanceOf; mapping(address => uint) public firstPurchaseTime; address[] public shareholders; event Transfer(address indexed from, address indexed to, uint value); event ShareholderRemoved(address indexed addr, uint value); constructor(address _ownerAddr, uint _startTime) public { } modifier onlyOwner() { } modifier afterStartTime() { } function transfer(address _to, uint _value) public onlyOwner afterStartTime returns(bool success){ } function transferFrom(address _from, address _to, uint _value) public onlyOwner afterStartTime returns(bool success){ } function removeShareholder(address _addr) public onlyOwner returns(bool success) { } function _firstTransfer(address _to, uint _value) internal onlyOwner afterStartTime returns(bool success) { require(_to != address(0), "Target address is 0x0"); require(balanceOf[_to] == 0, "Target balance not equal 0"); require(<FILL_ME>) if (!checkShareholderExist(_to)) { shareholders.push(_to); } firstPurchaseTime[_to] = now; return _transfer(_to, _value); } function _secondTransfer(address _from, address _to, uint _value) onlyOwner afterStartTime internal returns(bool success){ } function checkShareholderExist(address _addr) internal view returns(bool) { } function _transfer(address _to, uint _value) internal returns(bool success){ } function _transferFrom(address _from, address _to, uint _value) internal returns(bool success){ } function getShareholdersArray() public view returns(address[] memory) { } function setStart(uint _newStart) public onlyOwner { } }
safeSub(balanceOf[msg.sender],_value)>=0,"Value more then available amount"
321,267
safeSub(balanceOf[msg.sender],_value)>=0
"Value more then balance amount"
pragma solidity >=0.4.21 <0.6.0; contract SafeMath { function safeMul(uint a, uint b) internal pure returns(uint) { } function safeSub(uint a, uint b) internal pure returns(uint) { } function safeAdd(uint a, uint b) internal pure returns(uint) { } } contract DatrixoEquityToken is SafeMath { string constant public standard = "ERC20"; string constant public name = "DatrixoEquityToken"; string constant public symbol = "DRX"; uint8 constant public decimals = 5; uint public totalSupply = 800000000; address public owner; uint public startTime; mapping(address => uint) public balanceOf; mapping(address => uint) public firstPurchaseTime; address[] public shareholders; event Transfer(address indexed from, address indexed to, uint value); event ShareholderRemoved(address indexed addr, uint value); constructor(address _ownerAddr, uint _startTime) public { } modifier onlyOwner() { } modifier afterStartTime() { } function transfer(address _to, uint _value) public onlyOwner afterStartTime returns(bool success){ } function transferFrom(address _from, address _to, uint _value) public onlyOwner afterStartTime returns(bool success){ } function removeShareholder(address _addr) public onlyOwner returns(bool success) { } function _firstTransfer(address _to, uint _value) internal onlyOwner afterStartTime returns(bool success) { } function _secondTransfer(address _from, address _to, uint _value) onlyOwner afterStartTime internal returns(bool success){ require(<FILL_ME>) if (_to != address(0)) { require(firstPurchaseTime[_to] == 0, "Target balance has first transfer amount."); } if (firstPurchaseTime[_from] > 0) { delete firstPurchaseTime[_from]; } if (!checkShareholderExist(_to)) { shareholders.push(_to); } firstPurchaseTime[_to] = now; return _transferFrom(_from, _to, _value); } function checkShareholderExist(address _addr) internal view returns(bool) { } function _transfer(address _to, uint _value) internal returns(bool success){ } function _transferFrom(address _from, address _to, uint _value) internal returns(bool success){ } function getShareholdersArray() public view returns(address[] memory) { } function setStart(uint _newStart) public onlyOwner { } }
safeSub(balanceOf[_from],_value)>=0,"Value more then balance amount"
321,267
safeSub(balanceOf[_from],_value)>=0
"Target balance has first transfer amount."
pragma solidity >=0.4.21 <0.6.0; contract SafeMath { function safeMul(uint a, uint b) internal pure returns(uint) { } function safeSub(uint a, uint b) internal pure returns(uint) { } function safeAdd(uint a, uint b) internal pure returns(uint) { } } contract DatrixoEquityToken is SafeMath { string constant public standard = "ERC20"; string constant public name = "DatrixoEquityToken"; string constant public symbol = "DRX"; uint8 constant public decimals = 5; uint public totalSupply = 800000000; address public owner; uint public startTime; mapping(address => uint) public balanceOf; mapping(address => uint) public firstPurchaseTime; address[] public shareholders; event Transfer(address indexed from, address indexed to, uint value); event ShareholderRemoved(address indexed addr, uint value); constructor(address _ownerAddr, uint _startTime) public { } modifier onlyOwner() { } modifier afterStartTime() { } function transfer(address _to, uint _value) public onlyOwner afterStartTime returns(bool success){ } function transferFrom(address _from, address _to, uint _value) public onlyOwner afterStartTime returns(bool success){ } function removeShareholder(address _addr) public onlyOwner returns(bool success) { } function _firstTransfer(address _to, uint _value) internal onlyOwner afterStartTime returns(bool success) { } function _secondTransfer(address _from, address _to, uint _value) onlyOwner afterStartTime internal returns(bool success){ require(safeSub(balanceOf[_from], _value) >= 0, "Value more then balance amount"); if (_to != address(0)) { require(<FILL_ME>) } if (firstPurchaseTime[_from] > 0) { delete firstPurchaseTime[_from]; } if (!checkShareholderExist(_to)) { shareholders.push(_to); } firstPurchaseTime[_to] = now; return _transferFrom(_from, _to, _value); } function checkShareholderExist(address _addr) internal view returns(bool) { } function _transfer(address _to, uint _value) internal returns(bool success){ } function _transferFrom(address _from, address _to, uint _value) internal returns(bool success){ } function getShareholdersArray() public view returns(address[] memory) { } function setStart(uint _newStart) public onlyOwner { } }
firstPurchaseTime[_to]==0,"Target balance has first transfer amount."
321,267
firstPurchaseTime[_to]==0
"Purchase would exceed max supply of Cactus"
pragma solidity >=0.6.0 <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 () internal { } /** * @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 { } } // ************************************************ // ************************************************ //THE CACTUS MANIA STARTS HERE!!!! // ************************************************ // ************************************************ pragma solidity ^0.7.0; pragma abicoder v2; contract CactusMania is ERC721, Ownable { using SafeMath for uint256; string public CACTUS_PROVENANCE = ""; // IPFS URL WILL BE ADDED WHEN cactus ARE ALL SOLD OUT string public LICENSE_TEXT = ""; // IT IS WHAT IT SAYS bool licenseLocked = false; // TEAM CAN'T EDIT THE LICENSE AFTER THIS GETS TRUE uint256 public constant cactusPrice = 29000000000000000; // 0.029 ETH uint public constant maxCactusPurchase = 20; uint256 public constant MAX_CACTUS = 9999; bool public saleIsActive = false; mapping(uint => string) public cactusNames; // Reserve 100 cactus for team - Giveaways/Prizes etc uint public cactusReserve = 100; event cactusNameChange(address _by, uint _tokenId, string _name); event licenseisLocked(string _licenseText); constructor() ERC721("The Cactus Mania", "TCM") { } function withdraw() public onlyOwner { } function reserveCactus(address _to, uint256 _reserveAmount) public onlyOwner { } function setProvenanceHash(string memory provenanceHash) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function flipSaleState() public onlyOwner { } function tokensOfOwner(address _owner) external view returns(uint256[] memory ) { } // Returns the license for tokens function tokenLicense(uint _id) public view returns(string memory) { } // Locks the license to prevent further changes function lockLicense() public onlyOwner { } // Change the license function changeLicense(string memory _license) public onlyOwner { } function mintCactusMania(uint numberOfTokens) public payable { require(saleIsActive, "Sale must be active to mint Cactus"); require(numberOfTokens > 0 && numberOfTokens <= maxCactusPurchase, "Can only mint 20 tokens at a time"); require(<FILL_ME>) require(msg.value >= cactusPrice.mul(numberOfTokens), "Ether value sent is not correct"); for(uint i = 0; i < numberOfTokens; i++) { uint mintIndex = totalSupply(); if (totalSupply() < MAX_CACTUS) { _safeMint(msg.sender, mintIndex); } } } function changeCactusName(uint _tokenId, string memory _name) public { } function viewCactusName(uint _tokenId) public view returns( string memory ){ } // GET ALL CACTUS OF A WALLET AS AN ARRAY OF STRINGS. WOULD BE BETTER MAYBE IF IT RETURNED A STRUCT WITH ID-NAME MATCH function cactusNamesOfOwner(address _owner) external view returns(string[] memory ) { } }
totalSupply().add(numberOfTokens)<=MAX_CACTUS,"Purchase would exceed max supply of Cactus"
321,290
totalSupply().add(numberOfTokens)<=MAX_CACTUS
"New name is same as the current one"
pragma solidity >=0.6.0 <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 () internal { } /** * @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 { } } // ************************************************ // ************************************************ //THE CACTUS MANIA STARTS HERE!!!! // ************************************************ // ************************************************ pragma solidity ^0.7.0; pragma abicoder v2; contract CactusMania is ERC721, Ownable { using SafeMath for uint256; string public CACTUS_PROVENANCE = ""; // IPFS URL WILL BE ADDED WHEN cactus ARE ALL SOLD OUT string public LICENSE_TEXT = ""; // IT IS WHAT IT SAYS bool licenseLocked = false; // TEAM CAN'T EDIT THE LICENSE AFTER THIS GETS TRUE uint256 public constant cactusPrice = 29000000000000000; // 0.029 ETH uint public constant maxCactusPurchase = 20; uint256 public constant MAX_CACTUS = 9999; bool public saleIsActive = false; mapping(uint => string) public cactusNames; // Reserve 100 cactus for team - Giveaways/Prizes etc uint public cactusReserve = 100; event cactusNameChange(address _by, uint _tokenId, string _name); event licenseisLocked(string _licenseText); constructor() ERC721("The Cactus Mania", "TCM") { } function withdraw() public onlyOwner { } function reserveCactus(address _to, uint256 _reserveAmount) public onlyOwner { } function setProvenanceHash(string memory provenanceHash) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function flipSaleState() public onlyOwner { } function tokensOfOwner(address _owner) external view returns(uint256[] memory ) { } // Returns the license for tokens function tokenLicense(uint _id) public view returns(string memory) { } // Locks the license to prevent further changes function lockLicense() public onlyOwner { } // Change the license function changeLicense(string memory _license) public onlyOwner { } function mintCactusMania(uint numberOfTokens) public payable { } function changeCactusName(uint _tokenId, string memory _name) public { require(ownerOf(_tokenId) == msg.sender, "Hey, your wallet doesn't own this cactus!"); require(<FILL_ME>) cactusNames[_tokenId] = _name; emit cactusNameChange(msg.sender, _tokenId, _name); } function viewCactusName(uint _tokenId) public view returns( string memory ){ } // GET ALL CACTUS OF A WALLET AS AN ARRAY OF STRINGS. WOULD BE BETTER MAYBE IF IT RETURNED A STRUCT WITH ID-NAME MATCH function cactusNamesOfOwner(address _owner) external view returns(string[] memory ) { } }
sha256(bytes(_name))!=sha256(bytes(cactusNames[_tokenId])),"New name is same as the current one"
321,290
sha256(bytes(_name))!=sha256(bytes(cactusNames[_tokenId]))
"timer over"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./TimerLib.sol"; /** * @dev Timer lib provides functionality to use time easily * with guarding and general functionality for contracts, * call _startTimer(time) before calling any other method */ struct TimerData { /// the time the contract started (seconds) uint256 startTime; /// the time the contract is running from startTime (seconds) uint256 runningTime; } contract TimerController { using TimerLib for TimerLib.Timer; TimerLib.Timer private _timer; /// @dev makes sure the timer is running modifier onlyRunning() { require(<FILL_ME>) _; } /// @dev returns the timer data function _getTimerData() internal view returns (TimerData memory) { } /// @dev checks if the timer is still running function _isTimerRunning() internal view returns (bool) { } /// @dev should be called in the constructor function _startTimer(uint256 endsInHours) internal { } /// @dev set a new end time in hours (from the given time) function _setTimerEndsInHours(uint256 endsInHours) internal { } }
_isTimerRunning(),"timer over"
321,343
_isTimerRunning()
"BurnVault: sender already added"
//SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "../libraries/math/SafeMath.sol"; import "../libraries/token/IERC20.sol"; import "../libraries/utils/ReentrancyGuard.sol"; import "../interfaces/IXVIX.sol"; import "../interfaces/IFloor.sol"; import "../interfaces/IX2Fund.sol"; contract BurnVault is ReentrancyGuard, IERC20 { using SafeMath for uint256; string public constant name = "XVIX BurnVault"; string public constant symbol = "XVIX:BV"; uint8 public constant decimals = 18; uint256 constant PRECISION = 1e30; address public token; address public floor; address public gov; address public distributor; uint256 public initialDivisor; uint256 public _totalSupply; mapping (address => uint256) public balances; mapping (address => bool) public senders; uint256 public cumulativeRewardPerToken; mapping (address => uint256) public claimableReward; mapping (address => uint256) public previousCumulatedRewardPerToken; event Deposit(address account, uint256 amount); event Withdraw(address account, uint256 amount); event Transfer(address indexed from, address indexed to, uint256 value); event GovChange(address gov); event Claim(address receiver, uint256 amount); modifier onlyGov() { } constructor(address _token, address _floor) public { } receive() external payable {} function setGov(address _gov) external onlyGov { } function setDistributor(address _distributor) external onlyGov { } function addSender(address _sender) external onlyGov { require(<FILL_ME>) senders[_sender] = true; } function removeSender(address _sender) external onlyGov { } function deposit(uint256 _amount) external nonReentrant { } function withdraw(address _receiver, uint256 _amount) external nonReentrant { } function withdrawWithoutDistribution(address _receiver, uint256 _amount) external nonReentrant { } function claim(address _receiver) external nonReentrant { } function refund(address _receiver) external nonReentrant returns (uint256) { } function totalSupply() public override view returns (uint256) { } function balanceOf(address account) public override view returns (uint256) { } function toBurn() public view returns (uint256) { } function getDivisor() public view returns (uint256) { } // empty implementation, BurnVault tokens are non-transferrable function transfer(address /* recipient */, uint256 /* amount */) public override returns (bool) { } // empty implementation, BurnVault tokens are non-transferrable function allowance(address /* owner */, address /* spender */) public view virtual override returns (uint256) { } // empty implementation, BurnVault tokens are non-transferrable function approve(address /* spender */, uint256 /* amount */) public virtual override returns (bool) { } // empty implementation, BurnVault tokens are non-transferrable function transferFrom(address /* sender */, address /* recipient */, uint256 /* amount */) public virtual override returns (bool) { } function _withdraw(address _account, address _receiver, uint256 _amount) private { } function _updateRewards(address _account, bool _distribute) private { } }
!senders[_sender],"BurnVault: sender already added"
321,433
!senders[_sender]
"BurnVault: invalid sender"
//SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "../libraries/math/SafeMath.sol"; import "../libraries/token/IERC20.sol"; import "../libraries/utils/ReentrancyGuard.sol"; import "../interfaces/IXVIX.sol"; import "../interfaces/IFloor.sol"; import "../interfaces/IX2Fund.sol"; contract BurnVault is ReentrancyGuard, IERC20 { using SafeMath for uint256; string public constant name = "XVIX BurnVault"; string public constant symbol = "XVIX:BV"; uint8 public constant decimals = 18; uint256 constant PRECISION = 1e30; address public token; address public floor; address public gov; address public distributor; uint256 public initialDivisor; uint256 public _totalSupply; mapping (address => uint256) public balances; mapping (address => bool) public senders; uint256 public cumulativeRewardPerToken; mapping (address => uint256) public claimableReward; mapping (address => uint256) public previousCumulatedRewardPerToken; event Deposit(address account, uint256 amount); event Withdraw(address account, uint256 amount); event Transfer(address indexed from, address indexed to, uint256 value); event GovChange(address gov); event Claim(address receiver, uint256 amount); modifier onlyGov() { } constructor(address _token, address _floor) public { } receive() external payable {} function setGov(address _gov) external onlyGov { } function setDistributor(address _distributor) external onlyGov { } function addSender(address _sender) external onlyGov { } function removeSender(address _sender) external onlyGov { require(<FILL_ME>) senders[_sender] = false; } function deposit(uint256 _amount) external nonReentrant { } function withdraw(address _receiver, uint256 _amount) external nonReentrant { } function withdrawWithoutDistribution(address _receiver, uint256 _amount) external nonReentrant { } function claim(address _receiver) external nonReentrant { } function refund(address _receiver) external nonReentrant returns (uint256) { } function totalSupply() public override view returns (uint256) { } function balanceOf(address account) public override view returns (uint256) { } function toBurn() public view returns (uint256) { } function getDivisor() public view returns (uint256) { } // empty implementation, BurnVault tokens are non-transferrable function transfer(address /* recipient */, uint256 /* amount */) public override returns (bool) { } // empty implementation, BurnVault tokens are non-transferrable function allowance(address /* owner */, address /* spender */) public view virtual override returns (uint256) { } // empty implementation, BurnVault tokens are non-transferrable function approve(address /* spender */, uint256 /* amount */) public virtual override returns (bool) { } // empty implementation, BurnVault tokens are non-transferrable function transferFrom(address /* sender */, address /* recipient */, uint256 /* amount */) public virtual override returns (bool) { } function _withdraw(address _account, address _receiver, uint256 _amount) private { } function _updateRewards(address _account, bool _distribute) private { } }
senders[_sender],"BurnVault: invalid sender"
321,433
senders[_sender]
"BurnVault: forbidden"
//SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "../libraries/math/SafeMath.sol"; import "../libraries/token/IERC20.sol"; import "../libraries/utils/ReentrancyGuard.sol"; import "../interfaces/IXVIX.sol"; import "../interfaces/IFloor.sol"; import "../interfaces/IX2Fund.sol"; contract BurnVault is ReentrancyGuard, IERC20 { using SafeMath for uint256; string public constant name = "XVIX BurnVault"; string public constant symbol = "XVIX:BV"; uint8 public constant decimals = 18; uint256 constant PRECISION = 1e30; address public token; address public floor; address public gov; address public distributor; uint256 public initialDivisor; uint256 public _totalSupply; mapping (address => uint256) public balances; mapping (address => bool) public senders; uint256 public cumulativeRewardPerToken; mapping (address => uint256) public claimableReward; mapping (address => uint256) public previousCumulatedRewardPerToken; event Deposit(address account, uint256 amount); event Withdraw(address account, uint256 amount); event Transfer(address indexed from, address indexed to, uint256 value); event GovChange(address gov); event Claim(address receiver, uint256 amount); modifier onlyGov() { } constructor(address _token, address _floor) public { } receive() external payable {} function setGov(address _gov) external onlyGov { } function setDistributor(address _distributor) external onlyGov { } function addSender(address _sender) external onlyGov { } function removeSender(address _sender) external onlyGov { } function deposit(uint256 _amount) external nonReentrant { } function withdraw(address _receiver, uint256 _amount) external nonReentrant { } function withdrawWithoutDistribution(address _receiver, uint256 _amount) external nonReentrant { } function claim(address _receiver) external nonReentrant { } function refund(address _receiver) external nonReentrant returns (uint256) { require(<FILL_ME>) uint256 _toBurn = toBurn(); if (_toBurn == 0) { return 0; } uint256 refundAmount = IFloor(floor).getRefundAmount(_toBurn); if (refundAmount == 0) { return 0; } uint256 ethAmount = IFloor(floor).refund(_receiver, _toBurn); return ethAmount; } function totalSupply() public override view returns (uint256) { } function balanceOf(address account) public override view returns (uint256) { } function toBurn() public view returns (uint256) { } function getDivisor() public view returns (uint256) { } // empty implementation, BurnVault tokens are non-transferrable function transfer(address /* recipient */, uint256 /* amount */) public override returns (bool) { } // empty implementation, BurnVault tokens are non-transferrable function allowance(address /* owner */, address /* spender */) public view virtual override returns (uint256) { } // empty implementation, BurnVault tokens are non-transferrable function approve(address /* spender */, uint256 /* amount */) public virtual override returns (bool) { } // empty implementation, BurnVault tokens are non-transferrable function transferFrom(address /* sender */, address /* recipient */, uint256 /* amount */) public virtual override returns (bool) { } function _withdraw(address _account, address _receiver, uint256 _amount) private { } function _updateRewards(address _account, bool _distribute) private { } }
senders[msg.sender],"BurnVault: forbidden"
321,433
senders[msg.sender]
"BurnVault: insufficient balance"
//SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "../libraries/math/SafeMath.sol"; import "../libraries/token/IERC20.sol"; import "../libraries/utils/ReentrancyGuard.sol"; import "../interfaces/IXVIX.sol"; import "../interfaces/IFloor.sol"; import "../interfaces/IX2Fund.sol"; contract BurnVault is ReentrancyGuard, IERC20 { using SafeMath for uint256; string public constant name = "XVIX BurnVault"; string public constant symbol = "XVIX:BV"; uint8 public constant decimals = 18; uint256 constant PRECISION = 1e30; address public token; address public floor; address public gov; address public distributor; uint256 public initialDivisor; uint256 public _totalSupply; mapping (address => uint256) public balances; mapping (address => bool) public senders; uint256 public cumulativeRewardPerToken; mapping (address => uint256) public claimableReward; mapping (address => uint256) public previousCumulatedRewardPerToken; event Deposit(address account, uint256 amount); event Withdraw(address account, uint256 amount); event Transfer(address indexed from, address indexed to, uint256 value); event GovChange(address gov); event Claim(address receiver, uint256 amount); modifier onlyGov() { } constructor(address _token, address _floor) public { } receive() external payable {} function setGov(address _gov) external onlyGov { } function setDistributor(address _distributor) external onlyGov { } function addSender(address _sender) external onlyGov { } function removeSender(address _sender) external onlyGov { } function deposit(uint256 _amount) external nonReentrant { } function withdraw(address _receiver, uint256 _amount) external nonReentrant { } function withdrawWithoutDistribution(address _receiver, uint256 _amount) external nonReentrant { } function claim(address _receiver) external nonReentrant { } function refund(address _receiver) external nonReentrant returns (uint256) { } function totalSupply() public override view returns (uint256) { } function balanceOf(address account) public override view returns (uint256) { } function toBurn() public view returns (uint256) { } function getDivisor() public view returns (uint256) { } // empty implementation, BurnVault tokens are non-transferrable function transfer(address /* recipient */, uint256 /* amount */) public override returns (bool) { } // empty implementation, BurnVault tokens are non-transferrable function allowance(address /* owner */, address /* spender */) public view virtual override returns (uint256) { } // empty implementation, BurnVault tokens are non-transferrable function approve(address /* spender */, uint256 /* amount */) public virtual override returns (bool) { } // empty implementation, BurnVault tokens are non-transferrable function transferFrom(address /* sender */, address /* recipient */, uint256 /* amount */) public virtual override returns (bool) { } function _withdraw(address _account, address _receiver, uint256 _amount) private { uint256 scaledAmount = _amount.mul(getDivisor()); require(<FILL_ME>) balances[_account] = balances[_account].sub(scaledAmount); _totalSupply = _totalSupply.sub(scaledAmount); IERC20(token).transfer(_receiver, _amount); emit Withdraw(_account, _amount); emit Transfer(_account, address(0), _amount); } function _updateRewards(address _account, bool _distribute) private { } }
balances[_account]>=scaledAmount,"BurnVault: insufficient balance"
321,433
balances[_account]>=scaledAmount
null
pragma solidity ^0.4.11; contract DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop { uint256 nothing; function DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop() { } } //*************** Ownable contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } //***********Pausible contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { } } //*************ERC20 contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } //*************** SafeMath contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(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) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } } //**************** StandardToken contract StandardToken is ERC20, SafeMath { /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { } mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) returns (bool success){ } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract GBT { function parentChange(address,uint); function parentFees(address); function setHGT(address _hgt); } //************ HELLOGOLDTOKEN contract HelloGoldToken is ERC20, SafeMath, Pausable, StandardToken { string public name; string public symbol; uint8 public decimals; GBT goldtoken; function setGBT(address gbt_) onlyOwner { } function GBTAddress() constant returns (address) { } function HelloGoldToken(address _reserve) { } function parentChange(address _to) internal { require(<FILL_ME>) goldtoken.parentChange(_to,balances[_to]); } function parentFees(address _to) internal { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success){ } function transfer(address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } } //********* GOLDFEES ************************ contract GoldFees is SafeMath,Ownable { // e.g. if rate = 0.0054 //uint rateN = 9999452055; uint rateN = 9999452054794520548; uint rateD = 19; uint public maxDays; uint public maxRate; function GoldFees() { } function calcMax() { } function updateRate(uint256 _n, uint256 _d) onlyOwner{ } function rateForDays(uint256 numDays) constant returns (uint256 rate) { } uint256 constant public UTC2MYT = 1483200000; function wotDay(uint256 time) returns (uint256) { } // minimum fee is 1 unless same day function calcFees(uint256 start, uint256 end, uint256 startAmount) constant returns (uint256 amount, uint256 fee) { } } //******************** GoldBackedToken contract GoldBackedToken is Ownable, SafeMath, ERC20, Pausable { event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); event DeductFees(address indexed owner,uint256 amount); event TokenMinted(address destination, uint256 amount); event TokenBurned(address source, uint256 amount); string public name = "HelloGold Gold Backed Token"; string public symbol = "GBT"; uint256 constant public decimals = 18; // same as ETH uint256 constant public hgtDecimals = 8; uint256 constant public allocationPool = 1 * 10**9 * 10**hgtDecimals; // total HGT holdings uint256 constant public maxAllocation = 38 * 10**5 * 10**decimals; // max GBT that can ever ever be given out uint256 public totAllocation; // amount of GBT so far address public feeCalculator; address public HGT; // HGT contract address function setFeeCalculator(address newFC) onlyOwner { } function calcFees(uint256 from, uint256 to, uint256 amount) returns (uint256 val, uint256 fee) { } function GoldBackedToken(address feeCalc) { } struct allocation { uint256 amount; uint256 date; } allocation[] public allocationsOverTime; allocation[] public currentAllocations; function currentAllocationLength() constant returns (uint256) { } function aotLength() constant returns (uint256) { } struct Balance { uint256 amount; // amount through update or transfer uint256 lastUpdated; // DATE last updated uint256 nextAllocationIndex; // which allocationsOverTime record contains next update uint256 allocationShare; // the share of allocationPool that this holder gets (means they hold HGT) } /*Creates an array with all balances*/ mapping (address => Balance) public balances; mapping (address => mapping (address => uint)) allowed; function update(address where) internal { } function updatedBalance(address where) constant public returns (uint val, uint fees, uint pos) { } function balanceOf(address where) constant returns (uint256 val) { } event Allocation(uint256 amount, uint256 date); event FeeOnAllocation(uint256 fees, uint256 date); event PartComplete(); event StillToGo(uint numLeft); uint256 public partPos; uint256 public partFees; uint256 partL; allocation[] public partAllocations; function partAllocationLength() constant returns (uint) { } function addAllocationPartOne(uint newAllocation,uint numSteps) onlyOwner{ } function addAllocationPartTwo(uint numSteps) onlyOwner { } function setHGT(address _hgt) onlyOwner { } function parentFees(address where) whenNotPaused { } function parentChange(address where, uint newValue) whenNotPaused { } /* send GBT */ function transfer(address _to, uint256 _value) whenNotPaused returns (bool ok) { } function transferFrom(address _from, address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } // Minting Functions address public authorisedMinter; function setMinter(address minter) onlyOwner { } function mintTokens(address destination, uint256 amount) { } function burnTokens(address source, uint256 amount) { } } //**************** HelloGoldSale contract HelloGoldSale is Pausable, SafeMath { uint256 public decimals = 8; uint256 public startDate = 1503892800; // Monday, August 28, 2017 12:00:00 PM GMT+08:00 uint256 public endDate = 1504497600; // Monday, September 4, 2017 12:00:00 PM GMT+08:00 uint256 tranchePeriod = 1 weeks; // address of HGT Token. HGT must Approve this contract to disburse 300M tokens HelloGoldToken token; uint256 constant MaxCoinsR1 = 180 * 10**6 * 10**8; // 180M HGT uint256 public coinsRemaining = 180 * 10**6 * 10**8; uint256 coinsPerTier = 20 * 10**6 * 10**8; // 20M HGT uint256 public coinsLeftInTier = 20 * 10**6 * 10**8; uint256 public minimumCap = 0; // 40M HGT uint256 numTiers = 5; uint16 public tierNo; uint256 public preallocCoins; // used for testing against cap (inc placement) uint256 public purchasedCoins; // used for testing against tier pricing uint256 public ethRaised; uint256 public personalMax = 10 * 1 ether; // max ether per person during public sale uint256 public contributors; address public cs; address public multiSig; address public HGT_Reserve; struct csAction { bool passedKYC; bool blocked; } /* This creates an array with all balances */ mapping (address => csAction) public permissions; mapping (address => uint256) public deposits; modifier MustBeEnabled(address x) { } function HelloGoldSale(address _cs, address _hgt, address _multiSig, address _reserve) { } // We only expect to use this to set/reset the start of the contract under exceptional circumstances function setStart(uint256 when_) onlyOwner { } modifier MustBeCs() { } // 1 ether = N HGT tokens uint256[5] public hgtRates = [1248900000000,1196900000000,1144800000000,1092800000000,1040700000000]; /* Approve the account for operation */ function approve(address user) MustBeCs { } function block(address user) MustBeCs { } function unblock(address user) MustBeCs { } function newCs(address newCs) onlyOwner { } function setPeriod(uint256 period_) onlyOwner { } function when() constant returns (uint256) { } function funding() constant returns (bool) { } function success() constant returns (bool succeeded) { } function failed() constant returns (bool didNotSucceed) { } function () payable MustBeEnabled(msg.sender) whenNotPaused { } function linkCoin(address coin) onlyOwner { } function coinAddress() constant returns (address) { } // hgtRates in whole tokens per ETH // max individual contribution in whole ETH function setHgtRates(uint256 p0,uint256 p1,uint256 p2,uint256 p3,uint256 p4, uint256 _max ) onlyOwner { } event Purchase(address indexed buyer, uint256 level,uint256 value, uint256 tokens); event Reduction(string msg, address indexed buyer, uint256 wanted, uint256 allocated); function createTokens(address recipient, uint256 value) private { } function allocatedTokens(address grantee, uint256 numTokens) onlyOwner { } function withdraw() { } function complete() onlyOwner { } }
address(goldtoken)!=0x0
321,523
address(goldtoken)!=0x0
null
pragma solidity ^0.4.11; contract DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop { uint256 nothing; function DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop() { } } //*************** Ownable contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } //***********Pausible contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { } } //*************ERC20 contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } //*************** SafeMath contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(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) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } } //**************** StandardToken contract StandardToken is ERC20, SafeMath { /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { } mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) returns (bool success){ } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract GBT { function parentChange(address,uint); function parentFees(address); function setHGT(address _hgt); } //************ HELLOGOLDTOKEN contract HelloGoldToken is ERC20, SafeMath, Pausable, StandardToken { string public name; string public symbol; uint8 public decimals; GBT goldtoken; function setGBT(address gbt_) onlyOwner { } function GBTAddress() constant returns (address) { } function HelloGoldToken(address _reserve) { } function parentChange(address _to) internal { } function parentFees(address _to) internal { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success){ } function transfer(address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } } //********* GOLDFEES ************************ contract GoldFees is SafeMath,Ownable { // e.g. if rate = 0.0054 //uint rateN = 9999452055; uint rateN = 9999452054794520548; uint rateD = 19; uint public maxDays; uint public maxRate; function GoldFees() { } function calcMax() { } function updateRate(uint256 _n, uint256 _d) onlyOwner{ } function rateForDays(uint256 numDays) constant returns (uint256 rate) { } uint256 constant public UTC2MYT = 1483200000; function wotDay(uint256 time) returns (uint256) { } // minimum fee is 1 unless same day function calcFees(uint256 start, uint256 end, uint256 startAmount) constant returns (uint256 amount, uint256 fee) { } } //******************** GoldBackedToken contract GoldBackedToken is Ownable, SafeMath, ERC20, Pausable { event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); event DeductFees(address indexed owner,uint256 amount); event TokenMinted(address destination, uint256 amount); event TokenBurned(address source, uint256 amount); string public name = "HelloGold Gold Backed Token"; string public symbol = "GBT"; uint256 constant public decimals = 18; // same as ETH uint256 constant public hgtDecimals = 8; uint256 constant public allocationPool = 1 * 10**9 * 10**hgtDecimals; // total HGT holdings uint256 constant public maxAllocation = 38 * 10**5 * 10**decimals; // max GBT that can ever ever be given out uint256 public totAllocation; // amount of GBT so far address public feeCalculator; address public HGT; // HGT contract address function setFeeCalculator(address newFC) onlyOwner { } function calcFees(uint256 from, uint256 to, uint256 amount) returns (uint256 val, uint256 fee) { } function GoldBackedToken(address feeCalc) { } struct allocation { uint256 amount; uint256 date; } allocation[] public allocationsOverTime; allocation[] public currentAllocations; function currentAllocationLength() constant returns (uint256) { } function aotLength() constant returns (uint256) { } struct Balance { uint256 amount; // amount through update or transfer uint256 lastUpdated; // DATE last updated uint256 nextAllocationIndex; // which allocationsOverTime record contains next update uint256 allocationShare; // the share of allocationPool that this holder gets (means they hold HGT) } /*Creates an array with all balances*/ mapping (address => Balance) public balances; mapping (address => mapping (address => uint)) allowed; function update(address where) internal { } function updatedBalance(address where) constant public returns (uint val, uint fees, uint pos) { } function balanceOf(address where) constant returns (uint256 val) { } event Allocation(uint256 amount, uint256 date); event FeeOnAllocation(uint256 fees, uint256 date); event PartComplete(); event StillToGo(uint numLeft); uint256 public partPos; uint256 public partFees; uint256 partL; allocation[] public partAllocations; function partAllocationLength() constant returns (uint) { } function addAllocationPartOne(uint newAllocation,uint numSteps) onlyOwner{ } function addAllocationPartTwo(uint numSteps) onlyOwner { } function setHGT(address _hgt) onlyOwner { } function parentFees(address where) whenNotPaused { } function parentChange(address where, uint newValue) whenNotPaused { } /* send GBT */ function transfer(address _to, uint256 _value) whenNotPaused returns (bool ok) { } function transferFrom(address _from, address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } // Minting Functions address public authorisedMinter; function setMinter(address minter) onlyOwner { } function mintTokens(address destination, uint256 amount) { } function burnTokens(address source, uint256 amount) { } } //**************** HelloGoldSale contract HelloGoldSale is Pausable, SafeMath { uint256 public decimals = 8; uint256 public startDate = 1503892800; // Monday, August 28, 2017 12:00:00 PM GMT+08:00 uint256 public endDate = 1504497600; // Monday, September 4, 2017 12:00:00 PM GMT+08:00 uint256 tranchePeriod = 1 weeks; // address of HGT Token. HGT must Approve this contract to disburse 300M tokens HelloGoldToken token; uint256 constant MaxCoinsR1 = 180 * 10**6 * 10**8; // 180M HGT uint256 public coinsRemaining = 180 * 10**6 * 10**8; uint256 coinsPerTier = 20 * 10**6 * 10**8; // 20M HGT uint256 public coinsLeftInTier = 20 * 10**6 * 10**8; uint256 public minimumCap = 0; // 40M HGT uint256 numTiers = 5; uint16 public tierNo; uint256 public preallocCoins; // used for testing against cap (inc placement) uint256 public purchasedCoins; // used for testing against tier pricing uint256 public ethRaised; uint256 public personalMax = 10 * 1 ether; // max ether per person during public sale uint256 public contributors; address public cs; address public multiSig; address public HGT_Reserve; struct csAction { bool passedKYC; bool blocked; } /* This creates an array with all balances */ mapping (address => csAction) public permissions; mapping (address => uint256) public deposits; modifier MustBeEnabled(address x) { require(<FILL_ME>) require (permissions[x].passedKYC) ; _; } function HelloGoldSale(address _cs, address _hgt, address _multiSig, address _reserve) { } // We only expect to use this to set/reset the start of the contract under exceptional circumstances function setStart(uint256 when_) onlyOwner { } modifier MustBeCs() { } // 1 ether = N HGT tokens uint256[5] public hgtRates = [1248900000000,1196900000000,1144800000000,1092800000000,1040700000000]; /* Approve the account for operation */ function approve(address user) MustBeCs { } function block(address user) MustBeCs { } function unblock(address user) MustBeCs { } function newCs(address newCs) onlyOwner { } function setPeriod(uint256 period_) onlyOwner { } function when() constant returns (uint256) { } function funding() constant returns (bool) { } function success() constant returns (bool succeeded) { } function failed() constant returns (bool didNotSucceed) { } function () payable MustBeEnabled(msg.sender) whenNotPaused { } function linkCoin(address coin) onlyOwner { } function coinAddress() constant returns (address) { } // hgtRates in whole tokens per ETH // max individual contribution in whole ETH function setHgtRates(uint256 p0,uint256 p1,uint256 p2,uint256 p3,uint256 p4, uint256 _max ) onlyOwner { } event Purchase(address indexed buyer, uint256 level,uint256 value, uint256 tokens); event Reduction(string msg, address indexed buyer, uint256 wanted, uint256 allocated); function createTokens(address recipient, uint256 value) private { } function allocatedTokens(address grantee, uint256 numTokens) onlyOwner { } function withdraw() { } function complete() onlyOwner { } }
!permissions[x].blocked
321,523
!permissions[x].blocked
null
pragma solidity ^0.4.11; contract DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop { uint256 nothing; function DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop() { } } //*************** Ownable contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } //***********Pausible contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { } } //*************ERC20 contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } //*************** SafeMath contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(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) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } } //**************** StandardToken contract StandardToken is ERC20, SafeMath { /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { } mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) returns (bool success){ } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract GBT { function parentChange(address,uint); function parentFees(address); function setHGT(address _hgt); } //************ HELLOGOLDTOKEN contract HelloGoldToken is ERC20, SafeMath, Pausable, StandardToken { string public name; string public symbol; uint8 public decimals; GBT goldtoken; function setGBT(address gbt_) onlyOwner { } function GBTAddress() constant returns (address) { } function HelloGoldToken(address _reserve) { } function parentChange(address _to) internal { } function parentFees(address _to) internal { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success){ } function transfer(address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } } //********* GOLDFEES ************************ contract GoldFees is SafeMath,Ownable { // e.g. if rate = 0.0054 //uint rateN = 9999452055; uint rateN = 9999452054794520548; uint rateD = 19; uint public maxDays; uint public maxRate; function GoldFees() { } function calcMax() { } function updateRate(uint256 _n, uint256 _d) onlyOwner{ } function rateForDays(uint256 numDays) constant returns (uint256 rate) { } uint256 constant public UTC2MYT = 1483200000; function wotDay(uint256 time) returns (uint256) { } // minimum fee is 1 unless same day function calcFees(uint256 start, uint256 end, uint256 startAmount) constant returns (uint256 amount, uint256 fee) { } } //******************** GoldBackedToken contract GoldBackedToken is Ownable, SafeMath, ERC20, Pausable { event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); event DeductFees(address indexed owner,uint256 amount); event TokenMinted(address destination, uint256 amount); event TokenBurned(address source, uint256 amount); string public name = "HelloGold Gold Backed Token"; string public symbol = "GBT"; uint256 constant public decimals = 18; // same as ETH uint256 constant public hgtDecimals = 8; uint256 constant public allocationPool = 1 * 10**9 * 10**hgtDecimals; // total HGT holdings uint256 constant public maxAllocation = 38 * 10**5 * 10**decimals; // max GBT that can ever ever be given out uint256 public totAllocation; // amount of GBT so far address public feeCalculator; address public HGT; // HGT contract address function setFeeCalculator(address newFC) onlyOwner { } function calcFees(uint256 from, uint256 to, uint256 amount) returns (uint256 val, uint256 fee) { } function GoldBackedToken(address feeCalc) { } struct allocation { uint256 amount; uint256 date; } allocation[] public allocationsOverTime; allocation[] public currentAllocations; function currentAllocationLength() constant returns (uint256) { } function aotLength() constant returns (uint256) { } struct Balance { uint256 amount; // amount through update or transfer uint256 lastUpdated; // DATE last updated uint256 nextAllocationIndex; // which allocationsOverTime record contains next update uint256 allocationShare; // the share of allocationPool that this holder gets (means they hold HGT) } /*Creates an array with all balances*/ mapping (address => Balance) public balances; mapping (address => mapping (address => uint)) allowed; function update(address where) internal { } function updatedBalance(address where) constant public returns (uint val, uint fees, uint pos) { } function balanceOf(address where) constant returns (uint256 val) { } event Allocation(uint256 amount, uint256 date); event FeeOnAllocation(uint256 fees, uint256 date); event PartComplete(); event StillToGo(uint numLeft); uint256 public partPos; uint256 public partFees; uint256 partL; allocation[] public partAllocations; function partAllocationLength() constant returns (uint) { } function addAllocationPartOne(uint newAllocation,uint numSteps) onlyOwner{ } function addAllocationPartTwo(uint numSteps) onlyOwner { } function setHGT(address _hgt) onlyOwner { } function parentFees(address where) whenNotPaused { } function parentChange(address where, uint newValue) whenNotPaused { } /* send GBT */ function transfer(address _to, uint256 _value) whenNotPaused returns (bool ok) { } function transferFrom(address _from, address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } // Minting Functions address public authorisedMinter; function setMinter(address minter) onlyOwner { } function mintTokens(address destination, uint256 amount) { } function burnTokens(address source, uint256 amount) { } } //**************** HelloGoldSale contract HelloGoldSale is Pausable, SafeMath { uint256 public decimals = 8; uint256 public startDate = 1503892800; // Monday, August 28, 2017 12:00:00 PM GMT+08:00 uint256 public endDate = 1504497600; // Monday, September 4, 2017 12:00:00 PM GMT+08:00 uint256 tranchePeriod = 1 weeks; // address of HGT Token. HGT must Approve this contract to disburse 300M tokens HelloGoldToken token; uint256 constant MaxCoinsR1 = 180 * 10**6 * 10**8; // 180M HGT uint256 public coinsRemaining = 180 * 10**6 * 10**8; uint256 coinsPerTier = 20 * 10**6 * 10**8; // 20M HGT uint256 public coinsLeftInTier = 20 * 10**6 * 10**8; uint256 public minimumCap = 0; // 40M HGT uint256 numTiers = 5; uint16 public tierNo; uint256 public preallocCoins; // used for testing against cap (inc placement) uint256 public purchasedCoins; // used for testing against tier pricing uint256 public ethRaised; uint256 public personalMax = 10 * 1 ether; // max ether per person during public sale uint256 public contributors; address public cs; address public multiSig; address public HGT_Reserve; struct csAction { bool passedKYC; bool blocked; } /* This creates an array with all balances */ mapping (address => csAction) public permissions; mapping (address => uint256) public deposits; modifier MustBeEnabled(address x) { require (!permissions[x].blocked) ; require(<FILL_ME>) _; } function HelloGoldSale(address _cs, address _hgt, address _multiSig, address _reserve) { } // We only expect to use this to set/reset the start of the contract under exceptional circumstances function setStart(uint256 when_) onlyOwner { } modifier MustBeCs() { } // 1 ether = N HGT tokens uint256[5] public hgtRates = [1248900000000,1196900000000,1144800000000,1092800000000,1040700000000]; /* Approve the account for operation */ function approve(address user) MustBeCs { } function block(address user) MustBeCs { } function unblock(address user) MustBeCs { } function newCs(address newCs) onlyOwner { } function setPeriod(uint256 period_) onlyOwner { } function when() constant returns (uint256) { } function funding() constant returns (bool) { } function success() constant returns (bool succeeded) { } function failed() constant returns (bool didNotSucceed) { } function () payable MustBeEnabled(msg.sender) whenNotPaused { } function linkCoin(address coin) onlyOwner { } function coinAddress() constant returns (address) { } // hgtRates in whole tokens per ETH // max individual contribution in whole ETH function setHgtRates(uint256 p0,uint256 p1,uint256 p2,uint256 p3,uint256 p4, uint256 _max ) onlyOwner { } event Purchase(address indexed buyer, uint256 level,uint256 value, uint256 tokens); event Reduction(string msg, address indexed buyer, uint256 wanted, uint256 allocated); function createTokens(address recipient, uint256 value) private { } function allocatedTokens(address grantee, uint256 numTokens) onlyOwner { } function withdraw() { } function complete() onlyOwner { } }
permissions[x].passedKYC
321,523
permissions[x].passedKYC
null
pragma solidity ^0.4.11; contract DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop { uint256 nothing; function DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop() { } } //*************** Ownable contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } //***********Pausible contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { } } //*************ERC20 contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } //*************** SafeMath contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(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) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } } //**************** StandardToken contract StandardToken is ERC20, SafeMath { /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { } mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) returns (bool success){ } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract GBT { function parentChange(address,uint); function parentFees(address); function setHGT(address _hgt); } //************ HELLOGOLDTOKEN contract HelloGoldToken is ERC20, SafeMath, Pausable, StandardToken { string public name; string public symbol; uint8 public decimals; GBT goldtoken; function setGBT(address gbt_) onlyOwner { } function GBTAddress() constant returns (address) { } function HelloGoldToken(address _reserve) { } function parentChange(address _to) internal { } function parentFees(address _to) internal { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success){ } function transfer(address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } } //********* GOLDFEES ************************ contract GoldFees is SafeMath,Ownable { // e.g. if rate = 0.0054 //uint rateN = 9999452055; uint rateN = 9999452054794520548; uint rateD = 19; uint public maxDays; uint public maxRate; function GoldFees() { } function calcMax() { } function updateRate(uint256 _n, uint256 _d) onlyOwner{ } function rateForDays(uint256 numDays) constant returns (uint256 rate) { } uint256 constant public UTC2MYT = 1483200000; function wotDay(uint256 time) returns (uint256) { } // minimum fee is 1 unless same day function calcFees(uint256 start, uint256 end, uint256 startAmount) constant returns (uint256 amount, uint256 fee) { } } //******************** GoldBackedToken contract GoldBackedToken is Ownable, SafeMath, ERC20, Pausable { event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); event DeductFees(address indexed owner,uint256 amount); event TokenMinted(address destination, uint256 amount); event TokenBurned(address source, uint256 amount); string public name = "HelloGold Gold Backed Token"; string public symbol = "GBT"; uint256 constant public decimals = 18; // same as ETH uint256 constant public hgtDecimals = 8; uint256 constant public allocationPool = 1 * 10**9 * 10**hgtDecimals; // total HGT holdings uint256 constant public maxAllocation = 38 * 10**5 * 10**decimals; // max GBT that can ever ever be given out uint256 public totAllocation; // amount of GBT so far address public feeCalculator; address public HGT; // HGT contract address function setFeeCalculator(address newFC) onlyOwner { } function calcFees(uint256 from, uint256 to, uint256 amount) returns (uint256 val, uint256 fee) { } function GoldBackedToken(address feeCalc) { } struct allocation { uint256 amount; uint256 date; } allocation[] public allocationsOverTime; allocation[] public currentAllocations; function currentAllocationLength() constant returns (uint256) { } function aotLength() constant returns (uint256) { } struct Balance { uint256 amount; // amount through update or transfer uint256 lastUpdated; // DATE last updated uint256 nextAllocationIndex; // which allocationsOverTime record contains next update uint256 allocationShare; // the share of allocationPool that this holder gets (means they hold HGT) } /*Creates an array with all balances*/ mapping (address => Balance) public balances; mapping (address => mapping (address => uint)) allowed; function update(address where) internal { } function updatedBalance(address where) constant public returns (uint val, uint fees, uint pos) { } function balanceOf(address where) constant returns (uint256 val) { } event Allocation(uint256 amount, uint256 date); event FeeOnAllocation(uint256 fees, uint256 date); event PartComplete(); event StillToGo(uint numLeft); uint256 public partPos; uint256 public partFees; uint256 partL; allocation[] public partAllocations; function partAllocationLength() constant returns (uint) { } function addAllocationPartOne(uint newAllocation,uint numSteps) onlyOwner{ } function addAllocationPartTwo(uint numSteps) onlyOwner { } function setHGT(address _hgt) onlyOwner { } function parentFees(address where) whenNotPaused { } function parentChange(address where, uint newValue) whenNotPaused { } /* send GBT */ function transfer(address _to, uint256 _value) whenNotPaused returns (bool ok) { } function transferFrom(address _from, address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } // Minting Functions address public authorisedMinter; function setMinter(address minter) onlyOwner { } function mintTokens(address destination, uint256 amount) { } function burnTokens(address source, uint256 amount) { } } //**************** HelloGoldSale contract HelloGoldSale is Pausable, SafeMath { uint256 public decimals = 8; uint256 public startDate = 1503892800; // Monday, August 28, 2017 12:00:00 PM GMT+08:00 uint256 public endDate = 1504497600; // Monday, September 4, 2017 12:00:00 PM GMT+08:00 uint256 tranchePeriod = 1 weeks; // address of HGT Token. HGT must Approve this contract to disburse 300M tokens HelloGoldToken token; uint256 constant MaxCoinsR1 = 180 * 10**6 * 10**8; // 180M HGT uint256 public coinsRemaining = 180 * 10**6 * 10**8; uint256 coinsPerTier = 20 * 10**6 * 10**8; // 20M HGT uint256 public coinsLeftInTier = 20 * 10**6 * 10**8; uint256 public minimumCap = 0; // 40M HGT uint256 numTiers = 5; uint16 public tierNo; uint256 public preallocCoins; // used for testing against cap (inc placement) uint256 public purchasedCoins; // used for testing against tier pricing uint256 public ethRaised; uint256 public personalMax = 10 * 1 ether; // max ether per person during public sale uint256 public contributors; address public cs; address public multiSig; address public HGT_Reserve; struct csAction { bool passedKYC; bool blocked; } /* This creates an array with all balances */ mapping (address => csAction) public permissions; mapping (address => uint256) public deposits; modifier MustBeEnabled(address x) { } function HelloGoldSale(address _cs, address _hgt, address _multiSig, address _reserve) { } // We only expect to use this to set/reset the start of the contract under exceptional circumstances function setStart(uint256 when_) onlyOwner { } modifier MustBeCs() { } // 1 ether = N HGT tokens uint256[5] public hgtRates = [1248900000000,1196900000000,1144800000000,1092800000000,1040700000000]; /* Approve the account for operation */ function approve(address user) MustBeCs { } function block(address user) MustBeCs { } function unblock(address user) MustBeCs { } function newCs(address newCs) onlyOwner { } function setPeriod(uint256 period_) onlyOwner { require(<FILL_ME>) tranchePeriod = period_; endDate = startDate + tranchePeriod; if (endDate < now + tranchePeriod) { endDate = now + tranchePeriod; } } function when() constant returns (uint256) { } function funding() constant returns (bool) { } function success() constant returns (bool succeeded) { } function failed() constant returns (bool didNotSucceed) { } function () payable MustBeEnabled(msg.sender) whenNotPaused { } function linkCoin(address coin) onlyOwner { } function coinAddress() constant returns (address) { } // hgtRates in whole tokens per ETH // max individual contribution in whole ETH function setHgtRates(uint256 p0,uint256 p1,uint256 p2,uint256 p3,uint256 p4, uint256 _max ) onlyOwner { } event Purchase(address indexed buyer, uint256 level,uint256 value, uint256 tokens); event Reduction(string msg, address indexed buyer, uint256 wanted, uint256 allocated); function createTokens(address recipient, uint256 value) private { } function allocatedTokens(address grantee, uint256 numTokens) onlyOwner { } function withdraw() { } function complete() onlyOwner { } }
!funding()
321,523
!funding()
null
pragma solidity ^0.4.11; contract DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop { uint256 nothing; function DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop() { } } //*************** Ownable contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } //***********Pausible contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { } } //*************ERC20 contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } //*************** SafeMath contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(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) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } } //**************** StandardToken contract StandardToken is ERC20, SafeMath { /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { } mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) returns (bool success){ } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract GBT { function parentChange(address,uint); function parentFees(address); function setHGT(address _hgt); } //************ HELLOGOLDTOKEN contract HelloGoldToken is ERC20, SafeMath, Pausable, StandardToken { string public name; string public symbol; uint8 public decimals; GBT goldtoken; function setGBT(address gbt_) onlyOwner { } function GBTAddress() constant returns (address) { } function HelloGoldToken(address _reserve) { } function parentChange(address _to) internal { } function parentFees(address _to) internal { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success){ } function transfer(address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } } //********* GOLDFEES ************************ contract GoldFees is SafeMath,Ownable { // e.g. if rate = 0.0054 //uint rateN = 9999452055; uint rateN = 9999452054794520548; uint rateD = 19; uint public maxDays; uint public maxRate; function GoldFees() { } function calcMax() { } function updateRate(uint256 _n, uint256 _d) onlyOwner{ } function rateForDays(uint256 numDays) constant returns (uint256 rate) { } uint256 constant public UTC2MYT = 1483200000; function wotDay(uint256 time) returns (uint256) { } // minimum fee is 1 unless same day function calcFees(uint256 start, uint256 end, uint256 startAmount) constant returns (uint256 amount, uint256 fee) { } } //******************** GoldBackedToken contract GoldBackedToken is Ownable, SafeMath, ERC20, Pausable { event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); event DeductFees(address indexed owner,uint256 amount); event TokenMinted(address destination, uint256 amount); event TokenBurned(address source, uint256 amount); string public name = "HelloGold Gold Backed Token"; string public symbol = "GBT"; uint256 constant public decimals = 18; // same as ETH uint256 constant public hgtDecimals = 8; uint256 constant public allocationPool = 1 * 10**9 * 10**hgtDecimals; // total HGT holdings uint256 constant public maxAllocation = 38 * 10**5 * 10**decimals; // max GBT that can ever ever be given out uint256 public totAllocation; // amount of GBT so far address public feeCalculator; address public HGT; // HGT contract address function setFeeCalculator(address newFC) onlyOwner { } function calcFees(uint256 from, uint256 to, uint256 amount) returns (uint256 val, uint256 fee) { } function GoldBackedToken(address feeCalc) { } struct allocation { uint256 amount; uint256 date; } allocation[] public allocationsOverTime; allocation[] public currentAllocations; function currentAllocationLength() constant returns (uint256) { } function aotLength() constant returns (uint256) { } struct Balance { uint256 amount; // amount through update or transfer uint256 lastUpdated; // DATE last updated uint256 nextAllocationIndex; // which allocationsOverTime record contains next update uint256 allocationShare; // the share of allocationPool that this holder gets (means they hold HGT) } /*Creates an array with all balances*/ mapping (address => Balance) public balances; mapping (address => mapping (address => uint)) allowed; function update(address where) internal { } function updatedBalance(address where) constant public returns (uint val, uint fees, uint pos) { } function balanceOf(address where) constant returns (uint256 val) { } event Allocation(uint256 amount, uint256 date); event FeeOnAllocation(uint256 fees, uint256 date); event PartComplete(); event StillToGo(uint numLeft); uint256 public partPos; uint256 public partFees; uint256 partL; allocation[] public partAllocations; function partAllocationLength() constant returns (uint) { } function addAllocationPartOne(uint newAllocation,uint numSteps) onlyOwner{ } function addAllocationPartTwo(uint numSteps) onlyOwner { } function setHGT(address _hgt) onlyOwner { } function parentFees(address where) whenNotPaused { } function parentChange(address where, uint newValue) whenNotPaused { } /* send GBT */ function transfer(address _to, uint256 _value) whenNotPaused returns (bool ok) { } function transferFrom(address _from, address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } // Minting Functions address public authorisedMinter; function setMinter(address minter) onlyOwner { } function mintTokens(address destination, uint256 amount) { } function burnTokens(address source, uint256 amount) { } } //**************** HelloGoldSale contract HelloGoldSale is Pausable, SafeMath { uint256 public decimals = 8; uint256 public startDate = 1503892800; // Monday, August 28, 2017 12:00:00 PM GMT+08:00 uint256 public endDate = 1504497600; // Monday, September 4, 2017 12:00:00 PM GMT+08:00 uint256 tranchePeriod = 1 weeks; // address of HGT Token. HGT must Approve this contract to disburse 300M tokens HelloGoldToken token; uint256 constant MaxCoinsR1 = 180 * 10**6 * 10**8; // 180M HGT uint256 public coinsRemaining = 180 * 10**6 * 10**8; uint256 coinsPerTier = 20 * 10**6 * 10**8; // 20M HGT uint256 public coinsLeftInTier = 20 * 10**6 * 10**8; uint256 public minimumCap = 0; // 40M HGT uint256 numTiers = 5; uint16 public tierNo; uint256 public preallocCoins; // used for testing against cap (inc placement) uint256 public purchasedCoins; // used for testing against tier pricing uint256 public ethRaised; uint256 public personalMax = 10 * 1 ether; // max ether per person during public sale uint256 public contributors; address public cs; address public multiSig; address public HGT_Reserve; struct csAction { bool passedKYC; bool blocked; } /* This creates an array with all balances */ mapping (address => csAction) public permissions; mapping (address => uint256) public deposits; modifier MustBeEnabled(address x) { } function HelloGoldSale(address _cs, address _hgt, address _multiSig, address _reserve) { } // We only expect to use this to set/reset the start of the contract under exceptional circumstances function setStart(uint256 when_) onlyOwner { } modifier MustBeCs() { } // 1 ether = N HGT tokens uint256[5] public hgtRates = [1248900000000,1196900000000,1144800000000,1092800000000,1040700000000]; /* Approve the account for operation */ function approve(address user) MustBeCs { } function block(address user) MustBeCs { } function unblock(address user) MustBeCs { } function newCs(address newCs) onlyOwner { } function setPeriod(uint256 period_) onlyOwner { } function when() constant returns (uint256) { } function funding() constant returns (bool) { } function success() constant returns (bool succeeded) { } function failed() constant returns (bool didNotSucceed) { } function () payable MustBeEnabled(msg.sender) whenNotPaused { } function linkCoin(address coin) onlyOwner { } function coinAddress() constant returns (address) { } // hgtRates in whole tokens per ETH // max individual contribution in whole ETH function setHgtRates(uint256 p0,uint256 p1,uint256 p2,uint256 p3,uint256 p4, uint256 _max ) onlyOwner { } event Purchase(address indexed buyer, uint256 level,uint256 value, uint256 tokens); event Reduction(string msg, address indexed buyer, uint256 wanted, uint256 allocated); function createTokens(address recipient, uint256 value) private { uint256 totalTokens; uint256 hgtRate; require(<FILL_ME>) require (value > 1 finney) ; require (deposits[recipient] < personalMax); uint256 maxRefund = 0; if ((deposits[msg.sender] + value) > personalMax) { maxRefund = deposits[msg.sender] + value - personalMax; value -= maxRefund; log0("maximum funds exceeded"); } uint256 val = value; ethRaised = safeAdd(ethRaised,value); if (deposits[recipient] == 0) contributors++; do { hgtRate = hgtRates[tierNo]; // hgtRate must include the 10^8 uint tokens = safeMul(val, hgtRate); // (val in eth * 10^18) * #tokens per eth tokens = safeDiv(tokens, 1 ether); // val is in ether, msg.value is in wei if (tokens <= coinsLeftInTier) { uint256 actualTokens = tokens; uint refund = 0; if (tokens > coinsRemaining) { //can't sell desired # tokens Reduction("in tier",recipient,tokens,coinsRemaining); actualTokens = coinsRemaining; refund = safeSub(tokens, coinsRemaining ); // refund amount in tokens refund = safeDiv(refund*1 ether,hgtRate ); // refund amount in ETH // need a refund mechanism here too coinsRemaining = 0; val = safeSub( val,refund); } else { coinsRemaining = safeSub(coinsRemaining, actualTokens); } purchasedCoins = safeAdd(purchasedCoins, actualTokens); totalTokens = safeAdd(totalTokens,actualTokens); require (token.transferFrom(HGT_Reserve, recipient,totalTokens)) ; Purchase(recipient,tierNo,val,actualTokens); // event deposits[recipient] = safeAdd(deposits[recipient],val); // in case of refund - could pull off etherscan refund += maxRefund; if (refund > 0) { ethRaised = safeSub(ethRaised,refund); recipient.transfer(refund); } if (coinsRemaining <= (MaxCoinsR1 - minimumCap)){ // has passed success criteria if (!multiSig.send(this.balance)) { // send funds to HGF log0("cannot forward funds to owner"); } } coinsLeftInTier = safeSub(coinsLeftInTier,actualTokens); if ((coinsLeftInTier == 0) && (coinsRemaining != 0)) { // exact sell out of non final tier coinsLeftInTier = coinsPerTier; tierNo++; endDate = now + tranchePeriod; } return; } // check that coinsLeftInTier >= coinsRemaining uint256 coins2buy = min256(coinsLeftInTier , coinsRemaining); endDate = safeAdd( now, tranchePeriod); // Have bumped levels - need to modify end date here purchasedCoins = safeAdd(purchasedCoins, coins2buy); // give all coins remaining in this tier totalTokens = safeAdd(totalTokens,coins2buy); coinsRemaining = safeSub(coinsRemaining,coins2buy); uint weiCoinsLeftInThisTier = safeMul(coins2buy,1 ether); uint costOfTheseCoins = safeDiv(weiCoinsLeftInThisTier, hgtRate); // how much did that cost? Purchase(recipient, tierNo,costOfTheseCoins,coins2buy); // event deposits[recipient] = safeAdd(deposits[recipient],costOfTheseCoins); val = safeSub(val,costOfTheseCoins); tierNo = tierNo + 1; coinsLeftInTier = coinsPerTier; } while ((val > 0) && funding()); // escaped because we passed the end of the universe..... // so give them their tokens require (token.transferFrom(HGT_Reserve, recipient,totalTokens)) ; if ((val > 0) || (maxRefund > 0)){ Reduction("finished crowdsale, returning ",recipient,value,totalTokens); // return the remainder ! recipient.transfer(val+maxRefund); // if you can't return the balance, abort whole process } if (!multiSig.send(this.balance)) { ethRaised = safeSub(ethRaised,this.balance); log0("cannot send at tier jump"); } } function allocatedTokens(address grantee, uint256 numTokens) onlyOwner { } function withdraw() { } function complete() onlyOwner { } }
funding()
321,523
funding()
null
pragma solidity ^0.4.11; contract DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop { uint256 nothing; function DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop() { } } //*************** Ownable contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } //***********Pausible contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { } } //*************ERC20 contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } //*************** SafeMath contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(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) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } } //**************** StandardToken contract StandardToken is ERC20, SafeMath { /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { } mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) returns (bool success){ } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract GBT { function parentChange(address,uint); function parentFees(address); function setHGT(address _hgt); } //************ HELLOGOLDTOKEN contract HelloGoldToken is ERC20, SafeMath, Pausable, StandardToken { string public name; string public symbol; uint8 public decimals; GBT goldtoken; function setGBT(address gbt_) onlyOwner { } function GBTAddress() constant returns (address) { } function HelloGoldToken(address _reserve) { } function parentChange(address _to) internal { } function parentFees(address _to) internal { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success){ } function transfer(address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } } //********* GOLDFEES ************************ contract GoldFees is SafeMath,Ownable { // e.g. if rate = 0.0054 //uint rateN = 9999452055; uint rateN = 9999452054794520548; uint rateD = 19; uint public maxDays; uint public maxRate; function GoldFees() { } function calcMax() { } function updateRate(uint256 _n, uint256 _d) onlyOwner{ } function rateForDays(uint256 numDays) constant returns (uint256 rate) { } uint256 constant public UTC2MYT = 1483200000; function wotDay(uint256 time) returns (uint256) { } // minimum fee is 1 unless same day function calcFees(uint256 start, uint256 end, uint256 startAmount) constant returns (uint256 amount, uint256 fee) { } } //******************** GoldBackedToken contract GoldBackedToken is Ownable, SafeMath, ERC20, Pausable { event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); event DeductFees(address indexed owner,uint256 amount); event TokenMinted(address destination, uint256 amount); event TokenBurned(address source, uint256 amount); string public name = "HelloGold Gold Backed Token"; string public symbol = "GBT"; uint256 constant public decimals = 18; // same as ETH uint256 constant public hgtDecimals = 8; uint256 constant public allocationPool = 1 * 10**9 * 10**hgtDecimals; // total HGT holdings uint256 constant public maxAllocation = 38 * 10**5 * 10**decimals; // max GBT that can ever ever be given out uint256 public totAllocation; // amount of GBT so far address public feeCalculator; address public HGT; // HGT contract address function setFeeCalculator(address newFC) onlyOwner { } function calcFees(uint256 from, uint256 to, uint256 amount) returns (uint256 val, uint256 fee) { } function GoldBackedToken(address feeCalc) { } struct allocation { uint256 amount; uint256 date; } allocation[] public allocationsOverTime; allocation[] public currentAllocations; function currentAllocationLength() constant returns (uint256) { } function aotLength() constant returns (uint256) { } struct Balance { uint256 amount; // amount through update or transfer uint256 lastUpdated; // DATE last updated uint256 nextAllocationIndex; // which allocationsOverTime record contains next update uint256 allocationShare; // the share of allocationPool that this holder gets (means they hold HGT) } /*Creates an array with all balances*/ mapping (address => Balance) public balances; mapping (address => mapping (address => uint)) allowed; function update(address where) internal { } function updatedBalance(address where) constant public returns (uint val, uint fees, uint pos) { } function balanceOf(address where) constant returns (uint256 val) { } event Allocation(uint256 amount, uint256 date); event FeeOnAllocation(uint256 fees, uint256 date); event PartComplete(); event StillToGo(uint numLeft); uint256 public partPos; uint256 public partFees; uint256 partL; allocation[] public partAllocations; function partAllocationLength() constant returns (uint) { } function addAllocationPartOne(uint newAllocation,uint numSteps) onlyOwner{ } function addAllocationPartTwo(uint numSteps) onlyOwner { } function setHGT(address _hgt) onlyOwner { } function parentFees(address where) whenNotPaused { } function parentChange(address where, uint newValue) whenNotPaused { } /* send GBT */ function transfer(address _to, uint256 _value) whenNotPaused returns (bool ok) { } function transferFrom(address _from, address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } // Minting Functions address public authorisedMinter; function setMinter(address minter) onlyOwner { } function mintTokens(address destination, uint256 amount) { } function burnTokens(address source, uint256 amount) { } } //**************** HelloGoldSale contract HelloGoldSale is Pausable, SafeMath { uint256 public decimals = 8; uint256 public startDate = 1503892800; // Monday, August 28, 2017 12:00:00 PM GMT+08:00 uint256 public endDate = 1504497600; // Monday, September 4, 2017 12:00:00 PM GMT+08:00 uint256 tranchePeriod = 1 weeks; // address of HGT Token. HGT must Approve this contract to disburse 300M tokens HelloGoldToken token; uint256 constant MaxCoinsR1 = 180 * 10**6 * 10**8; // 180M HGT uint256 public coinsRemaining = 180 * 10**6 * 10**8; uint256 coinsPerTier = 20 * 10**6 * 10**8; // 20M HGT uint256 public coinsLeftInTier = 20 * 10**6 * 10**8; uint256 public minimumCap = 0; // 40M HGT uint256 numTiers = 5; uint16 public tierNo; uint256 public preallocCoins; // used for testing against cap (inc placement) uint256 public purchasedCoins; // used for testing against tier pricing uint256 public ethRaised; uint256 public personalMax = 10 * 1 ether; // max ether per person during public sale uint256 public contributors; address public cs; address public multiSig; address public HGT_Reserve; struct csAction { bool passedKYC; bool blocked; } /* This creates an array with all balances */ mapping (address => csAction) public permissions; mapping (address => uint256) public deposits; modifier MustBeEnabled(address x) { } function HelloGoldSale(address _cs, address _hgt, address _multiSig, address _reserve) { } // We only expect to use this to set/reset the start of the contract under exceptional circumstances function setStart(uint256 when_) onlyOwner { } modifier MustBeCs() { } // 1 ether = N HGT tokens uint256[5] public hgtRates = [1248900000000,1196900000000,1144800000000,1092800000000,1040700000000]; /* Approve the account for operation */ function approve(address user) MustBeCs { } function block(address user) MustBeCs { } function unblock(address user) MustBeCs { } function newCs(address newCs) onlyOwner { } function setPeriod(uint256 period_) onlyOwner { } function when() constant returns (uint256) { } function funding() constant returns (bool) { } function success() constant returns (bool succeeded) { } function failed() constant returns (bool didNotSucceed) { } function () payable MustBeEnabled(msg.sender) whenNotPaused { } function linkCoin(address coin) onlyOwner { } function coinAddress() constant returns (address) { } // hgtRates in whole tokens per ETH // max individual contribution in whole ETH function setHgtRates(uint256 p0,uint256 p1,uint256 p2,uint256 p3,uint256 p4, uint256 _max ) onlyOwner { } event Purchase(address indexed buyer, uint256 level,uint256 value, uint256 tokens); event Reduction(string msg, address indexed buyer, uint256 wanted, uint256 allocated); function createTokens(address recipient, uint256 value) private { uint256 totalTokens; uint256 hgtRate; require (funding()) ; require (value > 1 finney) ; require(<FILL_ME>) uint256 maxRefund = 0; if ((deposits[msg.sender] + value) > personalMax) { maxRefund = deposits[msg.sender] + value - personalMax; value -= maxRefund; log0("maximum funds exceeded"); } uint256 val = value; ethRaised = safeAdd(ethRaised,value); if (deposits[recipient] == 0) contributors++; do { hgtRate = hgtRates[tierNo]; // hgtRate must include the 10^8 uint tokens = safeMul(val, hgtRate); // (val in eth * 10^18) * #tokens per eth tokens = safeDiv(tokens, 1 ether); // val is in ether, msg.value is in wei if (tokens <= coinsLeftInTier) { uint256 actualTokens = tokens; uint refund = 0; if (tokens > coinsRemaining) { //can't sell desired # tokens Reduction("in tier",recipient,tokens,coinsRemaining); actualTokens = coinsRemaining; refund = safeSub(tokens, coinsRemaining ); // refund amount in tokens refund = safeDiv(refund*1 ether,hgtRate ); // refund amount in ETH // need a refund mechanism here too coinsRemaining = 0; val = safeSub( val,refund); } else { coinsRemaining = safeSub(coinsRemaining, actualTokens); } purchasedCoins = safeAdd(purchasedCoins, actualTokens); totalTokens = safeAdd(totalTokens,actualTokens); require (token.transferFrom(HGT_Reserve, recipient,totalTokens)) ; Purchase(recipient,tierNo,val,actualTokens); // event deposits[recipient] = safeAdd(deposits[recipient],val); // in case of refund - could pull off etherscan refund += maxRefund; if (refund > 0) { ethRaised = safeSub(ethRaised,refund); recipient.transfer(refund); } if (coinsRemaining <= (MaxCoinsR1 - minimumCap)){ // has passed success criteria if (!multiSig.send(this.balance)) { // send funds to HGF log0("cannot forward funds to owner"); } } coinsLeftInTier = safeSub(coinsLeftInTier,actualTokens); if ((coinsLeftInTier == 0) && (coinsRemaining != 0)) { // exact sell out of non final tier coinsLeftInTier = coinsPerTier; tierNo++; endDate = now + tranchePeriod; } return; } // check that coinsLeftInTier >= coinsRemaining uint256 coins2buy = min256(coinsLeftInTier , coinsRemaining); endDate = safeAdd( now, tranchePeriod); // Have bumped levels - need to modify end date here purchasedCoins = safeAdd(purchasedCoins, coins2buy); // give all coins remaining in this tier totalTokens = safeAdd(totalTokens,coins2buy); coinsRemaining = safeSub(coinsRemaining,coins2buy); uint weiCoinsLeftInThisTier = safeMul(coins2buy,1 ether); uint costOfTheseCoins = safeDiv(weiCoinsLeftInThisTier, hgtRate); // how much did that cost? Purchase(recipient, tierNo,costOfTheseCoins,coins2buy); // event deposits[recipient] = safeAdd(deposits[recipient],costOfTheseCoins); val = safeSub(val,costOfTheseCoins); tierNo = tierNo + 1; coinsLeftInTier = coinsPerTier; } while ((val > 0) && funding()); // escaped because we passed the end of the universe..... // so give them their tokens require (token.transferFrom(HGT_Reserve, recipient,totalTokens)) ; if ((val > 0) || (maxRefund > 0)){ Reduction("finished crowdsale, returning ",recipient,value,totalTokens); // return the remainder ! recipient.transfer(val+maxRefund); // if you can't return the balance, abort whole process } if (!multiSig.send(this.balance)) { ethRaised = safeSub(ethRaised,this.balance); log0("cannot send at tier jump"); } } function allocatedTokens(address grantee, uint256 numTokens) onlyOwner { } function withdraw() { } function complete() onlyOwner { } }
deposits[recipient]<personalMax
321,523
deposits[recipient]<personalMax
null
pragma solidity ^0.4.11; contract DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop { uint256 nothing; function DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop() { } } //*************** Ownable contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } //***********Pausible contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { } } //*************ERC20 contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } //*************** SafeMath contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(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) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } } //**************** StandardToken contract StandardToken is ERC20, SafeMath { /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { } mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) returns (bool success){ } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract GBT { function parentChange(address,uint); function parentFees(address); function setHGT(address _hgt); } //************ HELLOGOLDTOKEN contract HelloGoldToken is ERC20, SafeMath, Pausable, StandardToken { string public name; string public symbol; uint8 public decimals; GBT goldtoken; function setGBT(address gbt_) onlyOwner { } function GBTAddress() constant returns (address) { } function HelloGoldToken(address _reserve) { } function parentChange(address _to) internal { } function parentFees(address _to) internal { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success){ } function transfer(address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } } //********* GOLDFEES ************************ contract GoldFees is SafeMath,Ownable { // e.g. if rate = 0.0054 //uint rateN = 9999452055; uint rateN = 9999452054794520548; uint rateD = 19; uint public maxDays; uint public maxRate; function GoldFees() { } function calcMax() { } function updateRate(uint256 _n, uint256 _d) onlyOwner{ } function rateForDays(uint256 numDays) constant returns (uint256 rate) { } uint256 constant public UTC2MYT = 1483200000; function wotDay(uint256 time) returns (uint256) { } // minimum fee is 1 unless same day function calcFees(uint256 start, uint256 end, uint256 startAmount) constant returns (uint256 amount, uint256 fee) { } } //******************** GoldBackedToken contract GoldBackedToken is Ownable, SafeMath, ERC20, Pausable { event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); event DeductFees(address indexed owner,uint256 amount); event TokenMinted(address destination, uint256 amount); event TokenBurned(address source, uint256 amount); string public name = "HelloGold Gold Backed Token"; string public symbol = "GBT"; uint256 constant public decimals = 18; // same as ETH uint256 constant public hgtDecimals = 8; uint256 constant public allocationPool = 1 * 10**9 * 10**hgtDecimals; // total HGT holdings uint256 constant public maxAllocation = 38 * 10**5 * 10**decimals; // max GBT that can ever ever be given out uint256 public totAllocation; // amount of GBT so far address public feeCalculator; address public HGT; // HGT contract address function setFeeCalculator(address newFC) onlyOwner { } function calcFees(uint256 from, uint256 to, uint256 amount) returns (uint256 val, uint256 fee) { } function GoldBackedToken(address feeCalc) { } struct allocation { uint256 amount; uint256 date; } allocation[] public allocationsOverTime; allocation[] public currentAllocations; function currentAllocationLength() constant returns (uint256) { } function aotLength() constant returns (uint256) { } struct Balance { uint256 amount; // amount through update or transfer uint256 lastUpdated; // DATE last updated uint256 nextAllocationIndex; // which allocationsOverTime record contains next update uint256 allocationShare; // the share of allocationPool that this holder gets (means they hold HGT) } /*Creates an array with all balances*/ mapping (address => Balance) public balances; mapping (address => mapping (address => uint)) allowed; function update(address where) internal { } function updatedBalance(address where) constant public returns (uint val, uint fees, uint pos) { } function balanceOf(address where) constant returns (uint256 val) { } event Allocation(uint256 amount, uint256 date); event FeeOnAllocation(uint256 fees, uint256 date); event PartComplete(); event StillToGo(uint numLeft); uint256 public partPos; uint256 public partFees; uint256 partL; allocation[] public partAllocations; function partAllocationLength() constant returns (uint) { } function addAllocationPartOne(uint newAllocation,uint numSteps) onlyOwner{ } function addAllocationPartTwo(uint numSteps) onlyOwner { } function setHGT(address _hgt) onlyOwner { } function parentFees(address where) whenNotPaused { } function parentChange(address where, uint newValue) whenNotPaused { } /* send GBT */ function transfer(address _to, uint256 _value) whenNotPaused returns (bool ok) { } function transferFrom(address _from, address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } // Minting Functions address public authorisedMinter; function setMinter(address minter) onlyOwner { } function mintTokens(address destination, uint256 amount) { } function burnTokens(address source, uint256 amount) { } } //**************** HelloGoldSale contract HelloGoldSale is Pausable, SafeMath { uint256 public decimals = 8; uint256 public startDate = 1503892800; // Monday, August 28, 2017 12:00:00 PM GMT+08:00 uint256 public endDate = 1504497600; // Monday, September 4, 2017 12:00:00 PM GMT+08:00 uint256 tranchePeriod = 1 weeks; // address of HGT Token. HGT must Approve this contract to disburse 300M tokens HelloGoldToken token; uint256 constant MaxCoinsR1 = 180 * 10**6 * 10**8; // 180M HGT uint256 public coinsRemaining = 180 * 10**6 * 10**8; uint256 coinsPerTier = 20 * 10**6 * 10**8; // 20M HGT uint256 public coinsLeftInTier = 20 * 10**6 * 10**8; uint256 public minimumCap = 0; // 40M HGT uint256 numTiers = 5; uint16 public tierNo; uint256 public preallocCoins; // used for testing against cap (inc placement) uint256 public purchasedCoins; // used for testing against tier pricing uint256 public ethRaised; uint256 public personalMax = 10 * 1 ether; // max ether per person during public sale uint256 public contributors; address public cs; address public multiSig; address public HGT_Reserve; struct csAction { bool passedKYC; bool blocked; } /* This creates an array with all balances */ mapping (address => csAction) public permissions; mapping (address => uint256) public deposits; modifier MustBeEnabled(address x) { } function HelloGoldSale(address _cs, address _hgt, address _multiSig, address _reserve) { } // We only expect to use this to set/reset the start of the contract under exceptional circumstances function setStart(uint256 when_) onlyOwner { } modifier MustBeCs() { } // 1 ether = N HGT tokens uint256[5] public hgtRates = [1248900000000,1196900000000,1144800000000,1092800000000,1040700000000]; /* Approve the account for operation */ function approve(address user) MustBeCs { } function block(address user) MustBeCs { } function unblock(address user) MustBeCs { } function newCs(address newCs) onlyOwner { } function setPeriod(uint256 period_) onlyOwner { } function when() constant returns (uint256) { } function funding() constant returns (bool) { } function success() constant returns (bool succeeded) { } function failed() constant returns (bool didNotSucceed) { } function () payable MustBeEnabled(msg.sender) whenNotPaused { } function linkCoin(address coin) onlyOwner { } function coinAddress() constant returns (address) { } // hgtRates in whole tokens per ETH // max individual contribution in whole ETH function setHgtRates(uint256 p0,uint256 p1,uint256 p2,uint256 p3,uint256 p4, uint256 _max ) onlyOwner { } event Purchase(address indexed buyer, uint256 level,uint256 value, uint256 tokens); event Reduction(string msg, address indexed buyer, uint256 wanted, uint256 allocated); function createTokens(address recipient, uint256 value) private { uint256 totalTokens; uint256 hgtRate; require (funding()) ; require (value > 1 finney) ; require (deposits[recipient] < personalMax); uint256 maxRefund = 0; if ((deposits[msg.sender] + value) > personalMax) { maxRefund = deposits[msg.sender] + value - personalMax; value -= maxRefund; log0("maximum funds exceeded"); } uint256 val = value; ethRaised = safeAdd(ethRaised,value); if (deposits[recipient] == 0) contributors++; do { hgtRate = hgtRates[tierNo]; // hgtRate must include the 10^8 uint tokens = safeMul(val, hgtRate); // (val in eth * 10^18) * #tokens per eth tokens = safeDiv(tokens, 1 ether); // val is in ether, msg.value is in wei if (tokens <= coinsLeftInTier) { uint256 actualTokens = tokens; uint refund = 0; if (tokens > coinsRemaining) { //can't sell desired # tokens Reduction("in tier",recipient,tokens,coinsRemaining); actualTokens = coinsRemaining; refund = safeSub(tokens, coinsRemaining ); // refund amount in tokens refund = safeDiv(refund*1 ether,hgtRate ); // refund amount in ETH // need a refund mechanism here too coinsRemaining = 0; val = safeSub( val,refund); } else { coinsRemaining = safeSub(coinsRemaining, actualTokens); } purchasedCoins = safeAdd(purchasedCoins, actualTokens); totalTokens = safeAdd(totalTokens,actualTokens); require(<FILL_ME>) Purchase(recipient,tierNo,val,actualTokens); // event deposits[recipient] = safeAdd(deposits[recipient],val); // in case of refund - could pull off etherscan refund += maxRefund; if (refund > 0) { ethRaised = safeSub(ethRaised,refund); recipient.transfer(refund); } if (coinsRemaining <= (MaxCoinsR1 - minimumCap)){ // has passed success criteria if (!multiSig.send(this.balance)) { // send funds to HGF log0("cannot forward funds to owner"); } } coinsLeftInTier = safeSub(coinsLeftInTier,actualTokens); if ((coinsLeftInTier == 0) && (coinsRemaining != 0)) { // exact sell out of non final tier coinsLeftInTier = coinsPerTier; tierNo++; endDate = now + tranchePeriod; } return; } // check that coinsLeftInTier >= coinsRemaining uint256 coins2buy = min256(coinsLeftInTier , coinsRemaining); endDate = safeAdd( now, tranchePeriod); // Have bumped levels - need to modify end date here purchasedCoins = safeAdd(purchasedCoins, coins2buy); // give all coins remaining in this tier totalTokens = safeAdd(totalTokens,coins2buy); coinsRemaining = safeSub(coinsRemaining,coins2buy); uint weiCoinsLeftInThisTier = safeMul(coins2buy,1 ether); uint costOfTheseCoins = safeDiv(weiCoinsLeftInThisTier, hgtRate); // how much did that cost? Purchase(recipient, tierNo,costOfTheseCoins,coins2buy); // event deposits[recipient] = safeAdd(deposits[recipient],costOfTheseCoins); val = safeSub(val,costOfTheseCoins); tierNo = tierNo + 1; coinsLeftInTier = coinsPerTier; } while ((val > 0) && funding()); // escaped because we passed the end of the universe..... // so give them their tokens require (token.transferFrom(HGT_Reserve, recipient,totalTokens)) ; if ((val > 0) || (maxRefund > 0)){ Reduction("finished crowdsale, returning ",recipient,value,totalTokens); // return the remainder ! recipient.transfer(val+maxRefund); // if you can't return the balance, abort whole process } if (!multiSig.send(this.balance)) { ethRaised = safeSub(ethRaised,this.balance); log0("cannot send at tier jump"); } } function allocatedTokens(address grantee, uint256 numTokens) onlyOwner { } function withdraw() { } function complete() onlyOwner { } }
token.transferFrom(HGT_Reserve,recipient,totalTokens)
321,523
token.transferFrom(HGT_Reserve,recipient,totalTokens)
null
pragma solidity ^0.4.11; contract DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop { uint256 nothing; function DoNotDeployThisGetTheRightOneCosParityPutsThisOnTop() { } } //*************** Ownable contract Ownable { address public owner; function Ownable() { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } //***********Pausible contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { } } //*************ERC20 contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } //*************** SafeMath contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { } function safeDiv(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) { } function max64(uint64 a, uint64 b) internal constant returns (uint64) { } function min64(uint64 a, uint64 b) internal constant returns (uint64) { } function max256(uint256 a, uint256 b) internal constant returns (uint256) { } function min256(uint256 a, uint256 b) internal constant returns (uint256) { } } //**************** StandardToken contract StandardToken is ERC20, SafeMath { /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { } mapping(address => uint) balances; mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) returns (bool success){ } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } contract GBT { function parentChange(address,uint); function parentFees(address); function setHGT(address _hgt); } //************ HELLOGOLDTOKEN contract HelloGoldToken is ERC20, SafeMath, Pausable, StandardToken { string public name; string public symbol; uint8 public decimals; GBT goldtoken; function setGBT(address gbt_) onlyOwner { } function GBTAddress() constant returns (address) { } function HelloGoldToken(address _reserve) { } function parentChange(address _to) internal { } function parentFees(address _to) internal { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success){ } function transfer(address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } } //********* GOLDFEES ************************ contract GoldFees is SafeMath,Ownable { // e.g. if rate = 0.0054 //uint rateN = 9999452055; uint rateN = 9999452054794520548; uint rateD = 19; uint public maxDays; uint public maxRate; function GoldFees() { } function calcMax() { } function updateRate(uint256 _n, uint256 _d) onlyOwner{ } function rateForDays(uint256 numDays) constant returns (uint256 rate) { } uint256 constant public UTC2MYT = 1483200000; function wotDay(uint256 time) returns (uint256) { } // minimum fee is 1 unless same day function calcFees(uint256 start, uint256 end, uint256 startAmount) constant returns (uint256 amount, uint256 fee) { } } //******************** GoldBackedToken contract GoldBackedToken is Ownable, SafeMath, ERC20, Pausable { event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); event DeductFees(address indexed owner,uint256 amount); event TokenMinted(address destination, uint256 amount); event TokenBurned(address source, uint256 amount); string public name = "HelloGold Gold Backed Token"; string public symbol = "GBT"; uint256 constant public decimals = 18; // same as ETH uint256 constant public hgtDecimals = 8; uint256 constant public allocationPool = 1 * 10**9 * 10**hgtDecimals; // total HGT holdings uint256 constant public maxAllocation = 38 * 10**5 * 10**decimals; // max GBT that can ever ever be given out uint256 public totAllocation; // amount of GBT so far address public feeCalculator; address public HGT; // HGT contract address function setFeeCalculator(address newFC) onlyOwner { } function calcFees(uint256 from, uint256 to, uint256 amount) returns (uint256 val, uint256 fee) { } function GoldBackedToken(address feeCalc) { } struct allocation { uint256 amount; uint256 date; } allocation[] public allocationsOverTime; allocation[] public currentAllocations; function currentAllocationLength() constant returns (uint256) { } function aotLength() constant returns (uint256) { } struct Balance { uint256 amount; // amount through update or transfer uint256 lastUpdated; // DATE last updated uint256 nextAllocationIndex; // which allocationsOverTime record contains next update uint256 allocationShare; // the share of allocationPool that this holder gets (means they hold HGT) } /*Creates an array with all balances*/ mapping (address => Balance) public balances; mapping (address => mapping (address => uint)) allowed; function update(address where) internal { } function updatedBalance(address where) constant public returns (uint val, uint fees, uint pos) { } function balanceOf(address where) constant returns (uint256 val) { } event Allocation(uint256 amount, uint256 date); event FeeOnAllocation(uint256 fees, uint256 date); event PartComplete(); event StillToGo(uint numLeft); uint256 public partPos; uint256 public partFees; uint256 partL; allocation[] public partAllocations; function partAllocationLength() constant returns (uint) { } function addAllocationPartOne(uint newAllocation,uint numSteps) onlyOwner{ } function addAllocationPartTwo(uint numSteps) onlyOwner { } function setHGT(address _hgt) onlyOwner { } function parentFees(address where) whenNotPaused { } function parentChange(address where, uint newValue) whenNotPaused { } /* send GBT */ function transfer(address _to, uint256 _value) whenNotPaused returns (bool ok) { } function transferFrom(address _from, address _to, uint _value) whenNotPaused returns (bool success) { } function approve(address _spender, uint _value) whenNotPaused returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } // Minting Functions address public authorisedMinter; function setMinter(address minter) onlyOwner { } function mintTokens(address destination, uint256 amount) { } function burnTokens(address source, uint256 amount) { } } //**************** HelloGoldSale contract HelloGoldSale is Pausable, SafeMath { uint256 public decimals = 8; uint256 public startDate = 1503892800; // Monday, August 28, 2017 12:00:00 PM GMT+08:00 uint256 public endDate = 1504497600; // Monday, September 4, 2017 12:00:00 PM GMT+08:00 uint256 tranchePeriod = 1 weeks; // address of HGT Token. HGT must Approve this contract to disburse 300M tokens HelloGoldToken token; uint256 constant MaxCoinsR1 = 180 * 10**6 * 10**8; // 180M HGT uint256 public coinsRemaining = 180 * 10**6 * 10**8; uint256 coinsPerTier = 20 * 10**6 * 10**8; // 20M HGT uint256 public coinsLeftInTier = 20 * 10**6 * 10**8; uint256 public minimumCap = 0; // 40M HGT uint256 numTiers = 5; uint16 public tierNo; uint256 public preallocCoins; // used for testing against cap (inc placement) uint256 public purchasedCoins; // used for testing against tier pricing uint256 public ethRaised; uint256 public personalMax = 10 * 1 ether; // max ether per person during public sale uint256 public contributors; address public cs; address public multiSig; address public HGT_Reserve; struct csAction { bool passedKYC; bool blocked; } /* This creates an array with all balances */ mapping (address => csAction) public permissions; mapping (address => uint256) public deposits; modifier MustBeEnabled(address x) { } function HelloGoldSale(address _cs, address _hgt, address _multiSig, address _reserve) { } // We only expect to use this to set/reset the start of the contract under exceptional circumstances function setStart(uint256 when_) onlyOwner { } modifier MustBeCs() { } // 1 ether = N HGT tokens uint256[5] public hgtRates = [1248900000000,1196900000000,1144800000000,1092800000000,1040700000000]; /* Approve the account for operation */ function approve(address user) MustBeCs { } function block(address user) MustBeCs { } function unblock(address user) MustBeCs { } function newCs(address newCs) onlyOwner { } function setPeriod(uint256 period_) onlyOwner { } function when() constant returns (uint256) { } function funding() constant returns (bool) { } function success() constant returns (bool succeeded) { } function failed() constant returns (bool didNotSucceed) { } function () payable MustBeEnabled(msg.sender) whenNotPaused { } function linkCoin(address coin) onlyOwner { } function coinAddress() constant returns (address) { } // hgtRates in whole tokens per ETH // max individual contribution in whole ETH function setHgtRates(uint256 p0,uint256 p1,uint256 p2,uint256 p3,uint256 p4, uint256 _max ) onlyOwner { } event Purchase(address indexed buyer, uint256 level,uint256 value, uint256 tokens); event Reduction(string msg, address indexed buyer, uint256 wanted, uint256 allocated); function createTokens(address recipient, uint256 value) private { } function allocatedTokens(address grantee, uint256 numTokens) onlyOwner { require (now < startDate) ; if (numTokens < coinsRemaining) { coinsRemaining = safeSub(coinsRemaining, numTokens); } else { numTokens = coinsRemaining; coinsRemaining = 0; } preallocCoins = safeAdd(preallocCoins,numTokens); require(<FILL_ME>) } function withdraw() { } function complete() onlyOwner { } }
token.transferFrom(HGT_Reserve,grantee,numTokens)
321,523
token.transferFrom(HGT_Reserve,grantee,numTokens)
"Transfer lock : true"
pragma solidity ^0.5.17; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract Variable { string public name; string public symbol; uint256 public decimals; uint256 public totalSupply; address public owner; uint256 internal _decimals; bool internal transferLock; mapping (address => bool) public allowedAddress; mapping (address => bool) public blockedAddress; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) internal allowed; constructor() public { } } contract Modifiers is Variable { modifier isOwner { } } contract Event { event Transfer(address indexed from, address indexed to, uint256 value); event TokenBurn(address indexed from, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Admin is Variable, Modifiers, Event { using SafeMath for uint256; function tokenBurn(uint256 _value) public isOwner returns(bool success) { } function addAllowedAddress(address _address) public isOwner { } function deleteAllowedAddress(address _address) public isOwner { } function addBlockedAddress(address _address) public isOwner { } function deleteBlockedAddress(address _address) public isOwner { } function setTransferLock(bool _transferLock) public isOwner returns(bool success) { } } contract IMC is Variable, Event, Admin { function() external payable { } function allowance(address tokenOwner, address spender) public view returns (uint256 remaining) { } function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) { } function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) { } function approve(address _spender, uint256 _value) public returns (bool) { } function get_transferLock() public view returns(bool) { } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(<FILL_ME>) require(!blockedAddress[_from] && !blockedAddress[_to] && !blockedAddress[msg.sender], "Blocked address"); require(balanceOf[_from] >= _value && (balanceOf[_to].add(_value)) >= balanceOf[_to], "Invalid balance"); require(_value <= allowed[_from][msg.sender], "Invalid balance : allowed"); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } function transfer(address _to, uint256 _value) public returns (bool) { } }
allowedAddress[_from]||transferLock==false,"Transfer lock : true"
321,597
allowedAddress[_from]||transferLock==false
"Blocked address"
pragma solidity ^0.5.17; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract Variable { string public name; string public symbol; uint256 public decimals; uint256 public totalSupply; address public owner; uint256 internal _decimals; bool internal transferLock; mapping (address => bool) public allowedAddress; mapping (address => bool) public blockedAddress; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) internal allowed; constructor() public { } } contract Modifiers is Variable { modifier isOwner { } } contract Event { event Transfer(address indexed from, address indexed to, uint256 value); event TokenBurn(address indexed from, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Admin is Variable, Modifiers, Event { using SafeMath for uint256; function tokenBurn(uint256 _value) public isOwner returns(bool success) { } function addAllowedAddress(address _address) public isOwner { } function deleteAllowedAddress(address _address) public isOwner { } function addBlockedAddress(address _address) public isOwner { } function deleteBlockedAddress(address _address) public isOwner { } function setTransferLock(bool _transferLock) public isOwner returns(bool success) { } } contract IMC is Variable, Event, Admin { function() external payable { } function allowance(address tokenOwner, address spender) public view returns (uint256 remaining) { } function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) { } function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) { } function approve(address _spender, uint256 _value) public returns (bool) { } function get_transferLock() public view returns(bool) { } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(allowedAddress[_from] || transferLock == false, "Transfer lock : true"); require(<FILL_ME>) require(balanceOf[_from] >= _value && (balanceOf[_to].add(_value)) >= balanceOf[_to], "Invalid balance"); require(_value <= allowed[_from][msg.sender], "Invalid balance : allowed"); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } function transfer(address _to, uint256 _value) public returns (bool) { } }
!blockedAddress[_from]&&!blockedAddress[_to]&&!blockedAddress[msg.sender],"Blocked address"
321,597
!blockedAddress[_from]&&!blockedAddress[_to]&&!blockedAddress[msg.sender]
"Invalid balance"
pragma solidity ^0.5.17; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract Variable { string public name; string public symbol; uint256 public decimals; uint256 public totalSupply; address public owner; uint256 internal _decimals; bool internal transferLock; mapping (address => bool) public allowedAddress; mapping (address => bool) public blockedAddress; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) internal allowed; constructor() public { } } contract Modifiers is Variable { modifier isOwner { } } contract Event { event Transfer(address indexed from, address indexed to, uint256 value); event TokenBurn(address indexed from, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Admin is Variable, Modifiers, Event { using SafeMath for uint256; function tokenBurn(uint256 _value) public isOwner returns(bool success) { } function addAllowedAddress(address _address) public isOwner { } function deleteAllowedAddress(address _address) public isOwner { } function addBlockedAddress(address _address) public isOwner { } function deleteBlockedAddress(address _address) public isOwner { } function setTransferLock(bool _transferLock) public isOwner returns(bool success) { } } contract IMC is Variable, Event, Admin { function() external payable { } function allowance(address tokenOwner, address spender) public view returns (uint256 remaining) { } function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) { } function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) { } function approve(address _spender, uint256 _value) public returns (bool) { } function get_transferLock() public view returns(bool) { } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(allowedAddress[_from] || transferLock == false, "Transfer lock : true"); require(!blockedAddress[_from] && !blockedAddress[_to] && !blockedAddress[msg.sender], "Blocked address"); require(<FILL_ME>) require(_value <= allowed[_from][msg.sender], "Invalid balance : allowed"); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } function transfer(address _to, uint256 _value) public returns (bool) { } }
balanceOf[_from]>=_value&&(balanceOf[_to].add(_value))>=balanceOf[_to],"Invalid balance"
321,597
balanceOf[_from]>=_value&&(balanceOf[_to].add(_value))>=balanceOf[_to]
"Invalid balance"
pragma solidity ^0.5.17; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract Variable { string public name; string public symbol; uint256 public decimals; uint256 public totalSupply; address public owner; uint256 internal _decimals; bool internal transferLock; mapping (address => bool) public allowedAddress; mapping (address => bool) public blockedAddress; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) internal allowed; constructor() public { } } contract Modifiers is Variable { modifier isOwner { } } contract Event { event Transfer(address indexed from, address indexed to, uint256 value); event TokenBurn(address indexed from, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Admin is Variable, Modifiers, Event { using SafeMath for uint256; function tokenBurn(uint256 _value) public isOwner returns(bool success) { } function addAllowedAddress(address _address) public isOwner { } function deleteAllowedAddress(address _address) public isOwner { } function addBlockedAddress(address _address) public isOwner { } function deleteBlockedAddress(address _address) public isOwner { } function setTransferLock(bool _transferLock) public isOwner returns(bool success) { } } contract IMC is Variable, Event, Admin { function() external payable { } function allowance(address tokenOwner, address spender) public view returns (uint256 remaining) { } function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) { } function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) { } function approve(address _spender, uint256 _value) public returns (bool) { } function get_transferLock() public view returns(bool) { } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } function transfer(address _to, uint256 _value) public returns (bool) { require(allowedAddress[msg.sender] || transferLock == false, "Transfer lock : true"); require(!blockedAddress[msg.sender] && !blockedAddress[_to], "Blocked address"); require(<FILL_ME>) balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } }
balanceOf[msg.sender]>=_value&&(balanceOf[_to].add(_value))>=balanceOf[_to],"Invalid balance"
321,597
balanceOf[msg.sender]>=_value&&(balanceOf[_to].add(_value))>=balanceOf[_to]
"must wait 24 hours before unstaking"
pragma solidity 0.5.13; interface Callable { function tokenCallback(address _from, uint256 _tokens, bytes calldata _data) external returns (bool); } contract DeFiFirefly { uint256 constant public INITIAL_SUPPLY = 9e13; // 900,000 uint256 public unallocatedEth; uint256 id; mapping(uint256 => address) idToAddress; mapping(address => bool) isUser; string constant public name = "Defi Firefly"; string constant public symbol = "DFF"; uint8 constant public decimals = 8; struct User { uint256 balance; uint256 staked; mapping(address => uint256) allowance; uint256 dividend; uint256 totalEarned; uint256 stakeTimestamp; } struct Info { uint256 totalSupply; uint256 totalStaked; mapping(address => User) users; address admin; } Info public info; event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed owner, address indexed spender, uint256 tokens); event Stake(address indexed owner, uint256 tokens); event Unstake(address indexed owner, uint256 tokens); event Collect(address indexed owner, uint256 amount); event Fee(uint256 tokens); event POOLDDIVIDENDCALCULATE(uint256 totalStaked, uint256 amount,uint256 sharePerToken,uint256 eligibleMembers, uint256 totalDistributed); constructor() public { } function stake(uint256 _tokens) external { } function unstake(uint256 _tokens) external { } function collectDividend() public returns (uint256) { } function sendDividend() external payable onlyAdmin returns(uint256){ } function distribute() external onlyAdmin { } function transfer(address _to, uint256 _tokens) external returns (bool) { } function approve(address _spender, uint256 _tokens) external returns (bool) { } function transferFrom(address _from, address _to, uint256 _tokens) external returns (bool) { } function transferAndCall(address _to, uint256 _tokens, bytes calldata _data) external returns (bool) { } function bulkTransfer(address[] calldata _receivers, uint256[] calldata _amounts) external { } function totalSupply() public view returns (uint256) { } function totalStaked() public view returns (uint256) { } function balanceOf(address _user) public view returns (uint256) { } function stakedOf(address _user) public view returns (uint256) { } function dividendsOf(address _user) public view returns (uint256) { } function allowance(address _user, address _spender) public view returns (uint256) { } function userTotalEarned(address _user) public view returns(uint256){ } modifier onlyAdmin(){ } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function allInfoFor(address _user) public view returns (uint256 userBalance, uint256 userStaked, uint256 userDividends,uint256 totalEarned) { } function _transfer(address _from, address _to, uint256 _tokens) internal returns (uint256) { } function _stake(uint256 _amount) internal { } function _unstake(uint256 _amount) internal { require(stakedOf(msg.sender) >= _amount,"user stake already 0"); require(<FILL_ME>) if(dividendsOf(msg.sender)>0){ collectDividend(); } info.totalStaked -= _amount; info.users[msg.sender].staked -= _amount; emit Unstake(msg.sender, _amount); } }
info.users[msg.sender].stakeTimestamp+24hours<=now,"must wait 24 hours before unstaking"
321,668
info.users[msg.sender].stakeTimestamp+24hours<=now
"Address isn`t a contract"
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0 <= 0.9.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./ILions.sol"; contract YieldToken is ERC20("SexyToken", "SEXY") { using SafeMath for uint256; using Address for address; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); uint256 constant public BASE_RATE = 1 ether; uint256 constant public INITIAL_ISSUANCE = 10 ether; uint256 constant public REWARD_SEPARATOR = 86400; mapping(address => mapping(address => uint256)) rewards; mapping(address => mapping(address => uint256)) lastUpdates; mapping(address => uint256) rewardsEnd; address[] contracts; address owner; event RewardPaid(address indexed user, uint256 reward); modifier onlyOwner() { } modifier isContract() { require(<FILL_ME>) _; } modifier isValidAddress() { } constructor() { } function transferOwnership(address _newOwner) public virtual onlyOwner { } function min(uint256 a, uint256 b) internal pure returns (uint256) { } function updateRewardOnMint(address _user, uint256 _amount) external isValidAddress isContract { } // called on transfers function updateReward(address _from, address _to) external isValidAddress isContract{ } function _updateReward(address _contract, address _from, address _to) internal { } function getReward(address _to) external isValidAddress isContract { } function getReward(address _contract, address _to) internal { } function burn(address _from, uint256 _amount) external { } function getTotalClaimable(address _user) external view isValidAddress isContract returns(uint256) { } function addContract(address _contract, uint256 _rewardTime) public onlyOwner { } function getAllRewards() public { } }
msg.sender.isContract(),"Address isn`t a contract"
321,740
msg.sender.isContract()
"Not allowed from EOA"
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; /** * @title The entrance of Furucombo * @author Ben Huang */ contract Proxy is Cache, Config { using Address for address; using SafeERC20 for IERC20; // keccak256 hash of "furucombo.handler.registry" // prettier-ignore bytes32 private constant HANDLER_REGISTRY = 0x6874162fd62902201ea0f4bf541086067b3b88bd802fac9e150fd2d1db584e19; constructor(address registry) public { } /** * @notice Direct transfer from EOA should be reverted. * @dev Callback function will be handled here. */ function() external payable { require(<FILL_ME>) // If triggered by a function call, caller should be registered in registry. // The function call will then be forwarded to the location registered in // registry. if (msg.data.length != 0) { require(_isValid(msg.sender), "Invalid caller"); address target = address(bytes20(IRegistry(_getRegistry()).getInfo(msg.sender))); _exec(target, msg.data); } } /** * @notice Combo execution function. Including three phases: pre-process, * exection and post-process. * @param tos The handlers of combo. * @param datas The combo datas. */ function batchExec(address[] memory tos, bytes[] memory datas) public payable { } /** * @notice The execution interface for callback function to be executed. * @dev This function can only be called through the handler, which makes * the caller become proxy itself. */ function execs(address[] memory tos, bytes[] memory datas) public payable { } /** * @notice The execution phase. * @param tos The handlers of combo. * @param datas The combo datas. */ function _execs(address[] memory tos, bytes[] memory datas) internal { } /** * @notice The execution of a single cube. * @param _to The handler of cube. * @param _data The cube execution data. */ function _exec(address _to, bytes memory _data) internal returns (bytes memory result) { } /** * @notice Setup the post-process. * @param _to The handler of post-process. */ function _setPostProcess(address _to) internal { } /// @notice The pre-process phase. function _preProcess() internal isCacheEmpty { } /// @notice The post-process phase. function _postProcess() internal { } /// @notice Get the registry contract address. function _getRegistry() internal view returns (address registry) { } /// @notice Check if the handler is valid in registry. function _isValid(address handler) internal view returns (bool result) { } }
Address.isContract(msg.sender),"Not allowed from EOA"
321,782
Address.isContract(msg.sender)
"Invalid caller"
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; /** * @title The entrance of Furucombo * @author Ben Huang */ contract Proxy is Cache, Config { using Address for address; using SafeERC20 for IERC20; // keccak256 hash of "furucombo.handler.registry" // prettier-ignore bytes32 private constant HANDLER_REGISTRY = 0x6874162fd62902201ea0f4bf541086067b3b88bd802fac9e150fd2d1db584e19; constructor(address registry) public { } /** * @notice Direct transfer from EOA should be reverted. * @dev Callback function will be handled here. */ function() external payable { require(Address.isContract(msg.sender), "Not allowed from EOA"); // If triggered by a function call, caller should be registered in registry. // The function call will then be forwarded to the location registered in // registry. if (msg.data.length != 0) { require(<FILL_ME>) address target = address(bytes20(IRegistry(_getRegistry()).getInfo(msg.sender))); _exec(target, msg.data); } } /** * @notice Combo execution function. Including three phases: pre-process, * exection and post-process. * @param tos The handlers of combo. * @param datas The combo datas. */ function batchExec(address[] memory tos, bytes[] memory datas) public payable { } /** * @notice The execution interface for callback function to be executed. * @dev This function can only be called through the handler, which makes * the caller become proxy itself. */ function execs(address[] memory tos, bytes[] memory datas) public payable { } /** * @notice The execution phase. * @param tos The handlers of combo. * @param datas The combo datas. */ function _execs(address[] memory tos, bytes[] memory datas) internal { } /** * @notice The execution of a single cube. * @param _to The handler of cube. * @param _data The cube execution data. */ function _exec(address _to, bytes memory _data) internal returns (bytes memory result) { } /** * @notice Setup the post-process. * @param _to The handler of post-process. */ function _setPostProcess(address _to) internal { } /// @notice The pre-process phase. function _preProcess() internal isCacheEmpty { } /// @notice The post-process phase. function _postProcess() internal { } /// @notice Get the registry contract address. function _getRegistry() internal view returns (address registry) { } /// @notice Check if the handler is valid in registry. function _isValid(address handler) internal view returns (bool result) { } }
_isValid(msg.sender),"Invalid caller"
321,782
_isValid(msg.sender)
"Invalid handler"
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; /** * @title The entrance of Furucombo * @author Ben Huang */ contract Proxy is Cache, Config { using Address for address; using SafeERC20 for IERC20; // keccak256 hash of "furucombo.handler.registry" // prettier-ignore bytes32 private constant HANDLER_REGISTRY = 0x6874162fd62902201ea0f4bf541086067b3b88bd802fac9e150fd2d1db584e19; constructor(address registry) public { } /** * @notice Direct transfer from EOA should be reverted. * @dev Callback function will be handled here. */ function() external payable { } /** * @notice Combo execution function. Including three phases: pre-process, * exection and post-process. * @param tos The handlers of combo. * @param datas The combo datas. */ function batchExec(address[] memory tos, bytes[] memory datas) public payable { } /** * @notice The execution interface for callback function to be executed. * @dev This function can only be called through the handler, which makes * the caller become proxy itself. */ function execs(address[] memory tos, bytes[] memory datas) public payable { } /** * @notice The execution phase. * @param tos The handlers of combo. * @param datas The combo datas. */ function _execs(address[] memory tos, bytes[] memory datas) internal { } /** * @notice The execution of a single cube. * @param _to The handler of cube. * @param _data The cube execution data. */ function _exec(address _to, bytes memory _data) internal returns (bytes memory result) { require(<FILL_ME>) assembly { let succeeded := delegatecall( sub(gas, 5000), _to, add(_data, 0x20), mload(_data), 0, 0 ) let size := returndatasize result := mload(0x40) mstore( 0x40, add(result, and(add(add(size, 0x20), 0x1f), not(0x1f))) ) mstore(result, size) returndatacopy(add(result, 0x20), 0, size) switch iszero(succeeded) case 1 { revert(add(result, 0x20), size) } } } /** * @notice Setup the post-process. * @param _to The handler of post-process. */ function _setPostProcess(address _to) internal { } /// @notice The pre-process phase. function _preProcess() internal isCacheEmpty { } /// @notice The post-process phase. function _postProcess() internal { } /// @notice Get the registry contract address. function _getRegistry() internal view returns (address registry) { } /// @notice Check if the handler is valid in registry. function _isValid(address handler) internal view returns (bool result) { } }
_isValid(_to),"Invalid handler"
321,782
_isValid(_to)
null
pragma solidity ^0.4.20; // ---------------------------------------------------------------------------- // // GZR 'Gizer Gaming' token public sale contract // // For details, please visit: http://www.gizer.io // // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // // SafeMath // // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { } function sub(uint a, uint b) internal pure returns (uint c) { } function mul(uint a, uint b) internal pure returns (uint c) { } } // ---------------------------------------------------------------------------- // // Owned contract // // ---------------------------------------------------------------------------- contract Owned { address public owner; address public newOwner; mapping(address => bool) public isAdmin; // Events --------------------------- event OwnershipTransferProposed(address indexed _from, address indexed _to); event OwnershipTransferred(address indexed _from, address indexed _to); event AdminChange(address indexed _admin, bool _status); // Modifiers ------------------------ modifier onlyOwner { } modifier onlyAdmin { } // Functions ------------------------ function Owned() public { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } function addAdmin(address _a) public onlyOwner { require(<FILL_ME>) isAdmin[_a] = true; AdminChange(_a, true); } function removeAdmin(address _a) public onlyOwner { } } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // // ---------------------------------------------------------------------------- contract ERC20Interface { // Events --------------------------- event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); // Functions ------------------------ function totalSupply() public view returns (uint); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 // // ---------------------------------------------------------------------------- contract ERC20Token is ERC20Interface, Owned { using SafeMath for uint; uint public tokensIssuedTotal = 0; mapping(address => uint) balances; mapping(address => mapping (address => uint)) allowed; // Functions ------------------------ /* Total token supply */ function totalSupply() public view returns (uint) { } /* Get the account balance for an address */ function balanceOf(address _owner) public view returns (uint balance) { } /* Transfer the balance from owner's account to another account */ function transfer(address _to, uint _amount) public returns (bool success) { } /* Allow _spender to withdraw from your account up to _amount */ function approve(address _spender, uint _amount) public returns (bool success) { } /* Spender of tokens transfers tokens from the owner's balance */ /* Must be pre-approved by owner */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { } /* Returns the amount of tokens approved by the owner */ /* that can be transferred by spender */ function allowance(address _owner, address _spender) public view returns (uint remaining) { } } // ---------------------------------------------------------------------------- // // GZR public token sale // // ---------------------------------------------------------------------------- contract GizerToken is ERC20Token { /* Utility variable */ uint constant E6 = 10**6; /* Basic token data */ string public constant name = "Gizer Gaming Token"; string public constant symbol = "GZR"; uint8 public constant decimals = 6; /* Wallets */ address public wallet; address public redemptionWallet; address public gizerItemsContract; /* Crowdsale parameters (constants) */ uint public constant DATE_ICO_START = 1521122400; // 15-Mar-2018 14:00 UTC 10:00 EST uint public constant TOKEN_SUPPLY_TOTAL = 10000000 * E6; uint public constant TOKEN_SUPPLY_CROWD = 6112926 * E6; uint public constant TOKEN_SUPPLY_OWNER = 3887074 * E6; // 2,000,000 tokens reserve // 1,887,074 presale tokens uint public constant MIN_CONTRIBUTION = 1 ether / 100; uint public constant TOKENS_PER_ETH = 1000; uint public constant DATE_TOKENS_UNLOCKED = 1539180000; // 10-OCT-2018 14:00 UTC 10:00 EST /* Crowdsale parameters (can be modified by owner) */ uint public date_ico_end = 1523368800; // 10-Apr-2018 14:00 UTC 10:00 EST /* Crowdsale variables */ uint public tokensIssuedCrowd = 0; uint public tokensIssuedOwner = 0; uint public tokensIssuedLocked = 0; uint public etherReceived = 0; // does not include presale ethers /* Keep track of + ethers contributed, + tokens received + tokens locked during Crowdsale */ mapping(address => uint) public etherContributed; mapping(address => uint) public tokensReceived; mapping(address => uint) public locked; // Events --------------------------- event WalletUpdated(address _newWallet); event GizerItemsContractUpdated(address _GizerItemsContract); event RedemptionWalletUpdated(address _newRedemptionWallet); event DateIcoEndUpdated(uint _unixts); event TokensIssuedCrowd(address indexed _recipient, uint _tokens, uint _ether); event TokensIssuedOwner(address indexed _recipient, uint _tokens, bool _locked); event ItemsBought(address indexed _recipient, uint _lastIdx, uint _number); // Basic Functions ------------------ /* Initialize */ function GizerToken() public { } /* Fallback */ function () public payable { } // Information Functions ------------ /* What time is it? */ function atNow() public view returns (uint) { } /* Are tokens tradeable */ function tradeable() public view returns (bool) { } /* Available to mint by owner */ function availableToMint() public view returns (uint available) { } /* Unlocked tokens in an account */ function unlockedTokens(address _account) public view returns (uint _unlockedTokens) { } // Owner Functions ------------------ /* Change the crowdsale wallet address */ function setWallet(address _wallet) public onlyOwner { } /* Change the redemption wallet address */ function setRedemptionWallet(address _wallet) public onlyOwner { } /* Change the Gizer Items contract address */ function setGizerItemsContract(address _contract) public onlyOwner { } /* Change the ICO end date */ function extendIco(uint _unixts) public onlyOwner { } /* Minting of tokens by owner */ function mintTokens(address _account, uint _tokens) public onlyOwner { } /* Minting of tokens by owner */ function mintTokensLocked(address _account, uint _tokens) public onlyOwner { } /* Transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint amount) public onlyOwner returns (bool success) { } // Private functions ---------------- /* Accept ETH during crowdsale (called by default function) */ function buyTokens() private { } // ERC20 functions ------------------ /* Override "transfer" */ function transfer(address _to, uint _amount) public returns (bool success) { } /* Override "transferFrom" */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { } // Bulk token transfer function ----- /* Multiple token transfers from one address to save gas */ function transferMultiple(address[] _addresses, uint[] _amounts) external { } // Functions to convert GZR to Gizer items ----------- /* GZR token owner buys one Gizer Item */ function buyItem() public returns (uint idx) { } /* GZR token owner buys several Gizer Items (max 100) */ function buyMultipleItems(uint8 _items) public returns (uint idx) { } /* Internal function to call */ function mintItem(address _owner) internal returns(uint idx) { } } // ---------------------------------------------------------------------------- // // GZR Items interface // // ---------------------------------------------------------------------------- contract GizerItemsInterface is Owned { function mint(address _to) public onlyAdmin returns (uint idx); }
isAdmin[_a]==false
321,788
isAdmin[_a]==false
null
pragma solidity ^0.4.20; // ---------------------------------------------------------------------------- // // GZR 'Gizer Gaming' token public sale contract // // For details, please visit: http://www.gizer.io // // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // // SafeMath // // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { } function sub(uint a, uint b) internal pure returns (uint c) { } function mul(uint a, uint b) internal pure returns (uint c) { } } // ---------------------------------------------------------------------------- // // Owned contract // // ---------------------------------------------------------------------------- contract Owned { address public owner; address public newOwner; mapping(address => bool) public isAdmin; // Events --------------------------- event OwnershipTransferProposed(address indexed _from, address indexed _to); event OwnershipTransferred(address indexed _from, address indexed _to); event AdminChange(address indexed _admin, bool _status); // Modifiers ------------------------ modifier onlyOwner { } modifier onlyAdmin { } // Functions ------------------------ function Owned() public { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } function addAdmin(address _a) public onlyOwner { } function removeAdmin(address _a) public onlyOwner { require(<FILL_ME>) isAdmin[_a] = false; AdminChange(_a, false); } } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // // ---------------------------------------------------------------------------- contract ERC20Interface { // Events --------------------------- event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); // Functions ------------------------ function totalSupply() public view returns (uint); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 // // ---------------------------------------------------------------------------- contract ERC20Token is ERC20Interface, Owned { using SafeMath for uint; uint public tokensIssuedTotal = 0; mapping(address => uint) balances; mapping(address => mapping (address => uint)) allowed; // Functions ------------------------ /* Total token supply */ function totalSupply() public view returns (uint) { } /* Get the account balance for an address */ function balanceOf(address _owner) public view returns (uint balance) { } /* Transfer the balance from owner's account to another account */ function transfer(address _to, uint _amount) public returns (bool success) { } /* Allow _spender to withdraw from your account up to _amount */ function approve(address _spender, uint _amount) public returns (bool success) { } /* Spender of tokens transfers tokens from the owner's balance */ /* Must be pre-approved by owner */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { } /* Returns the amount of tokens approved by the owner */ /* that can be transferred by spender */ function allowance(address _owner, address _spender) public view returns (uint remaining) { } } // ---------------------------------------------------------------------------- // // GZR public token sale // // ---------------------------------------------------------------------------- contract GizerToken is ERC20Token { /* Utility variable */ uint constant E6 = 10**6; /* Basic token data */ string public constant name = "Gizer Gaming Token"; string public constant symbol = "GZR"; uint8 public constant decimals = 6; /* Wallets */ address public wallet; address public redemptionWallet; address public gizerItemsContract; /* Crowdsale parameters (constants) */ uint public constant DATE_ICO_START = 1521122400; // 15-Mar-2018 14:00 UTC 10:00 EST uint public constant TOKEN_SUPPLY_TOTAL = 10000000 * E6; uint public constant TOKEN_SUPPLY_CROWD = 6112926 * E6; uint public constant TOKEN_SUPPLY_OWNER = 3887074 * E6; // 2,000,000 tokens reserve // 1,887,074 presale tokens uint public constant MIN_CONTRIBUTION = 1 ether / 100; uint public constant TOKENS_PER_ETH = 1000; uint public constant DATE_TOKENS_UNLOCKED = 1539180000; // 10-OCT-2018 14:00 UTC 10:00 EST /* Crowdsale parameters (can be modified by owner) */ uint public date_ico_end = 1523368800; // 10-Apr-2018 14:00 UTC 10:00 EST /* Crowdsale variables */ uint public tokensIssuedCrowd = 0; uint public tokensIssuedOwner = 0; uint public tokensIssuedLocked = 0; uint public etherReceived = 0; // does not include presale ethers /* Keep track of + ethers contributed, + tokens received + tokens locked during Crowdsale */ mapping(address => uint) public etherContributed; mapping(address => uint) public tokensReceived; mapping(address => uint) public locked; // Events --------------------------- event WalletUpdated(address _newWallet); event GizerItemsContractUpdated(address _GizerItemsContract); event RedemptionWalletUpdated(address _newRedemptionWallet); event DateIcoEndUpdated(uint _unixts); event TokensIssuedCrowd(address indexed _recipient, uint _tokens, uint _ether); event TokensIssuedOwner(address indexed _recipient, uint _tokens, bool _locked); event ItemsBought(address indexed _recipient, uint _lastIdx, uint _number); // Basic Functions ------------------ /* Initialize */ function GizerToken() public { } /* Fallback */ function () public payable { } // Information Functions ------------ /* What time is it? */ function atNow() public view returns (uint) { } /* Are tokens tradeable */ function tradeable() public view returns (bool) { } /* Available to mint by owner */ function availableToMint() public view returns (uint available) { } /* Unlocked tokens in an account */ function unlockedTokens(address _account) public view returns (uint _unlockedTokens) { } // Owner Functions ------------------ /* Change the crowdsale wallet address */ function setWallet(address _wallet) public onlyOwner { } /* Change the redemption wallet address */ function setRedemptionWallet(address _wallet) public onlyOwner { } /* Change the Gizer Items contract address */ function setGizerItemsContract(address _contract) public onlyOwner { } /* Change the ICO end date */ function extendIco(uint _unixts) public onlyOwner { } /* Minting of tokens by owner */ function mintTokens(address _account, uint _tokens) public onlyOwner { } /* Minting of tokens by owner */ function mintTokensLocked(address _account, uint _tokens) public onlyOwner { } /* Transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint amount) public onlyOwner returns (bool success) { } // Private functions ---------------- /* Accept ETH during crowdsale (called by default function) */ function buyTokens() private { } // ERC20 functions ------------------ /* Override "transfer" */ function transfer(address _to, uint _amount) public returns (bool success) { } /* Override "transferFrom" */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { } // Bulk token transfer function ----- /* Multiple token transfers from one address to save gas */ function transferMultiple(address[] _addresses, uint[] _amounts) external { } // Functions to convert GZR to Gizer items ----------- /* GZR token owner buys one Gizer Item */ function buyItem() public returns (uint idx) { } /* GZR token owner buys several Gizer Items (max 100) */ function buyMultipleItems(uint8 _items) public returns (uint idx) { } /* Internal function to call */ function mintItem(address _owner) internal returns(uint idx) { } } // ---------------------------------------------------------------------------- // // GZR Items interface // // ---------------------------------------------------------------------------- contract GizerItemsInterface is Owned { function mint(address _to) public onlyAdmin returns (uint idx); }
isAdmin[_a]==true
321,788
isAdmin[_a]==true
null
pragma solidity ^0.4.20; // ---------------------------------------------------------------------------- // // GZR 'Gizer Gaming' token public sale contract // // For details, please visit: http://www.gizer.io // // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // // SafeMath // // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { } function sub(uint a, uint b) internal pure returns (uint c) { } function mul(uint a, uint b) internal pure returns (uint c) { } } // ---------------------------------------------------------------------------- // // Owned contract // // ---------------------------------------------------------------------------- contract Owned { address public owner; address public newOwner; mapping(address => bool) public isAdmin; // Events --------------------------- event OwnershipTransferProposed(address indexed _from, address indexed _to); event OwnershipTransferred(address indexed _from, address indexed _to); event AdminChange(address indexed _admin, bool _status); // Modifiers ------------------------ modifier onlyOwner { } modifier onlyAdmin { } // Functions ------------------------ function Owned() public { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } function addAdmin(address _a) public onlyOwner { } function removeAdmin(address _a) public onlyOwner { } } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // // ---------------------------------------------------------------------------- contract ERC20Interface { // Events --------------------------- event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); // Functions ------------------------ function totalSupply() public view returns (uint); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 // // ---------------------------------------------------------------------------- contract ERC20Token is ERC20Interface, Owned { using SafeMath for uint; uint public tokensIssuedTotal = 0; mapping(address => uint) balances; mapping(address => mapping (address => uint)) allowed; // Functions ------------------------ /* Total token supply */ function totalSupply() public view returns (uint) { } /* Get the account balance for an address */ function balanceOf(address _owner) public view returns (uint balance) { } /* Transfer the balance from owner's account to another account */ function transfer(address _to, uint _amount) public returns (bool success) { } /* Allow _spender to withdraw from your account up to _amount */ function approve(address _spender, uint _amount) public returns (bool success) { } /* Spender of tokens transfers tokens from the owner's balance */ /* Must be pre-approved by owner */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { } /* Returns the amount of tokens approved by the owner */ /* that can be transferred by spender */ function allowance(address _owner, address _spender) public view returns (uint remaining) { } } // ---------------------------------------------------------------------------- // // GZR public token sale // // ---------------------------------------------------------------------------- contract GizerToken is ERC20Token { /* Utility variable */ uint constant E6 = 10**6; /* Basic token data */ string public constant name = "Gizer Gaming Token"; string public constant symbol = "GZR"; uint8 public constant decimals = 6; /* Wallets */ address public wallet; address public redemptionWallet; address public gizerItemsContract; /* Crowdsale parameters (constants) */ uint public constant DATE_ICO_START = 1521122400; // 15-Mar-2018 14:00 UTC 10:00 EST uint public constant TOKEN_SUPPLY_TOTAL = 10000000 * E6; uint public constant TOKEN_SUPPLY_CROWD = 6112926 * E6; uint public constant TOKEN_SUPPLY_OWNER = 3887074 * E6; // 2,000,000 tokens reserve // 1,887,074 presale tokens uint public constant MIN_CONTRIBUTION = 1 ether / 100; uint public constant TOKENS_PER_ETH = 1000; uint public constant DATE_TOKENS_UNLOCKED = 1539180000; // 10-OCT-2018 14:00 UTC 10:00 EST /* Crowdsale parameters (can be modified by owner) */ uint public date_ico_end = 1523368800; // 10-Apr-2018 14:00 UTC 10:00 EST /* Crowdsale variables */ uint public tokensIssuedCrowd = 0; uint public tokensIssuedOwner = 0; uint public tokensIssuedLocked = 0; uint public etherReceived = 0; // does not include presale ethers /* Keep track of + ethers contributed, + tokens received + tokens locked during Crowdsale */ mapping(address => uint) public etherContributed; mapping(address => uint) public tokensReceived; mapping(address => uint) public locked; // Events --------------------------- event WalletUpdated(address _newWallet); event GizerItemsContractUpdated(address _GizerItemsContract); event RedemptionWalletUpdated(address _newRedemptionWallet); event DateIcoEndUpdated(uint _unixts); event TokensIssuedCrowd(address indexed _recipient, uint _tokens, uint _ether); event TokensIssuedOwner(address indexed _recipient, uint _tokens, bool _locked); event ItemsBought(address indexed _recipient, uint _lastIdx, uint _number); // Basic Functions ------------------ /* Initialize */ function GizerToken() public { require(<FILL_ME>) wallet = owner; redemptionWallet = owner; } /* Fallback */ function () public payable { } // Information Functions ------------ /* What time is it? */ function atNow() public view returns (uint) { } /* Are tokens tradeable */ function tradeable() public view returns (bool) { } /* Available to mint by owner */ function availableToMint() public view returns (uint available) { } /* Unlocked tokens in an account */ function unlockedTokens(address _account) public view returns (uint _unlockedTokens) { } // Owner Functions ------------------ /* Change the crowdsale wallet address */ function setWallet(address _wallet) public onlyOwner { } /* Change the redemption wallet address */ function setRedemptionWallet(address _wallet) public onlyOwner { } /* Change the Gizer Items contract address */ function setGizerItemsContract(address _contract) public onlyOwner { } /* Change the ICO end date */ function extendIco(uint _unixts) public onlyOwner { } /* Minting of tokens by owner */ function mintTokens(address _account, uint _tokens) public onlyOwner { } /* Minting of tokens by owner */ function mintTokensLocked(address _account, uint _tokens) public onlyOwner { } /* Transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint amount) public onlyOwner returns (bool success) { } // Private functions ---------------- /* Accept ETH during crowdsale (called by default function) */ function buyTokens() private { } // ERC20 functions ------------------ /* Override "transfer" */ function transfer(address _to, uint _amount) public returns (bool success) { } /* Override "transferFrom" */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { } // Bulk token transfer function ----- /* Multiple token transfers from one address to save gas */ function transferMultiple(address[] _addresses, uint[] _amounts) external { } // Functions to convert GZR to Gizer items ----------- /* GZR token owner buys one Gizer Item */ function buyItem() public returns (uint idx) { } /* GZR token owner buys several Gizer Items (max 100) */ function buyMultipleItems(uint8 _items) public returns (uint idx) { } /* Internal function to call */ function mintItem(address _owner) internal returns(uint idx) { } } // ---------------------------------------------------------------------------- // // GZR Items interface // // ---------------------------------------------------------------------------- contract GizerItemsInterface is Owned { function mint(address _to) public onlyAdmin returns (uint idx); }
TOKEN_SUPPLY_OWNER+TOKEN_SUPPLY_CROWD==TOKEN_SUPPLY_TOTAL
321,788
TOKEN_SUPPLY_OWNER+TOKEN_SUPPLY_CROWD==TOKEN_SUPPLY_TOTAL
null
pragma solidity ^0.4.20; // ---------------------------------------------------------------------------- // // GZR 'Gizer Gaming' token public sale contract // // For details, please visit: http://www.gizer.io // // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // // SafeMath // // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { } function sub(uint a, uint b) internal pure returns (uint c) { } function mul(uint a, uint b) internal pure returns (uint c) { } } // ---------------------------------------------------------------------------- // // Owned contract // // ---------------------------------------------------------------------------- contract Owned { address public owner; address public newOwner; mapping(address => bool) public isAdmin; // Events --------------------------- event OwnershipTransferProposed(address indexed _from, address indexed _to); event OwnershipTransferred(address indexed _from, address indexed _to); event AdminChange(address indexed _admin, bool _status); // Modifiers ------------------------ modifier onlyOwner { } modifier onlyAdmin { } // Functions ------------------------ function Owned() public { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } function addAdmin(address _a) public onlyOwner { } function removeAdmin(address _a) public onlyOwner { } } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // // ---------------------------------------------------------------------------- contract ERC20Interface { // Events --------------------------- event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); // Functions ------------------------ function totalSupply() public view returns (uint); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 // // ---------------------------------------------------------------------------- contract ERC20Token is ERC20Interface, Owned { using SafeMath for uint; uint public tokensIssuedTotal = 0; mapping(address => uint) balances; mapping(address => mapping (address => uint)) allowed; // Functions ------------------------ /* Total token supply */ function totalSupply() public view returns (uint) { } /* Get the account balance for an address */ function balanceOf(address _owner) public view returns (uint balance) { } /* Transfer the balance from owner's account to another account */ function transfer(address _to, uint _amount) public returns (bool success) { } /* Allow _spender to withdraw from your account up to _amount */ function approve(address _spender, uint _amount) public returns (bool success) { } /* Spender of tokens transfers tokens from the owner's balance */ /* Must be pre-approved by owner */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { } /* Returns the amount of tokens approved by the owner */ /* that can be transferred by spender */ function allowance(address _owner, address _spender) public view returns (uint remaining) { } } // ---------------------------------------------------------------------------- // // GZR public token sale // // ---------------------------------------------------------------------------- contract GizerToken is ERC20Token { /* Utility variable */ uint constant E6 = 10**6; /* Basic token data */ string public constant name = "Gizer Gaming Token"; string public constant symbol = "GZR"; uint8 public constant decimals = 6; /* Wallets */ address public wallet; address public redemptionWallet; address public gizerItemsContract; /* Crowdsale parameters (constants) */ uint public constant DATE_ICO_START = 1521122400; // 15-Mar-2018 14:00 UTC 10:00 EST uint public constant TOKEN_SUPPLY_TOTAL = 10000000 * E6; uint public constant TOKEN_SUPPLY_CROWD = 6112926 * E6; uint public constant TOKEN_SUPPLY_OWNER = 3887074 * E6; // 2,000,000 tokens reserve // 1,887,074 presale tokens uint public constant MIN_CONTRIBUTION = 1 ether / 100; uint public constant TOKENS_PER_ETH = 1000; uint public constant DATE_TOKENS_UNLOCKED = 1539180000; // 10-OCT-2018 14:00 UTC 10:00 EST /* Crowdsale parameters (can be modified by owner) */ uint public date_ico_end = 1523368800; // 10-Apr-2018 14:00 UTC 10:00 EST /* Crowdsale variables */ uint public tokensIssuedCrowd = 0; uint public tokensIssuedOwner = 0; uint public tokensIssuedLocked = 0; uint public etherReceived = 0; // does not include presale ethers /* Keep track of + ethers contributed, + tokens received + tokens locked during Crowdsale */ mapping(address => uint) public etherContributed; mapping(address => uint) public tokensReceived; mapping(address => uint) public locked; // Events --------------------------- event WalletUpdated(address _newWallet); event GizerItemsContractUpdated(address _GizerItemsContract); event RedemptionWalletUpdated(address _newRedemptionWallet); event DateIcoEndUpdated(uint _unixts); event TokensIssuedCrowd(address indexed _recipient, uint _tokens, uint _ether); event TokensIssuedOwner(address indexed _recipient, uint _tokens, bool _locked); event ItemsBought(address indexed _recipient, uint _lastIdx, uint _number); // Basic Functions ------------------ /* Initialize */ function GizerToken() public { } /* Fallback */ function () public payable { } // Information Functions ------------ /* What time is it? */ function atNow() public view returns (uint) { } /* Are tokens tradeable */ function tradeable() public view returns (bool) { } /* Available to mint by owner */ function availableToMint() public view returns (uint available) { } /* Unlocked tokens in an account */ function unlockedTokens(address _account) public view returns (uint _unlockedTokens) { } // Owner Functions ------------------ /* Change the crowdsale wallet address */ function setWallet(address _wallet) public onlyOwner { } /* Change the redemption wallet address */ function setRedemptionWallet(address _wallet) public onlyOwner { } /* Change the Gizer Items contract address */ function setGizerItemsContract(address _contract) public onlyOwner { } /* Change the ICO end date */ function extendIco(uint _unixts) public onlyOwner { } /* Minting of tokens by owner */ function mintTokens(address _account, uint _tokens) public onlyOwner { } /* Minting of tokens by owner */ function mintTokensLocked(address _account, uint _tokens) public onlyOwner { } /* Transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint amount) public onlyOwner returns (bool success) { } // Private functions ---------------- /* Accept ETH during crowdsale (called by default function) */ function buyTokens() private { // basic checks require(<FILL_ME>) require( msg.value >= MIN_CONTRIBUTION ); // check token volume uint tokensAvailable = TOKEN_SUPPLY_CROWD.sub(tokensIssuedCrowd); uint tokens = msg.value.mul(TOKENS_PER_ETH) / 10**12; require( tokens <= tokensAvailable ); // issue tokens balances[msg.sender] = balances[msg.sender].add(tokens); // update global tracking variables tokensIssuedCrowd = tokensIssuedCrowd.add(tokens); tokensIssuedTotal = tokensIssuedTotal.add(tokens); etherReceived = etherReceived.add(msg.value); // update contributor tracking variables etherContributed[msg.sender] = etherContributed[msg.sender].add(msg.value); tokensReceived[msg.sender] = tokensReceived[msg.sender].add(tokens); // transfer Ether out if (this.balance > 0) wallet.transfer(this.balance); // log token issuance TokensIssuedCrowd(msg.sender, tokens, msg.value); Transfer(0x0, msg.sender, tokens); } // ERC20 functions ------------------ /* Override "transfer" */ function transfer(address _to, uint _amount) public returns (bool success) { } /* Override "transferFrom" */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { } // Bulk token transfer function ----- /* Multiple token transfers from one address to save gas */ function transferMultiple(address[] _addresses, uint[] _amounts) external { } // Functions to convert GZR to Gizer items ----------- /* GZR token owner buys one Gizer Item */ function buyItem() public returns (uint idx) { } /* GZR token owner buys several Gizer Items (max 100) */ function buyMultipleItems(uint8 _items) public returns (uint idx) { } /* Internal function to call */ function mintItem(address _owner) internal returns(uint idx) { } } // ---------------------------------------------------------------------------- // // GZR Items interface // // ---------------------------------------------------------------------------- contract GizerItemsInterface is Owned { function mint(address _to) public onlyAdmin returns (uint idx); }
atNow()>DATE_ICO_START&&atNow()<date_ico_end
321,788
atNow()>DATE_ICO_START&&atNow()<date_ico_end
null
pragma solidity ^0.4.20; // ---------------------------------------------------------------------------- // // GZR 'Gizer Gaming' token public sale contract // // For details, please visit: http://www.gizer.io // // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // // SafeMath // // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { } function sub(uint a, uint b) internal pure returns (uint c) { } function mul(uint a, uint b) internal pure returns (uint c) { } } // ---------------------------------------------------------------------------- // // Owned contract // // ---------------------------------------------------------------------------- contract Owned { address public owner; address public newOwner; mapping(address => bool) public isAdmin; // Events --------------------------- event OwnershipTransferProposed(address indexed _from, address indexed _to); event OwnershipTransferred(address indexed _from, address indexed _to); event AdminChange(address indexed _admin, bool _status); // Modifiers ------------------------ modifier onlyOwner { } modifier onlyAdmin { } // Functions ------------------------ function Owned() public { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } function addAdmin(address _a) public onlyOwner { } function removeAdmin(address _a) public onlyOwner { } } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // // ---------------------------------------------------------------------------- contract ERC20Interface { // Events --------------------------- event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); // Functions ------------------------ function totalSupply() public view returns (uint); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 // // ---------------------------------------------------------------------------- contract ERC20Token is ERC20Interface, Owned { using SafeMath for uint; uint public tokensIssuedTotal = 0; mapping(address => uint) balances; mapping(address => mapping (address => uint)) allowed; // Functions ------------------------ /* Total token supply */ function totalSupply() public view returns (uint) { } /* Get the account balance for an address */ function balanceOf(address _owner) public view returns (uint balance) { } /* Transfer the balance from owner's account to another account */ function transfer(address _to, uint _amount) public returns (bool success) { } /* Allow _spender to withdraw from your account up to _amount */ function approve(address _spender, uint _amount) public returns (bool success) { } /* Spender of tokens transfers tokens from the owner's balance */ /* Must be pre-approved by owner */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { } /* Returns the amount of tokens approved by the owner */ /* that can be transferred by spender */ function allowance(address _owner, address _spender) public view returns (uint remaining) { } } // ---------------------------------------------------------------------------- // // GZR public token sale // // ---------------------------------------------------------------------------- contract GizerToken is ERC20Token { /* Utility variable */ uint constant E6 = 10**6; /* Basic token data */ string public constant name = "Gizer Gaming Token"; string public constant symbol = "GZR"; uint8 public constant decimals = 6; /* Wallets */ address public wallet; address public redemptionWallet; address public gizerItemsContract; /* Crowdsale parameters (constants) */ uint public constant DATE_ICO_START = 1521122400; // 15-Mar-2018 14:00 UTC 10:00 EST uint public constant TOKEN_SUPPLY_TOTAL = 10000000 * E6; uint public constant TOKEN_SUPPLY_CROWD = 6112926 * E6; uint public constant TOKEN_SUPPLY_OWNER = 3887074 * E6; // 2,000,000 tokens reserve // 1,887,074 presale tokens uint public constant MIN_CONTRIBUTION = 1 ether / 100; uint public constant TOKENS_PER_ETH = 1000; uint public constant DATE_TOKENS_UNLOCKED = 1539180000; // 10-OCT-2018 14:00 UTC 10:00 EST /* Crowdsale parameters (can be modified by owner) */ uint public date_ico_end = 1523368800; // 10-Apr-2018 14:00 UTC 10:00 EST /* Crowdsale variables */ uint public tokensIssuedCrowd = 0; uint public tokensIssuedOwner = 0; uint public tokensIssuedLocked = 0; uint public etherReceived = 0; // does not include presale ethers /* Keep track of + ethers contributed, + tokens received + tokens locked during Crowdsale */ mapping(address => uint) public etherContributed; mapping(address => uint) public tokensReceived; mapping(address => uint) public locked; // Events --------------------------- event WalletUpdated(address _newWallet); event GizerItemsContractUpdated(address _GizerItemsContract); event RedemptionWalletUpdated(address _newRedemptionWallet); event DateIcoEndUpdated(uint _unixts); event TokensIssuedCrowd(address indexed _recipient, uint _tokens, uint _ether); event TokensIssuedOwner(address indexed _recipient, uint _tokens, bool _locked); event ItemsBought(address indexed _recipient, uint _lastIdx, uint _number); // Basic Functions ------------------ /* Initialize */ function GizerToken() public { } /* Fallback */ function () public payable { } // Information Functions ------------ /* What time is it? */ function atNow() public view returns (uint) { } /* Are tokens tradeable */ function tradeable() public view returns (bool) { } /* Available to mint by owner */ function availableToMint() public view returns (uint available) { } /* Unlocked tokens in an account */ function unlockedTokens(address _account) public view returns (uint _unlockedTokens) { } // Owner Functions ------------------ /* Change the crowdsale wallet address */ function setWallet(address _wallet) public onlyOwner { } /* Change the redemption wallet address */ function setRedemptionWallet(address _wallet) public onlyOwner { } /* Change the Gizer Items contract address */ function setGizerItemsContract(address _contract) public onlyOwner { } /* Change the ICO end date */ function extendIco(uint _unixts) public onlyOwner { } /* Minting of tokens by owner */ function mintTokens(address _account, uint _tokens) public onlyOwner { } /* Minting of tokens by owner */ function mintTokensLocked(address _account, uint _tokens) public onlyOwner { } /* Transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint amount) public onlyOwner returns (bool success) { } // Private functions ---------------- /* Accept ETH during crowdsale (called by default function) */ function buyTokens() private { } // ERC20 functions ------------------ /* Override "transfer" */ function transfer(address _to, uint _amount) public returns (bool success) { require(<FILL_ME>) require( unlockedTokens(msg.sender) >= _amount ); return super.transfer(_to, _amount); } /* Override "transferFrom" */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { } // Bulk token transfer function ----- /* Multiple token transfers from one address to save gas */ function transferMultiple(address[] _addresses, uint[] _amounts) external { } // Functions to convert GZR to Gizer items ----------- /* GZR token owner buys one Gizer Item */ function buyItem() public returns (uint idx) { } /* GZR token owner buys several Gizer Items (max 100) */ function buyMultipleItems(uint8 _items) public returns (uint idx) { } /* Internal function to call */ function mintItem(address _owner) internal returns(uint idx) { } } // ---------------------------------------------------------------------------- // // GZR Items interface // // ---------------------------------------------------------------------------- contract GizerItemsInterface is Owned { function mint(address _to) public onlyAdmin returns (uint idx); }
tradeable()
321,788
tradeable()
null
pragma solidity ^0.4.20; // ---------------------------------------------------------------------------- // // GZR 'Gizer Gaming' token public sale contract // // For details, please visit: http://www.gizer.io // // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // // SafeMath // // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { } function sub(uint a, uint b) internal pure returns (uint c) { } function mul(uint a, uint b) internal pure returns (uint c) { } } // ---------------------------------------------------------------------------- // // Owned contract // // ---------------------------------------------------------------------------- contract Owned { address public owner; address public newOwner; mapping(address => bool) public isAdmin; // Events --------------------------- event OwnershipTransferProposed(address indexed _from, address indexed _to); event OwnershipTransferred(address indexed _from, address indexed _to); event AdminChange(address indexed _admin, bool _status); // Modifiers ------------------------ modifier onlyOwner { } modifier onlyAdmin { } // Functions ------------------------ function Owned() public { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } function addAdmin(address _a) public onlyOwner { } function removeAdmin(address _a) public onlyOwner { } } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // // ---------------------------------------------------------------------------- contract ERC20Interface { // Events --------------------------- event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); // Functions ------------------------ function totalSupply() public view returns (uint); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 // // ---------------------------------------------------------------------------- contract ERC20Token is ERC20Interface, Owned { using SafeMath for uint; uint public tokensIssuedTotal = 0; mapping(address => uint) balances; mapping(address => mapping (address => uint)) allowed; // Functions ------------------------ /* Total token supply */ function totalSupply() public view returns (uint) { } /* Get the account balance for an address */ function balanceOf(address _owner) public view returns (uint balance) { } /* Transfer the balance from owner's account to another account */ function transfer(address _to, uint _amount) public returns (bool success) { } /* Allow _spender to withdraw from your account up to _amount */ function approve(address _spender, uint _amount) public returns (bool success) { } /* Spender of tokens transfers tokens from the owner's balance */ /* Must be pre-approved by owner */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { } /* Returns the amount of tokens approved by the owner */ /* that can be transferred by spender */ function allowance(address _owner, address _spender) public view returns (uint remaining) { } } // ---------------------------------------------------------------------------- // // GZR public token sale // // ---------------------------------------------------------------------------- contract GizerToken is ERC20Token { /* Utility variable */ uint constant E6 = 10**6; /* Basic token data */ string public constant name = "Gizer Gaming Token"; string public constant symbol = "GZR"; uint8 public constant decimals = 6; /* Wallets */ address public wallet; address public redemptionWallet; address public gizerItemsContract; /* Crowdsale parameters (constants) */ uint public constant DATE_ICO_START = 1521122400; // 15-Mar-2018 14:00 UTC 10:00 EST uint public constant TOKEN_SUPPLY_TOTAL = 10000000 * E6; uint public constant TOKEN_SUPPLY_CROWD = 6112926 * E6; uint public constant TOKEN_SUPPLY_OWNER = 3887074 * E6; // 2,000,000 tokens reserve // 1,887,074 presale tokens uint public constant MIN_CONTRIBUTION = 1 ether / 100; uint public constant TOKENS_PER_ETH = 1000; uint public constant DATE_TOKENS_UNLOCKED = 1539180000; // 10-OCT-2018 14:00 UTC 10:00 EST /* Crowdsale parameters (can be modified by owner) */ uint public date_ico_end = 1523368800; // 10-Apr-2018 14:00 UTC 10:00 EST /* Crowdsale variables */ uint public tokensIssuedCrowd = 0; uint public tokensIssuedOwner = 0; uint public tokensIssuedLocked = 0; uint public etherReceived = 0; // does not include presale ethers /* Keep track of + ethers contributed, + tokens received + tokens locked during Crowdsale */ mapping(address => uint) public etherContributed; mapping(address => uint) public tokensReceived; mapping(address => uint) public locked; // Events --------------------------- event WalletUpdated(address _newWallet); event GizerItemsContractUpdated(address _GizerItemsContract); event RedemptionWalletUpdated(address _newRedemptionWallet); event DateIcoEndUpdated(uint _unixts); event TokensIssuedCrowd(address indexed _recipient, uint _tokens, uint _ether); event TokensIssuedOwner(address indexed _recipient, uint _tokens, bool _locked); event ItemsBought(address indexed _recipient, uint _lastIdx, uint _number); // Basic Functions ------------------ /* Initialize */ function GizerToken() public { } /* Fallback */ function () public payable { } // Information Functions ------------ /* What time is it? */ function atNow() public view returns (uint) { } /* Are tokens tradeable */ function tradeable() public view returns (bool) { } /* Available to mint by owner */ function availableToMint() public view returns (uint available) { } /* Unlocked tokens in an account */ function unlockedTokens(address _account) public view returns (uint _unlockedTokens) { } // Owner Functions ------------------ /* Change the crowdsale wallet address */ function setWallet(address _wallet) public onlyOwner { } /* Change the redemption wallet address */ function setRedemptionWallet(address _wallet) public onlyOwner { } /* Change the Gizer Items contract address */ function setGizerItemsContract(address _contract) public onlyOwner { } /* Change the ICO end date */ function extendIco(uint _unixts) public onlyOwner { } /* Minting of tokens by owner */ function mintTokens(address _account, uint _tokens) public onlyOwner { } /* Minting of tokens by owner */ function mintTokensLocked(address _account, uint _tokens) public onlyOwner { } /* Transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint amount) public onlyOwner returns (bool success) { } // Private functions ---------------- /* Accept ETH during crowdsale (called by default function) */ function buyTokens() private { } // ERC20 functions ------------------ /* Override "transfer" */ function transfer(address _to, uint _amount) public returns (bool success) { require( tradeable() ); require(<FILL_ME>) return super.transfer(_to, _amount); } /* Override "transferFrom" */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { } // Bulk token transfer function ----- /* Multiple token transfers from one address to save gas */ function transferMultiple(address[] _addresses, uint[] _amounts) external { } // Functions to convert GZR to Gizer items ----------- /* GZR token owner buys one Gizer Item */ function buyItem() public returns (uint idx) { } /* GZR token owner buys several Gizer Items (max 100) */ function buyMultipleItems(uint8 _items) public returns (uint idx) { } /* Internal function to call */ function mintItem(address _owner) internal returns(uint idx) { } } // ---------------------------------------------------------------------------- // // GZR Items interface // // ---------------------------------------------------------------------------- contract GizerItemsInterface is Owned { function mint(address _to) public onlyAdmin returns (uint idx); }
unlockedTokens(msg.sender)>=_amount
321,788
unlockedTokens(msg.sender)>=_amount
null
pragma solidity ^0.4.20; // ---------------------------------------------------------------------------- // // GZR 'Gizer Gaming' token public sale contract // // For details, please visit: http://www.gizer.io // // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // // SafeMath // // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { } function sub(uint a, uint b) internal pure returns (uint c) { } function mul(uint a, uint b) internal pure returns (uint c) { } } // ---------------------------------------------------------------------------- // // Owned contract // // ---------------------------------------------------------------------------- contract Owned { address public owner; address public newOwner; mapping(address => bool) public isAdmin; // Events --------------------------- event OwnershipTransferProposed(address indexed _from, address indexed _to); event OwnershipTransferred(address indexed _from, address indexed _to); event AdminChange(address indexed _admin, bool _status); // Modifiers ------------------------ modifier onlyOwner { } modifier onlyAdmin { } // Functions ------------------------ function Owned() public { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } function addAdmin(address _a) public onlyOwner { } function removeAdmin(address _a) public onlyOwner { } } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // // ---------------------------------------------------------------------------- contract ERC20Interface { // Events --------------------------- event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); // Functions ------------------------ function totalSupply() public view returns (uint); function balanceOf(address _owner) public view returns (uint balance); function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint remaining); } // ---------------------------------------------------------------------------- // // ERC Token Standard #20 // // ---------------------------------------------------------------------------- contract ERC20Token is ERC20Interface, Owned { using SafeMath for uint; uint public tokensIssuedTotal = 0; mapping(address => uint) balances; mapping(address => mapping (address => uint)) allowed; // Functions ------------------------ /* Total token supply */ function totalSupply() public view returns (uint) { } /* Get the account balance for an address */ function balanceOf(address _owner) public view returns (uint balance) { } /* Transfer the balance from owner's account to another account */ function transfer(address _to, uint _amount) public returns (bool success) { } /* Allow _spender to withdraw from your account up to _amount */ function approve(address _spender, uint _amount) public returns (bool success) { } /* Spender of tokens transfers tokens from the owner's balance */ /* Must be pre-approved by owner */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { } /* Returns the amount of tokens approved by the owner */ /* that can be transferred by spender */ function allowance(address _owner, address _spender) public view returns (uint remaining) { } } // ---------------------------------------------------------------------------- // // GZR public token sale // // ---------------------------------------------------------------------------- contract GizerToken is ERC20Token { /* Utility variable */ uint constant E6 = 10**6; /* Basic token data */ string public constant name = "Gizer Gaming Token"; string public constant symbol = "GZR"; uint8 public constant decimals = 6; /* Wallets */ address public wallet; address public redemptionWallet; address public gizerItemsContract; /* Crowdsale parameters (constants) */ uint public constant DATE_ICO_START = 1521122400; // 15-Mar-2018 14:00 UTC 10:00 EST uint public constant TOKEN_SUPPLY_TOTAL = 10000000 * E6; uint public constant TOKEN_SUPPLY_CROWD = 6112926 * E6; uint public constant TOKEN_SUPPLY_OWNER = 3887074 * E6; // 2,000,000 tokens reserve // 1,887,074 presale tokens uint public constant MIN_CONTRIBUTION = 1 ether / 100; uint public constant TOKENS_PER_ETH = 1000; uint public constant DATE_TOKENS_UNLOCKED = 1539180000; // 10-OCT-2018 14:00 UTC 10:00 EST /* Crowdsale parameters (can be modified by owner) */ uint public date_ico_end = 1523368800; // 10-Apr-2018 14:00 UTC 10:00 EST /* Crowdsale variables */ uint public tokensIssuedCrowd = 0; uint public tokensIssuedOwner = 0; uint public tokensIssuedLocked = 0; uint public etherReceived = 0; // does not include presale ethers /* Keep track of + ethers contributed, + tokens received + tokens locked during Crowdsale */ mapping(address => uint) public etherContributed; mapping(address => uint) public tokensReceived; mapping(address => uint) public locked; // Events --------------------------- event WalletUpdated(address _newWallet); event GizerItemsContractUpdated(address _GizerItemsContract); event RedemptionWalletUpdated(address _newRedemptionWallet); event DateIcoEndUpdated(uint _unixts); event TokensIssuedCrowd(address indexed _recipient, uint _tokens, uint _ether); event TokensIssuedOwner(address indexed _recipient, uint _tokens, bool _locked); event ItemsBought(address indexed _recipient, uint _lastIdx, uint _number); // Basic Functions ------------------ /* Initialize */ function GizerToken() public { } /* Fallback */ function () public payable { } // Information Functions ------------ /* What time is it? */ function atNow() public view returns (uint) { } /* Are tokens tradeable */ function tradeable() public view returns (bool) { } /* Available to mint by owner */ function availableToMint() public view returns (uint available) { } /* Unlocked tokens in an account */ function unlockedTokens(address _account) public view returns (uint _unlockedTokens) { } // Owner Functions ------------------ /* Change the crowdsale wallet address */ function setWallet(address _wallet) public onlyOwner { } /* Change the redemption wallet address */ function setRedemptionWallet(address _wallet) public onlyOwner { } /* Change the Gizer Items contract address */ function setGizerItemsContract(address _contract) public onlyOwner { } /* Change the ICO end date */ function extendIco(uint _unixts) public onlyOwner { } /* Minting of tokens by owner */ function mintTokens(address _account, uint _tokens) public onlyOwner { } /* Minting of tokens by owner */ function mintTokensLocked(address _account, uint _tokens) public onlyOwner { } /* Transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint amount) public onlyOwner returns (bool success) { } // Private functions ---------------- /* Accept ETH during crowdsale (called by default function) */ function buyTokens() private { } // ERC20 functions ------------------ /* Override "transfer" */ function transfer(address _to, uint _amount) public returns (bool success) { } /* Override "transferFrom" */ function transferFrom(address _from, address _to, uint _amount) public returns (bool success) { require( tradeable() ); require(<FILL_ME>) return super.transferFrom(_from, _to, _amount); } // Bulk token transfer function ----- /* Multiple token transfers from one address to save gas */ function transferMultiple(address[] _addresses, uint[] _amounts) external { } // Functions to convert GZR to Gizer items ----------- /* GZR token owner buys one Gizer Item */ function buyItem() public returns (uint idx) { } /* GZR token owner buys several Gizer Items (max 100) */ function buyMultipleItems(uint8 _items) public returns (uint idx) { } /* Internal function to call */ function mintItem(address _owner) internal returns(uint idx) { } } // ---------------------------------------------------------------------------- // // GZR Items interface // // ---------------------------------------------------------------------------- contract GizerItemsInterface is Owned { function mint(address _to) public onlyAdmin returns (uint idx); }
unlockedTokens(_from)>=_amount
321,788
unlockedTokens(_from)>=_amount
null
pragma solidity 0.6.12; pragma experimental ABIEncoderV2; interface IMasterChefV2 { function lpToken(uint256 pid) external view returns (IERC20 _lpToken); } /// @author @0xKeno contract SirenRewarder is IRewarder, BoringOwnable{ using BoringMath for uint256; using BoringMath128 for uint128; using BoringERC20 for IERC20; IERC20 public rewardToken; /// @notice Info of each MCV2 user. /// `amount` LP token amount the user has provided. /// `rewardDebt` The amount of SUSHI entitled to the user. struct UserInfo { uint256 amount; uint256 rewardDebt; } /// @notice Info of each MCV2 pool. /// `allocPoint` The amount of allocation points assigned to the pool. /// Also known as the amount of SUSHI to distribute per block. struct PoolInfo { uint128 accSushiPerShare; uint64 lastRewardTime; } /// @notice Info of each pool. mapping (uint256 => PoolInfo) public poolInfo; /// @notice Info of each user that stakes LP tokens. mapping (uint256 => mapping (address => UserInfo)) public userInfo; uint256 public rewardPerSecond; IERC20 public masterLpToken; uint256 private constant ACC_TOKEN_PRECISION = 1e12; address public immutable MASTERCHEF_V2; event LogOnReward(address indexed user, uint256 indexed pid, uint256 amount, address indexed to); event LogPoolAddition(uint256 indexed pid, uint256 allocPoint); event LogSetPool(uint256 indexed pid, uint256 allocPoint); event LogUpdatePool(uint256 indexed pid, uint64 lastRewardTime, uint256 lpSupply, uint256 accSushiPerShare); event LogRewardPerSecond(uint256 rewardPerSecond); event LogInit(); constructor (address _MASTERCHEF_V2) public { } /// @notice Serves as the constructor for clones, as clones can't have a regular constructor /// @dev `data` is abi encoded in the format: (IERC20 collateral, IERC20 asset, IOracle oracle, bytes oracleData) function init(bytes calldata data) public payable { } function onSushiReward (uint256 pid, address _user, address to, uint256, uint256 lpToken) onlyMCV2 override external { require(<FILL_ME>) PoolInfo memory pool = updatePool(pid); UserInfo storage user = userInfo[pid][_user]; uint256 pending; if (user.amount > 0) { pending = (user.amount.mul(pool.accSushiPerShare) / ACC_TOKEN_PRECISION).sub( user.rewardDebt ); rewardToken.safeTransfer(to, pending); } user.amount = lpToken; user.rewardDebt = lpToken.mul(pool.accSushiPerShare) / ACC_TOKEN_PRECISION; emit LogOnReward(_user, pid, pending, to); } function pendingTokens(uint256 pid, address user, uint256) override external view returns (IERC20[] memory rewardTokens, uint256[] memory rewardAmounts) { } /// @notice Sets the sushi per second to be distributed. Can only be called by the owner. /// @param _rewardPerSecond The amount of Sushi to be distributed per second. function setRewardPerSecond(uint256 _rewardPerSecond) public onlyOwner { } modifier onlyMCV2 { } /// @notice View function to see pending Token /// @param _pid The index of the pool. See `poolInfo`. /// @param _user Address of user. /// @return pending SUSHI reward for a given user. function pendingToken(uint256 _pid, address _user) public view returns (uint256 pending) { } /// @notice Update reward variables of the given pool. /// @param pid The index of the pool. See `poolInfo`. /// @return pool Returns the pool that was updated. function updatePool(uint256 pid) public returns (PoolInfo memory pool) { } }
IMasterChefV2(MASTERCHEF_V2).lpToken(pid)==masterLpToken
321,797
IMasterChefV2(MASTERCHEF_V2).lpToken(pid)==masterLpToken
null
pragma solidity ^0.4.16; //Define the pool contract SmartPool { //Pool info uint currAmount; //Current amount in the pool (=balance) uint ticketPrice; //Price of one ticket uint startDate; //The date of opening uint endDate; //The date of closing (or 0 if still open) //Block infos (better to use block number than dates to trigger the end) uint startBlock; uint endBlock; //End triggers uint duration; //The pool ends when the duration expire uint ticketCount; //Or when the reserve of tickets has been sold bool ended; //Current state (can't buy tickets when ended) bool terminated; //true if a winner has been picked bool moneySent; //true if the winner has picked his money //Min wait duration between ended and terminated states uint constant blockDuration = 15; // we use 15 sec for the block duration uint constant minWaitDuration = 240; // (= 3600 / blockDuration => 60 minutes waiting between 'ended' and 'terminated') //Players address[] players; //List of tickets owners, each ticket gives an entry in the array //Winning info address winner; //The final winner (only available when terminated == true) //Pool manager address (only the manager can call modifiers of this contract, see PoolManager.sol) address poolManager; //Create a pool with a fixed ticket price, a ticket reserve and/or a duration) function SmartPool(uint _ticketPrice, uint _ticketCount, uint _duration) public { //Positive ticket price and either ticketCount or duration must be provided require(_ticketPrice > 0 && (_ticketCount > 0 || _duration > blockDuration)); //Check for overflows require(<FILL_ME>) //Set ticketCount if needed (according to max balance) if (_ticketCount == 0) { _ticketCount = (2 ** 256 - 1) / _ticketPrice; } require(_ticketCount * _ticketPrice >= _ticketPrice); //Store manager poolManager = msg.sender; //Init currAmount = 0; startDate = now; endDate = 0; startBlock = block.number; endBlock = 0; ticketPrice = _ticketPrice; ticketCount = _ticketCount; duration = _duration / blockDuration; // compute duration in blocks ended = false; terminated = false; moneySent = false; winner = 0x0000000000000000000000000000000000000000; } //Accessors function getPlayers() public constant returns (address[]) { } function getStartDate() public constant returns (uint) { } function getStartBlock() public constant returns (uint) { } function getCurrAmount() public constant returns (uint) { } function getTicketPrice() public constant returns (uint) { } function getTicketCount() public constant returns (uint) { } function getBoughtTicketCount() public constant returns (uint) { } function getAvailableTicketCount() public constant returns (uint) { } function getEndDate() public constant returns (uint) { } function getEndBlock() public constant returns (uint) { } function getDuration() public constant returns (uint) { } function getDurationS() public constant returns (uint) { } function isEnded() public constant returns (bool) { } function isTerminated() public constant returns (bool) { } function isMoneySent() public constant returns (bool) { } function getWinner() public constant returns (address) { } //End trigger function checkEnd() public { } //Add player with ticketCount to the pool (only poolManager can do this) function addPlayer(address player, uint ticketBoughtCount, uint amount) public { } function canTerminate() public constant returns(bool) { } //Terminate the pool by picking a winner (only poolManager can do this, after the pool is ended and some time has passed so the seed has changed many times) function terminate(uint randSeed) public { } //Update pool state (only poolManager can call this when the money has been sent) function onMoneySent() public { } } //Wallet interface contract WalletContract { function payMe() public payable; } contract PoolManager { //Pool owner (address which manage the pool creation) address owner; //Wallet which receive the fees (1% of ticket price) address wallet; //Fees infos (external websites providing access to pools get 1% too) mapping(address => uint) fees; //Fees divider (1% for the wallet, and 1% for external website where player can buy tickets) uint constant feeDivider = 100; //(1/100 of the amount) //The ticket price for pools must be a multiple of 0.010205 ether (to avoid truncating the fees, and having a minimum to send to the winner) uint constant ticketPriceMultiple = 10205000000000000; //(multiple of 0.010205 ether for ticketPrice) //Pools infos (current active pools. When a pool is done, it goes into the poolsDone array bellow and a new pool is created to replace it at the same index) SmartPool[] pools; //Ended pools (cleaned automatically after winners get their prices) SmartPool[] poolsDone; //History (contains all the pools since the deploy) SmartPool[] poolsHistory; //Current rand seed (it changes a lot so it's pretty hard to know its value when the winner is picked) uint randSeed; //Constructor (only owner) function PoolManager(address wal) public { } //Called frequently by other functions to keep the seed moving function updateSeed() private { } //Create a new pool (only owner can do this) function addPool(uint ticketPrice, uint ticketCount, uint duration) public { } //Accessors (public) //Get Active Pools function getPoolCount() public constant returns(uint) { } function getPool(uint index) public constant returns(address) { } //Get Ended Pools function getPoolDoneCount() public constant returns(uint) { } function getPoolDone(uint index) public constant returns(address) { } //Get History function getPoolHistoryCount() public constant returns(uint) { } function getPoolHistory(uint index) public constant returns(address) { } //Buy tickets for a pool (public) function buyTicket(uint poolIndex, uint ticketCount, address websiteFeeAddr) public payable { } //Check pools end. (called by our console each 10 minutes, or can be called by anybody) function checkPoolsEnd() public { } //Check end of a pool and restart it if it's ended (public) function checkPoolEnd(uint i) public { } //Check pools done. (called by our console, or can be called by anybody) function checkPoolsDone() public { } //Check end of one pool function checkPoolDone(uint i) public { } //Send money of the pool to the winner (public) function sendPoolMoney(uint i) public { } //Clear pools done array (called once a week by our console, or can be called by anybody) function clearPoolsDone() public { } //Get current fee value function getFeeValue(address a) public constant returns (uint) { } //Send fee to address (public, with a min amount required) function getMyFee(address a) public { } //Add fee (private) function addFee(address a, uint fee) private { } }
now+_duration>=now
321,839
now+_duration>=now
null
pragma solidity ^0.4.16; //Define the pool contract SmartPool { //Pool info uint currAmount; //Current amount in the pool (=balance) uint ticketPrice; //Price of one ticket uint startDate; //The date of opening uint endDate; //The date of closing (or 0 if still open) //Block infos (better to use block number than dates to trigger the end) uint startBlock; uint endBlock; //End triggers uint duration; //The pool ends when the duration expire uint ticketCount; //Or when the reserve of tickets has been sold bool ended; //Current state (can't buy tickets when ended) bool terminated; //true if a winner has been picked bool moneySent; //true if the winner has picked his money //Min wait duration between ended and terminated states uint constant blockDuration = 15; // we use 15 sec for the block duration uint constant minWaitDuration = 240; // (= 3600 / blockDuration => 60 minutes waiting between 'ended' and 'terminated') //Players address[] players; //List of tickets owners, each ticket gives an entry in the array //Winning info address winner; //The final winner (only available when terminated == true) //Pool manager address (only the manager can call modifiers of this contract, see PoolManager.sol) address poolManager; //Create a pool with a fixed ticket price, a ticket reserve and/or a duration) function SmartPool(uint _ticketPrice, uint _ticketCount, uint _duration) public { //Positive ticket price and either ticketCount or duration must be provided require(_ticketPrice > 0 && (_ticketCount > 0 || _duration > blockDuration)); //Check for overflows require(now + _duration >= now); //Set ticketCount if needed (according to max balance) if (_ticketCount == 0) { _ticketCount = (2 ** 256 - 1) / _ticketPrice; } require(<FILL_ME>) //Store manager poolManager = msg.sender; //Init currAmount = 0; startDate = now; endDate = 0; startBlock = block.number; endBlock = 0; ticketPrice = _ticketPrice; ticketCount = _ticketCount; duration = _duration / blockDuration; // compute duration in blocks ended = false; terminated = false; moneySent = false; winner = 0x0000000000000000000000000000000000000000; } //Accessors function getPlayers() public constant returns (address[]) { } function getStartDate() public constant returns (uint) { } function getStartBlock() public constant returns (uint) { } function getCurrAmount() public constant returns (uint) { } function getTicketPrice() public constant returns (uint) { } function getTicketCount() public constant returns (uint) { } function getBoughtTicketCount() public constant returns (uint) { } function getAvailableTicketCount() public constant returns (uint) { } function getEndDate() public constant returns (uint) { } function getEndBlock() public constant returns (uint) { } function getDuration() public constant returns (uint) { } function getDurationS() public constant returns (uint) { } function isEnded() public constant returns (bool) { } function isTerminated() public constant returns (bool) { } function isMoneySent() public constant returns (bool) { } function getWinner() public constant returns (address) { } //End trigger function checkEnd() public { } //Add player with ticketCount to the pool (only poolManager can do this) function addPlayer(address player, uint ticketBoughtCount, uint amount) public { } function canTerminate() public constant returns(bool) { } //Terminate the pool by picking a winner (only poolManager can do this, after the pool is ended and some time has passed so the seed has changed many times) function terminate(uint randSeed) public { } //Update pool state (only poolManager can call this when the money has been sent) function onMoneySent() public { } } //Wallet interface contract WalletContract { function payMe() public payable; } contract PoolManager { //Pool owner (address which manage the pool creation) address owner; //Wallet which receive the fees (1% of ticket price) address wallet; //Fees infos (external websites providing access to pools get 1% too) mapping(address => uint) fees; //Fees divider (1% for the wallet, and 1% for external website where player can buy tickets) uint constant feeDivider = 100; //(1/100 of the amount) //The ticket price for pools must be a multiple of 0.010205 ether (to avoid truncating the fees, and having a minimum to send to the winner) uint constant ticketPriceMultiple = 10205000000000000; //(multiple of 0.010205 ether for ticketPrice) //Pools infos (current active pools. When a pool is done, it goes into the poolsDone array bellow and a new pool is created to replace it at the same index) SmartPool[] pools; //Ended pools (cleaned automatically after winners get their prices) SmartPool[] poolsDone; //History (contains all the pools since the deploy) SmartPool[] poolsHistory; //Current rand seed (it changes a lot so it's pretty hard to know its value when the winner is picked) uint randSeed; //Constructor (only owner) function PoolManager(address wal) public { } //Called frequently by other functions to keep the seed moving function updateSeed() private { } //Create a new pool (only owner can do this) function addPool(uint ticketPrice, uint ticketCount, uint duration) public { } //Accessors (public) //Get Active Pools function getPoolCount() public constant returns(uint) { } function getPool(uint index) public constant returns(address) { } //Get Ended Pools function getPoolDoneCount() public constant returns(uint) { } function getPoolDone(uint index) public constant returns(address) { } //Get History function getPoolHistoryCount() public constant returns(uint) { } function getPoolHistory(uint index) public constant returns(address) { } //Buy tickets for a pool (public) function buyTicket(uint poolIndex, uint ticketCount, address websiteFeeAddr) public payable { } //Check pools end. (called by our console each 10 minutes, or can be called by anybody) function checkPoolsEnd() public { } //Check end of a pool and restart it if it's ended (public) function checkPoolEnd(uint i) public { } //Check pools done. (called by our console, or can be called by anybody) function checkPoolsDone() public { } //Check end of one pool function checkPoolDone(uint i) public { } //Send money of the pool to the winner (public) function sendPoolMoney(uint i) public { } //Clear pools done array (called once a week by our console, or can be called by anybody) function clearPoolsDone() public { } //Get current fee value function getFeeValue(address a) public constant returns (uint) { } //Send fee to address (public, with a min amount required) function getMyFee(address a) public { } //Add fee (private) function addFee(address a, uint fee) private { } }
_ticketCount*_ticketPrice>=_ticketPrice
321,839
_ticketCount*_ticketPrice>=_ticketPrice
null
pragma solidity ^0.4.16; //Define the pool contract SmartPool { //Pool info uint currAmount; //Current amount in the pool (=balance) uint ticketPrice; //Price of one ticket uint startDate; //The date of opening uint endDate; //The date of closing (or 0 if still open) //Block infos (better to use block number than dates to trigger the end) uint startBlock; uint endBlock; //End triggers uint duration; //The pool ends when the duration expire uint ticketCount; //Or when the reserve of tickets has been sold bool ended; //Current state (can't buy tickets when ended) bool terminated; //true if a winner has been picked bool moneySent; //true if the winner has picked his money //Min wait duration between ended and terminated states uint constant blockDuration = 15; // we use 15 sec for the block duration uint constant minWaitDuration = 240; // (= 3600 / blockDuration => 60 minutes waiting between 'ended' and 'terminated') //Players address[] players; //List of tickets owners, each ticket gives an entry in the array //Winning info address winner; //The final winner (only available when terminated == true) //Pool manager address (only the manager can call modifiers of this contract, see PoolManager.sol) address poolManager; //Create a pool with a fixed ticket price, a ticket reserve and/or a duration) function SmartPool(uint _ticketPrice, uint _ticketCount, uint _duration) public { } //Accessors function getPlayers() public constant returns (address[]) { } function getStartDate() public constant returns (uint) { } function getStartBlock() public constant returns (uint) { } function getCurrAmount() public constant returns (uint) { } function getTicketPrice() public constant returns (uint) { } function getTicketCount() public constant returns (uint) { } function getBoughtTicketCount() public constant returns (uint) { } function getAvailableTicketCount() public constant returns (uint) { } function getEndDate() public constant returns (uint) { } function getEndBlock() public constant returns (uint) { } function getDuration() public constant returns (uint) { } function getDurationS() public constant returns (uint) { } function isEnded() public constant returns (bool) { } function isTerminated() public constant returns (bool) { } function isMoneySent() public constant returns (bool) { } function getWinner() public constant returns (address) { } //End trigger function checkEnd() public { } //Add player with ticketCount to the pool (only poolManager can do this) function addPlayer(address player, uint ticketBoughtCount, uint amount) public { } function canTerminate() public constant returns(bool) { } //Terminate the pool by picking a winner (only poolManager can do this, after the pool is ended and some time has passed so the seed has changed many times) function terminate(uint randSeed) public { //Only manager can call this require(msg.sender == poolManager); //The pool need to be ended, but not terminated require(<FILL_ME>) //Min duration between ended and terminated require(block.number - endBlock >= minWaitDuration); //Only one call to this function terminated = true; //Pick a winner if (players.length > 0) winner = players[randSeed % players.length]; } //Update pool state (only poolManager can call this when the money has been sent) function onMoneySent() public { } } //Wallet interface contract WalletContract { function payMe() public payable; } contract PoolManager { //Pool owner (address which manage the pool creation) address owner; //Wallet which receive the fees (1% of ticket price) address wallet; //Fees infos (external websites providing access to pools get 1% too) mapping(address => uint) fees; //Fees divider (1% for the wallet, and 1% for external website where player can buy tickets) uint constant feeDivider = 100; //(1/100 of the amount) //The ticket price for pools must be a multiple of 0.010205 ether (to avoid truncating the fees, and having a minimum to send to the winner) uint constant ticketPriceMultiple = 10205000000000000; //(multiple of 0.010205 ether for ticketPrice) //Pools infos (current active pools. When a pool is done, it goes into the poolsDone array bellow and a new pool is created to replace it at the same index) SmartPool[] pools; //Ended pools (cleaned automatically after winners get their prices) SmartPool[] poolsDone; //History (contains all the pools since the deploy) SmartPool[] poolsHistory; //Current rand seed (it changes a lot so it's pretty hard to know its value when the winner is picked) uint randSeed; //Constructor (only owner) function PoolManager(address wal) public { } //Called frequently by other functions to keep the seed moving function updateSeed() private { } //Create a new pool (only owner can do this) function addPool(uint ticketPrice, uint ticketCount, uint duration) public { } //Accessors (public) //Get Active Pools function getPoolCount() public constant returns(uint) { } function getPool(uint index) public constant returns(address) { } //Get Ended Pools function getPoolDoneCount() public constant returns(uint) { } function getPoolDone(uint index) public constant returns(address) { } //Get History function getPoolHistoryCount() public constant returns(uint) { } function getPoolHistory(uint index) public constant returns(address) { } //Buy tickets for a pool (public) function buyTicket(uint poolIndex, uint ticketCount, address websiteFeeAddr) public payable { } //Check pools end. (called by our console each 10 minutes, or can be called by anybody) function checkPoolsEnd() public { } //Check end of a pool and restart it if it's ended (public) function checkPoolEnd(uint i) public { } //Check pools done. (called by our console, or can be called by anybody) function checkPoolsDone() public { } //Check end of one pool function checkPoolDone(uint i) public { } //Send money of the pool to the winner (public) function sendPoolMoney(uint i) public { } //Clear pools done array (called once a week by our console, or can be called by anybody) function clearPoolsDone() public { } //Get current fee value function getFeeValue(address a) public constant returns (uint) { } //Send fee to address (public, with a min amount required) function getMyFee(address a) public { } //Add fee (private) function addFee(address a, uint fee) private { } }
ended&&!terminated
321,839
ended&&!terminated
null
pragma solidity ^0.4.16; //Define the pool contract SmartPool { //Pool info uint currAmount; //Current amount in the pool (=balance) uint ticketPrice; //Price of one ticket uint startDate; //The date of opening uint endDate; //The date of closing (or 0 if still open) //Block infos (better to use block number than dates to trigger the end) uint startBlock; uint endBlock; //End triggers uint duration; //The pool ends when the duration expire uint ticketCount; //Or when the reserve of tickets has been sold bool ended; //Current state (can't buy tickets when ended) bool terminated; //true if a winner has been picked bool moneySent; //true if the winner has picked his money //Min wait duration between ended and terminated states uint constant blockDuration = 15; // we use 15 sec for the block duration uint constant minWaitDuration = 240; // (= 3600 / blockDuration => 60 minutes waiting between 'ended' and 'terminated') //Players address[] players; //List of tickets owners, each ticket gives an entry in the array //Winning info address winner; //The final winner (only available when terminated == true) //Pool manager address (only the manager can call modifiers of this contract, see PoolManager.sol) address poolManager; //Create a pool with a fixed ticket price, a ticket reserve and/or a duration) function SmartPool(uint _ticketPrice, uint _ticketCount, uint _duration) public { } //Accessors function getPlayers() public constant returns (address[]) { } function getStartDate() public constant returns (uint) { } function getStartBlock() public constant returns (uint) { } function getCurrAmount() public constant returns (uint) { } function getTicketPrice() public constant returns (uint) { } function getTicketCount() public constant returns (uint) { } function getBoughtTicketCount() public constant returns (uint) { } function getAvailableTicketCount() public constant returns (uint) { } function getEndDate() public constant returns (uint) { } function getEndBlock() public constant returns (uint) { } function getDuration() public constant returns (uint) { } function getDurationS() public constant returns (uint) { } function isEnded() public constant returns (bool) { } function isTerminated() public constant returns (bool) { } function isMoneySent() public constant returns (bool) { } function getWinner() public constant returns (address) { } //End trigger function checkEnd() public { } //Add player with ticketCount to the pool (only poolManager can do this) function addPlayer(address player, uint ticketBoughtCount, uint amount) public { } function canTerminate() public constant returns(bool) { } //Terminate the pool by picking a winner (only poolManager can do this, after the pool is ended and some time has passed so the seed has changed many times) function terminate(uint randSeed) public { //Only manager can call this require(msg.sender == poolManager); //The pool need to be ended, but not terminated require(ended && !terminated); //Min duration between ended and terminated require(<FILL_ME>) //Only one call to this function terminated = true; //Pick a winner if (players.length > 0) winner = players[randSeed % players.length]; } //Update pool state (only poolManager can call this when the money has been sent) function onMoneySent() public { } } //Wallet interface contract WalletContract { function payMe() public payable; } contract PoolManager { //Pool owner (address which manage the pool creation) address owner; //Wallet which receive the fees (1% of ticket price) address wallet; //Fees infos (external websites providing access to pools get 1% too) mapping(address => uint) fees; //Fees divider (1% for the wallet, and 1% for external website where player can buy tickets) uint constant feeDivider = 100; //(1/100 of the amount) //The ticket price for pools must be a multiple of 0.010205 ether (to avoid truncating the fees, and having a minimum to send to the winner) uint constant ticketPriceMultiple = 10205000000000000; //(multiple of 0.010205 ether for ticketPrice) //Pools infos (current active pools. When a pool is done, it goes into the poolsDone array bellow and a new pool is created to replace it at the same index) SmartPool[] pools; //Ended pools (cleaned automatically after winners get their prices) SmartPool[] poolsDone; //History (contains all the pools since the deploy) SmartPool[] poolsHistory; //Current rand seed (it changes a lot so it's pretty hard to know its value when the winner is picked) uint randSeed; //Constructor (only owner) function PoolManager(address wal) public { } //Called frequently by other functions to keep the seed moving function updateSeed() private { } //Create a new pool (only owner can do this) function addPool(uint ticketPrice, uint ticketCount, uint duration) public { } //Accessors (public) //Get Active Pools function getPoolCount() public constant returns(uint) { } function getPool(uint index) public constant returns(address) { } //Get Ended Pools function getPoolDoneCount() public constant returns(uint) { } function getPoolDone(uint index) public constant returns(address) { } //Get History function getPoolHistoryCount() public constant returns(uint) { } function getPoolHistory(uint index) public constant returns(address) { } //Buy tickets for a pool (public) function buyTicket(uint poolIndex, uint ticketCount, address websiteFeeAddr) public payable { } //Check pools end. (called by our console each 10 minutes, or can be called by anybody) function checkPoolsEnd() public { } //Check end of a pool and restart it if it's ended (public) function checkPoolEnd(uint i) public { } //Check pools done. (called by our console, or can be called by anybody) function checkPoolsDone() public { } //Check end of one pool function checkPoolDone(uint i) public { } //Send money of the pool to the winner (public) function sendPoolMoney(uint i) public { } //Clear pools done array (called once a week by our console, or can be called by anybody) function clearPoolsDone() public { } //Get current fee value function getFeeValue(address a) public constant returns (uint) { } //Send fee to address (public, with a min amount required) function getMyFee(address a) public { } //Add fee (private) function addFee(address a, uint fee) private { } }
block.number-endBlock>=minWaitDuration
321,839
block.number-endBlock>=minWaitDuration
null
pragma solidity ^0.4.16; //Define the pool contract SmartPool { //Pool info uint currAmount; //Current amount in the pool (=balance) uint ticketPrice; //Price of one ticket uint startDate; //The date of opening uint endDate; //The date of closing (or 0 if still open) //Block infos (better to use block number than dates to trigger the end) uint startBlock; uint endBlock; //End triggers uint duration; //The pool ends when the duration expire uint ticketCount; //Or when the reserve of tickets has been sold bool ended; //Current state (can't buy tickets when ended) bool terminated; //true if a winner has been picked bool moneySent; //true if the winner has picked his money //Min wait duration between ended and terminated states uint constant blockDuration = 15; // we use 15 sec for the block duration uint constant minWaitDuration = 240; // (= 3600 / blockDuration => 60 minutes waiting between 'ended' and 'terminated') //Players address[] players; //List of tickets owners, each ticket gives an entry in the array //Winning info address winner; //The final winner (only available when terminated == true) //Pool manager address (only the manager can call modifiers of this contract, see PoolManager.sol) address poolManager; //Create a pool with a fixed ticket price, a ticket reserve and/or a duration) function SmartPool(uint _ticketPrice, uint _ticketCount, uint _duration) public { } //Accessors function getPlayers() public constant returns (address[]) { } function getStartDate() public constant returns (uint) { } function getStartBlock() public constant returns (uint) { } function getCurrAmount() public constant returns (uint) { } function getTicketPrice() public constant returns (uint) { } function getTicketCount() public constant returns (uint) { } function getBoughtTicketCount() public constant returns (uint) { } function getAvailableTicketCount() public constant returns (uint) { } function getEndDate() public constant returns (uint) { } function getEndBlock() public constant returns (uint) { } function getDuration() public constant returns (uint) { } function getDurationS() public constant returns (uint) { } function isEnded() public constant returns (bool) { } function isTerminated() public constant returns (bool) { } function isMoneySent() public constant returns (bool) { } function getWinner() public constant returns (address) { } //End trigger function checkEnd() public { } //Add player with ticketCount to the pool (only poolManager can do this) function addPlayer(address player, uint ticketBoughtCount, uint amount) public { } function canTerminate() public constant returns(bool) { } //Terminate the pool by picking a winner (only poolManager can do this, after the pool is ended and some time has passed so the seed has changed many times) function terminate(uint randSeed) public { } //Update pool state (only poolManager can call this when the money has been sent) function onMoneySent() public { //Only manager can call this require(msg.sender == poolManager); //The pool must be terminated (winner picked) require(terminated); //Update money sent (only one call to this function) require(<FILL_ME>) moneySent = true; } } //Wallet interface contract WalletContract { function payMe() public payable; } contract PoolManager { //Pool owner (address which manage the pool creation) address owner; //Wallet which receive the fees (1% of ticket price) address wallet; //Fees infos (external websites providing access to pools get 1% too) mapping(address => uint) fees; //Fees divider (1% for the wallet, and 1% for external website where player can buy tickets) uint constant feeDivider = 100; //(1/100 of the amount) //The ticket price for pools must be a multiple of 0.010205 ether (to avoid truncating the fees, and having a minimum to send to the winner) uint constant ticketPriceMultiple = 10205000000000000; //(multiple of 0.010205 ether for ticketPrice) //Pools infos (current active pools. When a pool is done, it goes into the poolsDone array bellow and a new pool is created to replace it at the same index) SmartPool[] pools; //Ended pools (cleaned automatically after winners get their prices) SmartPool[] poolsDone; //History (contains all the pools since the deploy) SmartPool[] poolsHistory; //Current rand seed (it changes a lot so it's pretty hard to know its value when the winner is picked) uint randSeed; //Constructor (only owner) function PoolManager(address wal) public { } //Called frequently by other functions to keep the seed moving function updateSeed() private { } //Create a new pool (only owner can do this) function addPool(uint ticketPrice, uint ticketCount, uint duration) public { } //Accessors (public) //Get Active Pools function getPoolCount() public constant returns(uint) { } function getPool(uint index) public constant returns(address) { } //Get Ended Pools function getPoolDoneCount() public constant returns(uint) { } function getPoolDone(uint index) public constant returns(address) { } //Get History function getPoolHistoryCount() public constant returns(uint) { } function getPoolHistory(uint index) public constant returns(address) { } //Buy tickets for a pool (public) function buyTicket(uint poolIndex, uint ticketCount, address websiteFeeAddr) public payable { } //Check pools end. (called by our console each 10 minutes, or can be called by anybody) function checkPoolsEnd() public { } //Check end of a pool and restart it if it's ended (public) function checkPoolEnd(uint i) public { } //Check pools done. (called by our console, or can be called by anybody) function checkPoolsDone() public { } //Check end of one pool function checkPoolDone(uint i) public { } //Send money of the pool to the winner (public) function sendPoolMoney(uint i) public { } //Clear pools done array (called once a week by our console, or can be called by anybody) function clearPoolsDone() public { } //Get current fee value function getFeeValue(address a) public constant returns (uint) { } //Send fee to address (public, with a min amount required) function getMyFee(address a) public { } //Add fee (private) function addFee(address a, uint fee) private { } }
!moneySent
321,839
!moneySent
null
pragma solidity ^0.4.16; //Define the pool contract SmartPool { //Pool info uint currAmount; //Current amount in the pool (=balance) uint ticketPrice; //Price of one ticket uint startDate; //The date of opening uint endDate; //The date of closing (or 0 if still open) //Block infos (better to use block number than dates to trigger the end) uint startBlock; uint endBlock; //End triggers uint duration; //The pool ends when the duration expire uint ticketCount; //Or when the reserve of tickets has been sold bool ended; //Current state (can't buy tickets when ended) bool terminated; //true if a winner has been picked bool moneySent; //true if the winner has picked his money //Min wait duration between ended and terminated states uint constant blockDuration = 15; // we use 15 sec for the block duration uint constant minWaitDuration = 240; // (= 3600 / blockDuration => 60 minutes waiting between 'ended' and 'terminated') //Players address[] players; //List of tickets owners, each ticket gives an entry in the array //Winning info address winner; //The final winner (only available when terminated == true) //Pool manager address (only the manager can call modifiers of this contract, see PoolManager.sol) address poolManager; //Create a pool with a fixed ticket price, a ticket reserve and/or a duration) function SmartPool(uint _ticketPrice, uint _ticketCount, uint _duration) public { } //Accessors function getPlayers() public constant returns (address[]) { } function getStartDate() public constant returns (uint) { } function getStartBlock() public constant returns (uint) { } function getCurrAmount() public constant returns (uint) { } function getTicketPrice() public constant returns (uint) { } function getTicketCount() public constant returns (uint) { } function getBoughtTicketCount() public constant returns (uint) { } function getAvailableTicketCount() public constant returns (uint) { } function getEndDate() public constant returns (uint) { } function getEndBlock() public constant returns (uint) { } function getDuration() public constant returns (uint) { } function getDurationS() public constant returns (uint) { } function isEnded() public constant returns (bool) { } function isTerminated() public constant returns (bool) { } function isMoneySent() public constant returns (bool) { } function getWinner() public constant returns (address) { } //End trigger function checkEnd() public { } //Add player with ticketCount to the pool (only poolManager can do this) function addPlayer(address player, uint ticketBoughtCount, uint amount) public { } function canTerminate() public constant returns(bool) { } //Terminate the pool by picking a winner (only poolManager can do this, after the pool is ended and some time has passed so the seed has changed many times) function terminate(uint randSeed) public { } //Update pool state (only poolManager can call this when the money has been sent) function onMoneySent() public { } } //Wallet interface contract WalletContract { function payMe() public payable; } contract PoolManager { //Pool owner (address which manage the pool creation) address owner; //Wallet which receive the fees (1% of ticket price) address wallet; //Fees infos (external websites providing access to pools get 1% too) mapping(address => uint) fees; //Fees divider (1% for the wallet, and 1% for external website where player can buy tickets) uint constant feeDivider = 100; //(1/100 of the amount) //The ticket price for pools must be a multiple of 0.010205 ether (to avoid truncating the fees, and having a minimum to send to the winner) uint constant ticketPriceMultiple = 10205000000000000; //(multiple of 0.010205 ether for ticketPrice) //Pools infos (current active pools. When a pool is done, it goes into the poolsDone array bellow and a new pool is created to replace it at the same index) SmartPool[] pools; //Ended pools (cleaned automatically after winners get their prices) SmartPool[] poolsDone; //History (contains all the pools since the deploy) SmartPool[] poolsHistory; //Current rand seed (it changes a lot so it's pretty hard to know its value when the winner is picked) uint randSeed; //Constructor (only owner) function PoolManager(address wal) public { } //Called frequently by other functions to keep the seed moving function updateSeed() private { } //Create a new pool (only owner can do this) function addPool(uint ticketPrice, uint ticketCount, uint duration) public { } //Accessors (public) //Get Active Pools function getPoolCount() public constant returns(uint) { } function getPool(uint index) public constant returns(address) { } //Get Ended Pools function getPoolDoneCount() public constant returns(uint) { } function getPoolDone(uint index) public constant returns(address) { } //Get History function getPoolHistoryCount() public constant returns(uint) { } function getPoolHistory(uint index) public constant returns(address) { } //Buy tickets for a pool (public) function buyTicket(uint poolIndex, uint ticketCount, address websiteFeeAddr) public payable { require(poolIndex < pools.length); require(ticketCount > 0); //Get pool and check state SmartPool pool = pools[poolIndex]; pool.checkEnd(); require(<FILL_ME>) //Adjust ticketCount according to available tickets uint availableCount = pool.getAvailableTicketCount(); if (ticketCount > availableCount) ticketCount = availableCount; //Get amount required and check msg.value uint amountRequired = ticketCount * pool.getTicketPrice(); require(msg.value >= amountRequired); //If too much value sent, we send it back to player uint amountLeft = msg.value - amountRequired; //if no websiteFeeAddr given, the wallet get the fee if (websiteFeeAddr == address(0)) websiteFeeAddr = wallet; //Compute fee uint feeAmount = amountRequired / feeDivider; addFee(websiteFeeAddr, feeAmount); addFee(wallet, feeAmount); //Add player to the pool with the amount minus the fees (1% + 1% = 2%) pool.addPlayer(msg.sender, ticketCount, amountRequired - 2 * feeAmount); //Send back amountLeft to player if too much value sent if (amountLeft > 0 && !msg.sender.send(amountLeft)) { addFee(wallet, amountLeft); // if it fails, we take it as a fee.. } updateSeed(); } //Check pools end. (called by our console each 10 minutes, or can be called by anybody) function checkPoolsEnd() public { } //Check end of a pool and restart it if it's ended (public) function checkPoolEnd(uint i) public { } //Check pools done. (called by our console, or can be called by anybody) function checkPoolsDone() public { } //Check end of one pool function checkPoolDone(uint i) public { } //Send money of the pool to the winner (public) function sendPoolMoney(uint i) public { } //Clear pools done array (called once a week by our console, or can be called by anybody) function clearPoolsDone() public { } //Get current fee value function getFeeValue(address a) public constant returns (uint) { } //Send fee to address (public, with a min amount required) function getMyFee(address a) public { } //Add fee (private) function addFee(address a, uint fee) private { } }
!pool.isEnded()
321,839
!pool.isEnded()
null
pragma solidity ^0.4.16; //Define the pool contract SmartPool { //Pool info uint currAmount; //Current amount in the pool (=balance) uint ticketPrice; //Price of one ticket uint startDate; //The date of opening uint endDate; //The date of closing (or 0 if still open) //Block infos (better to use block number than dates to trigger the end) uint startBlock; uint endBlock; //End triggers uint duration; //The pool ends when the duration expire uint ticketCount; //Or when the reserve of tickets has been sold bool ended; //Current state (can't buy tickets when ended) bool terminated; //true if a winner has been picked bool moneySent; //true if the winner has picked his money //Min wait duration between ended and terminated states uint constant blockDuration = 15; // we use 15 sec for the block duration uint constant minWaitDuration = 240; // (= 3600 / blockDuration => 60 minutes waiting between 'ended' and 'terminated') //Players address[] players; //List of tickets owners, each ticket gives an entry in the array //Winning info address winner; //The final winner (only available when terminated == true) //Pool manager address (only the manager can call modifiers of this contract, see PoolManager.sol) address poolManager; //Create a pool with a fixed ticket price, a ticket reserve and/or a duration) function SmartPool(uint _ticketPrice, uint _ticketCount, uint _duration) public { } //Accessors function getPlayers() public constant returns (address[]) { } function getStartDate() public constant returns (uint) { } function getStartBlock() public constant returns (uint) { } function getCurrAmount() public constant returns (uint) { } function getTicketPrice() public constant returns (uint) { } function getTicketCount() public constant returns (uint) { } function getBoughtTicketCount() public constant returns (uint) { } function getAvailableTicketCount() public constant returns (uint) { } function getEndDate() public constant returns (uint) { } function getEndBlock() public constant returns (uint) { } function getDuration() public constant returns (uint) { } function getDurationS() public constant returns (uint) { } function isEnded() public constant returns (bool) { } function isTerminated() public constant returns (bool) { } function isMoneySent() public constant returns (bool) { } function getWinner() public constant returns (address) { } //End trigger function checkEnd() public { } //Add player with ticketCount to the pool (only poolManager can do this) function addPlayer(address player, uint ticketBoughtCount, uint amount) public { } function canTerminate() public constant returns(bool) { } //Terminate the pool by picking a winner (only poolManager can do this, after the pool is ended and some time has passed so the seed has changed many times) function terminate(uint randSeed) public { } //Update pool state (only poolManager can call this when the money has been sent) function onMoneySent() public { } } //Wallet interface contract WalletContract { function payMe() public payable; } contract PoolManager { //Pool owner (address which manage the pool creation) address owner; //Wallet which receive the fees (1% of ticket price) address wallet; //Fees infos (external websites providing access to pools get 1% too) mapping(address => uint) fees; //Fees divider (1% for the wallet, and 1% for external website where player can buy tickets) uint constant feeDivider = 100; //(1/100 of the amount) //The ticket price for pools must be a multiple of 0.010205 ether (to avoid truncating the fees, and having a minimum to send to the winner) uint constant ticketPriceMultiple = 10205000000000000; //(multiple of 0.010205 ether for ticketPrice) //Pools infos (current active pools. When a pool is done, it goes into the poolsDone array bellow and a new pool is created to replace it at the same index) SmartPool[] pools; //Ended pools (cleaned automatically after winners get their prices) SmartPool[] poolsDone; //History (contains all the pools since the deploy) SmartPool[] poolsHistory; //Current rand seed (it changes a lot so it's pretty hard to know its value when the winner is picked) uint randSeed; //Constructor (only owner) function PoolManager(address wal) public { } //Called frequently by other functions to keep the seed moving function updateSeed() private { } //Create a new pool (only owner can do this) function addPool(uint ticketPrice, uint ticketCount, uint duration) public { } //Accessors (public) //Get Active Pools function getPoolCount() public constant returns(uint) { } function getPool(uint index) public constant returns(address) { } //Get Ended Pools function getPoolDoneCount() public constant returns(uint) { } function getPoolDone(uint index) public constant returns(address) { } //Get History function getPoolHistoryCount() public constant returns(uint) { } function getPoolHistory(uint index) public constant returns(address) { } //Buy tickets for a pool (public) function buyTicket(uint poolIndex, uint ticketCount, address websiteFeeAddr) public payable { } //Check pools end. (called by our console each 10 minutes, or can be called by anybody) function checkPoolsEnd() public { } //Check end of a pool and restart it if it's ended (public) function checkPoolEnd(uint i) public { } //Check pools done. (called by our console, or can be called by anybody) function checkPoolsDone() public { } //Check end of one pool function checkPoolDone(uint i) public { } //Send money of the pool to the winner (public) function sendPoolMoney(uint i) public { require(i < poolsDone.length); SmartPool pool = poolsDone[i]; require(<FILL_ME>) // we need a winner picked require(!pool.isMoneySent()); // money not sent uint amount = pool.getCurrAmount(); address winner = pool.getWinner(); pool.onMoneySent(); if (amount > 0 && !winner.send(amount)) // the winner can't get his money (should not happen) { addFee(wallet, amount); } //Pool goes into history array poolsHistory.push(pool); } //Clear pools done array (called once a week by our console, or can be called by anybody) function clearPoolsDone() public { } //Get current fee value function getFeeValue(address a) public constant returns (uint) { } //Send fee to address (public, with a min amount required) function getMyFee(address a) public { } //Add fee (private) function addFee(address a, uint fee) private { } }
pool.isTerminated()
321,839
pool.isTerminated()
null
pragma solidity ^0.4.16; //Define the pool contract SmartPool { //Pool info uint currAmount; //Current amount in the pool (=balance) uint ticketPrice; //Price of one ticket uint startDate; //The date of opening uint endDate; //The date of closing (or 0 if still open) //Block infos (better to use block number than dates to trigger the end) uint startBlock; uint endBlock; //End triggers uint duration; //The pool ends when the duration expire uint ticketCount; //Or when the reserve of tickets has been sold bool ended; //Current state (can't buy tickets when ended) bool terminated; //true if a winner has been picked bool moneySent; //true if the winner has picked his money //Min wait duration between ended and terminated states uint constant blockDuration = 15; // we use 15 sec for the block duration uint constant minWaitDuration = 240; // (= 3600 / blockDuration => 60 minutes waiting between 'ended' and 'terminated') //Players address[] players; //List of tickets owners, each ticket gives an entry in the array //Winning info address winner; //The final winner (only available when terminated == true) //Pool manager address (only the manager can call modifiers of this contract, see PoolManager.sol) address poolManager; //Create a pool with a fixed ticket price, a ticket reserve and/or a duration) function SmartPool(uint _ticketPrice, uint _ticketCount, uint _duration) public { } //Accessors function getPlayers() public constant returns (address[]) { } function getStartDate() public constant returns (uint) { } function getStartBlock() public constant returns (uint) { } function getCurrAmount() public constant returns (uint) { } function getTicketPrice() public constant returns (uint) { } function getTicketCount() public constant returns (uint) { } function getBoughtTicketCount() public constant returns (uint) { } function getAvailableTicketCount() public constant returns (uint) { } function getEndDate() public constant returns (uint) { } function getEndBlock() public constant returns (uint) { } function getDuration() public constant returns (uint) { } function getDurationS() public constant returns (uint) { } function isEnded() public constant returns (bool) { } function isTerminated() public constant returns (bool) { } function isMoneySent() public constant returns (bool) { } function getWinner() public constant returns (address) { } //End trigger function checkEnd() public { } //Add player with ticketCount to the pool (only poolManager can do this) function addPlayer(address player, uint ticketBoughtCount, uint amount) public { } function canTerminate() public constant returns(bool) { } //Terminate the pool by picking a winner (only poolManager can do this, after the pool is ended and some time has passed so the seed has changed many times) function terminate(uint randSeed) public { } //Update pool state (only poolManager can call this when the money has been sent) function onMoneySent() public { } } //Wallet interface contract WalletContract { function payMe() public payable; } contract PoolManager { //Pool owner (address which manage the pool creation) address owner; //Wallet which receive the fees (1% of ticket price) address wallet; //Fees infos (external websites providing access to pools get 1% too) mapping(address => uint) fees; //Fees divider (1% for the wallet, and 1% for external website where player can buy tickets) uint constant feeDivider = 100; //(1/100 of the amount) //The ticket price for pools must be a multiple of 0.010205 ether (to avoid truncating the fees, and having a minimum to send to the winner) uint constant ticketPriceMultiple = 10205000000000000; //(multiple of 0.010205 ether for ticketPrice) //Pools infos (current active pools. When a pool is done, it goes into the poolsDone array bellow and a new pool is created to replace it at the same index) SmartPool[] pools; //Ended pools (cleaned automatically after winners get their prices) SmartPool[] poolsDone; //History (contains all the pools since the deploy) SmartPool[] poolsHistory; //Current rand seed (it changes a lot so it's pretty hard to know its value when the winner is picked) uint randSeed; //Constructor (only owner) function PoolManager(address wal) public { } //Called frequently by other functions to keep the seed moving function updateSeed() private { } //Create a new pool (only owner can do this) function addPool(uint ticketPrice, uint ticketCount, uint duration) public { } //Accessors (public) //Get Active Pools function getPoolCount() public constant returns(uint) { } function getPool(uint index) public constant returns(address) { } //Get Ended Pools function getPoolDoneCount() public constant returns(uint) { } function getPoolDone(uint index) public constant returns(address) { } //Get History function getPoolHistoryCount() public constant returns(uint) { } function getPoolHistory(uint index) public constant returns(address) { } //Buy tickets for a pool (public) function buyTicket(uint poolIndex, uint ticketCount, address websiteFeeAddr) public payable { } //Check pools end. (called by our console each 10 minutes, or can be called by anybody) function checkPoolsEnd() public { } //Check end of a pool and restart it if it's ended (public) function checkPoolEnd(uint i) public { } //Check pools done. (called by our console, or can be called by anybody) function checkPoolsDone() public { } //Check end of one pool function checkPoolDone(uint i) public { } //Send money of the pool to the winner (public) function sendPoolMoney(uint i) public { require(i < poolsDone.length); SmartPool pool = poolsDone[i]; require (pool.isTerminated()); // we need a winner picked require(<FILL_ME>) // money not sent uint amount = pool.getCurrAmount(); address winner = pool.getWinner(); pool.onMoneySent(); if (amount > 0 && !winner.send(amount)) // the winner can't get his money (should not happen) { addFee(wallet, amount); } //Pool goes into history array poolsHistory.push(pool); } //Clear pools done array (called once a week by our console, or can be called by anybody) function clearPoolsDone() public { } //Get current fee value function getFeeValue(address a) public constant returns (uint) { } //Send fee to address (public, with a min amount required) function getMyFee(address a) public { } //Add fee (private) function addFee(address a, uint fee) private { } }
!pool.isMoneySent()
321,839
!pool.isMoneySent()
"<start"
//SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity 0.5.17; contract BoostGovV2 is LPTokenWrapperWithSlash { IERC20 public stablecoin; ITreasury public treasury; SwapRouter public swapRouter; // 1% = 100 uint256 public constant MIN_QUORUM_PUNISHMENT = 500; // 5% uint256 public constant MIN_QUORUM_THRESHOLD = 3000; // 30% uint256 public constant PERCENTAGE_PRECISION = 10000; uint256 public WITHDRAW_THRESHOLD = 1e21; // 1000 yCRV mapping(address => uint256) public voteLock; // timestamp that boost stakes are locked after voting struct Proposal { address proposer; address withdrawAddress; uint256 withdrawAmount; mapping(address => uint256) forVotes; mapping(address => uint256) againstVotes; uint256 totalForVotes; uint256 totalAgainstVotes; uint256 totalSupply; uint256 start; // block start; uint256 end; // start + period string url; string title; } mapping (uint256 => Proposal) public proposals; uint256 public proposalCount; uint256 public proposalPeriod = 2 days; uint256 public lockPeriod = 3 days; uint256 public minimum = 1337e16; // 13.37 BOOST constructor(IERC20 _stakeToken, ITreasury _treasury, SwapRouter _swapRouter) public LPTokenWrapperWithSlash(_stakeToken) { } function propose( string memory _url, string memory _title, uint256 _withdrawAmount, address _withdrawAddress ) public { } function voteFor(uint256 id) public { require(<FILL_ME>) require(proposals[id].end > block.timestamp , ">end"); require(proposals[id].againstVotes[msg.sender] == 0, "cannot switch votes"); uint256 userVotes = Math.sqrt(balanceOf(msg.sender)); uint256 votes = userVotes.sub(proposals[id].forVotes[msg.sender]); proposals[id].totalForVotes = proposals[id].totalForVotes.add(votes); proposals[id].forVotes[msg.sender] = userVotes; voteLock[msg.sender] = lockPeriod.add(block.timestamp); } function voteAgainst(uint256 id) public { } function stake(uint256 amount) public { } function withdraw(uint256 amount) public { } function resolveProposal(uint256 id) public { } function convertAndSendTreasuryFunds(uint256 amount) internal { } }
proposals[id].start<block.timestamp,"<start"
321,878
proposals[id].start<block.timestamp
">end"
//SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity 0.5.17; contract BoostGovV2 is LPTokenWrapperWithSlash { IERC20 public stablecoin; ITreasury public treasury; SwapRouter public swapRouter; // 1% = 100 uint256 public constant MIN_QUORUM_PUNISHMENT = 500; // 5% uint256 public constant MIN_QUORUM_THRESHOLD = 3000; // 30% uint256 public constant PERCENTAGE_PRECISION = 10000; uint256 public WITHDRAW_THRESHOLD = 1e21; // 1000 yCRV mapping(address => uint256) public voteLock; // timestamp that boost stakes are locked after voting struct Proposal { address proposer; address withdrawAddress; uint256 withdrawAmount; mapping(address => uint256) forVotes; mapping(address => uint256) againstVotes; uint256 totalForVotes; uint256 totalAgainstVotes; uint256 totalSupply; uint256 start; // block start; uint256 end; // start + period string url; string title; } mapping (uint256 => Proposal) public proposals; uint256 public proposalCount; uint256 public proposalPeriod = 2 days; uint256 public lockPeriod = 3 days; uint256 public minimum = 1337e16; // 13.37 BOOST constructor(IERC20 _stakeToken, ITreasury _treasury, SwapRouter _swapRouter) public LPTokenWrapperWithSlash(_stakeToken) { } function propose( string memory _url, string memory _title, uint256 _withdrawAmount, address _withdrawAddress ) public { } function voteFor(uint256 id) public { require(proposals[id].start < block.timestamp , "<start"); require(<FILL_ME>) require(proposals[id].againstVotes[msg.sender] == 0, "cannot switch votes"); uint256 userVotes = Math.sqrt(balanceOf(msg.sender)); uint256 votes = userVotes.sub(proposals[id].forVotes[msg.sender]); proposals[id].totalForVotes = proposals[id].totalForVotes.add(votes); proposals[id].forVotes[msg.sender] = userVotes; voteLock[msg.sender] = lockPeriod.add(block.timestamp); } function voteAgainst(uint256 id) public { } function stake(uint256 amount) public { } function withdraw(uint256 amount) public { } function resolveProposal(uint256 id) public { } function convertAndSendTreasuryFunds(uint256 amount) internal { } }
proposals[id].end>block.timestamp,">end"
321,878
proposals[id].end>block.timestamp
"cannot switch votes"
//SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity 0.5.17; contract BoostGovV2 is LPTokenWrapperWithSlash { IERC20 public stablecoin; ITreasury public treasury; SwapRouter public swapRouter; // 1% = 100 uint256 public constant MIN_QUORUM_PUNISHMENT = 500; // 5% uint256 public constant MIN_QUORUM_THRESHOLD = 3000; // 30% uint256 public constant PERCENTAGE_PRECISION = 10000; uint256 public WITHDRAW_THRESHOLD = 1e21; // 1000 yCRV mapping(address => uint256) public voteLock; // timestamp that boost stakes are locked after voting struct Proposal { address proposer; address withdrawAddress; uint256 withdrawAmount; mapping(address => uint256) forVotes; mapping(address => uint256) againstVotes; uint256 totalForVotes; uint256 totalAgainstVotes; uint256 totalSupply; uint256 start; // block start; uint256 end; // start + period string url; string title; } mapping (uint256 => Proposal) public proposals; uint256 public proposalCount; uint256 public proposalPeriod = 2 days; uint256 public lockPeriod = 3 days; uint256 public minimum = 1337e16; // 13.37 BOOST constructor(IERC20 _stakeToken, ITreasury _treasury, SwapRouter _swapRouter) public LPTokenWrapperWithSlash(_stakeToken) { } function propose( string memory _url, string memory _title, uint256 _withdrawAmount, address _withdrawAddress ) public { } function voteFor(uint256 id) public { require(proposals[id].start < block.timestamp , "<start"); require(proposals[id].end > block.timestamp , ">end"); require(<FILL_ME>) uint256 userVotes = Math.sqrt(balanceOf(msg.sender)); uint256 votes = userVotes.sub(proposals[id].forVotes[msg.sender]); proposals[id].totalForVotes = proposals[id].totalForVotes.add(votes); proposals[id].forVotes[msg.sender] = userVotes; voteLock[msg.sender] = lockPeriod.add(block.timestamp); } function voteAgainst(uint256 id) public { } function stake(uint256 amount) public { } function withdraw(uint256 amount) public { } function resolveProposal(uint256 id) public { } function convertAndSendTreasuryFunds(uint256 amount) internal { } }
proposals[id].againstVotes[msg.sender]==0,"cannot switch votes"
321,878
proposals[id].againstVotes[msg.sender]==0
"cannot switch votes"
//SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity 0.5.17; contract BoostGovV2 is LPTokenWrapperWithSlash { IERC20 public stablecoin; ITreasury public treasury; SwapRouter public swapRouter; // 1% = 100 uint256 public constant MIN_QUORUM_PUNISHMENT = 500; // 5% uint256 public constant MIN_QUORUM_THRESHOLD = 3000; // 30% uint256 public constant PERCENTAGE_PRECISION = 10000; uint256 public WITHDRAW_THRESHOLD = 1e21; // 1000 yCRV mapping(address => uint256) public voteLock; // timestamp that boost stakes are locked after voting struct Proposal { address proposer; address withdrawAddress; uint256 withdrawAmount; mapping(address => uint256) forVotes; mapping(address => uint256) againstVotes; uint256 totalForVotes; uint256 totalAgainstVotes; uint256 totalSupply; uint256 start; // block start; uint256 end; // start + period string url; string title; } mapping (uint256 => Proposal) public proposals; uint256 public proposalCount; uint256 public proposalPeriod = 2 days; uint256 public lockPeriod = 3 days; uint256 public minimum = 1337e16; // 13.37 BOOST constructor(IERC20 _stakeToken, ITreasury _treasury, SwapRouter _swapRouter) public LPTokenWrapperWithSlash(_stakeToken) { } function propose( string memory _url, string memory _title, uint256 _withdrawAmount, address _withdrawAddress ) public { } function voteFor(uint256 id) public { } function voteAgainst(uint256 id) public { require(proposals[id].start < block.timestamp , "<start"); require(proposals[id].end > block.timestamp , ">end"); require(<FILL_ME>) uint256 userVotes = Math.sqrt(balanceOf(msg.sender)); uint256 votes = userVotes.sub(proposals[id].againstVotes[msg.sender]); proposals[id].totalAgainstVotes = proposals[id].totalAgainstVotes.add(votes); proposals[id].againstVotes[msg.sender] = userVotes; voteLock[msg.sender] = lockPeriod.add(block.timestamp); } function stake(uint256 amount) public { } function withdraw(uint256 amount) public { } function resolveProposal(uint256 id) public { } function convertAndSendTreasuryFunds(uint256 amount) internal { } }
proposals[id].forVotes[msg.sender]==0,"cannot switch votes"
321,878
proposals[id].forVotes[msg.sender]==0
"tokens locked"
//SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity 0.5.17; contract BoostGovV2 is LPTokenWrapperWithSlash { IERC20 public stablecoin; ITreasury public treasury; SwapRouter public swapRouter; // 1% = 100 uint256 public constant MIN_QUORUM_PUNISHMENT = 500; // 5% uint256 public constant MIN_QUORUM_THRESHOLD = 3000; // 30% uint256 public constant PERCENTAGE_PRECISION = 10000; uint256 public WITHDRAW_THRESHOLD = 1e21; // 1000 yCRV mapping(address => uint256) public voteLock; // timestamp that boost stakes are locked after voting struct Proposal { address proposer; address withdrawAddress; uint256 withdrawAmount; mapping(address => uint256) forVotes; mapping(address => uint256) againstVotes; uint256 totalForVotes; uint256 totalAgainstVotes; uint256 totalSupply; uint256 start; // block start; uint256 end; // start + period string url; string title; } mapping (uint256 => Proposal) public proposals; uint256 public proposalCount; uint256 public proposalPeriod = 2 days; uint256 public lockPeriod = 3 days; uint256 public minimum = 1337e16; // 13.37 BOOST constructor(IERC20 _stakeToken, ITreasury _treasury, SwapRouter _swapRouter) public LPTokenWrapperWithSlash(_stakeToken) { } function propose( string memory _url, string memory _title, uint256 _withdrawAmount, address _withdrawAddress ) public { } function voteFor(uint256 id) public { } function voteAgainst(uint256 id) public { } function stake(uint256 amount) public { } function withdraw(uint256 amount) public { require(<FILL_ME>) super.withdraw(amount); } function resolveProposal(uint256 id) public { } function convertAndSendTreasuryFunds(uint256 amount) internal { } }
voteLock[msg.sender]<block.timestamp,"tokens locked"
321,878
voteLock[msg.sender]<block.timestamp
"non-existent proposal"
//SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity 0.5.17; contract BoostGovV2 is LPTokenWrapperWithSlash { IERC20 public stablecoin; ITreasury public treasury; SwapRouter public swapRouter; // 1% = 100 uint256 public constant MIN_QUORUM_PUNISHMENT = 500; // 5% uint256 public constant MIN_QUORUM_THRESHOLD = 3000; // 30% uint256 public constant PERCENTAGE_PRECISION = 10000; uint256 public WITHDRAW_THRESHOLD = 1e21; // 1000 yCRV mapping(address => uint256) public voteLock; // timestamp that boost stakes are locked after voting struct Proposal { address proposer; address withdrawAddress; uint256 withdrawAmount; mapping(address => uint256) forVotes; mapping(address => uint256) againstVotes; uint256 totalForVotes; uint256 totalAgainstVotes; uint256 totalSupply; uint256 start; // block start; uint256 end; // start + period string url; string title; } mapping (uint256 => Proposal) public proposals; uint256 public proposalCount; uint256 public proposalPeriod = 2 days; uint256 public lockPeriod = 3 days; uint256 public minimum = 1337e16; // 13.37 BOOST constructor(IERC20 _stakeToken, ITreasury _treasury, SwapRouter _swapRouter) public LPTokenWrapperWithSlash(_stakeToken) { } function propose( string memory _url, string memory _title, uint256 _withdrawAmount, address _withdrawAddress ) public { } function voteFor(uint256 id) public { } function voteAgainst(uint256 id) public { } function stake(uint256 amount) public { } function withdraw(uint256 amount) public { } function resolveProposal(uint256 id) public { require(<FILL_ME>) require(proposals[id].end < block.timestamp , "ongoing proposal"); require(proposals[id].totalSupply == 0, "already resolved"); // update proposal total supply proposals[id].totalSupply = Math.sqrt(totalSupply()); // sum votes, multiply by precision, divide by square rooted total supply uint256 quorum = (proposals[id].totalForVotes.add(proposals[id].totalAgainstVotes)) .mul(PERCENTAGE_PRECISION) .div(proposals[id].totalSupply); if ((quorum < MIN_QUORUM_PUNISHMENT) && proposals[id].withdrawAmount > WITHDRAW_THRESHOLD) { // user's stake gets slashed, converted to stablecoin and sent to treasury uint256 amount = slash(proposals[id].proposer); convertAndSendTreasuryFunds(amount); } else if ( (quorum > MIN_QUORUM_THRESHOLD) && (proposals[id].totalForVotes > proposals[id].totalAgainstVotes) ) { // treasury to send funds to proposal treasury.withdraw( proposals[id].withdrawAmount, proposals[id].withdrawAddress ); } } function convertAndSendTreasuryFunds(uint256 amount) internal { } }
proposals[id].proposer!=address(0),"non-existent proposal"
321,878
proposals[id].proposer!=address(0)
"ongoing proposal"
//SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity 0.5.17; contract BoostGovV2 is LPTokenWrapperWithSlash { IERC20 public stablecoin; ITreasury public treasury; SwapRouter public swapRouter; // 1% = 100 uint256 public constant MIN_QUORUM_PUNISHMENT = 500; // 5% uint256 public constant MIN_QUORUM_THRESHOLD = 3000; // 30% uint256 public constant PERCENTAGE_PRECISION = 10000; uint256 public WITHDRAW_THRESHOLD = 1e21; // 1000 yCRV mapping(address => uint256) public voteLock; // timestamp that boost stakes are locked after voting struct Proposal { address proposer; address withdrawAddress; uint256 withdrawAmount; mapping(address => uint256) forVotes; mapping(address => uint256) againstVotes; uint256 totalForVotes; uint256 totalAgainstVotes; uint256 totalSupply; uint256 start; // block start; uint256 end; // start + period string url; string title; } mapping (uint256 => Proposal) public proposals; uint256 public proposalCount; uint256 public proposalPeriod = 2 days; uint256 public lockPeriod = 3 days; uint256 public minimum = 1337e16; // 13.37 BOOST constructor(IERC20 _stakeToken, ITreasury _treasury, SwapRouter _swapRouter) public LPTokenWrapperWithSlash(_stakeToken) { } function propose( string memory _url, string memory _title, uint256 _withdrawAmount, address _withdrawAddress ) public { } function voteFor(uint256 id) public { } function voteAgainst(uint256 id) public { } function stake(uint256 amount) public { } function withdraw(uint256 amount) public { } function resolveProposal(uint256 id) public { require(proposals[id].proposer != address(0), "non-existent proposal"); require(<FILL_ME>) require(proposals[id].totalSupply == 0, "already resolved"); // update proposal total supply proposals[id].totalSupply = Math.sqrt(totalSupply()); // sum votes, multiply by precision, divide by square rooted total supply uint256 quorum = (proposals[id].totalForVotes.add(proposals[id].totalAgainstVotes)) .mul(PERCENTAGE_PRECISION) .div(proposals[id].totalSupply); if ((quorum < MIN_QUORUM_PUNISHMENT) && proposals[id].withdrawAmount > WITHDRAW_THRESHOLD) { // user's stake gets slashed, converted to stablecoin and sent to treasury uint256 amount = slash(proposals[id].proposer); convertAndSendTreasuryFunds(amount); } else if ( (quorum > MIN_QUORUM_THRESHOLD) && (proposals[id].totalForVotes > proposals[id].totalAgainstVotes) ) { // treasury to send funds to proposal treasury.withdraw( proposals[id].withdrawAmount, proposals[id].withdrawAddress ); } } function convertAndSendTreasuryFunds(uint256 amount) internal { } }
proposals[id].end<block.timestamp,"ongoing proposal"
321,878
proposals[id].end<block.timestamp
"already resolved"
//SPDX-License-Identifier: MIT /* * MIT License * =========== * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity 0.5.17; contract BoostGovV2 is LPTokenWrapperWithSlash { IERC20 public stablecoin; ITreasury public treasury; SwapRouter public swapRouter; // 1% = 100 uint256 public constant MIN_QUORUM_PUNISHMENT = 500; // 5% uint256 public constant MIN_QUORUM_THRESHOLD = 3000; // 30% uint256 public constant PERCENTAGE_PRECISION = 10000; uint256 public WITHDRAW_THRESHOLD = 1e21; // 1000 yCRV mapping(address => uint256) public voteLock; // timestamp that boost stakes are locked after voting struct Proposal { address proposer; address withdrawAddress; uint256 withdrawAmount; mapping(address => uint256) forVotes; mapping(address => uint256) againstVotes; uint256 totalForVotes; uint256 totalAgainstVotes; uint256 totalSupply; uint256 start; // block start; uint256 end; // start + period string url; string title; } mapping (uint256 => Proposal) public proposals; uint256 public proposalCount; uint256 public proposalPeriod = 2 days; uint256 public lockPeriod = 3 days; uint256 public minimum = 1337e16; // 13.37 BOOST constructor(IERC20 _stakeToken, ITreasury _treasury, SwapRouter _swapRouter) public LPTokenWrapperWithSlash(_stakeToken) { } function propose( string memory _url, string memory _title, uint256 _withdrawAmount, address _withdrawAddress ) public { } function voteFor(uint256 id) public { } function voteAgainst(uint256 id) public { } function stake(uint256 amount) public { } function withdraw(uint256 amount) public { } function resolveProposal(uint256 id) public { require(proposals[id].proposer != address(0), "non-existent proposal"); require(proposals[id].end < block.timestamp , "ongoing proposal"); require(<FILL_ME>) // update proposal total supply proposals[id].totalSupply = Math.sqrt(totalSupply()); // sum votes, multiply by precision, divide by square rooted total supply uint256 quorum = (proposals[id].totalForVotes.add(proposals[id].totalAgainstVotes)) .mul(PERCENTAGE_PRECISION) .div(proposals[id].totalSupply); if ((quorum < MIN_QUORUM_PUNISHMENT) && proposals[id].withdrawAmount > WITHDRAW_THRESHOLD) { // user's stake gets slashed, converted to stablecoin and sent to treasury uint256 amount = slash(proposals[id].proposer); convertAndSendTreasuryFunds(amount); } else if ( (quorum > MIN_QUORUM_THRESHOLD) && (proposals[id].totalForVotes > proposals[id].totalAgainstVotes) ) { // treasury to send funds to proposal treasury.withdraw( proposals[id].withdrawAmount, proposals[id].withdrawAddress ); } } function convertAndSendTreasuryFunds(uint256 amount) internal { } }
proposals[id].totalSupply==0,"already resolved"
321,878
proposals[id].totalSupply==0
null
pragma solidity ^0.5.1; contract Token{ // ERC20 Token, with the addition of symbol, name and decimals and a // fixed supply string public constant symbol = 'ARS-TIG'; string public constant name = 'ARS Tigereum'; uint8 public constant decimals = 2; uint public constant _totalSupply = 100000000 * 10**uint(decimals); address public owner; string public webAddress; // Balances for each account mapping(address => uint256) balances; // Owner of account approves the transfer of an amount to another account mapping(address => mapping(address => uint256)) allowed; constructor() public { } function totalSupply() public pure returns (uint) { } // Get the token balance for account { tokenOwner } function balanceOf(address tokenOwner) public view returns (uint balance) { } // Transfer the balance from owner's account to another account function transfer(address to, uint tokens) public returns (bool success) { } // Send {tokens} amount of tokens from address {from} to address {to} // The transferFrom method is used for a withdraw workflow, allowing contracts to send // tokens on your behalf function transferFrom(address from, address to, uint tokens) public returns (bool success) { require(<FILL_ME>) balances[from] -= tokens; allowed[from][msg.sender] -= tokens; balances[to] += tokens; emit Transfer(from, to, tokens); return true; } // Allow {spender} to withdraw from your account, multiple times, up to the {tokens} amount. function approve(address sender, uint256 tokens) public returns (bool success) { } // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account function allowance(address tokenOwner, address spender) public view returns (uint remaining) { } event Transfer(address indexed _from, address indexed _to, uint256 _amount); event Approval(address indexed _owner, address indexed _to, uint256 _amount); }
allowed[from][msg.sender]>=tokens&&balances[from]>=tokens&&tokens>0
321,886
allowed[from][msg.sender]>=tokens&&balances[from]>=tokens&&tokens>0
"vault: key is taken"
/* * Here we have a list of constants. In order to get access to an address * managed by ValueVaultMaster, the calling contract should copy and define * some of these constants and use them as keys. * Keys themselves are immutable. Addresses can be immutable or mutable. * * Vault addresses are immutable once set, and the list may grow: * K_VAULT_WETH = 0; * K_VAULT_ETH_USDC_UNI_V2_LP = 1; * K_VAULT_ETH_WBTC_UNI_V2_LP = 2; * * Strategy addresses are mutable: * K_STRATEGY_WETH_SODA_POOL = 0; * K_STRATEGY_WETH_MULTI_POOL = 1; * K_STRATEGY_ETHUSDC_MULTIPOOL = 100; * K_STRATEGY_ETHWBTC_MULTIPOOL = 200; */ /* * ValueVaultMaster manages all the vaults and strategies of our Value Vaults system. */ contract ValueVaultMaster { address public governance; address public bank; address public minorPool; address public profitSharer; address public govToken; // VALUE address public yfv; // When harvesting, convert some parts to YFV for govVault address public usdc; // we only used USDC to estimate APY address public govVault; // YFV -> VALUE, vUSD, vETH and 6.7% profit from Value Vaults address public insuranceFund = 0xb7b2Ea8A1198368f950834875047aA7294A2bDAa; // set to Governance Multisig at start address public performanceReward = 0x7Be4D5A99c903C437EC77A20CB6d0688cBB73c7f; // set to deploy wallet at start uint256 public constant FEE_DENOMINATOR = 10000; uint256 public govVaultProfitShareFee = 670; // 6.7% | VIP-1 (https://yfv.finance/vip-vote/vip_1) uint256 public gasFee = 50; // 0.5% at start and can be set by governance decision uint256 public minStakeTimeToClaimVaultReward = 24 hours; mapping(address => bool) public isVault; mapping(uint256 => address) public vaultByKey; mapping(address => bool) public isStrategy; mapping(uint256 => address) public strategyByKey; mapping(address => uint256) public strategyQuota; constructor(address _govToken, address _yfv, address _usdc) public { } function setGovernance(address _governance) external { } // Immutable once set. function setBank(address _bank) external { } // Mutable in case we want to upgrade the pool. function setMinorPool(address _minorPool) external { } // Mutable in case we want to upgrade this module. function setProfitSharer(address _profitSharer) external { } // Mutable, in case governance want to upgrade VALUE to new version function setGovToken(address _govToken) external { } // Immutable once added, and you can always add more. function addVault(uint256 _key, address _vault) external { require(msg.sender == governance, "!governance"); require(<FILL_ME>) isVault[_vault] = true; vaultByKey[_key] = _vault; } // Mutable and removable. function addStrategy(uint256 _key, address _strategy) external { } // Set 0 to disable quota (no limit) function setStrategyQuota(address _strategy, uint256 _quota) external { } function removeStrategy(uint256 _key) external { } function setGovVault(address _govVault) public { } function setInsuranceFund(address _insuranceFund) public { } function setPerformanceReward(address _performanceReward) public{ } function setGovVaultProfitShareFee(uint256 _govVaultProfitShareFee) public { } function setGasFee(uint256 _gasFee) public { } function setMinStakeTimeToClaimVaultReward(uint256 _minStakeTimeToClaimVaultReward) public { } /** * This function allows governance to take unsupported tokens out of the contract. * This is in an effort to make someone whole, should they seriously mess up. * There is no guarantee governance will vote to return these. * It also allows for removal of airdropped tokens. */ function governanceRecoverUnsupported(IERC20x _token, uint256 amount, address to) external { } } interface IERC20x { function transfer(address recipient, uint256 amount) external returns (bool); }
vaultByKey[_key]==address(0),"vault: key is taken"
321,960
vaultByKey[_key]==address(0)
"sender not vault"
interface IStrategyV2p1 { function approve(IERC20 _token) external; function approveForSpender(IERC20 _token, address spender) external; // Deposit tokens to a farm to yield more tokens. function deposit(address _vault, uint256 _amount) external; // IStrategy function deposit(uint256 _poolId, uint256 _amount) external; // IStrategyV2 // Claim farming tokens function claim(address _vault) external; // IStrategy function claim(uint256 _poolId) external; // IStrategyV2 // The vault request to harvest the profit function harvest(uint256 _bankPoolId) external; // IStrategy function harvest(uint256 _bankPoolId, uint256 _poolId) external; // IStrategyV2 // Withdraw the principal from a farm. function withdraw(address _vault, uint256 _amount) external; // IStrategy function withdraw(uint256 _poolId, uint256 _amount) external; // IStrategyV2 // Set 0 to disable quota (no limit) function poolQuota(uint256 _poolId) external view returns (uint256); // Use when we want to switch between strategies function forwardToAnotherStrategy(address _dest, uint256 _amount) external returns (uint256); function switchBetweenPoolsByGov(uint256 _sourcePoolId, uint256 _destPoolId, uint256 _amount) external; // IStrategyV2p1 // Source LP token of this strategy function getLpToken() external view returns(address); // Target farming token of this strategy. function getTargetToken(address _vault) external view returns(address); // IStrategy function getTargetToken(uint256 _poolId) external view returns(address); // IStrategyV2 function balanceOf(address _vault) external view returns (uint256); // IStrategy function balanceOf(uint256 _poolId) external view returns (uint256); // IStrategyV2 function pendingReward(address _vault) external view returns (uint256); // IStrategy function pendingReward(uint256 _poolId) external view returns (uint256); // IStrategyV2 function expectedAPY(address _vault) external view returns (uint256); // IStrategy function expectedAPY(uint256 _poolId, uint256 _lpTokenUsdcPrice) external view returns (uint256); // IStrategyV2 function governanceRescueToken(IERC20 _token) external returns (uint256); } interface IOneSplit { function getExpectedReturn( IERC20 fromToken, IERC20 destToken, uint256 amount, uint256 parts, uint256 flags // See constants in IOneSplit.sol ) external view returns( uint256 returnAmount, uint256[] memory distribution ); } interface IUniswapRouter { function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); } interface IStakingRewards { // Views function lastTimeRewardApplicable() external view returns (uint256); function rewardPerToken() external view returns (uint256); function rewardRate() external view returns (uint256); function earned(address account) external view returns (uint256); function getRewardForDuration() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); // Mutative function stake(uint256 amount) external; function withdraw(uint256 amount) external; function getReward() external; function exit() external; } interface ISushiPool { function deposit(uint256 _poolId, uint256 _amount) external; function withdraw(uint256 _poolId, uint256 _amount) external; } interface ISodaPool { function deposit(uint256 _poolId, uint256 _amount) external; function claim(uint256 _poolId) external; function withdraw(uint256 _poolId, uint256 _amount) external; } interface IProfitSharer { function shareProfit() external returns (uint256); } interface IValueVaultBank { function make_profit(uint256 _poolId, uint256 _amount) external; } // This contract is owned by Timelock. // What it does is simple: deposit WETH to pools, and wait for ValueVaultBank's command. // Atm we support 3 pool types: IStakingRewards (golff.finance), ISushiPool (chickenswap.org), ISodaPool (soda.finance) contract WETHMultiPoolStrategy is IStrategyV2p1 { using SafeMath for uint256; address public governance; // will be a Timelock contract address public operator; // can be EOA for non-fund transferring operation uint256 public constant FEE_DENOMINATOR = 10000; IOneSplit public onesplit = IOneSplit(0x50FDA034C0Ce7a8f7EFDAebDA7Aa7cA21CC1267e); IUniswapRouter public unirouter = IUniswapRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); ValueVaultMaster public valueVaultMaster; IERC20 public lpToken; // WETH mapping(address => mapping(address => address[])) public uniswapPaths; // [input -> output] => uniswap_path struct PoolInfo { address vault; IERC20 targetToken; address targetPool; uint256 targetPoolId; // poolId in soda/chicken pool (no use for IStakingRewards pool eg. golff.finance) uint256 minHarvestForTakeProfit; uint8 poolType; // 0: IStakingRewards, 1: ISushiPool, 2: ISodaPool uint256 poolQuota; // set 0 to disable quota (no limit) uint256 balance; } mapping(uint256 => PoolInfo) public poolMap; // poolIndex -> poolInfo uint256 public totalBalance; bool public aggressiveMode; // will try to stake all lpTokens available (be forwarded from bank or from another strategies) uint8[] public poolPreferredIds; // sorted by preference // weth = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" // golffToken = "0x7AfB39837Fd244A651e4F0C5660B4037214D4aDF" // poolMap[0].targetPool = "0x74BCb8b78996F49F46497be185174B2a89191fD6" constructor(ValueVaultMaster _valueVaultMaster, IERC20 _lpToken, bool _aggressiveMode) public { } // targetToken: golffToken = 0x7AfB39837Fd244A651e4F0C5660B4037214D4aDF // targetPool: poolMap[0].targetPool = 0x74BCb8b78996F49F46497be185174B2a89191fD6 function setPoolInfo(uint256 _poolId, address _vault, IERC20 _targetToken, address _targetPool, uint256 _targetPoolId, uint256 _minHarvestForTakeProfit, uint8 _poolType, uint256 _poolQuota) external { } function approve(IERC20 _token) external override { } function approveForSpender(IERC20 _token, address spender) external override { } function setGovernance(address _governance) external { } function setOperator(address _operator) external { } function setPoolPreferredIds(uint8[] memory _poolPreferredIds) public { } function setMinHarvestForTakeProfit(uint256 _poolId, uint256 _minHarvestForTakeProfit) external { } function setPoolQuota(uint256 _poolId, uint256 _poolQuota) external { } // Sometime the balance could be slightly changed (due to the pool, or because we call xxxByGov methods) function setPoolBalance(uint256 _poolId, uint256 _balance) external { } function setTotalBalance(uint256 _totalBalance) external { } function setAggressiveMode(bool _aggressiveMode) external { } function setOnesplit(IOneSplit _onesplit) external { } function setUnirouter(IUniswapRouter _unirouter) external { } /** * @dev See {IStrategy-deposit}. */ function deposit(address _vault, uint256 _amount) public override { require(<FILL_ME>) require(poolPreferredIds.length > 0, "no pool"); for (uint256 i = 0; i < poolPreferredIds.length; ++i) { uint256 _pid = poolPreferredIds[i]; if (poolMap[_pid].vault == _vault) { uint256 _quota = poolMap[_pid].poolQuota; if (_quota == 0 || balanceOf(_pid) < _quota) { _deposit(_pid, _amount); return; } } } revert("Exceeded pool quota"); } /** * @dev See {IStrategyV2-deposit}. */ function deposit(uint256 _poolId, uint256 _amount) public override { } function _deposit(uint256 _poolId, uint256 _amount) internal { } /** * @dev See {IStrategy-claim}. */ function claim(address _vault) external override { } /** * @dev See {IStrategyV2-claim}. */ function claim(uint256 _poolId) external override { } function _claim(uint256 _poolId) internal { } /** * @dev See {IStrategy-withdraw}. */ function withdraw(address _vault, uint256 _amount) external override { } /** * @dev See {IStrategyV2-withdraw}. */ function withdraw(uint256 _poolId, uint256 _amount) external override { } function _withdraw(uint256 _poolId, uint256 _amount) internal { } function depositByGov(address pool, uint8 _poolType, uint256 _targetPoolId, uint256 _amount) external { } function claimByGov(address pool, uint8 _poolType, uint256 _targetPoolId) external { } function withdrawByGov(address pool, uint8 _poolType, uint256 _targetPoolId, uint256 _amount) external { } function switchBetweenPoolsByGov(uint256 _sourcePoolId, uint256 _destPoolId, uint256 _amount) external override { } /** * @dev See {IStrategyV2-poolQuota} */ function poolQuota(uint256 _poolId) external override view returns (uint256) { } /** * @dev See {IStrategyV2-forwardToAnotherStrategy} */ function forwardToAnotherStrategy(address _dest, uint256 _amount) external override returns (uint256 sent) { } function setUnirouterPath(address _input, address _output, address [] memory _path) public { } function _swapTokens(address _input, address _output, uint256 _amount) internal { } /** * @dev See {IStrategy-harvest}. */ function harvest(uint256 _bankPoolId) external override { } /** * @dev See {IStrategy-harvest}. */ function harvest(uint256 _bankPoolId, uint256 _poolId) external override { } uint256 public log_golffBal; uint256 public log_wethBal; uint256 public log_yfvGovVault; function _harvest(uint256 _bankPoolId, uint256 _poolId) internal { } /** * @dev See {IStrategyV2-getLpToken}. */ function getLpToken() external view override returns(address) { } /** * @dev See {IStrategy-getTargetToken}. * Always use pool 0 (default). */ function getTargetToken(address) external override view returns(address) { } /** * @dev See {IStrategyV2-getTargetToken}. */ function getTargetToken(uint256 _poolId) external override view returns(address) { } function balanceOf(address _vault) public override view returns (uint256 _balanceOfVault) { } function balanceOf(uint256 _poolId) public override view returns (uint256) { } function pendingReward(address) public override view returns (uint256) { } // Only support IStakingRewards pool function pendingReward(uint256 _poolId) public override view returns (uint256) { } // always use pool 0 (default) function expectedAPY(address) public override view returns (uint256) { } // Helper function - should never use it on-chain. // Only support IStakingRewards pool. // Return 10000x of APY. _lpTokenUsdcPrice is not used. function expectedAPY(uint256 _poolId, uint256) public override view returns (uint256) { } event ExecuteTransaction(address indexed target, uint value, string signature, bytes data); /** * @dev This is from Timelock contract, the governance should be a Timelock contract before calling this */ function executeTransaction(address target, uint value, string memory signature, bytes memory data) public returns (bytes memory) { } /** * @dev if there is any token stuck we will need governance support to rescue the fund */ function governanceRescueToken(IERC20 _token) external override returns (uint256 balance) { } }
valueVaultMaster.isVault(msg.sender),"sender not vault"
321,961
valueVaultMaster.isVault(msg.sender)
"sender not vault"
interface IStrategyV2p1 { function approve(IERC20 _token) external; function approveForSpender(IERC20 _token, address spender) external; // Deposit tokens to a farm to yield more tokens. function deposit(address _vault, uint256 _amount) external; // IStrategy function deposit(uint256 _poolId, uint256 _amount) external; // IStrategyV2 // Claim farming tokens function claim(address _vault) external; // IStrategy function claim(uint256 _poolId) external; // IStrategyV2 // The vault request to harvest the profit function harvest(uint256 _bankPoolId) external; // IStrategy function harvest(uint256 _bankPoolId, uint256 _poolId) external; // IStrategyV2 // Withdraw the principal from a farm. function withdraw(address _vault, uint256 _amount) external; // IStrategy function withdraw(uint256 _poolId, uint256 _amount) external; // IStrategyV2 // Set 0 to disable quota (no limit) function poolQuota(uint256 _poolId) external view returns (uint256); // Use when we want to switch between strategies function forwardToAnotherStrategy(address _dest, uint256 _amount) external returns (uint256); function switchBetweenPoolsByGov(uint256 _sourcePoolId, uint256 _destPoolId, uint256 _amount) external; // IStrategyV2p1 // Source LP token of this strategy function getLpToken() external view returns(address); // Target farming token of this strategy. function getTargetToken(address _vault) external view returns(address); // IStrategy function getTargetToken(uint256 _poolId) external view returns(address); // IStrategyV2 function balanceOf(address _vault) external view returns (uint256); // IStrategy function balanceOf(uint256 _poolId) external view returns (uint256); // IStrategyV2 function pendingReward(address _vault) external view returns (uint256); // IStrategy function pendingReward(uint256 _poolId) external view returns (uint256); // IStrategyV2 function expectedAPY(address _vault) external view returns (uint256); // IStrategy function expectedAPY(uint256 _poolId, uint256 _lpTokenUsdcPrice) external view returns (uint256); // IStrategyV2 function governanceRescueToken(IERC20 _token) external returns (uint256); } interface IOneSplit { function getExpectedReturn( IERC20 fromToken, IERC20 destToken, uint256 amount, uint256 parts, uint256 flags // See constants in IOneSplit.sol ) external view returns( uint256 returnAmount, uint256[] memory distribution ); } interface IUniswapRouter { function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); } interface IStakingRewards { // Views function lastTimeRewardApplicable() external view returns (uint256); function rewardPerToken() external view returns (uint256); function rewardRate() external view returns (uint256); function earned(address account) external view returns (uint256); function getRewardForDuration() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); // Mutative function stake(uint256 amount) external; function withdraw(uint256 amount) external; function getReward() external; function exit() external; } interface ISushiPool { function deposit(uint256 _poolId, uint256 _amount) external; function withdraw(uint256 _poolId, uint256 _amount) external; } interface ISodaPool { function deposit(uint256 _poolId, uint256 _amount) external; function claim(uint256 _poolId) external; function withdraw(uint256 _poolId, uint256 _amount) external; } interface IProfitSharer { function shareProfit() external returns (uint256); } interface IValueVaultBank { function make_profit(uint256 _poolId, uint256 _amount) external; } // This contract is owned by Timelock. // What it does is simple: deposit WETH to pools, and wait for ValueVaultBank's command. // Atm we support 3 pool types: IStakingRewards (golff.finance), ISushiPool (chickenswap.org), ISodaPool (soda.finance) contract WETHMultiPoolStrategy is IStrategyV2p1 { using SafeMath for uint256; address public governance; // will be a Timelock contract address public operator; // can be EOA for non-fund transferring operation uint256 public constant FEE_DENOMINATOR = 10000; IOneSplit public onesplit = IOneSplit(0x50FDA034C0Ce7a8f7EFDAebDA7Aa7cA21CC1267e); IUniswapRouter public unirouter = IUniswapRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); ValueVaultMaster public valueVaultMaster; IERC20 public lpToken; // WETH mapping(address => mapping(address => address[])) public uniswapPaths; // [input -> output] => uniswap_path struct PoolInfo { address vault; IERC20 targetToken; address targetPool; uint256 targetPoolId; // poolId in soda/chicken pool (no use for IStakingRewards pool eg. golff.finance) uint256 minHarvestForTakeProfit; uint8 poolType; // 0: IStakingRewards, 1: ISushiPool, 2: ISodaPool uint256 poolQuota; // set 0 to disable quota (no limit) uint256 balance; } mapping(uint256 => PoolInfo) public poolMap; // poolIndex -> poolInfo uint256 public totalBalance; bool public aggressiveMode; // will try to stake all lpTokens available (be forwarded from bank or from another strategies) uint8[] public poolPreferredIds; // sorted by preference // weth = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" // golffToken = "0x7AfB39837Fd244A651e4F0C5660B4037214D4aDF" // poolMap[0].targetPool = "0x74BCb8b78996F49F46497be185174B2a89191fD6" constructor(ValueVaultMaster _valueVaultMaster, IERC20 _lpToken, bool _aggressiveMode) public { } // targetToken: golffToken = 0x7AfB39837Fd244A651e4F0C5660B4037214D4aDF // targetPool: poolMap[0].targetPool = 0x74BCb8b78996F49F46497be185174B2a89191fD6 function setPoolInfo(uint256 _poolId, address _vault, IERC20 _targetToken, address _targetPool, uint256 _targetPoolId, uint256 _minHarvestForTakeProfit, uint8 _poolType, uint256 _poolQuota) external { } function approve(IERC20 _token) external override { } function approveForSpender(IERC20 _token, address spender) external override { } function setGovernance(address _governance) external { } function setOperator(address _operator) external { } function setPoolPreferredIds(uint8[] memory _poolPreferredIds) public { } function setMinHarvestForTakeProfit(uint256 _poolId, uint256 _minHarvestForTakeProfit) external { } function setPoolQuota(uint256 _poolId, uint256 _poolQuota) external { } // Sometime the balance could be slightly changed (due to the pool, or because we call xxxByGov methods) function setPoolBalance(uint256 _poolId, uint256 _balance) external { } function setTotalBalance(uint256 _totalBalance) external { } function setAggressiveMode(bool _aggressiveMode) external { } function setOnesplit(IOneSplit _onesplit) external { } function setUnirouter(IUniswapRouter _unirouter) external { } /** * @dev See {IStrategy-deposit}. */ function deposit(address _vault, uint256 _amount) public override { } /** * @dev See {IStrategyV2-deposit}. */ function deposit(uint256 _poolId, uint256 _amount) public override { require(<FILL_ME>) _deposit(_poolId, _amount); } function _deposit(uint256 _poolId, uint256 _amount) internal { } /** * @dev See {IStrategy-claim}. */ function claim(address _vault) external override { } /** * @dev See {IStrategyV2-claim}. */ function claim(uint256 _poolId) external override { } function _claim(uint256 _poolId) internal { } /** * @dev See {IStrategy-withdraw}. */ function withdraw(address _vault, uint256 _amount) external override { } /** * @dev See {IStrategyV2-withdraw}. */ function withdraw(uint256 _poolId, uint256 _amount) external override { } function _withdraw(uint256 _poolId, uint256 _amount) internal { } function depositByGov(address pool, uint8 _poolType, uint256 _targetPoolId, uint256 _amount) external { } function claimByGov(address pool, uint8 _poolType, uint256 _targetPoolId) external { } function withdrawByGov(address pool, uint8 _poolType, uint256 _targetPoolId, uint256 _amount) external { } function switchBetweenPoolsByGov(uint256 _sourcePoolId, uint256 _destPoolId, uint256 _amount) external override { } /** * @dev See {IStrategyV2-poolQuota} */ function poolQuota(uint256 _poolId) external override view returns (uint256) { } /** * @dev See {IStrategyV2-forwardToAnotherStrategy} */ function forwardToAnotherStrategy(address _dest, uint256 _amount) external override returns (uint256 sent) { } function setUnirouterPath(address _input, address _output, address [] memory _path) public { } function _swapTokens(address _input, address _output, uint256 _amount) internal { } /** * @dev See {IStrategy-harvest}. */ function harvest(uint256 _bankPoolId) external override { } /** * @dev See {IStrategy-harvest}. */ function harvest(uint256 _bankPoolId, uint256 _poolId) external override { } uint256 public log_golffBal; uint256 public log_wethBal; uint256 public log_yfvGovVault; function _harvest(uint256 _bankPoolId, uint256 _poolId) internal { } /** * @dev See {IStrategyV2-getLpToken}. */ function getLpToken() external view override returns(address) { } /** * @dev See {IStrategy-getTargetToken}. * Always use pool 0 (default). */ function getTargetToken(address) external override view returns(address) { } /** * @dev See {IStrategyV2-getTargetToken}. */ function getTargetToken(uint256 _poolId) external override view returns(address) { } function balanceOf(address _vault) public override view returns (uint256 _balanceOfVault) { } function balanceOf(uint256 _poolId) public override view returns (uint256) { } function pendingReward(address) public override view returns (uint256) { } // Only support IStakingRewards pool function pendingReward(uint256 _poolId) public override view returns (uint256) { } // always use pool 0 (default) function expectedAPY(address) public override view returns (uint256) { } // Helper function - should never use it on-chain. // Only support IStakingRewards pool. // Return 10000x of APY. _lpTokenUsdcPrice is not used. function expectedAPY(uint256 _poolId, uint256) public override view returns (uint256) { } event ExecuteTransaction(address indexed target, uint value, string signature, bytes data); /** * @dev This is from Timelock contract, the governance should be a Timelock contract before calling this */ function executeTransaction(address target, uint value, string memory signature, bytes memory data) public returns (bytes memory) { } /** * @dev if there is any token stuck we will need governance support to rescue the fund */ function governanceRescueToken(IERC20 _token) external override returns (uint256 balance) { } }
poolMap[_poolId].vault==msg.sender,"sender not vault"
321,961
poolMap[_poolId].vault==msg.sender
"not vault"
interface IStrategyV2p1 { function approve(IERC20 _token) external; function approveForSpender(IERC20 _token, address spender) external; // Deposit tokens to a farm to yield more tokens. function deposit(address _vault, uint256 _amount) external; // IStrategy function deposit(uint256 _poolId, uint256 _amount) external; // IStrategyV2 // Claim farming tokens function claim(address _vault) external; // IStrategy function claim(uint256 _poolId) external; // IStrategyV2 // The vault request to harvest the profit function harvest(uint256 _bankPoolId) external; // IStrategy function harvest(uint256 _bankPoolId, uint256 _poolId) external; // IStrategyV2 // Withdraw the principal from a farm. function withdraw(address _vault, uint256 _amount) external; // IStrategy function withdraw(uint256 _poolId, uint256 _amount) external; // IStrategyV2 // Set 0 to disable quota (no limit) function poolQuota(uint256 _poolId) external view returns (uint256); // Use when we want to switch between strategies function forwardToAnotherStrategy(address _dest, uint256 _amount) external returns (uint256); function switchBetweenPoolsByGov(uint256 _sourcePoolId, uint256 _destPoolId, uint256 _amount) external; // IStrategyV2p1 // Source LP token of this strategy function getLpToken() external view returns(address); // Target farming token of this strategy. function getTargetToken(address _vault) external view returns(address); // IStrategy function getTargetToken(uint256 _poolId) external view returns(address); // IStrategyV2 function balanceOf(address _vault) external view returns (uint256); // IStrategy function balanceOf(uint256 _poolId) external view returns (uint256); // IStrategyV2 function pendingReward(address _vault) external view returns (uint256); // IStrategy function pendingReward(uint256 _poolId) external view returns (uint256); // IStrategyV2 function expectedAPY(address _vault) external view returns (uint256); // IStrategy function expectedAPY(uint256 _poolId, uint256 _lpTokenUsdcPrice) external view returns (uint256); // IStrategyV2 function governanceRescueToken(IERC20 _token) external returns (uint256); } interface IOneSplit { function getExpectedReturn( IERC20 fromToken, IERC20 destToken, uint256 amount, uint256 parts, uint256 flags // See constants in IOneSplit.sol ) external view returns( uint256 returnAmount, uint256[] memory distribution ); } interface IUniswapRouter { function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); } interface IStakingRewards { // Views function lastTimeRewardApplicable() external view returns (uint256); function rewardPerToken() external view returns (uint256); function rewardRate() external view returns (uint256); function earned(address account) external view returns (uint256); function getRewardForDuration() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); // Mutative function stake(uint256 amount) external; function withdraw(uint256 amount) external; function getReward() external; function exit() external; } interface ISushiPool { function deposit(uint256 _poolId, uint256 _amount) external; function withdraw(uint256 _poolId, uint256 _amount) external; } interface ISodaPool { function deposit(uint256 _poolId, uint256 _amount) external; function claim(uint256 _poolId) external; function withdraw(uint256 _poolId, uint256 _amount) external; } interface IProfitSharer { function shareProfit() external returns (uint256); } interface IValueVaultBank { function make_profit(uint256 _poolId, uint256 _amount) external; } // This contract is owned by Timelock. // What it does is simple: deposit WETH to pools, and wait for ValueVaultBank's command. // Atm we support 3 pool types: IStakingRewards (golff.finance), ISushiPool (chickenswap.org), ISodaPool (soda.finance) contract WETHMultiPoolStrategy is IStrategyV2p1 { using SafeMath for uint256; address public governance; // will be a Timelock contract address public operator; // can be EOA for non-fund transferring operation uint256 public constant FEE_DENOMINATOR = 10000; IOneSplit public onesplit = IOneSplit(0x50FDA034C0Ce7a8f7EFDAebDA7Aa7cA21CC1267e); IUniswapRouter public unirouter = IUniswapRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); ValueVaultMaster public valueVaultMaster; IERC20 public lpToken; // WETH mapping(address => mapping(address => address[])) public uniswapPaths; // [input -> output] => uniswap_path struct PoolInfo { address vault; IERC20 targetToken; address targetPool; uint256 targetPoolId; // poolId in soda/chicken pool (no use for IStakingRewards pool eg. golff.finance) uint256 minHarvestForTakeProfit; uint8 poolType; // 0: IStakingRewards, 1: ISushiPool, 2: ISodaPool uint256 poolQuota; // set 0 to disable quota (no limit) uint256 balance; } mapping(uint256 => PoolInfo) public poolMap; // poolIndex -> poolInfo uint256 public totalBalance; bool public aggressiveMode; // will try to stake all lpTokens available (be forwarded from bank or from another strategies) uint8[] public poolPreferredIds; // sorted by preference // weth = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" // golffToken = "0x7AfB39837Fd244A651e4F0C5660B4037214D4aDF" // poolMap[0].targetPool = "0x74BCb8b78996F49F46497be185174B2a89191fD6" constructor(ValueVaultMaster _valueVaultMaster, IERC20 _lpToken, bool _aggressiveMode) public { } // targetToken: golffToken = 0x7AfB39837Fd244A651e4F0C5660B4037214D4aDF // targetPool: poolMap[0].targetPool = 0x74BCb8b78996F49F46497be185174B2a89191fD6 function setPoolInfo(uint256 _poolId, address _vault, IERC20 _targetToken, address _targetPool, uint256 _targetPoolId, uint256 _minHarvestForTakeProfit, uint8 _poolType, uint256 _poolQuota) external { } function approve(IERC20 _token) external override { } function approveForSpender(IERC20 _token, address spender) external override { } function setGovernance(address _governance) external { } function setOperator(address _operator) external { } function setPoolPreferredIds(uint8[] memory _poolPreferredIds) public { } function setMinHarvestForTakeProfit(uint256 _poolId, uint256 _minHarvestForTakeProfit) external { } function setPoolQuota(uint256 _poolId, uint256 _poolQuota) external { } // Sometime the balance could be slightly changed (due to the pool, or because we call xxxByGov methods) function setPoolBalance(uint256 _poolId, uint256 _balance) external { } function setTotalBalance(uint256 _totalBalance) external { } function setAggressiveMode(bool _aggressiveMode) external { } function setOnesplit(IOneSplit _onesplit) external { } function setUnirouter(IUniswapRouter _unirouter) external { } /** * @dev See {IStrategy-deposit}. */ function deposit(address _vault, uint256 _amount) public override { } /** * @dev See {IStrategyV2-deposit}. */ function deposit(uint256 _poolId, uint256 _amount) public override { } function _deposit(uint256 _poolId, uint256 _amount) internal { } /** * @dev See {IStrategy-claim}. */ function claim(address _vault) external override { require(<FILL_ME>) require(poolPreferredIds.length > 0, "no pool"); for (uint256 i = 0; i < poolPreferredIds.length; ++i) { uint256 _pid = poolPreferredIds[i]; if (poolMap[_pid].vault == _vault) { _claim(_pid); } } } /** * @dev See {IStrategyV2-claim}. */ function claim(uint256 _poolId) external override { } function _claim(uint256 _poolId) internal { } /** * @dev See {IStrategy-withdraw}. */ function withdraw(address _vault, uint256 _amount) external override { } /** * @dev See {IStrategyV2-withdraw}. */ function withdraw(uint256 _poolId, uint256 _amount) external override { } function _withdraw(uint256 _poolId, uint256 _amount) internal { } function depositByGov(address pool, uint8 _poolType, uint256 _targetPoolId, uint256 _amount) external { } function claimByGov(address pool, uint8 _poolType, uint256 _targetPoolId) external { } function withdrawByGov(address pool, uint8 _poolType, uint256 _targetPoolId, uint256 _amount) external { } function switchBetweenPoolsByGov(uint256 _sourcePoolId, uint256 _destPoolId, uint256 _amount) external override { } /** * @dev See {IStrategyV2-poolQuota} */ function poolQuota(uint256 _poolId) external override view returns (uint256) { } /** * @dev See {IStrategyV2-forwardToAnotherStrategy} */ function forwardToAnotherStrategy(address _dest, uint256 _amount) external override returns (uint256 sent) { } function setUnirouterPath(address _input, address _output, address [] memory _path) public { } function _swapTokens(address _input, address _output, uint256 _amount) internal { } /** * @dev See {IStrategy-harvest}. */ function harvest(uint256 _bankPoolId) external override { } /** * @dev See {IStrategy-harvest}. */ function harvest(uint256 _bankPoolId, uint256 _poolId) external override { } uint256 public log_golffBal; uint256 public log_wethBal; uint256 public log_yfvGovVault; function _harvest(uint256 _bankPoolId, uint256 _poolId) internal { } /** * @dev See {IStrategyV2-getLpToken}. */ function getLpToken() external view override returns(address) { } /** * @dev See {IStrategy-getTargetToken}. * Always use pool 0 (default). */ function getTargetToken(address) external override view returns(address) { } /** * @dev See {IStrategyV2-getTargetToken}. */ function getTargetToken(uint256 _poolId) external override view returns(address) { } function balanceOf(address _vault) public override view returns (uint256 _balanceOfVault) { } function balanceOf(uint256 _poolId) public override view returns (uint256) { } function pendingReward(address) public override view returns (uint256) { } // Only support IStakingRewards pool function pendingReward(uint256 _poolId) public override view returns (uint256) { } // always use pool 0 (default) function expectedAPY(address) public override view returns (uint256) { } // Helper function - should never use it on-chain. // Only support IStakingRewards pool. // Return 10000x of APY. _lpTokenUsdcPrice is not used. function expectedAPY(uint256 _poolId, uint256) public override view returns (uint256) { } event ExecuteTransaction(address indexed target, uint value, string signature, bytes data); /** * @dev This is from Timelock contract, the governance should be a Timelock contract before calling this */ function executeTransaction(address target, uint value, string memory signature, bytes memory data) public returns (bytes memory) { } /** * @dev if there is any token stuck we will need governance support to rescue the fund */ function governanceRescueToken(IERC20 _token) external override returns (uint256 balance) { } }
valueVaultMaster.isVault(_vault),"not vault"
321,961
valueVaultMaster.isVault(_vault)
"!vault && !governance"
interface IStrategyV2p1 { function approve(IERC20 _token) external; function approveForSpender(IERC20 _token, address spender) external; // Deposit tokens to a farm to yield more tokens. function deposit(address _vault, uint256 _amount) external; // IStrategy function deposit(uint256 _poolId, uint256 _amount) external; // IStrategyV2 // Claim farming tokens function claim(address _vault) external; // IStrategy function claim(uint256 _poolId) external; // IStrategyV2 // The vault request to harvest the profit function harvest(uint256 _bankPoolId) external; // IStrategy function harvest(uint256 _bankPoolId, uint256 _poolId) external; // IStrategyV2 // Withdraw the principal from a farm. function withdraw(address _vault, uint256 _amount) external; // IStrategy function withdraw(uint256 _poolId, uint256 _amount) external; // IStrategyV2 // Set 0 to disable quota (no limit) function poolQuota(uint256 _poolId) external view returns (uint256); // Use when we want to switch between strategies function forwardToAnotherStrategy(address _dest, uint256 _amount) external returns (uint256); function switchBetweenPoolsByGov(uint256 _sourcePoolId, uint256 _destPoolId, uint256 _amount) external; // IStrategyV2p1 // Source LP token of this strategy function getLpToken() external view returns(address); // Target farming token of this strategy. function getTargetToken(address _vault) external view returns(address); // IStrategy function getTargetToken(uint256 _poolId) external view returns(address); // IStrategyV2 function balanceOf(address _vault) external view returns (uint256); // IStrategy function balanceOf(uint256 _poolId) external view returns (uint256); // IStrategyV2 function pendingReward(address _vault) external view returns (uint256); // IStrategy function pendingReward(uint256 _poolId) external view returns (uint256); // IStrategyV2 function expectedAPY(address _vault) external view returns (uint256); // IStrategy function expectedAPY(uint256 _poolId, uint256 _lpTokenUsdcPrice) external view returns (uint256); // IStrategyV2 function governanceRescueToken(IERC20 _token) external returns (uint256); } interface IOneSplit { function getExpectedReturn( IERC20 fromToken, IERC20 destToken, uint256 amount, uint256 parts, uint256 flags // See constants in IOneSplit.sol ) external view returns( uint256 returnAmount, uint256[] memory distribution ); } interface IUniswapRouter { function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); } interface IStakingRewards { // Views function lastTimeRewardApplicable() external view returns (uint256); function rewardPerToken() external view returns (uint256); function rewardRate() external view returns (uint256); function earned(address account) external view returns (uint256); function getRewardForDuration() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); // Mutative function stake(uint256 amount) external; function withdraw(uint256 amount) external; function getReward() external; function exit() external; } interface ISushiPool { function deposit(uint256 _poolId, uint256 _amount) external; function withdraw(uint256 _poolId, uint256 _amount) external; } interface ISodaPool { function deposit(uint256 _poolId, uint256 _amount) external; function claim(uint256 _poolId) external; function withdraw(uint256 _poolId, uint256 _amount) external; } interface IProfitSharer { function shareProfit() external returns (uint256); } interface IValueVaultBank { function make_profit(uint256 _poolId, uint256 _amount) external; } // This contract is owned by Timelock. // What it does is simple: deposit WETH to pools, and wait for ValueVaultBank's command. // Atm we support 3 pool types: IStakingRewards (golff.finance), ISushiPool (chickenswap.org), ISodaPool (soda.finance) contract WETHMultiPoolStrategy is IStrategyV2p1 { using SafeMath for uint256; address public governance; // will be a Timelock contract address public operator; // can be EOA for non-fund transferring operation uint256 public constant FEE_DENOMINATOR = 10000; IOneSplit public onesplit = IOneSplit(0x50FDA034C0Ce7a8f7EFDAebDA7Aa7cA21CC1267e); IUniswapRouter public unirouter = IUniswapRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); ValueVaultMaster public valueVaultMaster; IERC20 public lpToken; // WETH mapping(address => mapping(address => address[])) public uniswapPaths; // [input -> output] => uniswap_path struct PoolInfo { address vault; IERC20 targetToken; address targetPool; uint256 targetPoolId; // poolId in soda/chicken pool (no use for IStakingRewards pool eg. golff.finance) uint256 minHarvestForTakeProfit; uint8 poolType; // 0: IStakingRewards, 1: ISushiPool, 2: ISodaPool uint256 poolQuota; // set 0 to disable quota (no limit) uint256 balance; } mapping(uint256 => PoolInfo) public poolMap; // poolIndex -> poolInfo uint256 public totalBalance; bool public aggressiveMode; // will try to stake all lpTokens available (be forwarded from bank or from another strategies) uint8[] public poolPreferredIds; // sorted by preference // weth = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" // golffToken = "0x7AfB39837Fd244A651e4F0C5660B4037214D4aDF" // poolMap[0].targetPool = "0x74BCb8b78996F49F46497be185174B2a89191fD6" constructor(ValueVaultMaster _valueVaultMaster, IERC20 _lpToken, bool _aggressiveMode) public { } // targetToken: golffToken = 0x7AfB39837Fd244A651e4F0C5660B4037214D4aDF // targetPool: poolMap[0].targetPool = 0x74BCb8b78996F49F46497be185174B2a89191fD6 function setPoolInfo(uint256 _poolId, address _vault, IERC20 _targetToken, address _targetPool, uint256 _targetPoolId, uint256 _minHarvestForTakeProfit, uint8 _poolType, uint256 _poolQuota) external { } function approve(IERC20 _token) external override { } function approveForSpender(IERC20 _token, address spender) external override { } function setGovernance(address _governance) external { } function setOperator(address _operator) external { } function setPoolPreferredIds(uint8[] memory _poolPreferredIds) public { } function setMinHarvestForTakeProfit(uint256 _poolId, uint256 _minHarvestForTakeProfit) external { } function setPoolQuota(uint256 _poolId, uint256 _poolQuota) external { } // Sometime the balance could be slightly changed (due to the pool, or because we call xxxByGov methods) function setPoolBalance(uint256 _poolId, uint256 _balance) external { } function setTotalBalance(uint256 _totalBalance) external { } function setAggressiveMode(bool _aggressiveMode) external { } function setOnesplit(IOneSplit _onesplit) external { } function setUnirouter(IUniswapRouter _unirouter) external { } /** * @dev See {IStrategy-deposit}. */ function deposit(address _vault, uint256 _amount) public override { } /** * @dev See {IStrategyV2-deposit}. */ function deposit(uint256 _poolId, uint256 _amount) public override { } function _deposit(uint256 _poolId, uint256 _amount) internal { } /** * @dev See {IStrategy-claim}. */ function claim(address _vault) external override { } /** * @dev See {IStrategyV2-claim}. */ function claim(uint256 _poolId) external override { } function _claim(uint256 _poolId) internal { } /** * @dev See {IStrategy-withdraw}. */ function withdraw(address _vault, uint256 _amount) external override { } /** * @dev See {IStrategyV2-withdraw}. */ function withdraw(uint256 _poolId, uint256 _amount) external override { } function _withdraw(uint256 _poolId, uint256 _amount) internal { } function depositByGov(address pool, uint8 _poolType, uint256 _targetPoolId, uint256 _amount) external { } function claimByGov(address pool, uint8 _poolType, uint256 _targetPoolId) external { } function withdrawByGov(address pool, uint8 _poolType, uint256 _targetPoolId, uint256 _amount) external { } function switchBetweenPoolsByGov(uint256 _sourcePoolId, uint256 _destPoolId, uint256 _amount) external override { } /** * @dev See {IStrategyV2-poolQuota} */ function poolQuota(uint256 _poolId) external override view returns (uint256) { } /** * @dev See {IStrategyV2-forwardToAnotherStrategy} */ function forwardToAnotherStrategy(address _dest, uint256 _amount) external override returns (uint256 sent) { require(<FILL_ME>) require(valueVaultMaster.isStrategy(_dest), "not strategy"); require(IStrategyV2p1(_dest).getLpToken() == address(lpToken), "!lpToken"); uint256 lpTokenBal = lpToken.balanceOf(address(this)); sent = (_amount < lpTokenBal) ? _amount : lpTokenBal; lpToken.transfer(_dest, sent); } function setUnirouterPath(address _input, address _output, address [] memory _path) public { } function _swapTokens(address _input, address _output, uint256 _amount) internal { } /** * @dev See {IStrategy-harvest}. */ function harvest(uint256 _bankPoolId) external override { } /** * @dev See {IStrategy-harvest}. */ function harvest(uint256 _bankPoolId, uint256 _poolId) external override { } uint256 public log_golffBal; uint256 public log_wethBal; uint256 public log_yfvGovVault; function _harvest(uint256 _bankPoolId, uint256 _poolId) internal { } /** * @dev See {IStrategyV2-getLpToken}. */ function getLpToken() external view override returns(address) { } /** * @dev See {IStrategy-getTargetToken}. * Always use pool 0 (default). */ function getTargetToken(address) external override view returns(address) { } /** * @dev See {IStrategyV2-getTargetToken}. */ function getTargetToken(uint256 _poolId) external override view returns(address) { } function balanceOf(address _vault) public override view returns (uint256 _balanceOfVault) { } function balanceOf(uint256 _poolId) public override view returns (uint256) { } function pendingReward(address) public override view returns (uint256) { } // Only support IStakingRewards pool function pendingReward(uint256 _poolId) public override view returns (uint256) { } // always use pool 0 (default) function expectedAPY(address) public override view returns (uint256) { } // Helper function - should never use it on-chain. // Only support IStakingRewards pool. // Return 10000x of APY. _lpTokenUsdcPrice is not used. function expectedAPY(uint256 _poolId, uint256) public override view returns (uint256) { } event ExecuteTransaction(address indexed target, uint value, string signature, bytes data); /** * @dev This is from Timelock contract, the governance should be a Timelock contract before calling this */ function executeTransaction(address target, uint value, string memory signature, bytes memory data) public returns (bytes memory) { } /** * @dev if there is any token stuck we will need governance support to rescue the fund */ function governanceRescueToken(IERC20 _token) external override returns (uint256 balance) { } }
valueVaultMaster.isVault(msg.sender)||msg.sender==governance,"!vault && !governance"
321,961
valueVaultMaster.isVault(msg.sender)||msg.sender==governance
"not strategy"
interface IStrategyV2p1 { function approve(IERC20 _token) external; function approveForSpender(IERC20 _token, address spender) external; // Deposit tokens to a farm to yield more tokens. function deposit(address _vault, uint256 _amount) external; // IStrategy function deposit(uint256 _poolId, uint256 _amount) external; // IStrategyV2 // Claim farming tokens function claim(address _vault) external; // IStrategy function claim(uint256 _poolId) external; // IStrategyV2 // The vault request to harvest the profit function harvest(uint256 _bankPoolId) external; // IStrategy function harvest(uint256 _bankPoolId, uint256 _poolId) external; // IStrategyV2 // Withdraw the principal from a farm. function withdraw(address _vault, uint256 _amount) external; // IStrategy function withdraw(uint256 _poolId, uint256 _amount) external; // IStrategyV2 // Set 0 to disable quota (no limit) function poolQuota(uint256 _poolId) external view returns (uint256); // Use when we want to switch between strategies function forwardToAnotherStrategy(address _dest, uint256 _amount) external returns (uint256); function switchBetweenPoolsByGov(uint256 _sourcePoolId, uint256 _destPoolId, uint256 _amount) external; // IStrategyV2p1 // Source LP token of this strategy function getLpToken() external view returns(address); // Target farming token of this strategy. function getTargetToken(address _vault) external view returns(address); // IStrategy function getTargetToken(uint256 _poolId) external view returns(address); // IStrategyV2 function balanceOf(address _vault) external view returns (uint256); // IStrategy function balanceOf(uint256 _poolId) external view returns (uint256); // IStrategyV2 function pendingReward(address _vault) external view returns (uint256); // IStrategy function pendingReward(uint256 _poolId) external view returns (uint256); // IStrategyV2 function expectedAPY(address _vault) external view returns (uint256); // IStrategy function expectedAPY(uint256 _poolId, uint256 _lpTokenUsdcPrice) external view returns (uint256); // IStrategyV2 function governanceRescueToken(IERC20 _token) external returns (uint256); } interface IOneSplit { function getExpectedReturn( IERC20 fromToken, IERC20 destToken, uint256 amount, uint256 parts, uint256 flags // See constants in IOneSplit.sol ) external view returns( uint256 returnAmount, uint256[] memory distribution ); } interface IUniswapRouter { function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); } interface IStakingRewards { // Views function lastTimeRewardApplicable() external view returns (uint256); function rewardPerToken() external view returns (uint256); function rewardRate() external view returns (uint256); function earned(address account) external view returns (uint256); function getRewardForDuration() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); // Mutative function stake(uint256 amount) external; function withdraw(uint256 amount) external; function getReward() external; function exit() external; } interface ISushiPool { function deposit(uint256 _poolId, uint256 _amount) external; function withdraw(uint256 _poolId, uint256 _amount) external; } interface ISodaPool { function deposit(uint256 _poolId, uint256 _amount) external; function claim(uint256 _poolId) external; function withdraw(uint256 _poolId, uint256 _amount) external; } interface IProfitSharer { function shareProfit() external returns (uint256); } interface IValueVaultBank { function make_profit(uint256 _poolId, uint256 _amount) external; } // This contract is owned by Timelock. // What it does is simple: deposit WETH to pools, and wait for ValueVaultBank's command. // Atm we support 3 pool types: IStakingRewards (golff.finance), ISushiPool (chickenswap.org), ISodaPool (soda.finance) contract WETHMultiPoolStrategy is IStrategyV2p1 { using SafeMath for uint256; address public governance; // will be a Timelock contract address public operator; // can be EOA for non-fund transferring operation uint256 public constant FEE_DENOMINATOR = 10000; IOneSplit public onesplit = IOneSplit(0x50FDA034C0Ce7a8f7EFDAebDA7Aa7cA21CC1267e); IUniswapRouter public unirouter = IUniswapRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); ValueVaultMaster public valueVaultMaster; IERC20 public lpToken; // WETH mapping(address => mapping(address => address[])) public uniswapPaths; // [input -> output] => uniswap_path struct PoolInfo { address vault; IERC20 targetToken; address targetPool; uint256 targetPoolId; // poolId in soda/chicken pool (no use for IStakingRewards pool eg. golff.finance) uint256 minHarvestForTakeProfit; uint8 poolType; // 0: IStakingRewards, 1: ISushiPool, 2: ISodaPool uint256 poolQuota; // set 0 to disable quota (no limit) uint256 balance; } mapping(uint256 => PoolInfo) public poolMap; // poolIndex -> poolInfo uint256 public totalBalance; bool public aggressiveMode; // will try to stake all lpTokens available (be forwarded from bank or from another strategies) uint8[] public poolPreferredIds; // sorted by preference // weth = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" // golffToken = "0x7AfB39837Fd244A651e4F0C5660B4037214D4aDF" // poolMap[0].targetPool = "0x74BCb8b78996F49F46497be185174B2a89191fD6" constructor(ValueVaultMaster _valueVaultMaster, IERC20 _lpToken, bool _aggressiveMode) public { } // targetToken: golffToken = 0x7AfB39837Fd244A651e4F0C5660B4037214D4aDF // targetPool: poolMap[0].targetPool = 0x74BCb8b78996F49F46497be185174B2a89191fD6 function setPoolInfo(uint256 _poolId, address _vault, IERC20 _targetToken, address _targetPool, uint256 _targetPoolId, uint256 _minHarvestForTakeProfit, uint8 _poolType, uint256 _poolQuota) external { } function approve(IERC20 _token) external override { } function approveForSpender(IERC20 _token, address spender) external override { } function setGovernance(address _governance) external { } function setOperator(address _operator) external { } function setPoolPreferredIds(uint8[] memory _poolPreferredIds) public { } function setMinHarvestForTakeProfit(uint256 _poolId, uint256 _minHarvestForTakeProfit) external { } function setPoolQuota(uint256 _poolId, uint256 _poolQuota) external { } // Sometime the balance could be slightly changed (due to the pool, or because we call xxxByGov methods) function setPoolBalance(uint256 _poolId, uint256 _balance) external { } function setTotalBalance(uint256 _totalBalance) external { } function setAggressiveMode(bool _aggressiveMode) external { } function setOnesplit(IOneSplit _onesplit) external { } function setUnirouter(IUniswapRouter _unirouter) external { } /** * @dev See {IStrategy-deposit}. */ function deposit(address _vault, uint256 _amount) public override { } /** * @dev See {IStrategyV2-deposit}. */ function deposit(uint256 _poolId, uint256 _amount) public override { } function _deposit(uint256 _poolId, uint256 _amount) internal { } /** * @dev See {IStrategy-claim}. */ function claim(address _vault) external override { } /** * @dev See {IStrategyV2-claim}. */ function claim(uint256 _poolId) external override { } function _claim(uint256 _poolId) internal { } /** * @dev See {IStrategy-withdraw}. */ function withdraw(address _vault, uint256 _amount) external override { } /** * @dev See {IStrategyV2-withdraw}. */ function withdraw(uint256 _poolId, uint256 _amount) external override { } function _withdraw(uint256 _poolId, uint256 _amount) internal { } function depositByGov(address pool, uint8 _poolType, uint256 _targetPoolId, uint256 _amount) external { } function claimByGov(address pool, uint8 _poolType, uint256 _targetPoolId) external { } function withdrawByGov(address pool, uint8 _poolType, uint256 _targetPoolId, uint256 _amount) external { } function switchBetweenPoolsByGov(uint256 _sourcePoolId, uint256 _destPoolId, uint256 _amount) external override { } /** * @dev See {IStrategyV2-poolQuota} */ function poolQuota(uint256 _poolId) external override view returns (uint256) { } /** * @dev See {IStrategyV2-forwardToAnotherStrategy} */ function forwardToAnotherStrategy(address _dest, uint256 _amount) external override returns (uint256 sent) { require(valueVaultMaster.isVault(msg.sender) || msg.sender == governance, "!vault && !governance"); require(<FILL_ME>) require(IStrategyV2p1(_dest).getLpToken() == address(lpToken), "!lpToken"); uint256 lpTokenBal = lpToken.balanceOf(address(this)); sent = (_amount < lpTokenBal) ? _amount : lpTokenBal; lpToken.transfer(_dest, sent); } function setUnirouterPath(address _input, address _output, address [] memory _path) public { } function _swapTokens(address _input, address _output, uint256 _amount) internal { } /** * @dev See {IStrategy-harvest}. */ function harvest(uint256 _bankPoolId) external override { } /** * @dev See {IStrategy-harvest}. */ function harvest(uint256 _bankPoolId, uint256 _poolId) external override { } uint256 public log_golffBal; uint256 public log_wethBal; uint256 public log_yfvGovVault; function _harvest(uint256 _bankPoolId, uint256 _poolId) internal { } /** * @dev See {IStrategyV2-getLpToken}. */ function getLpToken() external view override returns(address) { } /** * @dev See {IStrategy-getTargetToken}. * Always use pool 0 (default). */ function getTargetToken(address) external override view returns(address) { } /** * @dev See {IStrategyV2-getTargetToken}. */ function getTargetToken(uint256 _poolId) external override view returns(address) { } function balanceOf(address _vault) public override view returns (uint256 _balanceOfVault) { } function balanceOf(uint256 _poolId) public override view returns (uint256) { } function pendingReward(address) public override view returns (uint256) { } // Only support IStakingRewards pool function pendingReward(uint256 _poolId) public override view returns (uint256) { } // always use pool 0 (default) function expectedAPY(address) public override view returns (uint256) { } // Helper function - should never use it on-chain. // Only support IStakingRewards pool. // Return 10000x of APY. _lpTokenUsdcPrice is not used. function expectedAPY(uint256 _poolId, uint256) public override view returns (uint256) { } event ExecuteTransaction(address indexed target, uint value, string signature, bytes data); /** * @dev This is from Timelock contract, the governance should be a Timelock contract before calling this */ function executeTransaction(address target, uint value, string memory signature, bytes memory data) public returns (bytes memory) { } /** * @dev if there is any token stuck we will need governance support to rescue the fund */ function governanceRescueToken(IERC20 _token) external override returns (uint256 balance) { } }
valueVaultMaster.isStrategy(_dest),"not strategy"
321,961
valueVaultMaster.isStrategy(_dest)
"!lpToken"
interface IStrategyV2p1 { function approve(IERC20 _token) external; function approveForSpender(IERC20 _token, address spender) external; // Deposit tokens to a farm to yield more tokens. function deposit(address _vault, uint256 _amount) external; // IStrategy function deposit(uint256 _poolId, uint256 _amount) external; // IStrategyV2 // Claim farming tokens function claim(address _vault) external; // IStrategy function claim(uint256 _poolId) external; // IStrategyV2 // The vault request to harvest the profit function harvest(uint256 _bankPoolId) external; // IStrategy function harvest(uint256 _bankPoolId, uint256 _poolId) external; // IStrategyV2 // Withdraw the principal from a farm. function withdraw(address _vault, uint256 _amount) external; // IStrategy function withdraw(uint256 _poolId, uint256 _amount) external; // IStrategyV2 // Set 0 to disable quota (no limit) function poolQuota(uint256 _poolId) external view returns (uint256); // Use when we want to switch between strategies function forwardToAnotherStrategy(address _dest, uint256 _amount) external returns (uint256); function switchBetweenPoolsByGov(uint256 _sourcePoolId, uint256 _destPoolId, uint256 _amount) external; // IStrategyV2p1 // Source LP token of this strategy function getLpToken() external view returns(address); // Target farming token of this strategy. function getTargetToken(address _vault) external view returns(address); // IStrategy function getTargetToken(uint256 _poolId) external view returns(address); // IStrategyV2 function balanceOf(address _vault) external view returns (uint256); // IStrategy function balanceOf(uint256 _poolId) external view returns (uint256); // IStrategyV2 function pendingReward(address _vault) external view returns (uint256); // IStrategy function pendingReward(uint256 _poolId) external view returns (uint256); // IStrategyV2 function expectedAPY(address _vault) external view returns (uint256); // IStrategy function expectedAPY(uint256 _poolId, uint256 _lpTokenUsdcPrice) external view returns (uint256); // IStrategyV2 function governanceRescueToken(IERC20 _token) external returns (uint256); } interface IOneSplit { function getExpectedReturn( IERC20 fromToken, IERC20 destToken, uint256 amount, uint256 parts, uint256 flags // See constants in IOneSplit.sol ) external view returns( uint256 returnAmount, uint256[] memory distribution ); } interface IUniswapRouter { function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); } interface IStakingRewards { // Views function lastTimeRewardApplicable() external view returns (uint256); function rewardPerToken() external view returns (uint256); function rewardRate() external view returns (uint256); function earned(address account) external view returns (uint256); function getRewardForDuration() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); // Mutative function stake(uint256 amount) external; function withdraw(uint256 amount) external; function getReward() external; function exit() external; } interface ISushiPool { function deposit(uint256 _poolId, uint256 _amount) external; function withdraw(uint256 _poolId, uint256 _amount) external; } interface ISodaPool { function deposit(uint256 _poolId, uint256 _amount) external; function claim(uint256 _poolId) external; function withdraw(uint256 _poolId, uint256 _amount) external; } interface IProfitSharer { function shareProfit() external returns (uint256); } interface IValueVaultBank { function make_profit(uint256 _poolId, uint256 _amount) external; } // This contract is owned by Timelock. // What it does is simple: deposit WETH to pools, and wait for ValueVaultBank's command. // Atm we support 3 pool types: IStakingRewards (golff.finance), ISushiPool (chickenswap.org), ISodaPool (soda.finance) contract WETHMultiPoolStrategy is IStrategyV2p1 { using SafeMath for uint256; address public governance; // will be a Timelock contract address public operator; // can be EOA for non-fund transferring operation uint256 public constant FEE_DENOMINATOR = 10000; IOneSplit public onesplit = IOneSplit(0x50FDA034C0Ce7a8f7EFDAebDA7Aa7cA21CC1267e); IUniswapRouter public unirouter = IUniswapRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); ValueVaultMaster public valueVaultMaster; IERC20 public lpToken; // WETH mapping(address => mapping(address => address[])) public uniswapPaths; // [input -> output] => uniswap_path struct PoolInfo { address vault; IERC20 targetToken; address targetPool; uint256 targetPoolId; // poolId in soda/chicken pool (no use for IStakingRewards pool eg. golff.finance) uint256 minHarvestForTakeProfit; uint8 poolType; // 0: IStakingRewards, 1: ISushiPool, 2: ISodaPool uint256 poolQuota; // set 0 to disable quota (no limit) uint256 balance; } mapping(uint256 => PoolInfo) public poolMap; // poolIndex -> poolInfo uint256 public totalBalance; bool public aggressiveMode; // will try to stake all lpTokens available (be forwarded from bank or from another strategies) uint8[] public poolPreferredIds; // sorted by preference // weth = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" // golffToken = "0x7AfB39837Fd244A651e4F0C5660B4037214D4aDF" // poolMap[0].targetPool = "0x74BCb8b78996F49F46497be185174B2a89191fD6" constructor(ValueVaultMaster _valueVaultMaster, IERC20 _lpToken, bool _aggressiveMode) public { } // targetToken: golffToken = 0x7AfB39837Fd244A651e4F0C5660B4037214D4aDF // targetPool: poolMap[0].targetPool = 0x74BCb8b78996F49F46497be185174B2a89191fD6 function setPoolInfo(uint256 _poolId, address _vault, IERC20 _targetToken, address _targetPool, uint256 _targetPoolId, uint256 _minHarvestForTakeProfit, uint8 _poolType, uint256 _poolQuota) external { } function approve(IERC20 _token) external override { } function approveForSpender(IERC20 _token, address spender) external override { } function setGovernance(address _governance) external { } function setOperator(address _operator) external { } function setPoolPreferredIds(uint8[] memory _poolPreferredIds) public { } function setMinHarvestForTakeProfit(uint256 _poolId, uint256 _minHarvestForTakeProfit) external { } function setPoolQuota(uint256 _poolId, uint256 _poolQuota) external { } // Sometime the balance could be slightly changed (due to the pool, or because we call xxxByGov methods) function setPoolBalance(uint256 _poolId, uint256 _balance) external { } function setTotalBalance(uint256 _totalBalance) external { } function setAggressiveMode(bool _aggressiveMode) external { } function setOnesplit(IOneSplit _onesplit) external { } function setUnirouter(IUniswapRouter _unirouter) external { } /** * @dev See {IStrategy-deposit}. */ function deposit(address _vault, uint256 _amount) public override { } /** * @dev See {IStrategyV2-deposit}. */ function deposit(uint256 _poolId, uint256 _amount) public override { } function _deposit(uint256 _poolId, uint256 _amount) internal { } /** * @dev See {IStrategy-claim}. */ function claim(address _vault) external override { } /** * @dev See {IStrategyV2-claim}. */ function claim(uint256 _poolId) external override { } function _claim(uint256 _poolId) internal { } /** * @dev See {IStrategy-withdraw}. */ function withdraw(address _vault, uint256 _amount) external override { } /** * @dev See {IStrategyV2-withdraw}. */ function withdraw(uint256 _poolId, uint256 _amount) external override { } function _withdraw(uint256 _poolId, uint256 _amount) internal { } function depositByGov(address pool, uint8 _poolType, uint256 _targetPoolId, uint256 _amount) external { } function claimByGov(address pool, uint8 _poolType, uint256 _targetPoolId) external { } function withdrawByGov(address pool, uint8 _poolType, uint256 _targetPoolId, uint256 _amount) external { } function switchBetweenPoolsByGov(uint256 _sourcePoolId, uint256 _destPoolId, uint256 _amount) external override { } /** * @dev See {IStrategyV2-poolQuota} */ function poolQuota(uint256 _poolId) external override view returns (uint256) { } /** * @dev See {IStrategyV2-forwardToAnotherStrategy} */ function forwardToAnotherStrategy(address _dest, uint256 _amount) external override returns (uint256 sent) { require(valueVaultMaster.isVault(msg.sender) || msg.sender == governance, "!vault && !governance"); require(valueVaultMaster.isStrategy(_dest), "not strategy"); require(<FILL_ME>) uint256 lpTokenBal = lpToken.balanceOf(address(this)); sent = (_amount < lpTokenBal) ? _amount : lpTokenBal; lpToken.transfer(_dest, sent); } function setUnirouterPath(address _input, address _output, address [] memory _path) public { } function _swapTokens(address _input, address _output, uint256 _amount) internal { } /** * @dev See {IStrategy-harvest}. */ function harvest(uint256 _bankPoolId) external override { } /** * @dev See {IStrategy-harvest}. */ function harvest(uint256 _bankPoolId, uint256 _poolId) external override { } uint256 public log_golffBal; uint256 public log_wethBal; uint256 public log_yfvGovVault; function _harvest(uint256 _bankPoolId, uint256 _poolId) internal { } /** * @dev See {IStrategyV2-getLpToken}. */ function getLpToken() external view override returns(address) { } /** * @dev See {IStrategy-getTargetToken}. * Always use pool 0 (default). */ function getTargetToken(address) external override view returns(address) { } /** * @dev See {IStrategyV2-getTargetToken}. */ function getTargetToken(uint256 _poolId) external override view returns(address) { } function balanceOf(address _vault) public override view returns (uint256 _balanceOfVault) { } function balanceOf(uint256 _poolId) public override view returns (uint256) { } function pendingReward(address) public override view returns (uint256) { } // Only support IStakingRewards pool function pendingReward(uint256 _poolId) public override view returns (uint256) { } // always use pool 0 (default) function expectedAPY(address) public override view returns (uint256) { } // Helper function - should never use it on-chain. // Only support IStakingRewards pool. // Return 10000x of APY. _lpTokenUsdcPrice is not used. function expectedAPY(uint256 _poolId, uint256) public override view returns (uint256) { } event ExecuteTransaction(address indexed target, uint value, string signature, bytes data); /** * @dev This is from Timelock contract, the governance should be a Timelock contract before calling this */ function executeTransaction(address target, uint value, string memory signature, bytes memory data) public returns (bytes memory) { } /** * @dev if there is any token stuck we will need governance support to rescue the fund */ function governanceRescueToken(IERC20 _token) external override returns (uint256 balance) { } }
IStrategyV2p1(_dest).getLpToken()==address(lpToken),"!lpToken"
321,961
IStrategyV2p1(_dest).getLpToken()==address(lpToken)
"transferFrom() failure. Make sure that your balance is not lower than the allowance you set"
// SPDX-License-Identifier: MIT pragma solidity ^ 0.8.9; interface IERC20 { function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } contract BridgeAssist { address public owner; IERC20 public tokenInterface; modifier restricted { } event Collect(address indexed sender, uint256 amount); event Dispense(address indexed sender, uint256 amount); event TransferOwnership(address indexed previousOwner, address indexed newOwner); function collect(address _sender, uint256 _amount) public restricted returns (bool success) { require(<FILL_ME>) emit Collect(_sender, _amount); return true; } function dispense(address _sender, uint256 _amount) public restricted returns (bool success) { } function transferOwnership(address _newOwner) public restricted { } constructor(IERC20 _tokenInterface) { } }
tokenInterface.transferFrom(_sender,address(this),_amount),"transferFrom() failure. Make sure that your balance is not lower than the allowance you set"
322,056
tokenInterface.transferFrom(_sender,address(this),_amount)
"transfer() failure. Contact contract owner"
// SPDX-License-Identifier: MIT pragma solidity ^ 0.8.9; interface IERC20 { function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } contract BridgeAssist { address public owner; IERC20 public tokenInterface; modifier restricted { } event Collect(address indexed sender, uint256 amount); event Dispense(address indexed sender, uint256 amount); event TransferOwnership(address indexed previousOwner, address indexed newOwner); function collect(address _sender, uint256 _amount) public restricted returns (bool success) { } function dispense(address _sender, uint256 _amount) public restricted returns (bool success) { require(<FILL_ME>) emit Dispense(_sender, _amount); return true; } function transferOwnership(address _newOwner) public restricted { } constructor(IERC20 _tokenInterface) { } }
tokenInterface.transfer(_sender,_amount),"transfer() failure. Contact contract owner"
322,056
tokenInterface.transfer(_sender,_amount)
"Insufficient supply"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract EtherBulls is ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; uint256 public constant MAX_BULLS = 6666; uint256 public constant MAX_PURCHASE = 50; uint256 public constant PRICE_PER_BULL = 60000000000000000 wei; bool private _saleIsActive = false; string private _metaBaseUri = "https://etherbulls.org/static/"; string private _provenance = ""; constructor() ERC721("EtherBulls", "EBULL") { } function mint(uint16 numberOfTokens) public payable { require(saleIsActive(), "Sale is not active"); require(numberOfTokens <= MAX_PURCHASE, "Can only mint 50 tokens per transaction"); require(<FILL_ME>) require(PRICE_PER_BULL.mul(numberOfTokens) == msg.value, "Ether value sent is incorrect"); _mintTokens(numberOfTokens); } /* Owner functions */ /** * Reserve a few bulls e.g. for giveaways */ function reserve(uint16 numberOfTokens) external onlyOwner { } function setSaleIsActive(bool active) external onlyOwner { } function setProvenance(string memory provHash) external onlyOwner { } function setMetaBaseURI(string memory baseURI) external onlyOwner { } function withdraw(uint256 amount) external onlyOwner { } function withdrawAll() external onlyOwner { } /* View functions */ function saleIsActive() public view returns (bool) { } function provenanceHash() public view returns (string memory) { } function tokenURI(uint256 tokenId) override public view returns (string memory) { } /* Internal functions */ function _mintTokens(uint16 numberOfTokens) internal { } function _baseURI() override internal view returns (string memory) { } }
totalSupply().add(numberOfTokens)<=MAX_BULLS,"Insufficient supply"
322,116
totalSupply().add(numberOfTokens)<=MAX_BULLS
"Ether value sent is incorrect"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract EtherBulls is ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; uint256 public constant MAX_BULLS = 6666; uint256 public constant MAX_PURCHASE = 50; uint256 public constant PRICE_PER_BULL = 60000000000000000 wei; bool private _saleIsActive = false; string private _metaBaseUri = "https://etherbulls.org/static/"; string private _provenance = ""; constructor() ERC721("EtherBulls", "EBULL") { } function mint(uint16 numberOfTokens) public payable { require(saleIsActive(), "Sale is not active"); require(numberOfTokens <= MAX_PURCHASE, "Can only mint 50 tokens per transaction"); require(totalSupply().add(numberOfTokens) <= MAX_BULLS, "Insufficient supply"); require(<FILL_ME>) _mintTokens(numberOfTokens); } /* Owner functions */ /** * Reserve a few bulls e.g. for giveaways */ function reserve(uint16 numberOfTokens) external onlyOwner { } function setSaleIsActive(bool active) external onlyOwner { } function setProvenance(string memory provHash) external onlyOwner { } function setMetaBaseURI(string memory baseURI) external onlyOwner { } function withdraw(uint256 amount) external onlyOwner { } function withdrawAll() external onlyOwner { } /* View functions */ function saleIsActive() public view returns (bool) { } function provenanceHash() public view returns (string memory) { } function tokenURI(uint256 tokenId) override public view returns (string memory) { } /* Internal functions */ function _mintTokens(uint16 numberOfTokens) internal { } function _baseURI() override internal view returns (string memory) { } }
PRICE_PER_BULL.mul(numberOfTokens)==msg.value,"Ether value sent is incorrect"
322,116
PRICE_PER_BULL.mul(numberOfTokens)==msg.value
null
pragma solidity ^0.4.19; /** * XC Plugin Contract Interface. */ interface XCPluginInterface { /** * Open the contract service status. */ function start() external; /** * Close the contract service status. */ function stop() external; /** * Get contract service status. * @return contract service status. */ function getStatus() external view returns (bool); /** * Get the current contract platform name. * @return contract platform name. */ function getPlatformName() external view returns (bytes32); /** * Set the current contract administrator. * @param account account of contract administrator. */ function setAdmin(address account) external; /** * Get the current contract administrator. * @return contract administrator. */ function getAdmin() external view returns (address); /** * Get the current token symbol. * @return token symbol. */ function getTokenSymbol() external view returns (bytes32); /** * Add a contract trust caller. * @param caller account of caller. */ function addCaller(address caller) external; /** * Delete a contract trust caller. * @param caller account of caller. */ function deleteCaller(address caller) external; /** * Whether the trust caller exists. * @param caller account of caller. * @return whether exists. */ function existCaller(address caller) external view returns (bool); /** * Get all contract trusted callers. * @return al lcallers. */ function getCallers() external view returns (address[]); /** * Get the trusted platform name. * @return name a platform name. */ function getTrustPlatform() external view returns (bytes32 name); /** * Add the trusted platform public key information. * @param publicKey a public key. */ function addPublicKey(address publicKey) external; /** * Delete the trusted platform public key information. * @param publicKey a public key. */ function deletePublicKey(address publicKey) external; /** * Whether the trusted platform public key information exists. * @param publicKey a public key. */ function existPublicKey(address publicKey) external view returns (bool); /** * Get the count of public key for the trusted platform. * @return count of public key. */ function countOfPublicKey() external view returns (uint); /** * Get the list of public key for the trusted platform. * @return list of public key. */ function publicKeys() external view returns (address[]); /** * Set the weight of a trusted platform. * @param weight weight of platform. */ function setWeight(uint weight) external; /** * Get the weight of a trusted platform. * @return weight of platform. */ function getWeight() external view returns (uint); /** * Initiate and vote on the transaction proposal. * @param fromAccount name of to platform. * @param toAccount account of to platform. * @param value transfer amount. * @param txid transaction id. * @param sig transaction signature. */ function voteProposal(address fromAccount, address toAccount, uint value, string txid, bytes sig) external; /** * Verify that the transaction proposal is valid. * @param fromAccount name of to platform. * @param toAccount account of to platform. * @param value transfer amount. * @param txid transaction id. */ function verifyProposal(address fromAccount, address toAccount, uint value, string txid) external view returns (bool, bool); /** * Commit the transaction proposal. * @param txid transaction id. */ function commitProposal(string txid) external returns (bool); /** * Get the transaction proposal information. * @param txid transaction id. * @return status completion status of proposal. * @return fromAccount account of to platform. * @return toAccount account of to platform. * @return value transfer amount. * @return voters notarial voters. * @return weight The weight value of the completed time. */ function getProposal(string txid) external view returns (bool status, address fromAccount, address toAccount, uint value, address[] voters, uint weight); /** * Delete the transaction proposal information. * @param txid transaction id. */ function deleteProposal(string txid) external; } contract XCPlugin is XCPluginInterface { /** * Contract Administrator * @field status Contract external service status. * @field platformName Current contract platform name. * @field tokenSymbol token Symbol. * @field account Current contract administrator. */ struct Admin { bool status; bytes32 platformName; bytes32 tokenSymbol; address account; string version; } /** * Transaction Proposal * @field status Transaction proposal status(false:pending,true:complete). * @field fromAccount Account of form platform. * @field toAccount Account of to platform. * @field value Transfer amount. * @field tokenSymbol token Symbol. * @field voters Proposers. * @field weight The weight value of the completed time. */ struct Proposal { bool status; address fromAccount; address toAccount; uint value; address[] voters; uint weight; } /** * Trusted Platform * @field status Trusted platform state(false:no trusted,true:trusted). * @field weight weight of platform. * @field publicKeys list of public key. * @field proposals list of proposal. */ struct Platform { bool status; bytes32 name; uint weight; address[] publicKeys; mapping(string => Proposal) proposals; } Admin private admin; address[] private callers; Platform private platform; constructor() public { } /** * TODO Parameters that must be set before compilation * $Init admin.status * $Init admin.platformName * $Init admin.tokenSymbol * $Init admin.account * $Init admin.version * $Init platform.status * $Init platform.name * $Init platform.weight * $Init platform.publicKeys */ function init() internal { } function start() onlyAdmin external { } function stop() onlyAdmin external { } function getStatus() external view returns (bool) { } function getPlatformName() external view returns (bytes32) { } function setAdmin(address account) onlyAdmin nonzeroAddress(account) external { } function getAdmin() external view returns (address) { } function getTokenSymbol() external view returns (bytes32) { } function addCaller(address caller) onlyAdmin nonzeroAddress(caller) external { } function deleteCaller(address caller) onlyAdmin nonzeroAddress(caller) external { } function existCaller(address caller) external view returns (bool) { } function getCallers() external view returns (address[]) { } function getTrustPlatform() external view returns (bytes32 name){ } function setWeight(uint weight) onlyAdmin external { } function getWeight() external view returns (uint) { } function addPublicKey(address publicKey) onlyAdmin nonzeroAddress(publicKey) external { } function deletePublicKey(address publicKey) onlyAdmin nonzeroAddress(publicKey) external { } function existPublicKey(address publicKey) external view returns (bool) { } function countOfPublicKey() external view returns (uint){ } function publicKeys() external view returns (address[]){ } function voteProposal(address fromAccount, address toAccount, uint value, string txid, bytes sig) opened external { bytes32 msgHash = hashMsg(platform.name, fromAccount, admin.platformName, toAccount, value, admin.tokenSymbol, txid,admin.version); address publicKey = recover(msgHash, sig); require(<FILL_ME>) Proposal storage proposal = platform.proposals[txid]; if (proposal.value == 0) { proposal.fromAccount = fromAccount; proposal.toAccount = toAccount; proposal.value = value; } else { require(proposal.fromAccount == fromAccount && proposal.toAccount == toAccount && proposal.value == value); } changeVoters(publicKey, txid); } function verifyProposal(address fromAccount, address toAccount, uint value, string txid) external view returns (bool, bool) { } function commitProposal(string txid) external returns (bool) { } function getProposal(string txid) external view returns (bool status, address fromAccount, address toAccount, uint value, address[] voters, uint weight){ } function deleteProposal(string txid) onlyAdmin external { } /** * ###################### * # private function # * ###################### */ function hashMsg(bytes32 fromPlatform, address fromAccount, bytes32 toPlatform, address toAccount, uint value, bytes32 tokenSymbol, string txid,string version) internal pure returns (bytes32) { } function changeVoters(address publicKey, string txid) internal { } function bytes32ToStr(bytes32 b) internal pure returns (string) { } function uintToStr(uint value, uint base) internal pure returns (string) { } function _existCaller(address caller) internal view returns (bool) { } function _existPublicKey(address publicKey) internal view returns (bool) { } function recover(bytes32 hash, bytes sig) internal pure returns (address) { } modifier onlyAdmin { } modifier nonzeroAddress(address account) { } modifier opened() { } }
_existPublicKey(publicKey)
322,177
_existPublicKey(publicKey)
null
pragma solidity ^0.4.19; /** * XC Plugin Contract Interface. */ interface XCPluginInterface { /** * Open the contract service status. */ function start() external; /** * Close the contract service status. */ function stop() external; /** * Get contract service status. * @return contract service status. */ function getStatus() external view returns (bool); /** * Get the current contract platform name. * @return contract platform name. */ function getPlatformName() external view returns (bytes32); /** * Set the current contract administrator. * @param account account of contract administrator. */ function setAdmin(address account) external; /** * Get the current contract administrator. * @return contract administrator. */ function getAdmin() external view returns (address); /** * Get the current token symbol. * @return token symbol. */ function getTokenSymbol() external view returns (bytes32); /** * Add a contract trust caller. * @param caller account of caller. */ function addCaller(address caller) external; /** * Delete a contract trust caller. * @param caller account of caller. */ function deleteCaller(address caller) external; /** * Whether the trust caller exists. * @param caller account of caller. * @return whether exists. */ function existCaller(address caller) external view returns (bool); /** * Get all contract trusted callers. * @return al lcallers. */ function getCallers() external view returns (address[]); /** * Get the trusted platform name. * @return name a platform name. */ function getTrustPlatform() external view returns (bytes32 name); /** * Add the trusted platform public key information. * @param publicKey a public key. */ function addPublicKey(address publicKey) external; /** * Delete the trusted platform public key information. * @param publicKey a public key. */ function deletePublicKey(address publicKey) external; /** * Whether the trusted platform public key information exists. * @param publicKey a public key. */ function existPublicKey(address publicKey) external view returns (bool); /** * Get the count of public key for the trusted platform. * @return count of public key. */ function countOfPublicKey() external view returns (uint); /** * Get the list of public key for the trusted platform. * @return list of public key. */ function publicKeys() external view returns (address[]); /** * Set the weight of a trusted platform. * @param weight weight of platform. */ function setWeight(uint weight) external; /** * Get the weight of a trusted platform. * @return weight of platform. */ function getWeight() external view returns (uint); /** * Initiate and vote on the transaction proposal. * @param fromAccount name of to platform. * @param toAccount account of to platform. * @param value transfer amount. * @param txid transaction id. * @param sig transaction signature. */ function voteProposal(address fromAccount, address toAccount, uint value, string txid, bytes sig) external; /** * Verify that the transaction proposal is valid. * @param fromAccount name of to platform. * @param toAccount account of to platform. * @param value transfer amount. * @param txid transaction id. */ function verifyProposal(address fromAccount, address toAccount, uint value, string txid) external view returns (bool, bool); /** * Commit the transaction proposal. * @param txid transaction id. */ function commitProposal(string txid) external returns (bool); /** * Get the transaction proposal information. * @param txid transaction id. * @return status completion status of proposal. * @return fromAccount account of to platform. * @return toAccount account of to platform. * @return value transfer amount. * @return voters notarial voters. * @return weight The weight value of the completed time. */ function getProposal(string txid) external view returns (bool status, address fromAccount, address toAccount, uint value, address[] voters, uint weight); /** * Delete the transaction proposal information. * @param txid transaction id. */ function deleteProposal(string txid) external; } contract XCPlugin is XCPluginInterface { /** * Contract Administrator * @field status Contract external service status. * @field platformName Current contract platform name. * @field tokenSymbol token Symbol. * @field account Current contract administrator. */ struct Admin { bool status; bytes32 platformName; bytes32 tokenSymbol; address account; string version; } /** * Transaction Proposal * @field status Transaction proposal status(false:pending,true:complete). * @field fromAccount Account of form platform. * @field toAccount Account of to platform. * @field value Transfer amount. * @field tokenSymbol token Symbol. * @field voters Proposers. * @field weight The weight value of the completed time. */ struct Proposal { bool status; address fromAccount; address toAccount; uint value; address[] voters; uint weight; } /** * Trusted Platform * @field status Trusted platform state(false:no trusted,true:trusted). * @field weight weight of platform. * @field publicKeys list of public key. * @field proposals list of proposal. */ struct Platform { bool status; bytes32 name; uint weight; address[] publicKeys; mapping(string => Proposal) proposals; } Admin private admin; address[] private callers; Platform private platform; constructor() public { } /** * TODO Parameters that must be set before compilation * $Init admin.status * $Init admin.platformName * $Init admin.tokenSymbol * $Init admin.account * $Init admin.version * $Init platform.status * $Init platform.name * $Init platform.weight * $Init platform.publicKeys */ function init() internal { } function start() onlyAdmin external { } function stop() onlyAdmin external { } function getStatus() external view returns (bool) { } function getPlatformName() external view returns (bytes32) { } function setAdmin(address account) onlyAdmin nonzeroAddress(account) external { } function getAdmin() external view returns (address) { } function getTokenSymbol() external view returns (bytes32) { } function addCaller(address caller) onlyAdmin nonzeroAddress(caller) external { } function deleteCaller(address caller) onlyAdmin nonzeroAddress(caller) external { } function existCaller(address caller) external view returns (bool) { } function getCallers() external view returns (address[]) { } function getTrustPlatform() external view returns (bytes32 name){ } function setWeight(uint weight) onlyAdmin external { } function getWeight() external view returns (uint) { } function addPublicKey(address publicKey) onlyAdmin nonzeroAddress(publicKey) external { } function deletePublicKey(address publicKey) onlyAdmin nonzeroAddress(publicKey) external { } function existPublicKey(address publicKey) external view returns (bool) { } function countOfPublicKey() external view returns (uint){ } function publicKeys() external view returns (address[]){ } function voteProposal(address fromAccount, address toAccount, uint value, string txid, bytes sig) opened external { } function verifyProposal(address fromAccount, address toAccount, uint value, string txid) external view returns (bool, bool) { } function commitProposal(string txid) external returns (bool) { require(<FILL_ME>) require(!platform.proposals[txid].status); platform.proposals[txid].status = true; platform.proposals[txid].weight = platform.proposals[txid].voters.length; return true; } function getProposal(string txid) external view returns (bool status, address fromAccount, address toAccount, uint value, address[] voters, uint weight){ } function deleteProposal(string txid) onlyAdmin external { } /** * ###################### * # private function # * ###################### */ function hashMsg(bytes32 fromPlatform, address fromAccount, bytes32 toPlatform, address toAccount, uint value, bytes32 tokenSymbol, string txid,string version) internal pure returns (bytes32) { } function changeVoters(address publicKey, string txid) internal { } function bytes32ToStr(bytes32 b) internal pure returns (string) { } function uintToStr(uint value, uint base) internal pure returns (string) { } function _existCaller(address caller) internal view returns (bool) { } function _existPublicKey(address publicKey) internal view returns (bool) { } function recover(bytes32 hash, bytes sig) internal pure returns (address) { } modifier onlyAdmin { } modifier nonzeroAddress(address account) { } modifier opened() { } }
(admin.status&&_existCaller(msg.sender))||msg.sender==admin.account
322,177
(admin.status&&_existCaller(msg.sender))||msg.sender==admin.account
null
pragma solidity ^0.4.19; /** * XC Plugin Contract Interface. */ interface XCPluginInterface { /** * Open the contract service status. */ function start() external; /** * Close the contract service status. */ function stop() external; /** * Get contract service status. * @return contract service status. */ function getStatus() external view returns (bool); /** * Get the current contract platform name. * @return contract platform name. */ function getPlatformName() external view returns (bytes32); /** * Set the current contract administrator. * @param account account of contract administrator. */ function setAdmin(address account) external; /** * Get the current contract administrator. * @return contract administrator. */ function getAdmin() external view returns (address); /** * Get the current token symbol. * @return token symbol. */ function getTokenSymbol() external view returns (bytes32); /** * Add a contract trust caller. * @param caller account of caller. */ function addCaller(address caller) external; /** * Delete a contract trust caller. * @param caller account of caller. */ function deleteCaller(address caller) external; /** * Whether the trust caller exists. * @param caller account of caller. * @return whether exists. */ function existCaller(address caller) external view returns (bool); /** * Get all contract trusted callers. * @return al lcallers. */ function getCallers() external view returns (address[]); /** * Get the trusted platform name. * @return name a platform name. */ function getTrustPlatform() external view returns (bytes32 name); /** * Add the trusted platform public key information. * @param publicKey a public key. */ function addPublicKey(address publicKey) external; /** * Delete the trusted platform public key information. * @param publicKey a public key. */ function deletePublicKey(address publicKey) external; /** * Whether the trusted platform public key information exists. * @param publicKey a public key. */ function existPublicKey(address publicKey) external view returns (bool); /** * Get the count of public key for the trusted platform. * @return count of public key. */ function countOfPublicKey() external view returns (uint); /** * Get the list of public key for the trusted platform. * @return list of public key. */ function publicKeys() external view returns (address[]); /** * Set the weight of a trusted platform. * @param weight weight of platform. */ function setWeight(uint weight) external; /** * Get the weight of a trusted platform. * @return weight of platform. */ function getWeight() external view returns (uint); /** * Initiate and vote on the transaction proposal. * @param fromAccount name of to platform. * @param toAccount account of to platform. * @param value transfer amount. * @param txid transaction id. * @param sig transaction signature. */ function voteProposal(address fromAccount, address toAccount, uint value, string txid, bytes sig) external; /** * Verify that the transaction proposal is valid. * @param fromAccount name of to platform. * @param toAccount account of to platform. * @param value transfer amount. * @param txid transaction id. */ function verifyProposal(address fromAccount, address toAccount, uint value, string txid) external view returns (bool, bool); /** * Commit the transaction proposal. * @param txid transaction id. */ function commitProposal(string txid) external returns (bool); /** * Get the transaction proposal information. * @param txid transaction id. * @return status completion status of proposal. * @return fromAccount account of to platform. * @return toAccount account of to platform. * @return value transfer amount. * @return voters notarial voters. * @return weight The weight value of the completed time. */ function getProposal(string txid) external view returns (bool status, address fromAccount, address toAccount, uint value, address[] voters, uint weight); /** * Delete the transaction proposal information. * @param txid transaction id. */ function deleteProposal(string txid) external; } contract XCPlugin is XCPluginInterface { /** * Contract Administrator * @field status Contract external service status. * @field platformName Current contract platform name. * @field tokenSymbol token Symbol. * @field account Current contract administrator. */ struct Admin { bool status; bytes32 platformName; bytes32 tokenSymbol; address account; string version; } /** * Transaction Proposal * @field status Transaction proposal status(false:pending,true:complete). * @field fromAccount Account of form platform. * @field toAccount Account of to platform. * @field value Transfer amount. * @field tokenSymbol token Symbol. * @field voters Proposers. * @field weight The weight value of the completed time. */ struct Proposal { bool status; address fromAccount; address toAccount; uint value; address[] voters; uint weight; } /** * Trusted Platform * @field status Trusted platform state(false:no trusted,true:trusted). * @field weight weight of platform. * @field publicKeys list of public key. * @field proposals list of proposal. */ struct Platform { bool status; bytes32 name; uint weight; address[] publicKeys; mapping(string => Proposal) proposals; } Admin private admin; address[] private callers; Platform private platform; constructor() public { } /** * TODO Parameters that must be set before compilation * $Init admin.status * $Init admin.platformName * $Init admin.tokenSymbol * $Init admin.account * $Init admin.version * $Init platform.status * $Init platform.name * $Init platform.weight * $Init platform.publicKeys */ function init() internal { } function start() onlyAdmin external { } function stop() onlyAdmin external { } function getStatus() external view returns (bool) { } function getPlatformName() external view returns (bytes32) { } function setAdmin(address account) onlyAdmin nonzeroAddress(account) external { } function getAdmin() external view returns (address) { } function getTokenSymbol() external view returns (bytes32) { } function addCaller(address caller) onlyAdmin nonzeroAddress(caller) external { } function deleteCaller(address caller) onlyAdmin nonzeroAddress(caller) external { } function existCaller(address caller) external view returns (bool) { } function getCallers() external view returns (address[]) { } function getTrustPlatform() external view returns (bytes32 name){ } function setWeight(uint weight) onlyAdmin external { } function getWeight() external view returns (uint) { } function addPublicKey(address publicKey) onlyAdmin nonzeroAddress(publicKey) external { } function deletePublicKey(address publicKey) onlyAdmin nonzeroAddress(publicKey) external { } function existPublicKey(address publicKey) external view returns (bool) { } function countOfPublicKey() external view returns (uint){ } function publicKeys() external view returns (address[]){ } function voteProposal(address fromAccount, address toAccount, uint value, string txid, bytes sig) opened external { } function verifyProposal(address fromAccount, address toAccount, uint value, string txid) external view returns (bool, bool) { } function commitProposal(string txid) external returns (bool) { require((admin.status &&_existCaller(msg.sender)) || msg.sender == admin.account); require(<FILL_ME>) platform.proposals[txid].status = true; platform.proposals[txid].weight = platform.proposals[txid].voters.length; return true; } function getProposal(string txid) external view returns (bool status, address fromAccount, address toAccount, uint value, address[] voters, uint weight){ } function deleteProposal(string txid) onlyAdmin external { } /** * ###################### * # private function # * ###################### */ function hashMsg(bytes32 fromPlatform, address fromAccount, bytes32 toPlatform, address toAccount, uint value, bytes32 tokenSymbol, string txid,string version) internal pure returns (bytes32) { } function changeVoters(address publicKey, string txid) internal { } function bytes32ToStr(bytes32 b) internal pure returns (string) { } function uintToStr(uint value, uint base) internal pure returns (string) { } function _existCaller(address caller) internal view returns (bool) { } function _existPublicKey(address publicKey) internal view returns (bool) { } function recover(bytes32 hash, bytes sig) internal pure returns (address) { } modifier onlyAdmin { } modifier nonzeroAddress(address account) { } modifier opened() { } }
!platform.proposals[txid].status
322,177
!platform.proposals[txid].status
null
pragma solidity ^0.4.19; /** * XC Plugin Contract Interface. */ interface XCPluginInterface { /** * Open the contract service status. */ function start() external; /** * Close the contract service status. */ function stop() external; /** * Get contract service status. * @return contract service status. */ function getStatus() external view returns (bool); /** * Get the current contract platform name. * @return contract platform name. */ function getPlatformName() external view returns (bytes32); /** * Set the current contract administrator. * @param account account of contract administrator. */ function setAdmin(address account) external; /** * Get the current contract administrator. * @return contract administrator. */ function getAdmin() external view returns (address); /** * Get the current token symbol. * @return token symbol. */ function getTokenSymbol() external view returns (bytes32); /** * Add a contract trust caller. * @param caller account of caller. */ function addCaller(address caller) external; /** * Delete a contract trust caller. * @param caller account of caller. */ function deleteCaller(address caller) external; /** * Whether the trust caller exists. * @param caller account of caller. * @return whether exists. */ function existCaller(address caller) external view returns (bool); /** * Get all contract trusted callers. * @return al lcallers. */ function getCallers() external view returns (address[]); /** * Get the trusted platform name. * @return name a platform name. */ function getTrustPlatform() external view returns (bytes32 name); /** * Add the trusted platform public key information. * @param publicKey a public key. */ function addPublicKey(address publicKey) external; /** * Delete the trusted platform public key information. * @param publicKey a public key. */ function deletePublicKey(address publicKey) external; /** * Whether the trusted platform public key information exists. * @param publicKey a public key. */ function existPublicKey(address publicKey) external view returns (bool); /** * Get the count of public key for the trusted platform. * @return count of public key. */ function countOfPublicKey() external view returns (uint); /** * Get the list of public key for the trusted platform. * @return list of public key. */ function publicKeys() external view returns (address[]); /** * Set the weight of a trusted platform. * @param weight weight of platform. */ function setWeight(uint weight) external; /** * Get the weight of a trusted platform. * @return weight of platform. */ function getWeight() external view returns (uint); /** * Initiate and vote on the transaction proposal. * @param fromAccount name of to platform. * @param toAccount account of to platform. * @param value transfer amount. * @param txid transaction id. * @param sig transaction signature. */ function voteProposal(address fromAccount, address toAccount, uint value, string txid, bytes sig) external; /** * Verify that the transaction proposal is valid. * @param fromAccount name of to platform. * @param toAccount account of to platform. * @param value transfer amount. * @param txid transaction id. */ function verifyProposal(address fromAccount, address toAccount, uint value, string txid) external view returns (bool, bool); /** * Commit the transaction proposal. * @param txid transaction id. */ function commitProposal(string txid) external returns (bool); /** * Get the transaction proposal information. * @param txid transaction id. * @return status completion status of proposal. * @return fromAccount account of to platform. * @return toAccount account of to platform. * @return value transfer amount. * @return voters notarial voters. * @return weight The weight value of the completed time. */ function getProposal(string txid) external view returns (bool status, address fromAccount, address toAccount, uint value, address[] voters, uint weight); /** * Delete the transaction proposal information. * @param txid transaction id. */ function deleteProposal(string txid) external; } contract XCPlugin is XCPluginInterface { /** * Contract Administrator * @field status Contract external service status. * @field platformName Current contract platform name. * @field tokenSymbol token Symbol. * @field account Current contract administrator. */ struct Admin { bool status; bytes32 platformName; bytes32 tokenSymbol; address account; string version; } /** * Transaction Proposal * @field status Transaction proposal status(false:pending,true:complete). * @field fromAccount Account of form platform. * @field toAccount Account of to platform. * @field value Transfer amount. * @field tokenSymbol token Symbol. * @field voters Proposers. * @field weight The weight value of the completed time. */ struct Proposal { bool status; address fromAccount; address toAccount; uint value; address[] voters; uint weight; } /** * Trusted Platform * @field status Trusted platform state(false:no trusted,true:trusted). * @field weight weight of platform. * @field publicKeys list of public key. * @field proposals list of proposal. */ struct Platform { bool status; bytes32 name; uint weight; address[] publicKeys; mapping(string => Proposal) proposals; } Admin private admin; address[] private callers; Platform private platform; constructor() public { } /** * TODO Parameters that must be set before compilation * $Init admin.status * $Init admin.platformName * $Init admin.tokenSymbol * $Init admin.account * $Init admin.version * $Init platform.status * $Init platform.name * $Init platform.weight * $Init platform.publicKeys */ function init() internal { } function start() onlyAdmin external { } function stop() onlyAdmin external { } function getStatus() external view returns (bool) { } function getPlatformName() external view returns (bytes32) { } function setAdmin(address account) onlyAdmin nonzeroAddress(account) external { } function getAdmin() external view returns (address) { } function getTokenSymbol() external view returns (bytes32) { } function addCaller(address caller) onlyAdmin nonzeroAddress(caller) external { } function deleteCaller(address caller) onlyAdmin nonzeroAddress(caller) external { } function existCaller(address caller) external view returns (bool) { } function getCallers() external view returns (address[]) { } function getTrustPlatform() external view returns (bytes32 name){ } function setWeight(uint weight) onlyAdmin external { } function getWeight() external view returns (uint) { } function addPublicKey(address publicKey) onlyAdmin nonzeroAddress(publicKey) external { } function deletePublicKey(address publicKey) onlyAdmin nonzeroAddress(publicKey) external { } function existPublicKey(address publicKey) external view returns (bool) { } function countOfPublicKey() external view returns (uint){ } function publicKeys() external view returns (address[]){ } function voteProposal(address fromAccount, address toAccount, uint value, string txid, bytes sig) opened external { } function verifyProposal(address fromAccount, address toAccount, uint value, string txid) external view returns (bool, bool) { } function commitProposal(string txid) external returns (bool) { } function getProposal(string txid) external view returns (bool status, address fromAccount, address toAccount, uint value, address[] voters, uint weight){ } function deleteProposal(string txid) onlyAdmin external { } /** * ###################### * # private function # * ###################### */ function hashMsg(bytes32 fromPlatform, address fromAccount, bytes32 toPlatform, address toAccount, uint value, bytes32 tokenSymbol, string txid,string version) internal pure returns (bytes32) { } function changeVoters(address publicKey, string txid) internal { } function bytes32ToStr(bytes32 b) internal pure returns (string) { } function uintToStr(uint value, uint base) internal pure returns (string) { } function _existCaller(address caller) internal view returns (bool) { } function _existPublicKey(address publicKey) internal view returns (bool) { } function recover(bytes32 hash, bytes sig) internal pure returns (address) { } modifier onlyAdmin { } modifier nonzeroAddress(address account) { } modifier opened() { require(<FILL_ME>) _; } }
admin.status
322,177
admin.status
"max single trade 1% of current total supply"
/* ABN = AutoBurn token Deflationary. Low gas. Made simple. This token has decreasing supply and increasing price achieved by 3% burn and 3% added to liquidity on each transaction except wallet to wallet transactions (non-contract). This is done by direct balance adjustments which are much cheaper than calling external methods for sell, add liquidity and mint LP tokens functions on each trade. The pool is verified to stay in sync despite no additional LP tokens are minted or burned, proportionally rewarding any additional liquidity providers. Price is driven up every day by burning 3% of ABN from liquidity pool while keeping WETH there intact. Wallet and other pool balances are not daily burn, only WETH-ABN pool is affected. Net size of a single transaction is limited to 1% of available supply, no limit on balances and no limit for wallet to wallet transactions (non-contract). If you get "error:undefined" on swap or "confirm" button is dead: Check slippage, increase to 7%. Set exact amount for ABN, not for the counterparty. Check token available supply, 1% bought at once may be later sold in 2 or more transactions if some supply was burn in meantime. Tip to remove liquidity: Save one transaction fee by removing liquidity to WETH instead of ETH. Disclaimer: This is an experimental project. DYOR and read contract code thoroughly before trading. Check liquidity distribution and lock duration. Deployer has no liability, direct or indirectly implied, of any loss or damage caused by bugs in code or EVM, Solidity vulnerabilities, bot activity or malicious behavior of token holders. */ //SPDX-License-Identifier: UNLICENSED // License: Parts different from open-zeppelin implementations are copyrighted. Any clones should send a 0.3% of tx value to deployer of this contract provided the tx is not considered feeless here. pragma solidity =0.7.6; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } 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); function increaseAllowance(address spender, uint256 addedValue) external returns (bool); function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); function burn(uint256 amount) external returns (bool); function burnFrom(address account, uint256 amount) external returns (bool); } interface UNIV2Sync { function sync() external; } interface IWETH { function deposit() external payable; function balanceOf(address _owner) external returns (uint256); function transfer(address _to, uint256 _value) external returns (bool); function withdraw(uint256 _amount) external; } 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) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } /* * An {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract DeflationaryERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _deployer; uint256 public lastPoolBurnTime; uint256 public epoch; // Transaction Fees: uint8 public txFee = 6; // total in %, half will burn and half adds to liquidity address public feeDistributor; // fees are sent to fee distributor = uniswap pool address public wethContract; // wrap ethers sent to contract to increase liquidity constructor (string memory __name, string memory __symbol) { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address owner, address spender) public view virtual override returns (uint256) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual override returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual override returns (bool) { } function countdownPoolBurnDue() public view returns (uint256) { } //Important: Due to checks made during swap process avoid calling this method inside a swap transaction. function PoolBurnAndSync() public virtual returns (bool) { } // assign a new pool address, enforce deflationary features and renounce ownership function setFeeDistributor(address _distributor) public { } // to caclulate the amounts for recipient and distributer after fees have been applied function calculateAmountsAfterFee( address sender, address recipient, uint256 amount ) public view returns (uint256 transferToAmount, uint256 transferToFeeDistributorAmount, uint256 burnAmount) { } function burnFrom(address account,uint256 amount) public virtual override returns (bool) { } function burn(uint256 amount) public virtual override returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount >= 100, "amount below 100 base units, avoiding underflows"); _beforeTokenTransfer(sender, recipient, amount); // calculate fee: (uint256 transferToAmount, uint256 transferToFeeDistributorAmount,uint256 burnAmount) = calculateAmountsAfterFee(sender, recipient, amount); // subtract net amount, keep amount for fees to be subtracted later _balances[sender] = _balances[sender].sub(transferToAmount, "ERC20: transfer amount exceeds balance"); // update recipients balance: _balances[recipient] = _balances[recipient].add(transferToAmount); emit Transfer(sender, recipient, transferToAmount); // update pool balance, limit max tx once pool contract is known and funded if(transferToFeeDistributorAmount > 0 && feeDistributor != address(0)){ require(<FILL_ME>) _burn(sender,burnAmount); _balances[sender] = _balances[sender].sub(transferToFeeDistributorAmount, "ERC20: fee transfer amount exceeds remaining balance"); _balances[feeDistributor] = _balances[feeDistributor].add(transferToFeeDistributorAmount); emit Transfer(sender, feeDistributor, transferToFeeDistributorAmount); //Sync is made automatically at the end of swap transaction, doing it earlier reverts the swap } else { //Since there may be relayers like 1inch allow sync on feeless txs only PoolBurnAndSync(); } } function _mint(address account, uint256 amount) internal virtual { } function _burn(address account, uint256 amount) internal virtual { } function _approve(address owner, address spender, uint256 amount) internal virtual { } /** * Hook that is called before any transfer of tokens. This includes minting and burning. * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } //Before sennding ether to this contract ensure gas cost is estimated properly receive() external payable { } } /** * ABN is a token designed to implement pool inflation and supply deflation using simplified way of transferring or burning * fees manually and then forcing Uniswap pool to resync balances instead of costly sell, add liquidity and mint LP tokens. * The ABN Token itself is just a standard ERC20, with: * No minting. * Public burning. * Transfer fee applied. Fixed to 3% into pool + 3% burn. */ contract AutoBurnToken is DeflationaryERC20 { constructor() DeflationaryERC20("AutoBurn", "ABN") { } }
_totalSupply.div(transferToAmount)>=99,"max single trade 1% of current total supply"
322,255
_totalSupply.div(transferToAmount)>=99
"_serviceName in invalid"
/** * @dev The NokuFlatPlan contract implements a flat pricing plan, manageable by the contract owner. */ contract NokuFlatPlan is NokuPricingPlan, Ownable { using SafeMath for uint256; event LogNokuFlatPlanCreated( address indexed caller, uint256 indexed paymentInterval, uint256 indexed flatFee, address nokuMasterToken, address tokenBurner ); event LogPaymentIntervalChanged(address indexed caller, uint256 indexed paymentInterval); event LogFlatFeeChanged(address indexed caller, uint256 indexed flatFee); // The validity time interval of the flat subscription. uint256 public paymentInterval; // When the next payment is required as timestamp in seconds from Unix epoch uint256 public nextPaymentTime; // The fee amount expressed in NOKU tokens. uint256 public flatFee; // The NOKU utility token used for paying fee address public nokuMasterToken; // The contract responsible for burning the NOKU tokens paid as service fee address public tokenBurner; constructor( uint256 _paymentInterval, uint256 _flatFee, address _nokuMasterToken, address _tokenBurner ) public { } function setPaymentInterval(uint256 _paymentInterval) public onlyOwner { } function setFlatFee(uint256 _flatFee) public onlyOwner { } function isValidService(bytes32 _serviceName) public pure returns(bool isValid) { } /** * @dev Defines the operation by checking if flat fee has been paid or not. */ function payFee(bytes32 _serviceName, uint256 _multiplier, address _client) public returns(bool paid) { require(<FILL_ME>) require(_multiplier != 0, "_multiplier is zero"); require(_client != 0, "_client is zero"); require(block.timestamp < nextPaymentTime); return true; } function usageFee(bytes32 /*_serviceName*/, uint256 /*_multiplier*/) public view returns(uint fee) { } function paySubscription(address _client) public returns(bool paid) { } }
isValidService(_serviceName),"_serviceName in invalid"
322,308
isValidService(_serviceName)
"INVALID_SIG_S"
// SPDX-License-Identifier: LGPL-3.0-or-later pragma solidity 0.7.6; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./interfaces/ITokenWrapper.sol"; import "./interfaces/IDAI.sol"; /** * @title DAITokenWrapper * @notice Contract for wrapping call to DAI token permit function because the DAI token permit function has a different signature from other tokens with which the protocol integrates */ contract DAITokenWrapper is ITokenWrapper, Ownable, ReentrancyGuard { address private daiTokenAddress; constructor( address _daiTokenAddress ) notZeroAddress(_daiTokenAddress) { } /** * @notice Checking if a non-zero address is provided, otherwise reverts. */ modifier notZeroAddress(address _tokenAddress) { } /** * @notice Conforms to EIP-2612. Calls permit on token, which may or may not have a permit function that conforms to EIP-2612 * @param _tokenOwner Address of the token owner who is approving tokens to be transferred by spender * @param _spender Address of the party who is transferring tokens on owner's behalf * @param _deadline Time after which this permission to transfer is no longer valid * @param _v Part of the owner's signatue * @param _r Part of the owner's signatue * @param _s Part of the owner's signatue */ function permit( address _tokenOwner, address _spender, uint256, uint256 _deadline, uint8 _v, bytes32 _r, bytes32 _s ) external override nonReentrant notZeroAddress(_tokenOwner) notZeroAddress(_spender) { // Ensure signature is unique // See https://github.com/OpenZeppelin/openzeppelin-contracts/blob/04695aecbd4d17dddfd55de766d10e3805d6f42f/contracts/cryptography/ECDSA.sol#L5 require(<FILL_ME>) require(_v == 27 || _v == 28, "INVALID_SIG_V"); uint nonce = IDAI(daiTokenAddress).nonces(_tokenOwner); IDAI(daiTokenAddress).permit(_tokenOwner, _spender, nonce, _deadline, true, _v, _r, _s); emit LogPermitCalledOnToken(daiTokenAddress, _tokenOwner, _spender, 0); } /** * @notice Set the address of the wrapper contract for the token. The wrapper is used to, for instance, allow the Boson Protocol functions that use permit functionality to work in a uniform way. * @param _tokenAddress Address of the token which will be updated. */ function setTokenAddress(address _tokenAddress) external override onlyOwner notZeroAddress(_tokenAddress) { } /** * @notice Get the address of the token wrapped by this contract * @return Address of the token wrapper contract */ function getTokenAddress() external view override returns (address) { } }
uint256(_s)<=0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0,"INVALID_SIG_S"
322,384
uint256(_s)<=0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0
null
contract HEXCrowdSale is Ownerable, SafeMath, ATXICOToken { uint256 public maxHEXCap; uint256 public minHEXCap; uint256 public ethRate; uint256 public atxRate; /* uint256 public ethFunded; uint256 public atxFunded; */ address[] public ethInvestors; mapping (address => uint256) public ethInvestorFunds; address[] public atxInvestors; mapping (address => uint256) public atxInvestorFunds; address[] public atxChangeAddrs; mapping (address => uint256) public atxChanges; KYC public kyc; HEX public hexToken; address public hexControllerAddr; ERC20Basic public atxToken; address public atxControllerAddr; //Vault public vault; address[] public memWallets; address[] public vaultWallets; struct Period { uint256 startTime; uint256 endTime; uint256 bonus; // used to calculate rate with bonus. ragne 0 ~ 15 (0% ~ 15%) } Period[] public periods; bool public isInitialized; bool public isFinalized; function init ( address _kyc, address _token, address _hexController, address _atxToken, address _atxController, // address _vault, address[] _memWallets, address[] _vaultWallets, uint256 _ethRate, uint256 _atxRate, uint256 _maxHEXCap, uint256 _minHEXCap ) public onlyOwner { } function () public payable { } function ethBuy() internal { // check validity require(msg.value >= 50e18); // minimum fund require(isInitialized); require(!isFinalized); require(msg.sender != 0x0 && msg.value != 0x0); require(<FILL_ME>) require(maxReached() == false); require(onSale()); uint256 fundingAmt = msg.value; uint256 bonus = getPeriodBonus(); uint256 currTotalSupply = hexToken.totalSupply(); uint256 fundableHEXRoom = sub(maxHEXCap, currTotalSupply); uint256 reqedHex = eth2HexWithBonus(fundingAmt, bonus); uint256 toFund; uint256 reFund; if(reqedHex > fundableHEXRoom) { reqedHex = fundableHEXRoom; toFund = hex2EthWithBonus(reqedHex, bonus); //div(fundableHEXRoom, mul(ethRate, add(1, div(bonus,100)))); reFund = sub(fundingAmt, toFund); // toFund 둜 κ³„μ‚°ν•œ HEX μˆ˜λŸ‰μ΄ fundableHEXRoom κ³Ό κ°™μ•„μ•Ό ν•œλ‹€. // κ·ΈλŸ¬λ‚˜ μ†Œμˆ˜μ  문제둜 μΈν•˜μ—¬ μ •ν™•νžˆ κ°™μ•„μ§€μ§€ μ•Šμ„ κ²½μš°κ°€ λ°œμƒν•œλ‹€. //require(reqedHex == eth2HexWithBonus(toFund, bonus) ); } else { toFund = fundingAmt; reFund = 0; } require(fundingAmt >= toFund); require(toFund > 0); // pushInvestorList if(ethInvestorFunds[msg.sender] == 0x0) { ethInvestors.push(msg.sender); } ethInvestorFunds[msg.sender] = add(ethInvestorFunds[msg.sender], toFund); /* ethFunded = add(ethFunded, toFund); */ hexToken.generateTokens(msg.sender, reqedHex); if(reFund > 0) { msg.sender.transfer(reFund); } //vault.ethDeposit.value(toFund)(msg.sender); emit SaleToken(msg.sender, msg.sender, 0, toFund, reqedHex); } // // ATXICOToken λ©”μ†Œλ“œ κ΅¬ν˜„. // μ™ΈλΆ€μ—μ„œ 이 ν•¨μˆ˜κ°€ λ°”λ‘œ 호좜되면 코인 생성됨. // λ°˜λ“œμ‹œ ATXController μ—μ„œλ§Œ 호좜 ν—ˆμš© ν•  것. // function atxBuy(address _from, uint256 _amount) public returns(bool) { } function finish() public onlyOwner { } function maxReached() public view returns (bool) { } function minReached() public view returns (bool) { } function addPeriod(uint256 _start, uint256 _end) public onlyOwner { } function getPeriodBonus() public view returns (uint256) { } function eth2HexWithBonus(uint256 _eth, uint256 bonus) public view returns(uint256) { } function hex2EthWithBonus(uint256 _hex, uint256 bonus) public view returns(uint256) { } function atx2HexWithBonus(uint256 _atx, uint256 bonus) public view returns(uint256) { } function hex2AtxWithBonus(uint256 _hex, uint256 bonus) public view returns(uint256) { } function onSale() public view returns (bool) { } function atxChangeAddrCount() public view returns(uint256) { } function returnATXChanges() public onlyOwner { } // // Safety Methods function claimTokens(address _claimToken) public onlyOwner { } // // Event event SaleToken(address indexed _sender, address indexed _investor, uint256 indexed _fundType, uint256 _toFund, uint256 _hexTokens); event ClaimedTokens(address indexed _claimToken, address indexed owner, uint256 balance); event SaleFinished(); }
kyc.registeredAddress(msg.sender)
322,414
kyc.registeredAddress(msg.sender)
null
contract HEXCrowdSale is Ownerable, SafeMath, ATXICOToken { uint256 public maxHEXCap; uint256 public minHEXCap; uint256 public ethRate; uint256 public atxRate; /* uint256 public ethFunded; uint256 public atxFunded; */ address[] public ethInvestors; mapping (address => uint256) public ethInvestorFunds; address[] public atxInvestors; mapping (address => uint256) public atxInvestorFunds; address[] public atxChangeAddrs; mapping (address => uint256) public atxChanges; KYC public kyc; HEX public hexToken; address public hexControllerAddr; ERC20Basic public atxToken; address public atxControllerAddr; //Vault public vault; address[] public memWallets; address[] public vaultWallets; struct Period { uint256 startTime; uint256 endTime; uint256 bonus; // used to calculate rate with bonus. ragne 0 ~ 15 (0% ~ 15%) } Period[] public periods; bool public isInitialized; bool public isFinalized; function init ( address _kyc, address _token, address _hexController, address _atxToken, address _atxController, // address _vault, address[] _memWallets, address[] _vaultWallets, uint256 _ethRate, uint256 _atxRate, uint256 _maxHEXCap, uint256 _minHEXCap ) public onlyOwner { } function () public payable { } function ethBuy() internal { // check validity require(msg.value >= 50e18); // minimum fund require(isInitialized); require(!isFinalized); require(msg.sender != 0x0 && msg.value != 0x0); require(kyc.registeredAddress(msg.sender)); require(<FILL_ME>) require(onSale()); uint256 fundingAmt = msg.value; uint256 bonus = getPeriodBonus(); uint256 currTotalSupply = hexToken.totalSupply(); uint256 fundableHEXRoom = sub(maxHEXCap, currTotalSupply); uint256 reqedHex = eth2HexWithBonus(fundingAmt, bonus); uint256 toFund; uint256 reFund; if(reqedHex > fundableHEXRoom) { reqedHex = fundableHEXRoom; toFund = hex2EthWithBonus(reqedHex, bonus); //div(fundableHEXRoom, mul(ethRate, add(1, div(bonus,100)))); reFund = sub(fundingAmt, toFund); // toFund 둜 κ³„μ‚°ν•œ HEX μˆ˜λŸ‰μ΄ fundableHEXRoom κ³Ό κ°™μ•„μ•Ό ν•œλ‹€. // κ·ΈλŸ¬λ‚˜ μ†Œμˆ˜μ  문제둜 μΈν•˜μ—¬ μ •ν™•νžˆ κ°™μ•„μ§€μ§€ μ•Šμ„ κ²½μš°κ°€ λ°œμƒν•œλ‹€. //require(reqedHex == eth2HexWithBonus(toFund, bonus) ); } else { toFund = fundingAmt; reFund = 0; } require(fundingAmt >= toFund); require(toFund > 0); // pushInvestorList if(ethInvestorFunds[msg.sender] == 0x0) { ethInvestors.push(msg.sender); } ethInvestorFunds[msg.sender] = add(ethInvestorFunds[msg.sender], toFund); /* ethFunded = add(ethFunded, toFund); */ hexToken.generateTokens(msg.sender, reqedHex); if(reFund > 0) { msg.sender.transfer(reFund); } //vault.ethDeposit.value(toFund)(msg.sender); emit SaleToken(msg.sender, msg.sender, 0, toFund, reqedHex); } // // ATXICOToken λ©”μ†Œλ“œ κ΅¬ν˜„. // μ™ΈλΆ€μ—μ„œ 이 ν•¨μˆ˜κ°€ λ°”λ‘œ 호좜되면 코인 생성됨. // λ°˜λ“œμ‹œ ATXController μ—μ„œλ§Œ 호좜 ν—ˆμš© ν•  것. // function atxBuy(address _from, uint256 _amount) public returns(bool) { } function finish() public onlyOwner { } function maxReached() public view returns (bool) { } function minReached() public view returns (bool) { } function addPeriod(uint256 _start, uint256 _end) public onlyOwner { } function getPeriodBonus() public view returns (uint256) { } function eth2HexWithBonus(uint256 _eth, uint256 bonus) public view returns(uint256) { } function hex2EthWithBonus(uint256 _hex, uint256 bonus) public view returns(uint256) { } function atx2HexWithBonus(uint256 _atx, uint256 bonus) public view returns(uint256) { } function hex2AtxWithBonus(uint256 _hex, uint256 bonus) public view returns(uint256) { } function onSale() public view returns (bool) { } function atxChangeAddrCount() public view returns(uint256) { } function returnATXChanges() public onlyOwner { } // // Safety Methods function claimTokens(address _claimToken) public onlyOwner { } // // Event event SaleToken(address indexed _sender, address indexed _investor, uint256 indexed _fundType, uint256 _toFund, uint256 _hexTokens); event ClaimedTokens(address indexed _claimToken, address indexed owner, uint256 balance); event SaleFinished(); }
maxReached()==false
322,414
maxReached()==false
null
contract HEXCrowdSale is Ownerable, SafeMath, ATXICOToken { uint256 public maxHEXCap; uint256 public minHEXCap; uint256 public ethRate; uint256 public atxRate; /* uint256 public ethFunded; uint256 public atxFunded; */ address[] public ethInvestors; mapping (address => uint256) public ethInvestorFunds; address[] public atxInvestors; mapping (address => uint256) public atxInvestorFunds; address[] public atxChangeAddrs; mapping (address => uint256) public atxChanges; KYC public kyc; HEX public hexToken; address public hexControllerAddr; ERC20Basic public atxToken; address public atxControllerAddr; //Vault public vault; address[] public memWallets; address[] public vaultWallets; struct Period { uint256 startTime; uint256 endTime; uint256 bonus; // used to calculate rate with bonus. ragne 0 ~ 15 (0% ~ 15%) } Period[] public periods; bool public isInitialized; bool public isFinalized; function init ( address _kyc, address _token, address _hexController, address _atxToken, address _atxController, // address _vault, address[] _memWallets, address[] _vaultWallets, uint256 _ethRate, uint256 _atxRate, uint256 _maxHEXCap, uint256 _minHEXCap ) public onlyOwner { } function () public payable { } function ethBuy() internal { // check validity require(msg.value >= 50e18); // minimum fund require(isInitialized); require(!isFinalized); require(msg.sender != 0x0 && msg.value != 0x0); require(kyc.registeredAddress(msg.sender)); require(maxReached() == false); require(<FILL_ME>) uint256 fundingAmt = msg.value; uint256 bonus = getPeriodBonus(); uint256 currTotalSupply = hexToken.totalSupply(); uint256 fundableHEXRoom = sub(maxHEXCap, currTotalSupply); uint256 reqedHex = eth2HexWithBonus(fundingAmt, bonus); uint256 toFund; uint256 reFund; if(reqedHex > fundableHEXRoom) { reqedHex = fundableHEXRoom; toFund = hex2EthWithBonus(reqedHex, bonus); //div(fundableHEXRoom, mul(ethRate, add(1, div(bonus,100)))); reFund = sub(fundingAmt, toFund); // toFund 둜 κ³„μ‚°ν•œ HEX μˆ˜λŸ‰μ΄ fundableHEXRoom κ³Ό κ°™μ•„μ•Ό ν•œλ‹€. // κ·ΈλŸ¬λ‚˜ μ†Œμˆ˜μ  문제둜 μΈν•˜μ—¬ μ •ν™•νžˆ κ°™μ•„μ§€μ§€ μ•Šμ„ κ²½μš°κ°€ λ°œμƒν•œλ‹€. //require(reqedHex == eth2HexWithBonus(toFund, bonus) ); } else { toFund = fundingAmt; reFund = 0; } require(fundingAmt >= toFund); require(toFund > 0); // pushInvestorList if(ethInvestorFunds[msg.sender] == 0x0) { ethInvestors.push(msg.sender); } ethInvestorFunds[msg.sender] = add(ethInvestorFunds[msg.sender], toFund); /* ethFunded = add(ethFunded, toFund); */ hexToken.generateTokens(msg.sender, reqedHex); if(reFund > 0) { msg.sender.transfer(reFund); } //vault.ethDeposit.value(toFund)(msg.sender); emit SaleToken(msg.sender, msg.sender, 0, toFund, reqedHex); } // // ATXICOToken λ©”μ†Œλ“œ κ΅¬ν˜„. // μ™ΈλΆ€μ—μ„œ 이 ν•¨μˆ˜κ°€ λ°”λ‘œ 호좜되면 코인 생성됨. // λ°˜λ“œμ‹œ ATXController μ—μ„œλ§Œ 호좜 ν—ˆμš© ν•  것. // function atxBuy(address _from, uint256 _amount) public returns(bool) { } function finish() public onlyOwner { } function maxReached() public view returns (bool) { } function minReached() public view returns (bool) { } function addPeriod(uint256 _start, uint256 _end) public onlyOwner { } function getPeriodBonus() public view returns (uint256) { } function eth2HexWithBonus(uint256 _eth, uint256 bonus) public view returns(uint256) { } function hex2EthWithBonus(uint256 _hex, uint256 bonus) public view returns(uint256) { } function atx2HexWithBonus(uint256 _atx, uint256 bonus) public view returns(uint256) { } function hex2AtxWithBonus(uint256 _hex, uint256 bonus) public view returns(uint256) { } function onSale() public view returns (bool) { } function atxChangeAddrCount() public view returns(uint256) { } function returnATXChanges() public onlyOwner { } // // Safety Methods function claimTokens(address _claimToken) public onlyOwner { } // // Event event SaleToken(address indexed _sender, address indexed _investor, uint256 indexed _fundType, uint256 _toFund, uint256 _hexTokens); event ClaimedTokens(address indexed _claimToken, address indexed owner, uint256 balance); event SaleFinished(); }
onSale()
322,414
onSale()
null
contract HEXCrowdSale is Ownerable, SafeMath, ATXICOToken { uint256 public maxHEXCap; uint256 public minHEXCap; uint256 public ethRate; uint256 public atxRate; /* uint256 public ethFunded; uint256 public atxFunded; */ address[] public ethInvestors; mapping (address => uint256) public ethInvestorFunds; address[] public atxInvestors; mapping (address => uint256) public atxInvestorFunds; address[] public atxChangeAddrs; mapping (address => uint256) public atxChanges; KYC public kyc; HEX public hexToken; address public hexControllerAddr; ERC20Basic public atxToken; address public atxControllerAddr; //Vault public vault; address[] public memWallets; address[] public vaultWallets; struct Period { uint256 startTime; uint256 endTime; uint256 bonus; // used to calculate rate with bonus. ragne 0 ~ 15 (0% ~ 15%) } Period[] public periods; bool public isInitialized; bool public isFinalized; function init ( address _kyc, address _token, address _hexController, address _atxToken, address _atxController, // address _vault, address[] _memWallets, address[] _vaultWallets, uint256 _ethRate, uint256 _atxRate, uint256 _maxHEXCap, uint256 _minHEXCap ) public onlyOwner { } function () public payable { } function ethBuy() internal { } // // ATXICOToken λ©”μ†Œλ“œ κ΅¬ν˜„. // μ™ΈλΆ€μ—μ„œ 이 ν•¨μˆ˜κ°€ λ°”λ‘œ 호좜되면 코인 생성됨. // λ°˜λ“œμ‹œ ATXController μ—μ„œλ§Œ 호좜 ν—ˆμš© ν•  것. // function atxBuy(address _from, uint256 _amount) public returns(bool) { // check validity require(_amount >= 250000e18); // minimum fund require(isInitialized); require(!isFinalized); require(_from != 0x0 && _amount != 0x0); require(<FILL_ME>) require(maxReached() == false); require(onSale()); // Only from ATX Controller. require(msg.sender == atxControllerAddr); // μˆ˜μ‹ μž(ν˜„μž¬μ»¨νŠΈλž™νŠΈ) atx μˆ˜μ‹ ν›„ μž”μ•‘ μ˜€λ²„ν”Œλ‘œμš° 확인. uint256 currAtxBal = atxToken.balanceOf( address(this) ); require(currAtxBal + _amount >= currAtxBal); // Check for overflow uint256 fundingAmt = _amount; uint256 bonus = getPeriodBonus(); uint256 currTotalSupply = hexToken.totalSupply(); uint256 fundableHEXRoom = sub(maxHEXCap, currTotalSupply); uint256 reqedHex = atx2HexWithBonus(fundingAmt, bonus); //mul(add(fundingAmt, mul(fundingAmt, div(bonus, 100))), atxRate); uint256 toFund; uint256 reFund; if(reqedHex > fundableHEXRoom) { reqedHex = fundableHEXRoom; toFund = hex2AtxWithBonus(reqedHex, bonus); //div(fundableHEXRoom, mul(atxRate, add(1, div(bonus,100)))); reFund = sub(fundingAmt, toFund); // toFund 둜 κ³„μ‚°ν•œ HEX μˆ˜λŸ‰μ΄ fundableHEXRoom κ³Ό κ°™μ•„μ•Ό ν•œλ‹€. // κ·ΈλŸ¬λ‚˜ μ†Œμˆ˜μ  문제둜 μΈν•˜μ—¬ μ •ν™•νžˆ κ°™μ•„μ§€μ§€ μ•Šμ„ κ²½μš°κ°€ λ°œμƒν•œλ‹€. //require(reqedHex == atx2HexWithBonus(toFund, bonus) ); } else { toFund = fundingAmt; reFund = 0; } require(fundingAmt >= toFund); require(toFund > 0); // pushInvestorList if(atxInvestorFunds[_from] == 0x0) { atxInvestors.push(_from); } atxInvestorFunds[_from] = add(atxInvestorFunds[_from], toFund); /* atxFunded = add(atxFunded, toFund); */ hexToken.generateTokens(_from, reqedHex); // ν˜„μž¬ μ‹œμ μ—μ„œ // HEXCrowdSale 이 μˆ˜μ‹ ν•œ ATX λŠ” // 아직 HEXCrowdSale κ³„μ •μ˜ μž”μ•‘μ— λ°˜μ˜λ˜μ§€ μ•Šμ•˜λ‹€.... // _amount λŠ” 아직 this 의 μž”μ•‘μ— λ°˜μ˜λ˜μ§€ μ•Šμ•˜κΈ°λ•Œλ¬Έμ—, // 이것을 vault 둜 전솑할 μˆ˜λ„ μ—†κ³ , // μž”μ•‘μ„ 되돌릴 μˆ˜λ„ μ—†λ‹€. if(reFund > 0) { //atxToken.transfer(_from, reFund); if(atxChanges[_from] == 0x0) { atxChangeAddrs.push(_from); } atxChanges[_from] = add(atxChanges[_from], reFund); } // ν˜„μž¬ μ‹œμ μ—μ„œ // HEXCrowdSale 이 μˆ˜μ‹ ν•œ ATX λŠ” // 아직 HEXCrowdSale κ³„μ •μ˜ μž”μ•‘μ— λ°˜μ˜λ˜μ§€ μ•Šμ•˜λ‹€.... // κ·Έλž˜μ„œ vault 둜 전솑할 μˆ˜κ°€ μ—†λ‹€. //if( atxToken.transfer( address(vault), toFund) ) { //vault.atxDeposit(_from, toFund); //} emit SaleToken(msg.sender, _from, 1, toFund, reqedHex); return true; } function finish() public onlyOwner { } function maxReached() public view returns (bool) { } function minReached() public view returns (bool) { } function addPeriod(uint256 _start, uint256 _end) public onlyOwner { } function getPeriodBonus() public view returns (uint256) { } function eth2HexWithBonus(uint256 _eth, uint256 bonus) public view returns(uint256) { } function hex2EthWithBonus(uint256 _hex, uint256 bonus) public view returns(uint256) { } function atx2HexWithBonus(uint256 _atx, uint256 bonus) public view returns(uint256) { } function hex2AtxWithBonus(uint256 _hex, uint256 bonus) public view returns(uint256) { } function onSale() public view returns (bool) { } function atxChangeAddrCount() public view returns(uint256) { } function returnATXChanges() public onlyOwner { } // // Safety Methods function claimTokens(address _claimToken) public onlyOwner { } // // Event event SaleToken(address indexed _sender, address indexed _investor, uint256 indexed _fundType, uint256 _toFund, uint256 _hexTokens); event ClaimedTokens(address indexed _claimToken, address indexed owner, uint256 balance); event SaleFinished(); }
kyc.registeredAddress(_from)
322,414
kyc.registeredAddress(_from)
null
contract HEXCrowdSale is Ownerable, SafeMath, ATXICOToken { uint256 public maxHEXCap; uint256 public minHEXCap; uint256 public ethRate; uint256 public atxRate; /* uint256 public ethFunded; uint256 public atxFunded; */ address[] public ethInvestors; mapping (address => uint256) public ethInvestorFunds; address[] public atxInvestors; mapping (address => uint256) public atxInvestorFunds; address[] public atxChangeAddrs; mapping (address => uint256) public atxChanges; KYC public kyc; HEX public hexToken; address public hexControllerAddr; ERC20Basic public atxToken; address public atxControllerAddr; //Vault public vault; address[] public memWallets; address[] public vaultWallets; struct Period { uint256 startTime; uint256 endTime; uint256 bonus; // used to calculate rate with bonus. ragne 0 ~ 15 (0% ~ 15%) } Period[] public periods; bool public isInitialized; bool public isFinalized; function init ( address _kyc, address _token, address _hexController, address _atxToken, address _atxController, // address _vault, address[] _memWallets, address[] _vaultWallets, uint256 _ethRate, uint256 _atxRate, uint256 _maxHEXCap, uint256 _minHEXCap ) public onlyOwner { } function () public payable { } function ethBuy() internal { } // // ATXICOToken λ©”μ†Œλ“œ κ΅¬ν˜„. // μ™ΈλΆ€μ—μ„œ 이 ν•¨μˆ˜κ°€ λ°”λ‘œ 호좜되면 코인 생성됨. // λ°˜λ“œμ‹œ ATXController μ—μ„œλ§Œ 호좜 ν—ˆμš© ν•  것. // function atxBuy(address _from, uint256 _amount) public returns(bool) { // check validity require(_amount >= 250000e18); // minimum fund require(isInitialized); require(!isFinalized); require(_from != 0x0 && _amount != 0x0); require(kyc.registeredAddress(_from)); require(maxReached() == false); require(onSale()); // Only from ATX Controller. require(msg.sender == atxControllerAddr); // μˆ˜μ‹ μž(ν˜„μž¬μ»¨νŠΈλž™νŠΈ) atx μˆ˜μ‹ ν›„ μž”μ•‘ μ˜€λ²„ν”Œλ‘œμš° 확인. uint256 currAtxBal = atxToken.balanceOf( address(this) ); require(<FILL_ME>) // Check for overflow uint256 fundingAmt = _amount; uint256 bonus = getPeriodBonus(); uint256 currTotalSupply = hexToken.totalSupply(); uint256 fundableHEXRoom = sub(maxHEXCap, currTotalSupply); uint256 reqedHex = atx2HexWithBonus(fundingAmt, bonus); //mul(add(fundingAmt, mul(fundingAmt, div(bonus, 100))), atxRate); uint256 toFund; uint256 reFund; if(reqedHex > fundableHEXRoom) { reqedHex = fundableHEXRoom; toFund = hex2AtxWithBonus(reqedHex, bonus); //div(fundableHEXRoom, mul(atxRate, add(1, div(bonus,100)))); reFund = sub(fundingAmt, toFund); // toFund 둜 κ³„μ‚°ν•œ HEX μˆ˜λŸ‰μ΄ fundableHEXRoom κ³Ό κ°™μ•„μ•Ό ν•œλ‹€. // κ·ΈλŸ¬λ‚˜ μ†Œμˆ˜μ  문제둜 μΈν•˜μ—¬ μ •ν™•νžˆ κ°™μ•„μ§€μ§€ μ•Šμ„ κ²½μš°κ°€ λ°œμƒν•œλ‹€. //require(reqedHex == atx2HexWithBonus(toFund, bonus) ); } else { toFund = fundingAmt; reFund = 0; } require(fundingAmt >= toFund); require(toFund > 0); // pushInvestorList if(atxInvestorFunds[_from] == 0x0) { atxInvestors.push(_from); } atxInvestorFunds[_from] = add(atxInvestorFunds[_from], toFund); /* atxFunded = add(atxFunded, toFund); */ hexToken.generateTokens(_from, reqedHex); // ν˜„μž¬ μ‹œμ μ—μ„œ // HEXCrowdSale 이 μˆ˜μ‹ ν•œ ATX λŠ” // 아직 HEXCrowdSale κ³„μ •μ˜ μž”μ•‘μ— λ°˜μ˜λ˜μ§€ μ•Šμ•˜λ‹€.... // _amount λŠ” 아직 this 의 μž”μ•‘μ— λ°˜μ˜λ˜μ§€ μ•Šμ•˜κΈ°λ•Œλ¬Έμ—, // 이것을 vault 둜 전솑할 μˆ˜λ„ μ—†κ³ , // μž”μ•‘μ„ 되돌릴 μˆ˜λ„ μ—†λ‹€. if(reFund > 0) { //atxToken.transfer(_from, reFund); if(atxChanges[_from] == 0x0) { atxChangeAddrs.push(_from); } atxChanges[_from] = add(atxChanges[_from], reFund); } // ν˜„μž¬ μ‹œμ μ—μ„œ // HEXCrowdSale 이 μˆ˜μ‹ ν•œ ATX λŠ” // 아직 HEXCrowdSale κ³„μ •μ˜ μž”μ•‘μ— λ°˜μ˜λ˜μ§€ μ•Šμ•˜λ‹€.... // κ·Έλž˜μ„œ vault 둜 전솑할 μˆ˜κ°€ μ—†λ‹€. //if( atxToken.transfer( address(vault), toFund) ) { //vault.atxDeposit(_from, toFund); //} emit SaleToken(msg.sender, _from, 1, toFund, reqedHex); return true; } function finish() public onlyOwner { } function maxReached() public view returns (bool) { } function minReached() public view returns (bool) { } function addPeriod(uint256 _start, uint256 _end) public onlyOwner { } function getPeriodBonus() public view returns (uint256) { } function eth2HexWithBonus(uint256 _eth, uint256 bonus) public view returns(uint256) { } function hex2EthWithBonus(uint256 _hex, uint256 bonus) public view returns(uint256) { } function atx2HexWithBonus(uint256 _atx, uint256 bonus) public view returns(uint256) { } function hex2AtxWithBonus(uint256 _hex, uint256 bonus) public view returns(uint256) { } function onSale() public view returns (bool) { } function atxChangeAddrCount() public view returns(uint256) { } function returnATXChanges() public onlyOwner { } // // Safety Methods function claimTokens(address _claimToken) public onlyOwner { } // // Event event SaleToken(address indexed _sender, address indexed _investor, uint256 indexed _fundType, uint256 _toFund, uint256 _hexTokens); event ClaimedTokens(address indexed _claimToken, address indexed owner, uint256 balance); event SaleFinished(); }
currAtxBal+_amount>=currAtxBal
322,414
currAtxBal+_amount>=currAtxBal
null
contract HEXCrowdSale is Ownerable, SafeMath, ATXICOToken { uint256 public maxHEXCap; uint256 public minHEXCap; uint256 public ethRate; uint256 public atxRate; /* uint256 public ethFunded; uint256 public atxFunded; */ address[] public ethInvestors; mapping (address => uint256) public ethInvestorFunds; address[] public atxInvestors; mapping (address => uint256) public atxInvestorFunds; address[] public atxChangeAddrs; mapping (address => uint256) public atxChanges; KYC public kyc; HEX public hexToken; address public hexControllerAddr; ERC20Basic public atxToken; address public atxControllerAddr; //Vault public vault; address[] public memWallets; address[] public vaultWallets; struct Period { uint256 startTime; uint256 endTime; uint256 bonus; // used to calculate rate with bonus. ragne 0 ~ 15 (0% ~ 15%) } Period[] public periods; bool public isInitialized; bool public isFinalized; function init ( address _kyc, address _token, address _hexController, address _atxToken, address _atxController, // address _vault, address[] _memWallets, address[] _vaultWallets, uint256 _ethRate, uint256 _atxRate, uint256 _maxHEXCap, uint256 _minHEXCap ) public onlyOwner { } function () public payable { } function ethBuy() internal { } // // ATXICOToken λ©”μ†Œλ“œ κ΅¬ν˜„. // μ™ΈλΆ€μ—μ„œ 이 ν•¨μˆ˜κ°€ λ°”λ‘œ 호좜되면 코인 생성됨. // λ°˜λ“œμ‹œ ATXController μ—μ„œλ§Œ 호좜 ν—ˆμš© ν•  것. // function atxBuy(address _from, uint256 _amount) public returns(bool) { } function finish() public onlyOwner { } function maxReached() public view returns (bool) { } function minReached() public view returns (bool) { } function addPeriod(uint256 _start, uint256 _end) public onlyOwner { require(now < _start && _start < _end); if (periods.length != 0) { //require(sub(_endTime, _startTime) <= 7 days); require(<FILL_ME>) } Period memory newPeriod; newPeriod.startTime = _start; newPeriod.endTime = _end; newPeriod.bonus = 0; if(periods.length == 0) { newPeriod.bonus = 50; // Private } else if(periods.length == 1) { newPeriod.bonus = 30; // pre } else if(periods.length == 2) { newPeriod.bonus = 20; // crowd 1 } else if (periods.length == 3) { newPeriod.bonus = 15; // crowd 2 } else if (periods.length == 4) { newPeriod.bonus = 10; // crowd 3 } else if (periods.length == 5) { newPeriod.bonus = 5; // crowd 4 } periods.push(newPeriod); } function getPeriodBonus() public view returns (uint256) { } function eth2HexWithBonus(uint256 _eth, uint256 bonus) public view returns(uint256) { } function hex2EthWithBonus(uint256 _hex, uint256 bonus) public view returns(uint256) { } function atx2HexWithBonus(uint256 _atx, uint256 bonus) public view returns(uint256) { } function hex2AtxWithBonus(uint256 _hex, uint256 bonus) public view returns(uint256) { } function onSale() public view returns (bool) { } function atxChangeAddrCount() public view returns(uint256) { } function returnATXChanges() public onlyOwner { } // // Safety Methods function claimTokens(address _claimToken) public onlyOwner { } // // Event event SaleToken(address indexed _sender, address indexed _investor, uint256 indexed _fundType, uint256 _toFund, uint256 _hexTokens); event ClaimedTokens(address indexed _claimToken, address indexed owner, uint256 balance); event SaleFinished(); }
periods[periods.length-1].endTime<_start
322,414
periods[periods.length-1].endTime<_start
'Contract already whitelisted.'
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; // ,@@@@@@@, // ,,,. ,@@@@@@/@@, .oo8888o. // ,&%%&%&&%,@@@@@/@@@@@@,8888\88/8o // ,%&\%&&%&&%,@@@\@@@/@@@88\88888/88' // %&&%&%&/%&&%@@\@@/ /@@@88888\88888' // %&&%/ %&%%&&@@\ V /@@' `88\8 `/88' // `&%\ ` /%&' |.| \ '|8' // |o| | | | | // |.| | | | | // \\/ ._\//_/__/ ,\_//__\\/. \_//__/_ /** @title NFTree @author Lorax + Bebop @notice ERC-721 token that keeps track of total carbon offset. */ contract NFTree is Ownable, ERC721URIStorage { uint256 tokenId; uint256 public carbonOffset; address[] whitelists; mapping(address => Whitelist) whitelistMap; struct Whitelist { bool isValid; address contractAddress; } /** @dev Sets values for {_name} and {_symbol}. Initializes {tokenId} to 1, {totalOffset} to 0, and {treesPlanted} to 0. */ constructor() ERC721('NFTree', 'TREE') { } /** @dev Emitted after a succesful NFTree mint. @param _recipient Address that the NFTree was minted to. @param _tokenId IPFS hash of token metadata. @param _carbonOffset Number of carbon offset (tonnes). @param _collection Name of NFTree collection. */ event Mint(address _recipient, uint256 _tokenId, uint256 _carbonOffset, string _collection); /** @dev Creates new Whitelist instance and maps to the {whitelists} array. @param _contractAddress Address of the contract to be whitelisted. requirements: - {_contractAddress} must not already be the address of a contract on the whitelist. */ function addWhitelist(address _contractAddress) external onlyOwner { require(<FILL_ME>) whitelistMap[_contractAddress] = Whitelist(true, _contractAddress); whitelists.push(_contractAddress); } /** @dev Deletes Whitelist instance and removes from {whitelists} array. @param _contractAddress Address of the contract to be removed from the whitelist. requirements: - {_contractAddress} must be the address of a whitelisted contract. */ function removeWhitelist(address _contractAddress) external onlyOwner { } /** @dev Retrieves array of valid whitelisted contracts. @return address[] {whitelists}. */ function getValidWhitelists() external view onlyOwner returns(address[] memory) { } /** @dev Retrieves next token id to be minted. @return uint256 {tokenId}. */ function getNextTokenId() external view returns(uint256) { } /** @dev Retrieves list of tokens owned by {_owner} @return uint256[] {tokenIds}. */ function tokensOfOwner(address _owner) external view returns(uint256[] memory) { } /** @dev Mints NFTree to {_recipient}. Emits Mint event. @param _recipient Address to mint the NFTree to. @param _tokenURI IPFS hash of token metadata. @param _carbonOffset Number of carbon offset (tonnes). @param _collection Name of NFTree collection. Requirements: - {msg.sender} must be a whitelisted contract. */ function mintNFTree(address _recipient, string memory _tokenURI, uint256 _carbonOffset, string memory _collection) external { } }
!whitelistMap[_contractAddress].isValid,'Contract already whitelisted.'
322,442
!whitelistMap[_contractAddress].isValid
'Not a valid whitelisted contract.'
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; // ,@@@@@@@, // ,,,. ,@@@@@@/@@, .oo8888o. // ,&%%&%&&%,@@@@@/@@@@@@,8888\88/8o // ,%&\%&&%&&%,@@@\@@@/@@@88\88888/88' // %&&%&%&/%&&%@@\@@/ /@@@88888\88888' // %&&%/ %&%%&&@@\ V /@@' `88\8 `/88' // `&%\ ` /%&' |.| \ '|8' // |o| | | | | // |.| | | | | // \\/ ._\//_/__/ ,\_//__\\/. \_//__/_ /** @title NFTree @author Lorax + Bebop @notice ERC-721 token that keeps track of total carbon offset. */ contract NFTree is Ownable, ERC721URIStorage { uint256 tokenId; uint256 public carbonOffset; address[] whitelists; mapping(address => Whitelist) whitelistMap; struct Whitelist { bool isValid; address contractAddress; } /** @dev Sets values for {_name} and {_symbol}. Initializes {tokenId} to 1, {totalOffset} to 0, and {treesPlanted} to 0. */ constructor() ERC721('NFTree', 'TREE') { } /** @dev Emitted after a succesful NFTree mint. @param _recipient Address that the NFTree was minted to. @param _tokenId IPFS hash of token metadata. @param _carbonOffset Number of carbon offset (tonnes). @param _collection Name of NFTree collection. */ event Mint(address _recipient, uint256 _tokenId, uint256 _carbonOffset, string _collection); /** @dev Creates new Whitelist instance and maps to the {whitelists} array. @param _contractAddress Address of the contract to be whitelisted. requirements: - {_contractAddress} must not already be the address of a contract on the whitelist. */ function addWhitelist(address _contractAddress) external onlyOwner { } /** @dev Deletes Whitelist instance and removes from {whitelists} array. @param _contractAddress Address of the contract to be removed from the whitelist. requirements: - {_contractAddress} must be the address of a whitelisted contract. */ function removeWhitelist(address _contractAddress) external onlyOwner { require(<FILL_ME>) uint256 index; for (uint256 i = 0; i < whitelists.length; i++) { if (whitelists[i] == _contractAddress) { index = i; } } whitelists[index] = whitelists[whitelists.length - 1]; whitelists.pop(); delete whitelistMap[_contractAddress]; } /** @dev Retrieves array of valid whitelisted contracts. @return address[] {whitelists}. */ function getValidWhitelists() external view onlyOwner returns(address[] memory) { } /** @dev Retrieves next token id to be minted. @return uint256 {tokenId}. */ function getNextTokenId() external view returns(uint256) { } /** @dev Retrieves list of tokens owned by {_owner} @return uint256[] {tokenIds}. */ function tokensOfOwner(address _owner) external view returns(uint256[] memory) { } /** @dev Mints NFTree to {_recipient}. Emits Mint event. @param _recipient Address to mint the NFTree to. @param _tokenURI IPFS hash of token metadata. @param _carbonOffset Number of carbon offset (tonnes). @param _collection Name of NFTree collection. Requirements: - {msg.sender} must be a whitelisted contract. */ function mintNFTree(address _recipient, string memory _tokenURI, uint256 _carbonOffset, string memory _collection) external { } }
whitelistMap[_contractAddress].isValid,'Not a valid whitelisted contract.'
322,442
whitelistMap[_contractAddress].isValid