comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"Presale already active."
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract TSSNFT is ERC721Enumerable, Ownable { using SafeMath for uint; uint public constant MAX_SNEAKERHEADZ = 4444; uint public constant MAX_SALE = 20; uint public constant MAX_PRESALE = 5; address payableAddress; uint public price; mapping(address => uint256) private preSaleAllowance; bool public hasPreSaleStarted = false; bool public preSaleOver = false; bool public hasSaleStarted = false; event SneakerHeadzMinted(uint indexed tokenId, address indexed owner); constructor() ERC721("The SneakerHeadz Society", "TSS") { } function mint(uint _quantity) external payable { } function preMint(uint _quantity) external payable { } function mintByOwner(address _to, uint256 _quantity) external onlyOwner { } function tokensOfOwner(address _owner) public view returns(uint[] memory ) { } function tokenURI(uint256 _tokenId) public pure override returns (string memory) { } function baseTokenURI() public pure returns (string memory) { } function contractURI() public pure returns (string memory) { } function setPrice(uint _price) external onlyOwner { } function startSale() external onlyOwner { } function pauseSale() external onlyOwner { } function startPreSale() external onlyOwner { require(!preSaleOver, "Presale is over, cannot start again."); require(<FILL_ME>) hasPreSaleStarted = true; } function pausePreSale() external onlyOwner { } function setPayableAddress(address _payableAddress) external onlyOwner { } function checkEarlyBird(address earlyBirdAddress) public view returns (uint) { } function addEarlyBirds(address[] memory earlyBirdAddresses) external onlyOwner { } }
!hasPreSaleStarted,"Presale already active."
294,695
!hasPreSaleStarted
"DENORM_MIN"
pragma solidity 0.6.12; contract PowerIndexPoolController is PowerIndexWrappedController { using SafeERC20 for IERC20; /* ========== Storage ========== */ /** @dev Signature to execute bind in pool. */ bytes4 public constant BIND_SIG = bytes4(keccak256(bytes("bind(address,uint256,uint256,uint256,uint256)"))); /** @dev Signature to execute unbind in pool. */ bytes4 public constant UNBIND_SIG = bytes4(keccak256(bytes("unbind(address)"))); struct DynamicWeightInput { address token; uint256 targetDenorm; uint256 fromTimestamp; uint256 targetTimestamp; } /** @dev Emitted on setting new weights strategy. */ event SetWeightsStrategy(address indexed weightsStrategy); /** @dev Weights strategy contract address. */ address public weightsStrategy; modifier onlyWeightsStrategy() { } constructor( address _pool, address _poolWrapper, address _wrapperFactory, address _weightsStrategy ) public PowerIndexWrappedController(_pool, _poolWrapper, _wrapperFactory) { } /* ========== Configuration Actions ========== */ /** * @notice Call bind in pool. * @param token Token to bind. * @param balance Initial token balance. * @param targetDenorm Target weight. * @param fromTimestamp Start timestamp to change weight. * @param targetTimestamp Target timestamp to change weight. */ function bind( address token, uint256 balance, uint256 targetDenorm, uint256 fromTimestamp, uint256 targetTimestamp ) external onlyOwner { } /** * @notice Set the old token's target weight to MIN_WEIGHT and add a new token * with a previous weight of the old token. * @param oldToken Token to replace. * @param newToken New token. * @param balance Initial new token balance. * @param fromTimestamp Start timestamp to change weight. * @param targetTimestamp Target timestamp to change weight. */ function replaceTokenWithNew( address oldToken, address newToken, uint256 balance, uint256 fromTimestamp, uint256 targetTimestamp ) external onlyOwner { } /** * @notice The same as replaceTokenWithNew, but sets fromTimestamp with block.timestamp * and uses durationFromNow to set targetTimestamp. * @param oldToken Token to replace * @param newToken New token * @param balance Initial new token balance * @param durationFromNow Duration to set targetTimestamp. */ function replaceTokenWithNewFromNow( address oldToken, address newToken, uint256 balance, uint256 durationFromNow ) external onlyOwner { } /** * @notice Call setDynamicWeight for several tokens. * @param _dynamicWeights Tokens dynamic weights configs. */ function setDynamicWeightList(DynamicWeightInput[] memory _dynamicWeights) external onlyOwner { } /** * @notice Set _weightsStrategy address. * @param _weightsStrategy Contract for weights management. */ function setWeightsStrategy(address _weightsStrategy) external onlyOwner { } /** * @notice Call setDynamicWeight for several tokens, can be called only by weightsStrategy address. * @param _dynamicWeights Tokens dynamic weights configs. */ function setDynamicWeightListByStrategy(DynamicWeightInput[] memory _dynamicWeights) external onlyWeightsStrategy { } /** * @notice Permissionless function to unbind tokens with MIN_WEIGHT. * @param _token Token to unbind. */ function unbindNotActualToken(address _token) external { require(<FILL_ME>) (, uint256 targetTimestamp, , ) = pool.getDynamicWeightSettings(_token); require(block.timestamp > targetTimestamp, "TIMESTAMP_MORE_THEN_TARGET"); uint256 tokenBalance = pool.getBalance(_token); pool.unbind(_token); (, , , address communityWallet) = pool.getCommunityFee(); IERC20(_token).safeTransfer(communityWallet, tokenBalance); } function _checkSignature(bytes4 signature) internal pure override { } /*** Internal Functions ***/ /** * @notice Set the old token's target weight to MIN_WEIGHT and * add a new token with a previous weight of the old token. * @param oldToken Token to replace * @param newToken New token * @param balance Initial new token balance * @param fromTimestamp Start timestamp to change weight. * @param targetTimestamp Target timestamp to change weight. */ function _replaceTokenWithNew( address oldToken, address newToken, uint256 balance, uint256 fromTimestamp, uint256 targetTimestamp ) internal { } /** * @notice Check that pool doesn't have the maximum number of bound tokens. * If there is a max number of bound tokens, one should have a minimum weight. */ function _validateNewTokenBind() internal { } }
pool.getDenormalizedWeight(_token)==pool.getMinWeight(),"DENORM_MIN"
294,763
pool.getDenormalizedWeight(_token)==pool.getMinWeight()
"The value of controllers[msg.sender] must be non-zero"
/** * Copyright CENTRE SECZ 2018 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ pragma solidity ^0.4.24; /** * @title Controller * @notice Generic implementation of the owner-controller-worker model. * One owner manages many controllers. Each controller manages one worker. * Workers may be reused across different controllers. */ contract Controller is Ownable { /** * @notice A controller manages a single worker address. * controllers[controller] = worker */ mapping(address => address) internal controllers; event ControllerConfigured( address indexed _controller, address indexed _worker ); event ControllerRemoved(address indexed _controller); /** * @notice Ensures that caller is the controller of a non-zero worker * address. */ modifier onlyController() { require(<FILL_ME>) _; } /** * @notice Gets the worker at address _controller. */ function getWorker( address _controller ) external view returns (address) { } // onlyOwner functions /** * @notice Configure a controller with the given worker. * @param _controller The controller to be configured with a worker. * @param _worker The worker to be set for the newly configured controller. * _worker must not be a non-zero address. To disable a worker, * use removeController instead. */ function configureController( address _controller, address _worker ) public onlyOwner { } /** * @notice disables a controller by setting its worker to address(0). * @param _controller The controller to disable. */ function removeController( address _controller ) public onlyOwner { } }
controllers[msg.sender]!=address(0),"The value of controllers[msg.sender] must be non-zero"
294,811
controllers[msg.sender]!=address(0)
"Worker must be a non-zero address"
/** * Copyright CENTRE SECZ 2018 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ pragma solidity ^0.4.24; /** * @title Controller * @notice Generic implementation of the owner-controller-worker model. * One owner manages many controllers. Each controller manages one worker. * Workers may be reused across different controllers. */ contract Controller is Ownable { /** * @notice A controller manages a single worker address. * controllers[controller] = worker */ mapping(address => address) internal controllers; event ControllerConfigured( address indexed _controller, address indexed _worker ); event ControllerRemoved(address indexed _controller); /** * @notice Ensures that caller is the controller of a non-zero worker * address. */ modifier onlyController() { } /** * @notice Gets the worker at address _controller. */ function getWorker( address _controller ) external view returns (address) { } // onlyOwner functions /** * @notice Configure a controller with the given worker. * @param _controller The controller to be configured with a worker. * @param _worker The worker to be set for the newly configured controller. * _worker must not be a non-zero address. To disable a worker, * use removeController instead. */ function configureController( address _controller, address _worker ) public onlyOwner { } /** * @notice disables a controller by setting its worker to address(0). * @param _controller The controller to disable. */ function removeController( address _controller ) public onlyOwner { require(_controller != address(0), "Controller must be a non-zero address"); require(<FILL_ME>) controllers[_controller] = address(0); emit ControllerRemoved(_controller); } }
controllers[_controller]!=address(0),"Worker must be a non-zero address"
294,811
controllers[_controller]!=address(0)
"ERC721SlimApe: transfer to non ERC721Receiver implementer"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension and the Enumerable extensions. * * This implementation is called `Slim` because the gas usage is extremely saved in the minting, transfer operations. * But as a drawback, those view functions like balanceOf and any functions from IERC721Enumerable * will be costly because it needs heavy iterations over the array that stores the token array. */ abstract contract ERC721SlimApe is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; uint256 private _burntTokens = 0; address[] private _tokenOwners; mapping(uint256 => address) _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { } /** * @dev Safely mints `tokenId` in batch and transfers it to `to`. * * Requirements: * * - `to` must not be a zero address. * - `amount` must not be zero */ function _safeBatchMint(address to, uint256 amount) internal returns (uint256 startId) { require(to != address(0), "ERC721SlimApe: mint to the zero address"); require(amount > 0, "ERC721SlimApe: mint nothing"); startId = _tokenOwners.length; for (uint256 i = 0; i < amount; i++) { _tokenOwners.push(to); emit Transfer(address(0), to, _tokenOwners.length - 1); } require(<FILL_ME>) } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to) internal virtual { } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, bytes memory _data ) internal virtual { } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to) internal virtual returns (uint256) { } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } // ======================================== // IERC721Enumerable implementations // ======================================== /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() public override view returns (uint256) { } /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId) { } /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256) { } // ======================================== // Miscellaneous functions // ======================================== /** * @dev Returns the total amount of tokens stored by the contract. */ function _totalMinted() internal view returns (uint256) { } }
_checkOnERC721Received(address(0),to,startId,""),"ERC721SlimApe: transfer to non ERC721Receiver implementer"
294,845
_checkOnERC721Received(address(0),to,startId,"")
"ERC721SlimApe: transfer from incorrect owner"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension and the Enumerable extensions. * * This implementation is called `Slim` because the gas usage is extremely saved in the minting, transfer operations. * But as a drawback, those view functions like balanceOf and any functions from IERC721Enumerable * will be costly because it needs heavy iterations over the array that stores the token array. */ abstract contract ERC721SlimApe is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; uint256 private _burntTokens = 0; address[] private _tokenOwners; mapping(uint256 => address) _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { } /** * @dev Safely mints `tokenId` in batch and transfers it to `to`. * * Requirements: * * - `to` must not be a zero address. * - `amount` must not be zero */ function _safeBatchMint(address to, uint256 amount) internal returns (uint256 startId) { } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to) internal virtual { } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, bytes memory _data ) internal virtual { } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to) internal virtual returns (uint256) { } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(<FILL_ME>) require(to != address(0), "ERC721SlimApe: transfer to the zero address"); _tokenOwners[tokenId] = to; _tokenApprovals[tokenId] = address(0); emit Approval(from, address(0), tokenId); emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } // ======================================== // IERC721Enumerable implementations // ======================================== /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() public override view returns (uint256) { } /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId) { } /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256) { } // ======================================== // Miscellaneous functions // ======================================== /** * @dev Returns the total amount of tokens stored by the contract. */ function _totalMinted() internal view returns (uint256) { } }
ERC721SlimApe.ownerOf(tokenId)==from,"ERC721SlimApe: transfer from incorrect owner"
294,845
ERC721SlimApe.ownerOf(tokenId)==from
null
pragma solidity 0.4.24; contract ERC20 { function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address _from, address _to, uint _value) external returns (bool); } contract Ownable { address public owner = 0x345aCaFA4314Bc2479a3aA7cCf8eb47f223C1d0e; modifier onlyOwner() { } } /** * @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 allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { } } /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <[email protected]> (https://github.com/dete) contract ERC721 { // Required methods function totalSupply() public view returns (uint total); function balanceOf(address owner) public view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function approve(address to, uint tokenId) external; function transfer(address to, uint tokenId) public; function transferFrom(address from, address to, uint tokenId) external; // Events event Transfer(address indexed from, address indexed to, uint tokenId); event Approval(address indexed owner, address indexed approved, uint tokenId); // Optional function name() public view returns (string); function symbol() public view returns (string); function tokensOfOwner(address owner) external view returns (uint[] tokenIds); function tokenMetadata(uint tokenId, string preferredTransport) public view returns (string infoUrl); // ERC-165 Compatibility (https://github.com/ethereum/EIPs/issues/165) function supportsInterface(bytes4 contractID) external view returns (bool); } contract ERC721Metadata { function getMetadata(uint tokenId, string preferredTransport) public view returns (bytes32[4] buffer, uint count); } contract CryptoversePreorderBonusAssets is Pausable, ERC721 { struct Item { ItemType typeId; ItemModel model; ItemManufacturer manufacturer; ItemRarity rarity; uint createTime; uint amount; } enum ItemType {VRCBox, VCXVault, SaiHead, SaiBody, SaiEarrings, MechHead, MechBody, MechLegs, MechRailgun, MechMachineGun, MechRocketLauncher} enum ItemModel {NC01, MK1, V1, V1_1, V2_1, M442_1, BG, Q3, TRFL405, BC, DES1, PlasmaS, BD, DRL, Casper, Kilo, Mega, Giga, Tera, Peta, Exa, EA} enum ItemManufacturer {BTC, VRC, ETH, Satoshipowered} enum ItemRarity {Common, Uncommon, Rare, Superior, Epic, Legendary, Unique} function name() public view returns (string){ } function symbol() public view returns (string){ } Item[] public items; mapping(uint => address) public itemIndexToOwner; mapping(address => uint) public ownershipTokenCount; mapping(uint => address) public itemIndexToApproved; function reclaimToken(ERC20 token) external onlyOwner { } function _transfer(address from, address to, uint tokenId) internal { } event CreateItem(uint id, ItemType typeId, ItemModel model, ItemManufacturer manufacturer, ItemRarity rarity, uint createTime, uint amount, address indexed owner); function createItem(ItemType typeId, ItemModel model, ItemManufacturer manufacturer, ItemRarity rarity, uint amount, address owner) internal returns (uint) { } function tokensOfOwner(address owner) external view returns (uint[] ownerTokens) { } function tokensInfoOfOwner(address owner) external view returns (uint[] ownerTokens) { } function tokenInfo(uint itemId) external view returns (uint[] ownerTokens) { } ERC721Metadata public erc721Metadata; bytes4 constant InterfaceSignature_ERC165 = bytes4(keccak256('supportsInterface(bytes4)')); bytes4 constant InterfaceSignature_ERC721 = bytes4(keccak256('name()')) ^ bytes4(keccak256('symbol()')) ^ bytes4(keccak256('totalSupply()')) ^ bytes4(keccak256('balanceOf(address)')) ^ bytes4(keccak256('ownerOf(uint)')) ^ bytes4(keccak256('approve(address,uint)')) ^ bytes4(keccak256('transfer(address,uint)')) ^ bytes4(keccak256('transferFrom(address,address,uint)')) ^ bytes4(keccak256('tokensOfOwner(address)')) ^ bytes4(keccak256('tokenMetadata(uint,string)')); function supportsInterface(bytes4 contractID) external view returns (bool) { } function setMetadataAddress(address contractAddress) public onlyOwner { } function _owns(address claimant, uint tokenId) internal view returns (bool) { } function _approvedFor(address claimant, uint tokenId) internal view returns (bool) { } function _approve(uint tokenId, address approved) internal { } function balanceOf(address owner) public view returns (uint count) { } function transfer(address to, uint tokenId) public { require(to != address(0)); require(<FILL_ME>) require(!_owns(to, tokenId)); _transfer(msg.sender, to, tokenId); } function approve(address to, uint tokenId) external { } function transferFrom(address from, address to, uint tokenId) external { } function totalSupply() public view returns (uint) { } function ownerOf(uint tokenId) external view returns (address owner) { } /// @dev Adapted from memcpy() by @arachnid (Nick Johnson <[email protected]>) /// This method is licenced under the Apache License. /// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol function _memcpy(uint _dest, uint _src, uint _len) private pure { } /// @dev Adapted from toString(slice) by @arachnid (Nick Johnson <[email protected]>) /// This method is licenced under the Apache License. /// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol function _toString(bytes32[4] _rawBytes, uint _stringLength) private pure returns (string) { } /// @notice Returns a URI pointing to a metadata package for this token conforming to /// ERC-721 (https://github.com/ethereum/EIPs/issues/721) /// @param _tokenId The ID number of the Kitty whose metadata should be returned. function tokenMetadata(uint _tokenId, string _preferredTransport) public view returns (string infoUrl) { } } contract CryptoversePreorder is CryptoversePreorderBonusAssets { ERC20 public vrc; ERC20 public vcx; address public vrcWallet; address public vcxWallet; uint public vrcCount; uint public vcxCount; uint public weiRaised; uint public constant minInvest = 0.1 ether; uint public contributorsCompleteCount; mapping(address => uint) public contributorBalance; mapping(address => bool) public contributorComplete; mapping(address => uint) public contributorWhiteListTime; uint public constant hardCap = 50000 ether; address[] public contributors; event Purchase(address indexed contributor, uint weiAmount); function() public payable { } function createSaiLimitedEdition(uint weiAmount, address contributor) private { } function createSaiCollectorsEdition(uint weiAmount, address contributor) private { } function createSaiFoundersEdition(uint weiAmount, address contributor) private { } function createVRCBox(ItemModel model, uint weiAmount, address contributor) private { } function createVCXVault(uint weiAmount, address contributor) private { } function createMechBTC(uint weiAmount, address contributor) private { } function createMechVRC(uint weiAmount, address contributor) private { } function createMechETH(uint weiAmount, address contributor) private { } function buyTokens(address contributor) public whenNotPaused payable { } function sendTokens(uint balance, address contributor, bool hasBonus) private { } function withdrawal(uint amount) public onlyOwner { } function contributorsCount() public view returns (uint){ } function setVRC(address _vrc, address _vrcWallet, uint _vrcCount) public onlyOwner { } function setVCX(address _vcx, address _vcxWallet, uint _vcxCount) public onlyOwner { } function getBoxes(address contributor) public view returns (uint[] boxes) { } function isBox(Item item) private pure returns (bool){ } function isBoxItemId(uint itemId) public view returns (bool){ } function openBoxes(uint[] itemIds) public { } }
_owns(msg.sender,tokenId)
294,857
_owns(msg.sender,tokenId)
null
pragma solidity 0.4.24; contract ERC20 { function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address _from, address _to, uint _value) external returns (bool); } contract Ownable { address public owner = 0x345aCaFA4314Bc2479a3aA7cCf8eb47f223C1d0e; modifier onlyOwner() { } } /** * @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 allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { } } /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <[email protected]> (https://github.com/dete) contract ERC721 { // Required methods function totalSupply() public view returns (uint total); function balanceOf(address owner) public view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function approve(address to, uint tokenId) external; function transfer(address to, uint tokenId) public; function transferFrom(address from, address to, uint tokenId) external; // Events event Transfer(address indexed from, address indexed to, uint tokenId); event Approval(address indexed owner, address indexed approved, uint tokenId); // Optional function name() public view returns (string); function symbol() public view returns (string); function tokensOfOwner(address owner) external view returns (uint[] tokenIds); function tokenMetadata(uint tokenId, string preferredTransport) public view returns (string infoUrl); // ERC-165 Compatibility (https://github.com/ethereum/EIPs/issues/165) function supportsInterface(bytes4 contractID) external view returns (bool); } contract ERC721Metadata { function getMetadata(uint tokenId, string preferredTransport) public view returns (bytes32[4] buffer, uint count); } contract CryptoversePreorderBonusAssets is Pausable, ERC721 { struct Item { ItemType typeId; ItemModel model; ItemManufacturer manufacturer; ItemRarity rarity; uint createTime; uint amount; } enum ItemType {VRCBox, VCXVault, SaiHead, SaiBody, SaiEarrings, MechHead, MechBody, MechLegs, MechRailgun, MechMachineGun, MechRocketLauncher} enum ItemModel {NC01, MK1, V1, V1_1, V2_1, M442_1, BG, Q3, TRFL405, BC, DES1, PlasmaS, BD, DRL, Casper, Kilo, Mega, Giga, Tera, Peta, Exa, EA} enum ItemManufacturer {BTC, VRC, ETH, Satoshipowered} enum ItemRarity {Common, Uncommon, Rare, Superior, Epic, Legendary, Unique} function name() public view returns (string){ } function symbol() public view returns (string){ } Item[] public items; mapping(uint => address) public itemIndexToOwner; mapping(address => uint) public ownershipTokenCount; mapping(uint => address) public itemIndexToApproved; function reclaimToken(ERC20 token) external onlyOwner { } function _transfer(address from, address to, uint tokenId) internal { } event CreateItem(uint id, ItemType typeId, ItemModel model, ItemManufacturer manufacturer, ItemRarity rarity, uint createTime, uint amount, address indexed owner); function createItem(ItemType typeId, ItemModel model, ItemManufacturer manufacturer, ItemRarity rarity, uint amount, address owner) internal returns (uint) { } function tokensOfOwner(address owner) external view returns (uint[] ownerTokens) { } function tokensInfoOfOwner(address owner) external view returns (uint[] ownerTokens) { } function tokenInfo(uint itemId) external view returns (uint[] ownerTokens) { } ERC721Metadata public erc721Metadata; bytes4 constant InterfaceSignature_ERC165 = bytes4(keccak256('supportsInterface(bytes4)')); bytes4 constant InterfaceSignature_ERC721 = bytes4(keccak256('name()')) ^ bytes4(keccak256('symbol()')) ^ bytes4(keccak256('totalSupply()')) ^ bytes4(keccak256('balanceOf(address)')) ^ bytes4(keccak256('ownerOf(uint)')) ^ bytes4(keccak256('approve(address,uint)')) ^ bytes4(keccak256('transfer(address,uint)')) ^ bytes4(keccak256('transferFrom(address,address,uint)')) ^ bytes4(keccak256('tokensOfOwner(address)')) ^ bytes4(keccak256('tokenMetadata(uint,string)')); function supportsInterface(bytes4 contractID) external view returns (bool) { } function setMetadataAddress(address contractAddress) public onlyOwner { } function _owns(address claimant, uint tokenId) internal view returns (bool) { } function _approvedFor(address claimant, uint tokenId) internal view returns (bool) { } function _approve(uint tokenId, address approved) internal { } function balanceOf(address owner) public view returns (uint count) { } function transfer(address to, uint tokenId) public { require(to != address(0)); require(_owns(msg.sender, tokenId)); require(<FILL_ME>) _transfer(msg.sender, to, tokenId); } function approve(address to, uint tokenId) external { } function transferFrom(address from, address to, uint tokenId) external { } function totalSupply() public view returns (uint) { } function ownerOf(uint tokenId) external view returns (address owner) { } /// @dev Adapted from memcpy() by @arachnid (Nick Johnson <[email protected]>) /// This method is licenced under the Apache License. /// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol function _memcpy(uint _dest, uint _src, uint _len) private pure { } /// @dev Adapted from toString(slice) by @arachnid (Nick Johnson <[email protected]>) /// This method is licenced under the Apache License. /// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol function _toString(bytes32[4] _rawBytes, uint _stringLength) private pure returns (string) { } /// @notice Returns a URI pointing to a metadata package for this token conforming to /// ERC-721 (https://github.com/ethereum/EIPs/issues/721) /// @param _tokenId The ID number of the Kitty whose metadata should be returned. function tokenMetadata(uint _tokenId, string _preferredTransport) public view returns (string infoUrl) { } } contract CryptoversePreorder is CryptoversePreorderBonusAssets { ERC20 public vrc; ERC20 public vcx; address public vrcWallet; address public vcxWallet; uint public vrcCount; uint public vcxCount; uint public weiRaised; uint public constant minInvest = 0.1 ether; uint public contributorsCompleteCount; mapping(address => uint) public contributorBalance; mapping(address => bool) public contributorComplete; mapping(address => uint) public contributorWhiteListTime; uint public constant hardCap = 50000 ether; address[] public contributors; event Purchase(address indexed contributor, uint weiAmount); function() public payable { } function createSaiLimitedEdition(uint weiAmount, address contributor) private { } function createSaiCollectorsEdition(uint weiAmount, address contributor) private { } function createSaiFoundersEdition(uint weiAmount, address contributor) private { } function createVRCBox(ItemModel model, uint weiAmount, address contributor) private { } function createVCXVault(uint weiAmount, address contributor) private { } function createMechBTC(uint weiAmount, address contributor) private { } function createMechVRC(uint weiAmount, address contributor) private { } function createMechETH(uint weiAmount, address contributor) private { } function buyTokens(address contributor) public whenNotPaused payable { } function sendTokens(uint balance, address contributor, bool hasBonus) private { } function withdrawal(uint amount) public onlyOwner { } function contributorsCount() public view returns (uint){ } function setVRC(address _vrc, address _vrcWallet, uint _vrcCount) public onlyOwner { } function setVCX(address _vcx, address _vcxWallet, uint _vcxCount) public onlyOwner { } function getBoxes(address contributor) public view returns (uint[] boxes) { } function isBox(Item item) private pure returns (bool){ } function isBoxItemId(uint itemId) public view returns (bool){ } function openBoxes(uint[] itemIds) public { } }
!_owns(to,tokenId)
294,857
!_owns(to,tokenId)
null
pragma solidity 0.4.24; contract ERC20 { function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address _from, address _to, uint _value) external returns (bool); } contract Ownable { address public owner = 0x345aCaFA4314Bc2479a3aA7cCf8eb47f223C1d0e; modifier onlyOwner() { } } /** * @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 allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { } } /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <[email protected]> (https://github.com/dete) contract ERC721 { // Required methods function totalSupply() public view returns (uint total); function balanceOf(address owner) public view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function approve(address to, uint tokenId) external; function transfer(address to, uint tokenId) public; function transferFrom(address from, address to, uint tokenId) external; // Events event Transfer(address indexed from, address indexed to, uint tokenId); event Approval(address indexed owner, address indexed approved, uint tokenId); // Optional function name() public view returns (string); function symbol() public view returns (string); function tokensOfOwner(address owner) external view returns (uint[] tokenIds); function tokenMetadata(uint tokenId, string preferredTransport) public view returns (string infoUrl); // ERC-165 Compatibility (https://github.com/ethereum/EIPs/issues/165) function supportsInterface(bytes4 contractID) external view returns (bool); } contract ERC721Metadata { function getMetadata(uint tokenId, string preferredTransport) public view returns (bytes32[4] buffer, uint count); } contract CryptoversePreorderBonusAssets is Pausable, ERC721 { struct Item { ItemType typeId; ItemModel model; ItemManufacturer manufacturer; ItemRarity rarity; uint createTime; uint amount; } enum ItemType {VRCBox, VCXVault, SaiHead, SaiBody, SaiEarrings, MechHead, MechBody, MechLegs, MechRailgun, MechMachineGun, MechRocketLauncher} enum ItemModel {NC01, MK1, V1, V1_1, V2_1, M442_1, BG, Q3, TRFL405, BC, DES1, PlasmaS, BD, DRL, Casper, Kilo, Mega, Giga, Tera, Peta, Exa, EA} enum ItemManufacturer {BTC, VRC, ETH, Satoshipowered} enum ItemRarity {Common, Uncommon, Rare, Superior, Epic, Legendary, Unique} function name() public view returns (string){ } function symbol() public view returns (string){ } Item[] public items; mapping(uint => address) public itemIndexToOwner; mapping(address => uint) public ownershipTokenCount; mapping(uint => address) public itemIndexToApproved; function reclaimToken(ERC20 token) external onlyOwner { } function _transfer(address from, address to, uint tokenId) internal { } event CreateItem(uint id, ItemType typeId, ItemModel model, ItemManufacturer manufacturer, ItemRarity rarity, uint createTime, uint amount, address indexed owner); function createItem(ItemType typeId, ItemModel model, ItemManufacturer manufacturer, ItemRarity rarity, uint amount, address owner) internal returns (uint) { } function tokensOfOwner(address owner) external view returns (uint[] ownerTokens) { } function tokensInfoOfOwner(address owner) external view returns (uint[] ownerTokens) { } function tokenInfo(uint itemId) external view returns (uint[] ownerTokens) { } ERC721Metadata public erc721Metadata; bytes4 constant InterfaceSignature_ERC165 = bytes4(keccak256('supportsInterface(bytes4)')); bytes4 constant InterfaceSignature_ERC721 = bytes4(keccak256('name()')) ^ bytes4(keccak256('symbol()')) ^ bytes4(keccak256('totalSupply()')) ^ bytes4(keccak256('balanceOf(address)')) ^ bytes4(keccak256('ownerOf(uint)')) ^ bytes4(keccak256('approve(address,uint)')) ^ bytes4(keccak256('transfer(address,uint)')) ^ bytes4(keccak256('transferFrom(address,address,uint)')) ^ bytes4(keccak256('tokensOfOwner(address)')) ^ bytes4(keccak256('tokenMetadata(uint,string)')); function supportsInterface(bytes4 contractID) external view returns (bool) { } function setMetadataAddress(address contractAddress) public onlyOwner { } function _owns(address claimant, uint tokenId) internal view returns (bool) { } function _approvedFor(address claimant, uint tokenId) internal view returns (bool) { } function _approve(uint tokenId, address approved) internal { } function balanceOf(address owner) public view returns (uint count) { } function transfer(address to, uint tokenId) public { } function approve(address to, uint tokenId) external { } function transferFrom(address from, address to, uint tokenId) external { require(to != address(0)); require(to != address(this)); require(<FILL_ME>) require(_owns(from, tokenId)); _transfer(from, to, tokenId); } function totalSupply() public view returns (uint) { } function ownerOf(uint tokenId) external view returns (address owner) { } /// @dev Adapted from memcpy() by @arachnid (Nick Johnson <[email protected]>) /// This method is licenced under the Apache License. /// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol function _memcpy(uint _dest, uint _src, uint _len) private pure { } /// @dev Adapted from toString(slice) by @arachnid (Nick Johnson <[email protected]>) /// This method is licenced under the Apache License. /// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol function _toString(bytes32[4] _rawBytes, uint _stringLength) private pure returns (string) { } /// @notice Returns a URI pointing to a metadata package for this token conforming to /// ERC-721 (https://github.com/ethereum/EIPs/issues/721) /// @param _tokenId The ID number of the Kitty whose metadata should be returned. function tokenMetadata(uint _tokenId, string _preferredTransport) public view returns (string infoUrl) { } } contract CryptoversePreorder is CryptoversePreorderBonusAssets { ERC20 public vrc; ERC20 public vcx; address public vrcWallet; address public vcxWallet; uint public vrcCount; uint public vcxCount; uint public weiRaised; uint public constant minInvest = 0.1 ether; uint public contributorsCompleteCount; mapping(address => uint) public contributorBalance; mapping(address => bool) public contributorComplete; mapping(address => uint) public contributorWhiteListTime; uint public constant hardCap = 50000 ether; address[] public contributors; event Purchase(address indexed contributor, uint weiAmount); function() public payable { } function createSaiLimitedEdition(uint weiAmount, address contributor) private { } function createSaiCollectorsEdition(uint weiAmount, address contributor) private { } function createSaiFoundersEdition(uint weiAmount, address contributor) private { } function createVRCBox(ItemModel model, uint weiAmount, address contributor) private { } function createVCXVault(uint weiAmount, address contributor) private { } function createMechBTC(uint weiAmount, address contributor) private { } function createMechVRC(uint weiAmount, address contributor) private { } function createMechETH(uint weiAmount, address contributor) private { } function buyTokens(address contributor) public whenNotPaused payable { } function sendTokens(uint balance, address contributor, bool hasBonus) private { } function withdrawal(uint amount) public onlyOwner { } function contributorsCount() public view returns (uint){ } function setVRC(address _vrc, address _vrcWallet, uint _vrcCount) public onlyOwner { } function setVCX(address _vcx, address _vcxWallet, uint _vcxCount) public onlyOwner { } function getBoxes(address contributor) public view returns (uint[] boxes) { } function isBox(Item item) private pure returns (bool){ } function isBoxItemId(uint itemId) public view returns (bool){ } function openBoxes(uint[] itemIds) public { } }
_approvedFor(msg.sender,tokenId)
294,857
_approvedFor(msg.sender,tokenId)
null
pragma solidity 0.4.24; contract ERC20 { function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address _from, address _to, uint _value) external returns (bool); } contract Ownable { address public owner = 0x345aCaFA4314Bc2479a3aA7cCf8eb47f223C1d0e; modifier onlyOwner() { } } /** * @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 allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { } } /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <[email protected]> (https://github.com/dete) contract ERC721 { // Required methods function totalSupply() public view returns (uint total); function balanceOf(address owner) public view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function approve(address to, uint tokenId) external; function transfer(address to, uint tokenId) public; function transferFrom(address from, address to, uint tokenId) external; // Events event Transfer(address indexed from, address indexed to, uint tokenId); event Approval(address indexed owner, address indexed approved, uint tokenId); // Optional function name() public view returns (string); function symbol() public view returns (string); function tokensOfOwner(address owner) external view returns (uint[] tokenIds); function tokenMetadata(uint tokenId, string preferredTransport) public view returns (string infoUrl); // ERC-165 Compatibility (https://github.com/ethereum/EIPs/issues/165) function supportsInterface(bytes4 contractID) external view returns (bool); } contract ERC721Metadata { function getMetadata(uint tokenId, string preferredTransport) public view returns (bytes32[4] buffer, uint count); } contract CryptoversePreorderBonusAssets is Pausable, ERC721 { struct Item { ItemType typeId; ItemModel model; ItemManufacturer manufacturer; ItemRarity rarity; uint createTime; uint amount; } enum ItemType {VRCBox, VCXVault, SaiHead, SaiBody, SaiEarrings, MechHead, MechBody, MechLegs, MechRailgun, MechMachineGun, MechRocketLauncher} enum ItemModel {NC01, MK1, V1, V1_1, V2_1, M442_1, BG, Q3, TRFL405, BC, DES1, PlasmaS, BD, DRL, Casper, Kilo, Mega, Giga, Tera, Peta, Exa, EA} enum ItemManufacturer {BTC, VRC, ETH, Satoshipowered} enum ItemRarity {Common, Uncommon, Rare, Superior, Epic, Legendary, Unique} function name() public view returns (string){ } function symbol() public view returns (string){ } Item[] public items; mapping(uint => address) public itemIndexToOwner; mapping(address => uint) public ownershipTokenCount; mapping(uint => address) public itemIndexToApproved; function reclaimToken(ERC20 token) external onlyOwner { } function _transfer(address from, address to, uint tokenId) internal { } event CreateItem(uint id, ItemType typeId, ItemModel model, ItemManufacturer manufacturer, ItemRarity rarity, uint createTime, uint amount, address indexed owner); function createItem(ItemType typeId, ItemModel model, ItemManufacturer manufacturer, ItemRarity rarity, uint amount, address owner) internal returns (uint) { } function tokensOfOwner(address owner) external view returns (uint[] ownerTokens) { } function tokensInfoOfOwner(address owner) external view returns (uint[] ownerTokens) { } function tokenInfo(uint itemId) external view returns (uint[] ownerTokens) { } ERC721Metadata public erc721Metadata; bytes4 constant InterfaceSignature_ERC165 = bytes4(keccak256('supportsInterface(bytes4)')); bytes4 constant InterfaceSignature_ERC721 = bytes4(keccak256('name()')) ^ bytes4(keccak256('symbol()')) ^ bytes4(keccak256('totalSupply()')) ^ bytes4(keccak256('balanceOf(address)')) ^ bytes4(keccak256('ownerOf(uint)')) ^ bytes4(keccak256('approve(address,uint)')) ^ bytes4(keccak256('transfer(address,uint)')) ^ bytes4(keccak256('transferFrom(address,address,uint)')) ^ bytes4(keccak256('tokensOfOwner(address)')) ^ bytes4(keccak256('tokenMetadata(uint,string)')); function supportsInterface(bytes4 contractID) external view returns (bool) { } function setMetadataAddress(address contractAddress) public onlyOwner { } function _owns(address claimant, uint tokenId) internal view returns (bool) { } function _approvedFor(address claimant, uint tokenId) internal view returns (bool) { } function _approve(uint tokenId, address approved) internal { } function balanceOf(address owner) public view returns (uint count) { } function transfer(address to, uint tokenId) public { } function approve(address to, uint tokenId) external { } function transferFrom(address from, address to, uint tokenId) external { require(to != address(0)); require(to != address(this)); require(_approvedFor(msg.sender, tokenId)); require(<FILL_ME>) _transfer(from, to, tokenId); } function totalSupply() public view returns (uint) { } function ownerOf(uint tokenId) external view returns (address owner) { } /// @dev Adapted from memcpy() by @arachnid (Nick Johnson <[email protected]>) /// This method is licenced under the Apache License. /// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol function _memcpy(uint _dest, uint _src, uint _len) private pure { } /// @dev Adapted from toString(slice) by @arachnid (Nick Johnson <[email protected]>) /// This method is licenced under the Apache License. /// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol function _toString(bytes32[4] _rawBytes, uint _stringLength) private pure returns (string) { } /// @notice Returns a URI pointing to a metadata package for this token conforming to /// ERC-721 (https://github.com/ethereum/EIPs/issues/721) /// @param _tokenId The ID number of the Kitty whose metadata should be returned. function tokenMetadata(uint _tokenId, string _preferredTransport) public view returns (string infoUrl) { } } contract CryptoversePreorder is CryptoversePreorderBonusAssets { ERC20 public vrc; ERC20 public vcx; address public vrcWallet; address public vcxWallet; uint public vrcCount; uint public vcxCount; uint public weiRaised; uint public constant minInvest = 0.1 ether; uint public contributorsCompleteCount; mapping(address => uint) public contributorBalance; mapping(address => bool) public contributorComplete; mapping(address => uint) public contributorWhiteListTime; uint public constant hardCap = 50000 ether; address[] public contributors; event Purchase(address indexed contributor, uint weiAmount); function() public payable { } function createSaiLimitedEdition(uint weiAmount, address contributor) private { } function createSaiCollectorsEdition(uint weiAmount, address contributor) private { } function createSaiFoundersEdition(uint weiAmount, address contributor) private { } function createVRCBox(ItemModel model, uint weiAmount, address contributor) private { } function createVCXVault(uint weiAmount, address contributor) private { } function createMechBTC(uint weiAmount, address contributor) private { } function createMechVRC(uint weiAmount, address contributor) private { } function createMechETH(uint weiAmount, address contributor) private { } function buyTokens(address contributor) public whenNotPaused payable { } function sendTokens(uint balance, address contributor, bool hasBonus) private { } function withdrawal(uint amount) public onlyOwner { } function contributorsCount() public view returns (uint){ } function setVRC(address _vrc, address _vrcWallet, uint _vrcCount) public onlyOwner { } function setVCX(address _vcx, address _vcxWallet, uint _vcxCount) public onlyOwner { } function getBoxes(address contributor) public view returns (uint[] boxes) { } function isBox(Item item) private pure returns (bool){ } function isBoxItemId(uint itemId) public view returns (bool){ } function openBoxes(uint[] itemIds) public { } }
_owns(from,tokenId)
294,857
_owns(from,tokenId)
null
pragma solidity 0.4.24; contract ERC20 { function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address _from, address _to, uint _value) external returns (bool); } contract Ownable { address public owner = 0x345aCaFA4314Bc2479a3aA7cCf8eb47f223C1d0e; modifier onlyOwner() { } } /** * @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 allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { } } /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <[email protected]> (https://github.com/dete) contract ERC721 { // Required methods function totalSupply() public view returns (uint total); function balanceOf(address owner) public view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function approve(address to, uint tokenId) external; function transfer(address to, uint tokenId) public; function transferFrom(address from, address to, uint tokenId) external; // Events event Transfer(address indexed from, address indexed to, uint tokenId); event Approval(address indexed owner, address indexed approved, uint tokenId); // Optional function name() public view returns (string); function symbol() public view returns (string); function tokensOfOwner(address owner) external view returns (uint[] tokenIds); function tokenMetadata(uint tokenId, string preferredTransport) public view returns (string infoUrl); // ERC-165 Compatibility (https://github.com/ethereum/EIPs/issues/165) function supportsInterface(bytes4 contractID) external view returns (bool); } contract ERC721Metadata { function getMetadata(uint tokenId, string preferredTransport) public view returns (bytes32[4] buffer, uint count); } contract CryptoversePreorderBonusAssets is Pausable, ERC721 { struct Item { ItemType typeId; ItemModel model; ItemManufacturer manufacturer; ItemRarity rarity; uint createTime; uint amount; } enum ItemType {VRCBox, VCXVault, SaiHead, SaiBody, SaiEarrings, MechHead, MechBody, MechLegs, MechRailgun, MechMachineGun, MechRocketLauncher} enum ItemModel {NC01, MK1, V1, V1_1, V2_1, M442_1, BG, Q3, TRFL405, BC, DES1, PlasmaS, BD, DRL, Casper, Kilo, Mega, Giga, Tera, Peta, Exa, EA} enum ItemManufacturer {BTC, VRC, ETH, Satoshipowered} enum ItemRarity {Common, Uncommon, Rare, Superior, Epic, Legendary, Unique} function name() public view returns (string){ } function symbol() public view returns (string){ } Item[] public items; mapping(uint => address) public itemIndexToOwner; mapping(address => uint) public ownershipTokenCount; mapping(uint => address) public itemIndexToApproved; function reclaimToken(ERC20 token) external onlyOwner { } function _transfer(address from, address to, uint tokenId) internal { } event CreateItem(uint id, ItemType typeId, ItemModel model, ItemManufacturer manufacturer, ItemRarity rarity, uint createTime, uint amount, address indexed owner); function createItem(ItemType typeId, ItemModel model, ItemManufacturer manufacturer, ItemRarity rarity, uint amount, address owner) internal returns (uint) { } function tokensOfOwner(address owner) external view returns (uint[] ownerTokens) { } function tokensInfoOfOwner(address owner) external view returns (uint[] ownerTokens) { } function tokenInfo(uint itemId) external view returns (uint[] ownerTokens) { } ERC721Metadata public erc721Metadata; bytes4 constant InterfaceSignature_ERC165 = bytes4(keccak256('supportsInterface(bytes4)')); bytes4 constant InterfaceSignature_ERC721 = bytes4(keccak256('name()')) ^ bytes4(keccak256('symbol()')) ^ bytes4(keccak256('totalSupply()')) ^ bytes4(keccak256('balanceOf(address)')) ^ bytes4(keccak256('ownerOf(uint)')) ^ bytes4(keccak256('approve(address,uint)')) ^ bytes4(keccak256('transfer(address,uint)')) ^ bytes4(keccak256('transferFrom(address,address,uint)')) ^ bytes4(keccak256('tokensOfOwner(address)')) ^ bytes4(keccak256('tokenMetadata(uint,string)')); function supportsInterface(bytes4 contractID) external view returns (bool) { } function setMetadataAddress(address contractAddress) public onlyOwner { } function _owns(address claimant, uint tokenId) internal view returns (bool) { } function _approvedFor(address claimant, uint tokenId) internal view returns (bool) { } function _approve(uint tokenId, address approved) internal { } function balanceOf(address owner) public view returns (uint count) { } function transfer(address to, uint tokenId) public { } function approve(address to, uint tokenId) external { } function transferFrom(address from, address to, uint tokenId) external { } function totalSupply() public view returns (uint) { } function ownerOf(uint tokenId) external view returns (address owner) { } /// @dev Adapted from memcpy() by @arachnid (Nick Johnson <[email protected]>) /// This method is licenced under the Apache License. /// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol function _memcpy(uint _dest, uint _src, uint _len) private pure { } /// @dev Adapted from toString(slice) by @arachnid (Nick Johnson <[email protected]>) /// This method is licenced under the Apache License. /// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol function _toString(bytes32[4] _rawBytes, uint _stringLength) private pure returns (string) { } /// @notice Returns a URI pointing to a metadata package for this token conforming to /// ERC-721 (https://github.com/ethereum/EIPs/issues/721) /// @param _tokenId The ID number of the Kitty whose metadata should be returned. function tokenMetadata(uint _tokenId, string _preferredTransport) public view returns (string infoUrl) { } } contract CryptoversePreorder is CryptoversePreorderBonusAssets { ERC20 public vrc; ERC20 public vcx; address public vrcWallet; address public vcxWallet; uint public vrcCount; uint public vcxCount; uint public weiRaised; uint public constant minInvest = 0.1 ether; uint public contributorsCompleteCount; mapping(address => uint) public contributorBalance; mapping(address => bool) public contributorComplete; mapping(address => uint) public contributorWhiteListTime; uint public constant hardCap = 50000 ether; address[] public contributors; event Purchase(address indexed contributor, uint weiAmount); function() public payable { } function createSaiLimitedEdition(uint weiAmount, address contributor) private { } function createSaiCollectorsEdition(uint weiAmount, address contributor) private { } function createSaiFoundersEdition(uint weiAmount, address contributor) private { } function createVRCBox(ItemModel model, uint weiAmount, address contributor) private { } function createVCXVault(uint weiAmount, address contributor) private { } function createMechBTC(uint weiAmount, address contributor) private { } function createMechVRC(uint weiAmount, address contributor) private { } function createMechETH(uint weiAmount, address contributor) private { } function buyTokens(address contributor) public whenNotPaused payable { require(contributor != address(0)); uint weiAmount = msg.value; require(weiAmount >= minInvest); weiRaised += weiAmount; require(weiRaised <= hardCap); emit Purchase(contributor, weiAmount); if (contributorBalance[contributor] == 0) { contributors.push(contributor); contributorBalance[contributor] += weiAmount; contributorWhiteListTime[contributor] = now; } else { require(<FILL_ME>) require(weiAmount >= contributorBalance[contributor] * 99); bool hasBonus = (now - contributorWhiteListTime[contributor]) < 72 hours; contributorBalance[contributor] += weiAmount; sendTokens(contributorBalance[contributor], contributor, hasBonus); contributorComplete[contributor] = true; contributorsCompleteCount++; } } function sendTokens(uint balance, address contributor, bool hasBonus) private { } function withdrawal(uint amount) public onlyOwner { } function contributorsCount() public view returns (uint){ } function setVRC(address _vrc, address _vrcWallet, uint _vrcCount) public onlyOwner { } function setVCX(address _vcx, address _vcxWallet, uint _vcxCount) public onlyOwner { } function getBoxes(address contributor) public view returns (uint[] boxes) { } function isBox(Item item) private pure returns (bool){ } function isBoxItemId(uint itemId) public view returns (bool){ } function openBoxes(uint[] itemIds) public { } }
!contributorComplete[contributor]
294,857
!contributorComplete[contributor]
null
pragma solidity 0.4.24; contract ERC20 { function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address _from, address _to, uint _value) external returns (bool); } contract Ownable { address public owner = 0x345aCaFA4314Bc2479a3aA7cCf8eb47f223C1d0e; modifier onlyOwner() { } } /** * @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 allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { } } /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <[email protected]> (https://github.com/dete) contract ERC721 { // Required methods function totalSupply() public view returns (uint total); function balanceOf(address owner) public view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function approve(address to, uint tokenId) external; function transfer(address to, uint tokenId) public; function transferFrom(address from, address to, uint tokenId) external; // Events event Transfer(address indexed from, address indexed to, uint tokenId); event Approval(address indexed owner, address indexed approved, uint tokenId); // Optional function name() public view returns (string); function symbol() public view returns (string); function tokensOfOwner(address owner) external view returns (uint[] tokenIds); function tokenMetadata(uint tokenId, string preferredTransport) public view returns (string infoUrl); // ERC-165 Compatibility (https://github.com/ethereum/EIPs/issues/165) function supportsInterface(bytes4 contractID) external view returns (bool); } contract ERC721Metadata { function getMetadata(uint tokenId, string preferredTransport) public view returns (bytes32[4] buffer, uint count); } contract CryptoversePreorderBonusAssets is Pausable, ERC721 { struct Item { ItemType typeId; ItemModel model; ItemManufacturer manufacturer; ItemRarity rarity; uint createTime; uint amount; } enum ItemType {VRCBox, VCXVault, SaiHead, SaiBody, SaiEarrings, MechHead, MechBody, MechLegs, MechRailgun, MechMachineGun, MechRocketLauncher} enum ItemModel {NC01, MK1, V1, V1_1, V2_1, M442_1, BG, Q3, TRFL405, BC, DES1, PlasmaS, BD, DRL, Casper, Kilo, Mega, Giga, Tera, Peta, Exa, EA} enum ItemManufacturer {BTC, VRC, ETH, Satoshipowered} enum ItemRarity {Common, Uncommon, Rare, Superior, Epic, Legendary, Unique} function name() public view returns (string){ } function symbol() public view returns (string){ } Item[] public items; mapping(uint => address) public itemIndexToOwner; mapping(address => uint) public ownershipTokenCount; mapping(uint => address) public itemIndexToApproved; function reclaimToken(ERC20 token) external onlyOwner { } function _transfer(address from, address to, uint tokenId) internal { } event CreateItem(uint id, ItemType typeId, ItemModel model, ItemManufacturer manufacturer, ItemRarity rarity, uint createTime, uint amount, address indexed owner); function createItem(ItemType typeId, ItemModel model, ItemManufacturer manufacturer, ItemRarity rarity, uint amount, address owner) internal returns (uint) { } function tokensOfOwner(address owner) external view returns (uint[] ownerTokens) { } function tokensInfoOfOwner(address owner) external view returns (uint[] ownerTokens) { } function tokenInfo(uint itemId) external view returns (uint[] ownerTokens) { } ERC721Metadata public erc721Metadata; bytes4 constant InterfaceSignature_ERC165 = bytes4(keccak256('supportsInterface(bytes4)')); bytes4 constant InterfaceSignature_ERC721 = bytes4(keccak256('name()')) ^ bytes4(keccak256('symbol()')) ^ bytes4(keccak256('totalSupply()')) ^ bytes4(keccak256('balanceOf(address)')) ^ bytes4(keccak256('ownerOf(uint)')) ^ bytes4(keccak256('approve(address,uint)')) ^ bytes4(keccak256('transfer(address,uint)')) ^ bytes4(keccak256('transferFrom(address,address,uint)')) ^ bytes4(keccak256('tokensOfOwner(address)')) ^ bytes4(keccak256('tokenMetadata(uint,string)')); function supportsInterface(bytes4 contractID) external view returns (bool) { } function setMetadataAddress(address contractAddress) public onlyOwner { } function _owns(address claimant, uint tokenId) internal view returns (bool) { } function _approvedFor(address claimant, uint tokenId) internal view returns (bool) { } function _approve(uint tokenId, address approved) internal { } function balanceOf(address owner) public view returns (uint count) { } function transfer(address to, uint tokenId) public { } function approve(address to, uint tokenId) external { } function transferFrom(address from, address to, uint tokenId) external { } function totalSupply() public view returns (uint) { } function ownerOf(uint tokenId) external view returns (address owner) { } /// @dev Adapted from memcpy() by @arachnid (Nick Johnson <[email protected]>) /// This method is licenced under the Apache License. /// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol function _memcpy(uint _dest, uint _src, uint _len) private pure { } /// @dev Adapted from toString(slice) by @arachnid (Nick Johnson <[email protected]>) /// This method is licenced under the Apache License. /// Ref: https://github.com/Arachnid/solidity-stringutils/blob/2f6ca9accb48ae14c66f1437ec50ed19a0616f78/strings.sol function _toString(bytes32[4] _rawBytes, uint _stringLength) private pure returns (string) { } /// @notice Returns a URI pointing to a metadata package for this token conforming to /// ERC-721 (https://github.com/ethereum/EIPs/issues/721) /// @param _tokenId The ID number of the Kitty whose metadata should be returned. function tokenMetadata(uint _tokenId, string _preferredTransport) public view returns (string infoUrl) { } } contract CryptoversePreorder is CryptoversePreorderBonusAssets { ERC20 public vrc; ERC20 public vcx; address public vrcWallet; address public vcxWallet; uint public vrcCount; uint public vcxCount; uint public weiRaised; uint public constant minInvest = 0.1 ether; uint public contributorsCompleteCount; mapping(address => uint) public contributorBalance; mapping(address => bool) public contributorComplete; mapping(address => uint) public contributorWhiteListTime; uint public constant hardCap = 50000 ether; address[] public contributors; event Purchase(address indexed contributor, uint weiAmount); function() public payable { } function createSaiLimitedEdition(uint weiAmount, address contributor) private { } function createSaiCollectorsEdition(uint weiAmount, address contributor) private { } function createSaiFoundersEdition(uint weiAmount, address contributor) private { } function createVRCBox(ItemModel model, uint weiAmount, address contributor) private { } function createVCXVault(uint weiAmount, address contributor) private { } function createMechBTC(uint weiAmount, address contributor) private { } function createMechVRC(uint weiAmount, address contributor) private { } function createMechETH(uint weiAmount, address contributor) private { } function buyTokens(address contributor) public whenNotPaused payable { } function sendTokens(uint balance, address contributor, bool hasBonus) private { } function withdrawal(uint amount) public onlyOwner { } function contributorsCount() public view returns (uint){ } function setVRC(address _vrc, address _vrcWallet, uint _vrcCount) public onlyOwner { } function setVCX(address _vcx, address _vcxWallet, uint _vcxCount) public onlyOwner { } function getBoxes(address contributor) public view returns (uint[] boxes) { } function isBox(Item item) private pure returns (bool){ } function isBoxItemId(uint itemId) public view returns (bool){ } function openBoxes(uint[] itemIds) public { for (uint i = 0; i < itemIds.length; i++) { uint itemId = itemIds[i]; Item storage item = items[itemId]; require(<FILL_ME>) transfer(this, itemId); if (item.typeId == ItemType.VRCBox) { vrc.transferFrom(vrcWallet, msg.sender, item.amount * vrcCount / weiRaised); } else { vcx.transferFrom(vcxWallet, msg.sender, item.amount * vcxCount / weiRaised); } } } }
isBox(item)
294,857
isBox(item)
null
interface UniswapExchange { function ethToTokenSwapInput( uint256 min_tokens, uint256 deadline ) external payable returns (uint256 tokens_bought); function tokenToEthSwapInput( uint256 tokens_sold, uint256 min_eth, uint256 deadline ) external returns (uint256 eth_bought); function getEthToTokenInputPrice( uint256 eth_sold ) external view returns (uint256 tokens_bought); function getTokenToEthInputPrice( uint256 tokens_sold ) external view returns (uint256 eth_bought); } interface UniswapFactory { function getExchange(address token) external view returns (address exchange); } contract KyberUniswapReserve is KyberReserveInterface, Withdrawable, Utils2 { // Parts per 10000 uint public constant DEFAULT_FEE_BPS = 25; UniswapFactory public uniswapFactory; address public kyberNetwork; uint public feeBps = DEFAULT_FEE_BPS; // Uniswap exchange contract for every listed token // token -> exchange mapping (address => address) public tokenExchange; bool public tradeEnabled = true; /** Constructor */ function KyberUniswapReserve( UniswapFactory _uniswapFactory, address _admin, address _kyberNetwork ) public { require(<FILL_ME>) require(_admin != 0); require(_kyberNetwork != 0); uniswapFactory = _uniswapFactory; admin = _admin; kyberNetwork = _kyberNetwork; } function() public payable { } /** Returns dest quantity / source quantity. */ function getConversionRate( ERC20 src, ERC20 dest, uint srcQty, uint blockNumber ) public view returns(uint) { } event TradeExecute( address indexed sender, address src, uint srcAmount, address destToken, uint destAmount, address destAddress ); /** conversionRate: expected conversion rate should be >= this value. */ function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool) { } event FeeUpdated( uint bps ); function setFee( uint bps ) public onlyAdmin { } event TokenListed( ERC20 token, UniswapExchange exchange ); function listToken(ERC20 token) public onlyAdmin { } event TokenDelisted(ERC20 token); function delistToken(ERC20 token) public onlyAdmin { } function isValidTokens( ERC20 src, ERC20 dest ) public view returns(bool) { } event TradeEnabled( bool enable ); function enableTrade() public onlyAdmin returns(bool) { } function disableTrade() public onlyAlerter returns(bool) { } event KyberNetworkSet( address kyberNetwork ); function setKyberNetwork( address _kyberNetwork ) public onlyAdmin { } }
address(_uniswapFactory)!=0
294,859
address(_uniswapFactory)!=0
null
interface UniswapExchange { function ethToTokenSwapInput( uint256 min_tokens, uint256 deadline ) external payable returns (uint256 tokens_bought); function tokenToEthSwapInput( uint256 tokens_sold, uint256 min_eth, uint256 deadline ) external returns (uint256 eth_bought); function getEthToTokenInputPrice( uint256 eth_sold ) external view returns (uint256 tokens_bought); function getTokenToEthInputPrice( uint256 tokens_sold ) external view returns (uint256 eth_bought); } interface UniswapFactory { function getExchange(address token) external view returns (address exchange); } contract KyberUniswapReserve is KyberReserveInterface, Withdrawable, Utils2 { // Parts per 10000 uint public constant DEFAULT_FEE_BPS = 25; UniswapFactory public uniswapFactory; address public kyberNetwork; uint public feeBps = DEFAULT_FEE_BPS; // Uniswap exchange contract for every listed token // token -> exchange mapping (address => address) public tokenExchange; bool public tradeEnabled = true; /** Constructor */ function KyberUniswapReserve( UniswapFactory _uniswapFactory, address _admin, address _kyberNetwork ) public { } function() public payable { } /** Returns dest quantity / source quantity. */ function getConversionRate( ERC20 src, ERC20 dest, uint srcQty, uint blockNumber ) public view returns(uint) { // This makes the UNUSED warning go away. blockNumber; require(<FILL_ME>) if (!tradeEnabled) return 0; ERC20 token; if (src == ETH_TOKEN_ADDRESS) { token = dest; } else if (dest == ETH_TOKEN_ADDRESS) { token = src; } else { // Should never arrive here - isValidTokens requires one side to be ETH revert(); } UniswapExchange exchange = UniswapExchange(tokenExchange[token]); uint convertedQuantity; if (src == ETH_TOKEN_ADDRESS) { uint quantity = srcQty * (10000 - feeBps) / 10000; convertedQuantity = exchange.getEthToTokenInputPrice(quantity); } else { convertedQuantity = exchange.getTokenToEthInputPrice(srcQty); convertedQuantity = convertedQuantity * (10000 - feeBps) / 10000; } return calcRateFromQty( srcQty, /* srcAmount */ convertedQuantity, /* destAmount */ getDecimals(src), /* srcDecimals */ getDecimals(dest) /* dstDecimals */ ); } event TradeExecute( address indexed sender, address src, uint srcAmount, address destToken, uint destAmount, address destAddress ); /** conversionRate: expected conversion rate should be >= this value. */ function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool) { } event FeeUpdated( uint bps ); function setFee( uint bps ) public onlyAdmin { } event TokenListed( ERC20 token, UniswapExchange exchange ); function listToken(ERC20 token) public onlyAdmin { } event TokenDelisted(ERC20 token); function delistToken(ERC20 token) public onlyAdmin { } function isValidTokens( ERC20 src, ERC20 dest ) public view returns(bool) { } event TradeEnabled( bool enable ); function enableTrade() public onlyAdmin returns(bool) { } function disableTrade() public onlyAlerter returns(bool) { } event KyberNetworkSet( address kyberNetwork ); function setKyberNetwork( address _kyberNetwork ) public onlyAdmin { } }
isValidTokens(src,dest)
294,859
isValidTokens(src,dest)
null
interface UniswapExchange { function ethToTokenSwapInput( uint256 min_tokens, uint256 deadline ) external payable returns (uint256 tokens_bought); function tokenToEthSwapInput( uint256 tokens_sold, uint256 min_eth, uint256 deadline ) external returns (uint256 eth_bought); function getEthToTokenInputPrice( uint256 eth_sold ) external view returns (uint256 tokens_bought); function getTokenToEthInputPrice( uint256 tokens_sold ) external view returns (uint256 eth_bought); } interface UniswapFactory { function getExchange(address token) external view returns (address exchange); } contract KyberUniswapReserve is KyberReserveInterface, Withdrawable, Utils2 { // Parts per 10000 uint public constant DEFAULT_FEE_BPS = 25; UniswapFactory public uniswapFactory; address public kyberNetwork; uint public feeBps = DEFAULT_FEE_BPS; // Uniswap exchange contract for every listed token // token -> exchange mapping (address => address) public tokenExchange; bool public tradeEnabled = true; /** Constructor */ function KyberUniswapReserve( UniswapFactory _uniswapFactory, address _admin, address _kyberNetwork ) public { } function() public payable { } /** Returns dest quantity / source quantity. */ function getConversionRate( ERC20 src, ERC20 dest, uint srcQty, uint blockNumber ) public view returns(uint) { } event TradeExecute( address indexed sender, address src, uint srcAmount, address destToken, uint destAmount, address destAddress ); /** conversionRate: expected conversion rate should be >= this value. */ function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool) { // Not using this variable that is part of the interface. validate; require(tradeEnabled); require(msg.sender == kyberNetwork); require(<FILL_ME>) uint expectedConversionRate = getConversionRate( srcToken, destToken, srcAmount, 0 /* blockNumber */ ); require(expectedConversionRate <= conversionRate); uint destAmount; UniswapExchange exchange; if (srcToken == ETH_TOKEN_ADDRESS) { require(srcAmount == msg.value); // Fees in ETH uint quantity = srcAmount * (10000 - feeBps) / 10000; exchange = UniswapExchange(tokenExchange[destToken]); destAmount = exchange.ethToTokenSwapInput.value(quantity)( 1, /* min_tokens: uniswap requires it to be > 0 */ 2 ** 255 /* deadline */ ); require(destToken.transfer(destAddress, destAmount)); } else { require(msg.value == 0); require(srcToken.transferFrom(msg.sender, address(this), srcAmount)); exchange = UniswapExchange(tokenExchange[srcToken]); destAmount = exchange.tokenToEthSwapInput( srcAmount, 1, /* min_eth: uniswap requires it to be > 0 */ 2 ** 255 /* deadline */ ); // Fees in ETH destAmount = destAmount * (10000 - feeBps) / 10000; destAddress.transfer(destAmount); } TradeExecute( msg.sender, /* sender */ srcToken, /* src */ srcAmount, /* srcAmount */ destToken, /* destToken */ destAmount, /* destAmount */ destAddress /* destAddress */ ); return true; } event FeeUpdated( uint bps ); function setFee( uint bps ) public onlyAdmin { } event TokenListed( ERC20 token, UniswapExchange exchange ); function listToken(ERC20 token) public onlyAdmin { } event TokenDelisted(ERC20 token); function delistToken(ERC20 token) public onlyAdmin { } function isValidTokens( ERC20 src, ERC20 dest ) public view returns(bool) { } event TradeEnabled( bool enable ); function enableTrade() public onlyAdmin returns(bool) { } function disableTrade() public onlyAlerter returns(bool) { } event KyberNetworkSet( address kyberNetwork ); function setKyberNetwork( address _kyberNetwork ) public onlyAdmin { } }
isValidTokens(srcToken,destToken)
294,859
isValidTokens(srcToken,destToken)
null
interface UniswapExchange { function ethToTokenSwapInput( uint256 min_tokens, uint256 deadline ) external payable returns (uint256 tokens_bought); function tokenToEthSwapInput( uint256 tokens_sold, uint256 min_eth, uint256 deadline ) external returns (uint256 eth_bought); function getEthToTokenInputPrice( uint256 eth_sold ) external view returns (uint256 tokens_bought); function getTokenToEthInputPrice( uint256 tokens_sold ) external view returns (uint256 eth_bought); } interface UniswapFactory { function getExchange(address token) external view returns (address exchange); } contract KyberUniswapReserve is KyberReserveInterface, Withdrawable, Utils2 { // Parts per 10000 uint public constant DEFAULT_FEE_BPS = 25; UniswapFactory public uniswapFactory; address public kyberNetwork; uint public feeBps = DEFAULT_FEE_BPS; // Uniswap exchange contract for every listed token // token -> exchange mapping (address => address) public tokenExchange; bool public tradeEnabled = true; /** Constructor */ function KyberUniswapReserve( UniswapFactory _uniswapFactory, address _admin, address _kyberNetwork ) public { } function() public payable { } /** Returns dest quantity / source quantity. */ function getConversionRate( ERC20 src, ERC20 dest, uint srcQty, uint blockNumber ) public view returns(uint) { } event TradeExecute( address indexed sender, address src, uint srcAmount, address destToken, uint destAmount, address destAddress ); /** conversionRate: expected conversion rate should be >= this value. */ function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool) { // Not using this variable that is part of the interface. validate; require(tradeEnabled); require(msg.sender == kyberNetwork); require(isValidTokens(srcToken, destToken)); uint expectedConversionRate = getConversionRate( srcToken, destToken, srcAmount, 0 /* blockNumber */ ); require(expectedConversionRate <= conversionRate); uint destAmount; UniswapExchange exchange; if (srcToken == ETH_TOKEN_ADDRESS) { require(srcAmount == msg.value); // Fees in ETH uint quantity = srcAmount * (10000 - feeBps) / 10000; exchange = UniswapExchange(tokenExchange[destToken]); destAmount = exchange.ethToTokenSwapInput.value(quantity)( 1, /* min_tokens: uniswap requires it to be > 0 */ 2 ** 255 /* deadline */ ); require(destToken.transfer(destAddress, destAmount)); } else { require(msg.value == 0); require(<FILL_ME>) exchange = UniswapExchange(tokenExchange[srcToken]); destAmount = exchange.tokenToEthSwapInput( srcAmount, 1, /* min_eth: uniswap requires it to be > 0 */ 2 ** 255 /* deadline */ ); // Fees in ETH destAmount = destAmount * (10000 - feeBps) / 10000; destAddress.transfer(destAmount); } TradeExecute( msg.sender, /* sender */ srcToken, /* src */ srcAmount, /* srcAmount */ destToken, /* destToken */ destAmount, /* destAmount */ destAddress /* destAddress */ ); return true; } event FeeUpdated( uint bps ); function setFee( uint bps ) public onlyAdmin { } event TokenListed( ERC20 token, UniswapExchange exchange ); function listToken(ERC20 token) public onlyAdmin { } event TokenDelisted(ERC20 token); function delistToken(ERC20 token) public onlyAdmin { } function isValidTokens( ERC20 src, ERC20 dest ) public view returns(bool) { } event TradeEnabled( bool enable ); function enableTrade() public onlyAdmin returns(bool) { } function disableTrade() public onlyAlerter returns(bool) { } event KyberNetworkSet( address kyberNetwork ); function setKyberNetwork( address _kyberNetwork ) public onlyAdmin { } }
srcToken.transferFrom(msg.sender,address(this),srcAmount)
294,859
srcToken.transferFrom(msg.sender,address(this),srcAmount)
null
interface UniswapExchange { function ethToTokenSwapInput( uint256 min_tokens, uint256 deadline ) external payable returns (uint256 tokens_bought); function tokenToEthSwapInput( uint256 tokens_sold, uint256 min_eth, uint256 deadline ) external returns (uint256 eth_bought); function getEthToTokenInputPrice( uint256 eth_sold ) external view returns (uint256 tokens_bought); function getTokenToEthInputPrice( uint256 tokens_sold ) external view returns (uint256 eth_bought); } interface UniswapFactory { function getExchange(address token) external view returns (address exchange); } contract KyberUniswapReserve is KyberReserveInterface, Withdrawable, Utils2 { // Parts per 10000 uint public constant DEFAULT_FEE_BPS = 25; UniswapFactory public uniswapFactory; address public kyberNetwork; uint public feeBps = DEFAULT_FEE_BPS; // Uniswap exchange contract for every listed token // token -> exchange mapping (address => address) public tokenExchange; bool public tradeEnabled = true; /** Constructor */ function KyberUniswapReserve( UniswapFactory _uniswapFactory, address _admin, address _kyberNetwork ) public { } function() public payable { } /** Returns dest quantity / source quantity. */ function getConversionRate( ERC20 src, ERC20 dest, uint srcQty, uint blockNumber ) public view returns(uint) { } event TradeExecute( address indexed sender, address src, uint srcAmount, address destToken, uint destAmount, address destAddress ); /** conversionRate: expected conversion rate should be >= this value. */ function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool) { } event FeeUpdated( uint bps ); function setFee( uint bps ) public onlyAdmin { } event TokenListed( ERC20 token, UniswapExchange exchange ); function listToken(ERC20 token) public onlyAdmin { require(<FILL_ME>) UniswapExchange uniswapExchange = UniswapExchange( uniswapFactory.getExchange(token) ); tokenExchange[token] = uniswapExchange; setDecimals(token); require(token.approve(uniswapExchange, 2**255)); TokenListed(token, uniswapExchange); } event TokenDelisted(ERC20 token); function delistToken(ERC20 token) public onlyAdmin { } function isValidTokens( ERC20 src, ERC20 dest ) public view returns(bool) { } event TradeEnabled( bool enable ); function enableTrade() public onlyAdmin returns(bool) { } function disableTrade() public onlyAlerter returns(bool) { } event KyberNetworkSet( address kyberNetwork ); function setKyberNetwork( address _kyberNetwork ) public onlyAdmin { } }
address(token)!=0
294,859
address(token)!=0
null
interface UniswapExchange { function ethToTokenSwapInput( uint256 min_tokens, uint256 deadline ) external payable returns (uint256 tokens_bought); function tokenToEthSwapInput( uint256 tokens_sold, uint256 min_eth, uint256 deadline ) external returns (uint256 eth_bought); function getEthToTokenInputPrice( uint256 eth_sold ) external view returns (uint256 tokens_bought); function getTokenToEthInputPrice( uint256 tokens_sold ) external view returns (uint256 eth_bought); } interface UniswapFactory { function getExchange(address token) external view returns (address exchange); } contract KyberUniswapReserve is KyberReserveInterface, Withdrawable, Utils2 { // Parts per 10000 uint public constant DEFAULT_FEE_BPS = 25; UniswapFactory public uniswapFactory; address public kyberNetwork; uint public feeBps = DEFAULT_FEE_BPS; // Uniswap exchange contract for every listed token // token -> exchange mapping (address => address) public tokenExchange; bool public tradeEnabled = true; /** Constructor */ function KyberUniswapReserve( UniswapFactory _uniswapFactory, address _admin, address _kyberNetwork ) public { } function() public payable { } /** Returns dest quantity / source quantity. */ function getConversionRate( ERC20 src, ERC20 dest, uint srcQty, uint blockNumber ) public view returns(uint) { } event TradeExecute( address indexed sender, address src, uint srcAmount, address destToken, uint destAmount, address destAddress ); /** conversionRate: expected conversion rate should be >= this value. */ function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool) { } event FeeUpdated( uint bps ); function setFee( uint bps ) public onlyAdmin { } event TokenListed( ERC20 token, UniswapExchange exchange ); function listToken(ERC20 token) public onlyAdmin { require(address(token) != 0); UniswapExchange uniswapExchange = UniswapExchange( uniswapFactory.getExchange(token) ); tokenExchange[token] = uniswapExchange; setDecimals(token); require(<FILL_ME>) TokenListed(token, uniswapExchange); } event TokenDelisted(ERC20 token); function delistToken(ERC20 token) public onlyAdmin { } function isValidTokens( ERC20 src, ERC20 dest ) public view returns(bool) { } event TradeEnabled( bool enable ); function enableTrade() public onlyAdmin returns(bool) { } function disableTrade() public onlyAlerter returns(bool) { } event KyberNetworkSet( address kyberNetwork ); function setKyberNetwork( address _kyberNetwork ) public onlyAdmin { } }
token.approve(uniswapExchange,2**255)
294,859
token.approve(uniswapExchange,2**255)
null
interface UniswapExchange { function ethToTokenSwapInput( uint256 min_tokens, uint256 deadline ) external payable returns (uint256 tokens_bought); function tokenToEthSwapInput( uint256 tokens_sold, uint256 min_eth, uint256 deadline ) external returns (uint256 eth_bought); function getEthToTokenInputPrice( uint256 eth_sold ) external view returns (uint256 tokens_bought); function getTokenToEthInputPrice( uint256 tokens_sold ) external view returns (uint256 eth_bought); } interface UniswapFactory { function getExchange(address token) external view returns (address exchange); } contract KyberUniswapReserve is KyberReserveInterface, Withdrawable, Utils2 { // Parts per 10000 uint public constant DEFAULT_FEE_BPS = 25; UniswapFactory public uniswapFactory; address public kyberNetwork; uint public feeBps = DEFAULT_FEE_BPS; // Uniswap exchange contract for every listed token // token -> exchange mapping (address => address) public tokenExchange; bool public tradeEnabled = true; /** Constructor */ function KyberUniswapReserve( UniswapFactory _uniswapFactory, address _admin, address _kyberNetwork ) public { } function() public payable { } /** Returns dest quantity / source quantity. */ function getConversionRate( ERC20 src, ERC20 dest, uint srcQty, uint blockNumber ) public view returns(uint) { } event TradeExecute( address indexed sender, address src, uint srcAmount, address destToken, uint destAmount, address destAddress ); /** conversionRate: expected conversion rate should be >= this value. */ function trade( ERC20 srcToken, uint srcAmount, ERC20 destToken, address destAddress, uint conversionRate, bool validate ) public payable returns(bool) { } event FeeUpdated( uint bps ); function setFee( uint bps ) public onlyAdmin { } event TokenListed( ERC20 token, UniswapExchange exchange ); function listToken(ERC20 token) public onlyAdmin { } event TokenDelisted(ERC20 token); function delistToken(ERC20 token) public onlyAdmin { require(<FILL_ME>) tokenExchange[token] = 0; TokenDelisted(token); } function isValidTokens( ERC20 src, ERC20 dest ) public view returns(bool) { } event TradeEnabled( bool enable ); function enableTrade() public onlyAdmin returns(bool) { } function disableTrade() public onlyAlerter returns(bool) { } event KyberNetworkSet( address kyberNetwork ); function setKyberNetwork( address _kyberNetwork ) public onlyAdmin { } }
tokenExchange[token]!=0
294,859
tokenExchange[token]!=0
"Sent ether value is incorrect"
pragma solidity ^0.8.0; contract ThePlanetOfHares is ERC721Enumerable, Ownable { using Address for address; using Strings for uint256; address public multiSigWallet; uint256 public constant MAX_SUPPLY = 10000; uint256 public constant NFT_PRICE_PRESALE = 60000000000000000; // 0.06 ETH uint256 public constant NFT_PRICE = 80000000000000000; // 0.08 ETH uint256 public constant MIN_NFT_PURCHASE_PRESALE = 10; uint256 public constant MAX_NFT_PURCHASE_PRESALE = 50; uint256 public constant MIN_NFT_PURCHASE = 1; uint256 public constant MAX_NFT_PURCHASE = 10; uint256 public hareReserve = 100; bool public saleIsActive = false; bool public presaleIsActive = false; bool public isMetadataLocked = false; string private _baseURIExtended; modifier OnlyMultiSignWallet() { } constructor(address _multiSigWallet) ERC721("The Planet of Hares","HARES") { } function withdraw(uint256 _amount, address payable _recipient) public OnlyMultiSignWallet { } function flipPresaleState() public onlyOwner { } function flipSaleState() public onlyOwner { } function flipPresaleStateAndSaleState() public onlyOwner { } function lockMetadata() public onlyOwner { } function reserveHares(address _to, uint256 _reserveAmount) public onlyOwner { } function mintHarePresale(uint numberOfTokens) public payable { require(presaleIsActive, "Presale is not active at the moment"); require(numberOfTokens >= MIN_NFT_PURCHASE_PRESALE, "Number of tokens can not be less than 10"); require(numberOfTokens <= MAX_NFT_PURCHASE_PRESALE, "Number of tokens can not be more than 30"); require(<FILL_ME>) for (uint i = 0; i < numberOfTokens; i++) { _safeMint(msg.sender, totalSupply()); } } function mintHare(uint numberOfTokens) public payable { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI_) external onlyOwner { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
NFT_PRICE_PRESALE*numberOfTokens<=msg.value,"Sent ether value is incorrect"
294,873
NFT_PRICE_PRESALE*numberOfTokens<=msg.value
"Purchase would exceed max supply of Hares"
pragma solidity ^0.8.0; contract ThePlanetOfHares is ERC721Enumerable, Ownable { using Address for address; using Strings for uint256; address public multiSigWallet; uint256 public constant MAX_SUPPLY = 10000; uint256 public constant NFT_PRICE_PRESALE = 60000000000000000; // 0.06 ETH uint256 public constant NFT_PRICE = 80000000000000000; // 0.08 ETH uint256 public constant MIN_NFT_PURCHASE_PRESALE = 10; uint256 public constant MAX_NFT_PURCHASE_PRESALE = 50; uint256 public constant MIN_NFT_PURCHASE = 1; uint256 public constant MAX_NFT_PURCHASE = 10; uint256 public hareReserve = 100; bool public saleIsActive = false; bool public presaleIsActive = false; bool public isMetadataLocked = false; string private _baseURIExtended; modifier OnlyMultiSignWallet() { } constructor(address _multiSigWallet) ERC721("The Planet of Hares","HARES") { } function withdraw(uint256 _amount, address payable _recipient) public OnlyMultiSignWallet { } function flipPresaleState() public onlyOwner { } function flipSaleState() public onlyOwner { } function flipPresaleStateAndSaleState() public onlyOwner { } function lockMetadata() public onlyOwner { } function reserveHares(address _to, uint256 _reserveAmount) public onlyOwner { } function mintHarePresale(uint numberOfTokens) public payable { } function mintHare(uint numberOfTokens) public payable { require(saleIsActive, "Sale is not active at the moment"); require(numberOfTokens >= MIN_NFT_PURCHASE, "Number of tokens can not be less than 1"); require(numberOfTokens <= MAX_NFT_PURCHASE, "Number of tokens can not be more than 10"); require(<FILL_ME>) require(NFT_PRICE * numberOfTokens <= msg.value, "Sent ether value is incorrect"); for (uint i = 0; i < numberOfTokens; i++) { _safeMint(msg.sender, totalSupply()); } } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI_) external onlyOwner { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
totalSupply()+numberOfTokens<=MAX_SUPPLY-hareReserve,"Purchase would exceed max supply of Hares"
294,873
totalSupply()+numberOfTokens<=MAX_SUPPLY-hareReserve
"Sent ether value is incorrect"
pragma solidity ^0.8.0; contract ThePlanetOfHares is ERC721Enumerable, Ownable { using Address for address; using Strings for uint256; address public multiSigWallet; uint256 public constant MAX_SUPPLY = 10000; uint256 public constant NFT_PRICE_PRESALE = 60000000000000000; // 0.06 ETH uint256 public constant NFT_PRICE = 80000000000000000; // 0.08 ETH uint256 public constant MIN_NFT_PURCHASE_PRESALE = 10; uint256 public constant MAX_NFT_PURCHASE_PRESALE = 50; uint256 public constant MIN_NFT_PURCHASE = 1; uint256 public constant MAX_NFT_PURCHASE = 10; uint256 public hareReserve = 100; bool public saleIsActive = false; bool public presaleIsActive = false; bool public isMetadataLocked = false; string private _baseURIExtended; modifier OnlyMultiSignWallet() { } constructor(address _multiSigWallet) ERC721("The Planet of Hares","HARES") { } function withdraw(uint256 _amount, address payable _recipient) public OnlyMultiSignWallet { } function flipPresaleState() public onlyOwner { } function flipSaleState() public onlyOwner { } function flipPresaleStateAndSaleState() public onlyOwner { } function lockMetadata() public onlyOwner { } function reserveHares(address _to, uint256 _reserveAmount) public onlyOwner { } function mintHarePresale(uint numberOfTokens) public payable { } function mintHare(uint numberOfTokens) public payable { require(saleIsActive, "Sale is not active at the moment"); require(numberOfTokens >= MIN_NFT_PURCHASE, "Number of tokens can not be less than 1"); require(numberOfTokens <= MAX_NFT_PURCHASE, "Number of tokens can not be more than 10"); require(totalSupply() + numberOfTokens <= MAX_SUPPLY - hareReserve, "Purchase would exceed max supply of Hares"); require(<FILL_ME>) for (uint i = 0; i < numberOfTokens; i++) { _safeMint(msg.sender, totalSupply()); } } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI_) external onlyOwner { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
NFT_PRICE*numberOfTokens<=msg.value,"Sent ether value is incorrect"
294,873
NFT_PRICE*numberOfTokens<=msg.value
"Metadata is locked"
pragma solidity ^0.8.0; contract ThePlanetOfHares is ERC721Enumerable, Ownable { using Address for address; using Strings for uint256; address public multiSigWallet; uint256 public constant MAX_SUPPLY = 10000; uint256 public constant NFT_PRICE_PRESALE = 60000000000000000; // 0.06 ETH uint256 public constant NFT_PRICE = 80000000000000000; // 0.08 ETH uint256 public constant MIN_NFT_PURCHASE_PRESALE = 10; uint256 public constant MAX_NFT_PURCHASE_PRESALE = 50; uint256 public constant MIN_NFT_PURCHASE = 1; uint256 public constant MAX_NFT_PURCHASE = 10; uint256 public hareReserve = 100; bool public saleIsActive = false; bool public presaleIsActive = false; bool public isMetadataLocked = false; string private _baseURIExtended; modifier OnlyMultiSignWallet() { } constructor(address _multiSigWallet) ERC721("The Planet of Hares","HARES") { } function withdraw(uint256 _amount, address payable _recipient) public OnlyMultiSignWallet { } function flipPresaleState() public onlyOwner { } function flipSaleState() public onlyOwner { } function flipPresaleStateAndSaleState() public onlyOwner { } function lockMetadata() public onlyOwner { } function reserveHares(address _to, uint256 _reserveAmount) public onlyOwner { } function mintHarePresale(uint numberOfTokens) public payable { } function mintHare(uint numberOfTokens) public payable { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI_) external onlyOwner { require(<FILL_ME>) _baseURIExtended = baseURI_; } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
!isMetadataLocked,"Metadata is locked"
294,873
!isMetadataLocked
null
pragma solidity ^0.5.0; contract Root is Ownable, Controllable { bytes32 constant private ROOT_NODE = bytes32(0); bytes4 constant private INTERFACE_META_ID = bytes4(keccak256("supportsInterface(bytes4)")); event TLDLocked(bytes32 indexed label); ENS public ens; mapping(bytes32=>bool) public locked; constructor(ENS _ens) public { } function setSubnodeOwner(bytes32 label, address owner) external onlyController { require(<FILL_ME>) ens.setSubnodeOwner(ROOT_NODE, label, owner); } function setResolver(address resolver) external onlyOwner { } function lock(bytes32 label) external onlyOwner { } function supportsInterface(bytes4 interfaceID) external pure returns (bool) { } }
!locked[label]
294,878
!locked[label]
"Supply limit"
/* ╔═╗┌─┐┌─┐┌─┐┌┐┌┬ ╔═╗┌─┐┌┐┌┌─┐┬─┐┌─┐┌┬┐┬┬ ┬┌─┐ ╚═╗├─┤│ │ │││││ ║ ╦├┤ │││├┤ ├┬┘├─┤ │ │└┐┌┘├┤ ╚═╝┴ ┴└─┘└─┘┘└┘┴ ╚═╝└─┘┘└┘└─┘┴└─┴ ┴ ┴ ┴ └┘ └─┘ */ pragma solidity ^0.8.2; contract SaconiHolmovimiento is ERC721, ERC721Enumerable, Ownable { uint256 public constant MAX_SUPPLY = 2000; uint256 public constant PRICE = 0.04 ether; uint256 private tokenCounter; bool public saleActive; string private URI = "https://gateway.pinata.cloud/ipfs/QmQ32LbxeNhQCsHgp521M5NRddUYMhh2WGdoWGGXyPq3oF/"; constructor() ERC721("Saconi Holmovimiento", "SGHM") {} function _baseURI() internal view override returns (string memory) { } function setURI(string memory _URI) external onlyOwner { } function flipSale() external onlyOwner { } function mint(address to, uint256 amount) external payable { require(saleActive, "Sale inactive"); require(amount <= 10, "Exceeds 10"); require(<FILL_ME>) require(msg.value >= amount * PRICE, "Incorrect ETH"); // Solidity optimization uint256 _tokenCounter = tokenCounter; for (uint256 i = 0; i < amount; i++) { _safeMint(to, _tokenCounter); _tokenCounter++; } tokenCounter = _tokenCounter; } // cash money function withdrawAll() external payable onlyOwner { } function forge(address to, uint256 amount) external onlyOwner { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override(ERC721, ERC721Enumerable) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } }
amount+tokenCounter<MAX_SUPPLY,"Supply limit"
294,919
amount+tokenCounter<MAX_SUPPLY
"AngryApeArmyWeapons::claimByOwner: Token outside valid range."
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; interface AAAToken { function tokensOfOwner(address _owner) external view returns(uint[] memory ); } contract AngryApeArmyWeapons is ERC721Enumerable, Ownable { using SafeMath for uint; string baseURI; string public contractURI; uint public constant MAX_CLAIM = 50; uint public constant MAX_WEAPONS = 3333; AAAToken ogToken; bool public hasDropStarted = false; bool public hasDropFinished = false; event WeaponMinted(uint indexed tokenId, address indexed owner); constructor(string memory baseURI_, string memory contractURI_, address ogAddress_) ERC721("AAA Weapons Wave 1", "AAAW1") { } function claimByOwner(address _to, uint[] memory _tokenIds) public onlyOwner { require(hasDropFinished, "AngryApeArmyWeapons::claimByOwner: Drop hasn't finished yet."); require(_tokenIds.length <= MAX_CLAIM, "AngryApeArmyWeapons::claimByOwner: Cannot claim more than MAX_CLAIM"); for (uint i = 0; i < _tokenIds.length; i++) { require(<FILL_ME>) _safeMint(_to, _tokenIds[i]); emit WeaponMinted(_tokenIds[i], _to); } } function checkClaimableWeapons(address user) public view returns (uint[] memory) { } function claimWeapons() external { } function tokensOfOwner(address _owner) public view returns(uint[] memory ) { } function setBaseURI(string memory _URI) external onlyOwner { } function setContractURI(string memory _URI) external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function startDrop() external onlyOwner { } function pauseDrop() external onlyOwner { } function finishDrop() external onlyOwner { } }
_tokenIds[i]<MAX_WEAPONS,"AngryApeArmyWeapons::claimByOwner: Token outside valid range."
295,074
_tokenIds[i]<MAX_WEAPONS
"AngryApeArmyWeapons::startDrop: Drop already active."
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; interface AAAToken { function tokensOfOwner(address _owner) external view returns(uint[] memory ); } contract AngryApeArmyWeapons is ERC721Enumerable, Ownable { using SafeMath for uint; string baseURI; string public contractURI; uint public constant MAX_CLAIM = 50; uint public constant MAX_WEAPONS = 3333; AAAToken ogToken; bool public hasDropStarted = false; bool public hasDropFinished = false; event WeaponMinted(uint indexed tokenId, address indexed owner); constructor(string memory baseURI_, string memory contractURI_, address ogAddress_) ERC721("AAA Weapons Wave 1", "AAAW1") { } function claimByOwner(address _to, uint[] memory _tokenIds) public onlyOwner { } function checkClaimableWeapons(address user) public view returns (uint[] memory) { } function claimWeapons() external { } function tokensOfOwner(address _owner) public view returns(uint[] memory ) { } function setBaseURI(string memory _URI) external onlyOwner { } function setContractURI(string memory _URI) external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function startDrop() external onlyOwner { require(<FILL_ME>) require(!hasDropFinished, "AngryApeArmyWeapons::startDrop: Drop has already finished."); hasDropStarted = true; } function pauseDrop() external onlyOwner { } function finishDrop() external onlyOwner { } }
!hasDropStarted,"AngryApeArmyWeapons::startDrop: Drop already active."
295,074
!hasDropStarted
"AngryApeArmyWeapons::startDrop: Drop has already finished."
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; interface AAAToken { function tokensOfOwner(address _owner) external view returns(uint[] memory ); } contract AngryApeArmyWeapons is ERC721Enumerable, Ownable { using SafeMath for uint; string baseURI; string public contractURI; uint public constant MAX_CLAIM = 50; uint public constant MAX_WEAPONS = 3333; AAAToken ogToken; bool public hasDropStarted = false; bool public hasDropFinished = false; event WeaponMinted(uint indexed tokenId, address indexed owner); constructor(string memory baseURI_, string memory contractURI_, address ogAddress_) ERC721("AAA Weapons Wave 1", "AAAW1") { } function claimByOwner(address _to, uint[] memory _tokenIds) public onlyOwner { } function checkClaimableWeapons(address user) public view returns (uint[] memory) { } function claimWeapons() external { } function tokensOfOwner(address _owner) public view returns(uint[] memory ) { } function setBaseURI(string memory _URI) external onlyOwner { } function setContractURI(string memory _URI) external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function startDrop() external onlyOwner { require(!hasDropStarted, "AngryApeArmyWeapons::startDrop: Drop already active."); require(<FILL_ME>) hasDropStarted = true; } function pauseDrop() external onlyOwner { } function finishDrop() external onlyOwner { } }
!hasDropFinished,"AngryApeArmyWeapons::startDrop: Drop has already finished."
295,074
!hasDropFinished
"Governance::propose: proposer votes below proposal threshold"
/* This contract is provided "as is" and "with all faults." The deployer makes no representations or warranties of any kind concerning the safety, suitability, lack of exploits, inaccuracies, typographical errors, or other harmful components of this contract. There are inherent dangers in the use of any contract, and you are solely responsible for determining whether this contract is safe to use. You are also solely responsible for the protection of your funds, and the deployer will not be liable for any damages you may suffer in connection with using, modifying, or distributing this contract. */ pragma solidity ^0.5.17; pragma experimental ABIEncoderV2; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } contract Governance { using SafeMath for uint; /// @notice The name of this contract string public constant name = "Governance"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed uint public _quorumVotes = 400; // % of total supply required /// @notice The number of votes required in order for a voter to become a proposer uint public _proposalThreshold = 100; uint public constant BASE = 10000; function setQuorum(uint quorum_) external { } function quorumVotes() public view returns (uint) { } function proposalThreshold() public view returns (uint) { } function setThreshold(uint threshold_) external { } /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { } // 10 actions /// @notice The delay before voting on a proposal may take place, once proposed function votingDelay() public pure returns (uint) { } // 1 block /// @notice The duration of voting on a proposal, in blocks function votingPeriod() public pure returns (uint) { } // ~7 days in blocks (assuming 15s blocks) /// @notice The address of the governance token DelegateInterface public VOTER; /// @notice The total number of proposals uint public proposalCount; struct Proposal { /// @notice Unique id for looking up a proposal uint id; /// @notice Creator of the proposal address proposer; /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; /// @notice the ordered list of target addresses for calls to be made address[] targets; /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; /// @notice The ordered list of function signatures to be called string[] signatures; /// @notice The ordered list of calldata to be passed to each call bytes[] calldatas; /// @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; /// @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; /// @notice Current number of votes in favor of this proposal uint forVotes; /// @notice Current number of votes in opposition to this proposal uint againstVotes; /// @notice Flag marking whether the proposal has been canceled bool canceled; /// @notice Flag marking whether the proposal has been executed bool executed; /// @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { /// @notice Whether or not a vote has been cast bool hasVoted; /// @notice Whether or not the voter supports the proposal bool support; /// @notice The number of votes the voter had, which were cast uint votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { require(<FILL_ME>) require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "Governance::propose: proposal function information arity mismatch"); require(targets.length != 0, "Governance::propose: must provide actions"); require(targets.length <= proposalMaxOperations(), "Governance::propose: too many actions"); uint latestProposalId = latestProposalIds[msg.sender]; if (latestProposalId != 0) { ProposalState proposersLatestProposalState = state(latestProposalId); require(proposersLatestProposalState != ProposalState.Active, "Governance::propose: one live proposal per proposer, found an already active proposal"); require(proposersLatestProposalState != ProposalState.Pending, "Governance::propose: one live proposal per proposer, found an already pending proposal"); } uint startBlock = block.number.add(votingDelay()); uint endBlock = startBlock.add(votingPeriod()); proposalCount++; Proposal memory newProposal = Proposal({ id: proposalCount, proposer: msg.sender, eta: 0, targets: targets, values: values, signatures: signatures, calldatas: calldatas, startBlock: startBlock, endBlock: endBlock, forVotes: 0, againstVotes: 0, canceled: false, executed: false }); proposals[newProposal.id] = newProposal; latestProposalIds[newProposal.proposer] = newProposal.id; emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description); return newProposal.id; } function queue(uint proposalId) public { } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { } function execute(uint proposalId) public payable { } function cancel(uint proposalId) public { } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { } function state(uint proposalId) public view returns (ProposalState) { } function castVote(uint proposalId, bool support) public { } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { } function _castVote(address voter, uint proposalId, bool support) internal { } function getChainId() internal pure returns (uint) { } event NewDelay(uint indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); uint public constant GRACE_PERIOD = 14 days; uint public constant MINIMUM_DELAY = 1 days; uint public constant MAXIMUM_DELAY = 30 days; uint public delay = MINIMUM_DELAY; mapping (bytes32 => bool) public queuedTransactions; constructor(address token_) public { } function() external payable { } function setDelay(uint delay_) public { } function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { } function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { } function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { } function getBlockTimestamp() internal view returns (uint) { } } interface DelegateInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint); function totalSupply() external view returns (uint); } contract GovernanceFactory { function deploy(address voter) external returns (address) { } }
VOTER.getPriorVotes(msg.sender,block.number.sub(1))>proposalThreshold(),"Governance::propose: proposer votes below proposal threshold"
295,110
VOTER.getPriorVotes(msg.sender,block.number.sub(1))>proposalThreshold()
"Governance::_queueOrRevert: proposal action already queued at eta"
/* This contract is provided "as is" and "with all faults." The deployer makes no representations or warranties of any kind concerning the safety, suitability, lack of exploits, inaccuracies, typographical errors, or other harmful components of this contract. There are inherent dangers in the use of any contract, and you are solely responsible for determining whether this contract is safe to use. You are also solely responsible for the protection of your funds, and the deployer will not be liable for any damages you may suffer in connection with using, modifying, or distributing this contract. */ pragma solidity ^0.5.17; pragma experimental ABIEncoderV2; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } contract Governance { using SafeMath for uint; /// @notice The name of this contract string public constant name = "Governance"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed uint public _quorumVotes = 400; // % of total supply required /// @notice The number of votes required in order for a voter to become a proposer uint public _proposalThreshold = 100; uint public constant BASE = 10000; function setQuorum(uint quorum_) external { } function quorumVotes() public view returns (uint) { } function proposalThreshold() public view returns (uint) { } function setThreshold(uint threshold_) external { } /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { } // 10 actions /// @notice The delay before voting on a proposal may take place, once proposed function votingDelay() public pure returns (uint) { } // 1 block /// @notice The duration of voting on a proposal, in blocks function votingPeriod() public pure returns (uint) { } // ~7 days in blocks (assuming 15s blocks) /// @notice The address of the governance token DelegateInterface public VOTER; /// @notice The total number of proposals uint public proposalCount; struct Proposal { /// @notice Unique id for looking up a proposal uint id; /// @notice Creator of the proposal address proposer; /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; /// @notice the ordered list of target addresses for calls to be made address[] targets; /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; /// @notice The ordered list of function signatures to be called string[] signatures; /// @notice The ordered list of calldata to be passed to each call bytes[] calldatas; /// @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; /// @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; /// @notice Current number of votes in favor of this proposal uint forVotes; /// @notice Current number of votes in opposition to this proposal uint againstVotes; /// @notice Flag marking whether the proposal has been canceled bool canceled; /// @notice Flag marking whether the proposal has been executed bool executed; /// @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { /// @notice Whether or not a vote has been cast bool hasVoted; /// @notice Whether or not the voter supports the proposal bool support; /// @notice The number of votes the voter had, which were cast uint votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { } function queue(uint proposalId) public { } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { require(<FILL_ME>) queueTransaction(target, value, signature, data, eta); } function execute(uint proposalId) public payable { } function cancel(uint proposalId) public { } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { } function state(uint proposalId) public view returns (ProposalState) { } function castVote(uint proposalId, bool support) public { } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { } function _castVote(address voter, uint proposalId, bool support) internal { } function getChainId() internal pure returns (uint) { } event NewDelay(uint indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); uint public constant GRACE_PERIOD = 14 days; uint public constant MINIMUM_DELAY = 1 days; uint public constant MAXIMUM_DELAY = 30 days; uint public delay = MINIMUM_DELAY; mapping (bytes32 => bool) public queuedTransactions; constructor(address token_) public { } function() external payable { } function setDelay(uint delay_) public { } function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { } function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { } function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { } function getBlockTimestamp() internal view returns (uint) { } } interface DelegateInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint); function totalSupply() external view returns (uint); } contract GovernanceFactory { function deploy(address voter) external returns (address) { } }
!queuedTransactions[keccak256(abi.encode(target,value,signature,data,eta))],"Governance::_queueOrRevert: proposal action already queued at eta"
295,110
!queuedTransactions[keccak256(abi.encode(target,value,signature,data,eta))]
"Governance::cancel: proposer above threshold"
/* This contract is provided "as is" and "with all faults." The deployer makes no representations or warranties of any kind concerning the safety, suitability, lack of exploits, inaccuracies, typographical errors, or other harmful components of this contract. There are inherent dangers in the use of any contract, and you are solely responsible for determining whether this contract is safe to use. You are also solely responsible for the protection of your funds, and the deployer will not be liable for any damages you may suffer in connection with using, modifying, or distributing this contract. */ pragma solidity ^0.5.17; pragma experimental ABIEncoderV2; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } contract Governance { using SafeMath for uint; /// @notice The name of this contract string public constant name = "Governance"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed uint public _quorumVotes = 400; // % of total supply required /// @notice The number of votes required in order for a voter to become a proposer uint public _proposalThreshold = 100; uint public constant BASE = 10000; function setQuorum(uint quorum_) external { } function quorumVotes() public view returns (uint) { } function proposalThreshold() public view returns (uint) { } function setThreshold(uint threshold_) external { } /// @notice The maximum number of actions that can be included in a proposal function proposalMaxOperations() public pure returns (uint) { } // 10 actions /// @notice The delay before voting on a proposal may take place, once proposed function votingDelay() public pure returns (uint) { } // 1 block /// @notice The duration of voting on a proposal, in blocks function votingPeriod() public pure returns (uint) { } // ~7 days in blocks (assuming 15s blocks) /// @notice The address of the governance token DelegateInterface public VOTER; /// @notice The total number of proposals uint public proposalCount; struct Proposal { /// @notice Unique id for looking up a proposal uint id; /// @notice Creator of the proposal address proposer; /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; /// @notice the ordered list of target addresses for calls to be made address[] targets; /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; /// @notice The ordered list of function signatures to be called string[] signatures; /// @notice The ordered list of calldata to be passed to each call bytes[] calldatas; /// @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; /// @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; /// @notice Current number of votes in favor of this proposal uint forVotes; /// @notice Current number of votes in opposition to this proposal uint againstVotes; /// @notice Flag marking whether the proposal has been canceled bool canceled; /// @notice Flag marking whether the proposal has been executed bool executed; /// @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { /// @notice Whether or not a vote has been cast bool hasVoted; /// @notice Whether or not the voter supports the proposal bool support; /// @notice The number of votes the voter had, which were cast uint votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { } function queue(uint proposalId) public { } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { } function execute(uint proposalId) public payable { } function cancel(uint proposalId) public { ProposalState state = state(proposalId); require(state != ProposalState.Executed, "Governance::cancel: cannot cancel executed proposal"); Proposal storage proposal = proposals[proposalId]; require(<FILL_ME>) proposal.canceled = true; for (uint i = 0; i < proposal.targets.length; i++) { cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalCanceled(proposalId); } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { } function state(uint proposalId) public view returns (ProposalState) { } function castVote(uint proposalId, bool support) public { } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { } function _castVote(address voter, uint proposalId, bool support) internal { } function getChainId() internal pure returns (uint) { } event NewDelay(uint indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); uint public constant GRACE_PERIOD = 14 days; uint public constant MINIMUM_DELAY = 1 days; uint public constant MAXIMUM_DELAY = 30 days; uint public delay = MINIMUM_DELAY; mapping (bytes32 => bool) public queuedTransactions; constructor(address token_) public { } function() external payable { } function setDelay(uint delay_) public { } function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { } function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { } function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { } function getBlockTimestamp() internal view returns (uint) { } } interface DelegateInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint); function totalSupply() external view returns (uint); } contract GovernanceFactory { function deploy(address voter) external returns (address) { } }
VOTER.getPriorVotes(proposal.proposer,block.number.sub(1))<proposalThreshold(),"Governance::cancel: proposer above threshold"
295,110
VOTER.getPriorVotes(proposal.proposer,block.number.sub(1))<proposalThreshold()
"No re-entrancy"
/** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract Presale { IERC20 public MFI; // these aren't ether, we're just using this for unit conversion uint public constant presaleSupply = 4_000_000 ether; // how much the presale has already issued uint public presaleIssued = 0; address public treasury; address constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; address constant uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; uint public startDate; uint public lastVestedQuarter; // 1_500_000 / 8 uint public constant vestingQuarterly = 187_500 ether; // check for reentrancy bool disbursing; // initial best-guess ETH price uint constant initialDollarsPerETH = 1400; // updatable ETH price uint public dollarsPerETH = initialDollarsPerETH; uint public constant tokensPerDollar = 4; uint public constant maxPerWallet = 10 ether * initialDollarsPerETH * tokensPerDollar; constructor(IERC20 tokenContract, uint _startDate, address _treasury) public { } receive() external payable { // rule out reentrancy require(<FILL_ME>) disbursing = true; // check time constraints // after start date require(block.timestamp >= startDate, "Presale hasn't started yet"); uint endDate = startDate + 2 days; // before end date require(endDate >= block.timestamp, "Presale is over"); // calculate price // no overflow because scarcity uint tokensPerETH = dollarsPerETH * tokensPerDollar; // no overflow, again because scarcity uint tokensRequested = msg.value * tokensPerETH; // calculate how much the sender actually gets uint tokensToTransfer = min(tokensRequested, // price sub(presaleSupply, presaleIssued), // don't exceed supply sub(maxPerWallet, MFI.balanceOf(msg.sender))); // don't exceed wallet max // any eth that needs to go back uint ethReturn = sub(tokensRequested, tokensToTransfer) / tokensPerETH; if (ethReturn > 0) { // send it back payable(msg.sender).transfer(ethReturn); } // send eth to treasury and tokens to buyer payable(treasury).transfer(sub(msg.value, ethReturn)); MFI.transferFrom(treasury, msg.sender, tokensToTransfer); disbursing = false; } // can be called by anyone to update the current price function setDollarsPerETH() external { } function min(uint a, uint b, uint c) internal pure returns (uint result) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } // send vested tokens back to treasury function withdrawVested() external { } } interface UniRouter { function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); }
!disbursing,"No re-entrancy"
295,183
!disbursing
"not whitelisted"
pragma solidity ^0.6.0; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } interface Pauseable { function unpause() external; function changeBurnFee(uint256 _perc) external; } /** * @title MoonPlusCrowdsale * @dev Crowdsale contract for MD+. * * , _/ \_ * < > * /.'.\ * * ,-----.,_ , .'` '. _/ \_ , / `\ < > _/ \_ | ,.---. \ /.'.\ < > \.' _,'.--. ; ` ` /.'.\ .' (o ) ; ` ` / '--' | * / ) | * * | .-; ; , \_/ |___,' ; _/ \_ , |`---.___|_ / < > * _/ \_ \ ` / /.'.\ < > '. _,' ` ` MD+ /.'.\ `'------'` * ` ` */ contract MoondayPlusCrowdsale is Ownable { using SafeMath for uint256; // Caps uint256 public constant ROUND_1_CAP = 7.875 ether; uint256 public constant MAX_CONTRIBUTION_WHITE = 0.5 ether; uint256 public constant MIN_CONTRIBUTION = 0.1 ether; uint256 public constant HARDCAP = 57.92180625 ether; // Start time 5pm UTC 26 jan 2021 uint256 public CROWDSALE_START_TIME = 1611691200; // End time uint256 public CROWDSALE_END_TIME = CROWDSALE_START_TIME + 96 hours; uint256 public constant MOON_PER_ETH = 21.365010522 ether; uint256 public constant MOON_PER_ETH_WHITE = 28.571428571 ether; // Round 1 whitelist mapping(address => bool) public whitelistCapsRound1; // Contributions state mapping(address => uint256) public contributions; uint256 public weiRaised; bool public liquidityLocked = false; IERC20 public moonToken; IUniswapV2Router02 internal uniswapRouter = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); event TokenPurchase(address indexed beneficiary, uint256 weiAmount, uint256 tokenAmount); constructor(IERC20 _moonToken) Ownable() public { } receive() payable external { } function _buyTokens(address beneficiary) internal { } function _buyTokens(address beneficiary, uint256 weiAmount) internal { if(isWithinCappedSaleWindow()){ require(<FILL_ME>) require(weiRaised <= ROUND_1_CAP, "VIP REACHED"); require(contributions[beneficiary].add(weiAmount) <= MAX_CONTRIBUTION_WHITE , "MoonPlusCrowdsale: bigger than max contribution whitesale."); } require(weiAmount >= MIN_CONTRIBUTION, "MoonPlusCrowdsale: smaller than min contribution."); _validatePurchase(beneficiary); // Update internal state weiRaised = weiRaised.add(weiAmount); contributions[beneficiary] = contributions[beneficiary].add(weiAmount); // Transfer tokens uint256 tokenAmount = _getTokenAmount(weiAmount); moonToken.transfer(beneficiary, tokenAmount); emit TokenPurchase(beneficiary, weiAmount, tokenAmount); } function _validatePurchase(address beneficiary) internal view { } function _getTokenAmount(uint256 weiAmount) internal view returns (uint256) { } function isOpen() public view returns (bool) { } function isWithinCappedSaleWindow() public view returns (bool) { } function hasEnded() public view returns (bool) { } // Whitelist function setWhitelist1(address[] calldata accounts) external onlyOwner { } // Uniswap function addAndLockLiquidity() external { } }
whitelistCapsRound1[msg.sender],"not whitelisted"
295,260
whitelistCapsRound1[msg.sender]
"MoonPlusCrowdsale: bigger than max contribution whitesale."
pragma solidity ^0.6.0; interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } interface Pauseable { function unpause() external; function changeBurnFee(uint256 _perc) external; } /** * @title MoonPlusCrowdsale * @dev Crowdsale contract for MD+. * * , _/ \_ * < > * /.'.\ * * ,-----.,_ , .'` '. _/ \_ , / `\ < > _/ \_ | ,.---. \ /.'.\ < > \.' _,'.--. ; ` ` /.'.\ .' (o ) ; ` ` / '--' | * / ) | * * | .-; ; , \_/ |___,' ; _/ \_ , |`---.___|_ / < > * _/ \_ \ ` / /.'.\ < > '. _,' ` ` MD+ /.'.\ `'------'` * ` ` */ contract MoondayPlusCrowdsale is Ownable { using SafeMath for uint256; // Caps uint256 public constant ROUND_1_CAP = 7.875 ether; uint256 public constant MAX_CONTRIBUTION_WHITE = 0.5 ether; uint256 public constant MIN_CONTRIBUTION = 0.1 ether; uint256 public constant HARDCAP = 57.92180625 ether; // Start time 5pm UTC 26 jan 2021 uint256 public CROWDSALE_START_TIME = 1611691200; // End time uint256 public CROWDSALE_END_TIME = CROWDSALE_START_TIME + 96 hours; uint256 public constant MOON_PER_ETH = 21.365010522 ether; uint256 public constant MOON_PER_ETH_WHITE = 28.571428571 ether; // Round 1 whitelist mapping(address => bool) public whitelistCapsRound1; // Contributions state mapping(address => uint256) public contributions; uint256 public weiRaised; bool public liquidityLocked = false; IERC20 public moonToken; IUniswapV2Router02 internal uniswapRouter = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); event TokenPurchase(address indexed beneficiary, uint256 weiAmount, uint256 tokenAmount); constructor(IERC20 _moonToken) Ownable() public { } receive() payable external { } function _buyTokens(address beneficiary) internal { } function _buyTokens(address beneficiary, uint256 weiAmount) internal { if(isWithinCappedSaleWindow()){ require(whitelistCapsRound1[msg.sender],"not whitelisted"); require(weiRaised <= ROUND_1_CAP, "VIP REACHED"); require(<FILL_ME>) } require(weiAmount >= MIN_CONTRIBUTION, "MoonPlusCrowdsale: smaller than min contribution."); _validatePurchase(beneficiary); // Update internal state weiRaised = weiRaised.add(weiAmount); contributions[beneficiary] = contributions[beneficiary].add(weiAmount); // Transfer tokens uint256 tokenAmount = _getTokenAmount(weiAmount); moonToken.transfer(beneficiary, tokenAmount); emit TokenPurchase(beneficiary, weiAmount, tokenAmount); } function _validatePurchase(address beneficiary) internal view { } function _getTokenAmount(uint256 weiAmount) internal view returns (uint256) { } function isOpen() public view returns (bool) { } function isWithinCappedSaleWindow() public view returns (bool) { } function hasEnded() public view returns (bool) { } // Whitelist function setWhitelist1(address[] calldata accounts) external onlyOwner { } // Uniswap function addAndLockLiquidity() external { } }
contributions[beneficiary].add(weiAmount)<=MAX_CONTRIBUTION_WHITE,"MoonPlusCrowdsale: bigger than max contribution whitesale."
295,260
contributions[beneficiary].add(weiAmount)<=MAX_CONTRIBUTION_WHITE
"Sorry, you've claimed your freebies for the day."
pragma solidity ^0.8.0; // Importing ERC 721 standard contracts from OpenZeppelin import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "hardhat/console.sol"; contract EvolutioNFT is ERC721Enumerable, Ownable { using SafeMath for uint256; uint256 public _currentTokenId = 0; uint256 MAX_SUPPLY = 5555; string public baseTokenURI = "Nothing Yet"; uint256 public Mint_price = 0.022 ether; uint256 public buy3_Discount = 0.048 ether; uint256 public Discount = 0.016 ether; string _name = "EvolutioNFT"; string _symbol = "EVO"; constructor() ERC721(_name, _symbol) { } //Allows users to claim for free function mintFree() external { require(<FILL_ME>) require(_currentTokenId < 1000, "Sorry all freebies have been claimed."); _mint(_msgSender(), _getNextTokenId()); _incrementTokenId(); } function mint3discount() public payable { } function mintMultiples(uint amountToMint) external payable { } function burn(uint256 _tokenId) public { } //////////Owner Mint Functions function mintMany(uint256 num, address _to) public onlyOwner { } function mintTo(address _to) public onlyOwner { } function withdraw() external onlyOwner { } /** * @dev calculates the next token ID based on value of _currentTokenId * @return uint256 for the next token ID */ function _getNextTokenId() private view returns (uint256) { } /** * @dev increments the value of _currentTokenId */ function _incrementTokenId() private { } /** * @dev change the EvolutionURI if there are future problems with the API service */ function setBaseUri(string memory _uri) external onlyOwner { } function tokenURI(uint256 _tokenId) public view override returns (string memory) { } }
balanceOf(_msgSender())<=3,"Sorry, you've claimed your freebies for the day."
295,303
balanceOf(_msgSender())<=3
"Max Supply Reached"
pragma solidity ^0.8.0; // Importing ERC 721 standard contracts from OpenZeppelin import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "hardhat/console.sol"; contract EvolutioNFT is ERC721Enumerable, Ownable { using SafeMath for uint256; uint256 public _currentTokenId = 0; uint256 MAX_SUPPLY = 5555; string public baseTokenURI = "Nothing Yet"; uint256 public Mint_price = 0.022 ether; uint256 public buy3_Discount = 0.048 ether; uint256 public Discount = 0.016 ether; string _name = "EvolutioNFT"; string _symbol = "EVO"; constructor() ERC721(_name, _symbol) { } //Allows users to claim for free function mintFree() external { } function mint3discount() public payable { require(msg.value >= buy3_Discount, "Incorrect Ether amount."); uint256 num = 3; if(balanceOf(_msgSender()) == 0 ){ num = num + 1; } require(<FILL_ME>) for(uint256 i=0; i<num; i++){ _mint(_msgSender(), _getNextTokenId()); _incrementTokenId(); } } function mintMultiples(uint amountToMint) external payable { } function burn(uint256 _tokenId) public { } //////////Owner Mint Functions function mintMany(uint256 num, address _to) public onlyOwner { } function mintTo(address _to) public onlyOwner { } function withdraw() external onlyOwner { } /** * @dev calculates the next token ID based on value of _currentTokenId * @return uint256 for the next token ID */ function _getNextTokenId() private view returns (uint256) { } /** * @dev increments the value of _currentTokenId */ function _incrementTokenId() private { } /** * @dev change the EvolutionURI if there are future problems with the API service */ function setBaseUri(string memory _uri) external onlyOwner { } function tokenURI(uint256 _tokenId) public view override returns (string memory) { } }
_currentTokenId.add(num)<MAX_SUPPLY,"Max Supply Reached"
295,303
_currentTokenId.add(num)<MAX_SUPPLY
null
pragma solidity ^0.8.0; // Importing ERC 721 standard contracts from OpenZeppelin import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "hardhat/console.sol"; contract EvolutioNFT is ERC721Enumerable, Ownable { using SafeMath for uint256; uint256 public _currentTokenId = 0; uint256 MAX_SUPPLY = 5555; string public baseTokenURI = "Nothing Yet"; uint256 public Mint_price = 0.022 ether; uint256 public buy3_Discount = 0.048 ether; uint256 public Discount = 0.016 ether; string _name = "EvolutioNFT"; string _symbol = "EVO"; constructor() ERC721(_name, _symbol) { } //Allows users to claim for free function mintFree() external { } function mint3discount() public payable { } function mintMultiples(uint amountToMint) external payable { require(<FILL_ME>) require(amountToMint <= 12, "Only 12 per transaction"); require(_currentTokenId.add(amountToMint) < MAX_SUPPLY, "Max Supply Reached"); _mint(_msgSender(), _getNextTokenId()); _incrementTokenId(); } function burn(uint256 _tokenId) public { } //////////Owner Mint Functions function mintMany(uint256 num, address _to) public onlyOwner { } function mintTo(address _to) public onlyOwner { } function withdraw() external onlyOwner { } /** * @dev calculates the next token ID based on value of _currentTokenId * @return uint256 for the next token ID */ function _getNextTokenId() private view returns (uint256) { } /** * @dev increments the value of _currentTokenId */ function _incrementTokenId() private { } /** * @dev change the EvolutionURI if there are future problems with the API service */ function setBaseUri(string memory _uri) external onlyOwner { } function tokenURI(uint256 _tokenId) public view override returns (string memory) { } }
amountToMint.mul(Discount)<=msg.value
295,303
amountToMint.mul(Discount)<=msg.value
"Max Supply Reached"
pragma solidity ^0.8.0; // Importing ERC 721 standard contracts from OpenZeppelin import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "hardhat/console.sol"; contract EvolutioNFT is ERC721Enumerable, Ownable { using SafeMath for uint256; uint256 public _currentTokenId = 0; uint256 MAX_SUPPLY = 5555; string public baseTokenURI = "Nothing Yet"; uint256 public Mint_price = 0.022 ether; uint256 public buy3_Discount = 0.048 ether; uint256 public Discount = 0.016 ether; string _name = "EvolutioNFT"; string _symbol = "EVO"; constructor() ERC721(_name, _symbol) { } //Allows users to claim for free function mintFree() external { } function mint3discount() public payable { } function mintMultiples(uint amountToMint) external payable { require(amountToMint.mul(Discount) <= msg.value); require(amountToMint <= 12, "Only 12 per transaction"); require(<FILL_ME>) _mint(_msgSender(), _getNextTokenId()); _incrementTokenId(); } function burn(uint256 _tokenId) public { } //////////Owner Mint Functions function mintMany(uint256 num, address _to) public onlyOwner { } function mintTo(address _to) public onlyOwner { } function withdraw() external onlyOwner { } /** * @dev calculates the next token ID based on value of _currentTokenId * @return uint256 for the next token ID */ function _getNextTokenId() private view returns (uint256) { } /** * @dev increments the value of _currentTokenId */ function _incrementTokenId() private { } /** * @dev change the EvolutionURI if there are future problems with the API service */ function setBaseUri(string memory _uri) external onlyOwner { } function tokenURI(uint256 _tokenId) public view override returns (string memory) { } }
_currentTokenId.add(amountToMint)<MAX_SUPPLY,"Max Supply Reached"
295,303
_currentTokenId.add(amountToMint)<MAX_SUPPLY
"Max Limit"
pragma solidity ^0.8.0; // Importing ERC 721 standard contracts from OpenZeppelin import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "hardhat/console.sol"; contract EvolutioNFT is ERC721Enumerable, Ownable { using SafeMath for uint256; uint256 public _currentTokenId = 0; uint256 MAX_SUPPLY = 5555; string public baseTokenURI = "Nothing Yet"; uint256 public Mint_price = 0.022 ether; uint256 public buy3_Discount = 0.048 ether; uint256 public Discount = 0.016 ether; string _name = "EvolutioNFT"; string _symbol = "EVO"; constructor() ERC721(_name, _symbol) { } //Allows users to claim for free function mintFree() external { } function mint3discount() public payable { } function mintMultiples(uint amountToMint) external payable { } function burn(uint256 _tokenId) public { } //////////Owner Mint Functions function mintMany(uint256 num, address _to) public onlyOwner { require(<FILL_ME>) require(num <= 20, "Max 20 Allowed."); for(uint256 i=0; i<num; i++){ _mint(_to, _getNextTokenId()); _incrementTokenId(); } } function mintTo(address _to) public onlyOwner { } function withdraw() external onlyOwner { } /** * @dev calculates the next token ID based on value of _currentTokenId * @return uint256 for the next token ID */ function _getNextTokenId() private view returns (uint256) { } /** * @dev increments the value of _currentTokenId */ function _incrementTokenId() private { } /** * @dev change the EvolutionURI if there are future problems with the API service */ function setBaseUri(string memory _uri) external onlyOwner { } function tokenURI(uint256 _tokenId) public view override returns (string memory) { } }
_currentTokenId+num<MAX_SUPPLY,"Max Limit"
295,303
_currentTokenId+num<MAX_SUPPLY
null
pragma solidity >=0.4.22 <0.7.0; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external; } contract GTX { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; address public owner; // This creates an array with all balances mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; mapping(address => uint256) public freezeOf; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This generates a public event on the blockchain that will notify clients event Approval(address indexed _owner, address indexed _spender, uint256 _value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /* This notifies clients about the amount frozen */ event Freeze(address indexed from, uint256 value); /* This notifies clients about the amount unfrozen */ event Unfreeze(address indexed from, uint256 value); event Mint(uint256 _value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ constructor( uint256 initialSupply, string memory tokenName, string memory tokenSymbol ) public { } function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public returns (bool success) { } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` on behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens on your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes memory _extraData) public returns (bool success) { } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { } /** * mint tokens * * add `_value` tokens from the system irreversibly * * @param _value the amount of money to mint */ function mint(uint256 _value) public returns (bool success) { require(<FILL_ME>) // Only the owner can do this balanceOf[msg.sender] += _value; // add coin for sender totalSupply += _value; // Updates totalSupply emit Mint(_value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { } function freeze(uint256 _value) public returns (bool success) { } function unfreeze(uint256 _value) public returns (bool success) { } //Transfer of ownership,only owner can call this function function transferOwnership(address _address) public returns (bool success){ } }
(msg.sender==owner)
295,365
(msg.sender==owner)
"Supply exceeded!"
pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { } /** * @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 { } } pragma solidity >=0.6.0 <0.8.0; //TODO // CHANGE WITHDRAW ADDRESS contract CBS is ERC721, Ownable { using SafeMath for uint256; uint256 public _price = 55000000000000000; uint256 private _tokensAllowedPerPresaleAddress = 9; uint256 private _tokensAllowedPerPublicMint = 21; uint256 public _maxTotalSupply = 8999; uint256 private _giveAwayReserve = 200; uint256 public _reserveAmountMinted = 0; uint256 public _totalAvailableForSale = _maxTotalSupply.sub(_giveAwayReserve); bool private _paused = true; address private _giveawayWalletAddress = 0x5a1b7bfA7C220cF020e3cF30F4561F7011339E45; address private _withdrawAddress = 0x966B0d7e79cE40191e914E9a28E019b6846F73ad; bool private _initialReserveMinted = false; bool private _presaleEnabled = false; mapping (address => bool) public _canTransferBeforeMintingIsEnabled; mapping (address => uint256) public _amountMintedByAddress; constructor() ERC721('Chill Bear Society', 'CBS') { } //MINT x amount of Chill Bears function mint(uint256 _num) public payable { uint supply = totalSupply(); require(<FILL_ME>) if(msg.sender != _giveawayWalletAddress) { require(msg.value >= getPrice() * _num, "ETH sent not correct!"); if(_presaleEnabled){ require(_canTransferBeforeMintingIsEnabled[msg.sender], "This Address has not been whitelisted"); require((_amountMintedByAddress[msg.sender].add(_num))<_tokensAllowedPerPresaleAddress, "Max Number of presale mints reached"); _amountMintedByAddress[msg.sender]+=_num; } else { require(_num < _tokensAllowedPerPublicMint, "You can only mint 20 Chill Bears with each transaction!"); require(!_paused, "Minting is currently paused!"); } } for(uint i = 0; i < _num; i++) { _safeMint(msg.sender, supply+i); } } function mintInitialReserve() private { } function addToWhitelist(address[] memory accounts) public onlyOwner { } function removeFromWhitelist(address[] memory accounts) public onlyOwner { } /*giveaway wallet can mint from reserve of 200 for contests / payment for influencers*/ function giveAwayFromReserve(address[] memory accounts) public { } /*owner should also be able to giveaway as backup*/ function ownerGiveAway(address[] memory accounts) public onlyOwner { } //CHANGE PAUSE STATE function pause(bool _value) public onlyOwner { } //GET PRICE function getPrice() public view returns (uint256) { } //RETURN ALL TOKENS OF A SPECIFIC ADDRESS function walletOfOwner(address _owner) external view returns (uint256[] memory) { } //RETURNS THE AMOUNT OF TOKES THAT HAVE BEEN MINTED ALREADY function returnSupply() external view returns (uint256) { } //WITHDRAW CONTRACT BALANCE TO DEFINED ADDRESS function withdraw() public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function togglePresaleEnabled(bool enabled) public onlyOwner{ } function canTransferBeforeMintingIsEnabled(address account) public view returns(bool) { } }
supply.add(_num)<_totalAvailableForSale,"Supply exceeded!"
295,465
supply.add(_num)<_totalAvailableForSale
"This Address has not been whitelisted"
pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { } /** * @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 { } } pragma solidity >=0.6.0 <0.8.0; //TODO // CHANGE WITHDRAW ADDRESS contract CBS is ERC721, Ownable { using SafeMath for uint256; uint256 public _price = 55000000000000000; uint256 private _tokensAllowedPerPresaleAddress = 9; uint256 private _tokensAllowedPerPublicMint = 21; uint256 public _maxTotalSupply = 8999; uint256 private _giveAwayReserve = 200; uint256 public _reserveAmountMinted = 0; uint256 public _totalAvailableForSale = _maxTotalSupply.sub(_giveAwayReserve); bool private _paused = true; address private _giveawayWalletAddress = 0x5a1b7bfA7C220cF020e3cF30F4561F7011339E45; address private _withdrawAddress = 0x966B0d7e79cE40191e914E9a28E019b6846F73ad; bool private _initialReserveMinted = false; bool private _presaleEnabled = false; mapping (address => bool) public _canTransferBeforeMintingIsEnabled; mapping (address => uint256) public _amountMintedByAddress; constructor() ERC721('Chill Bear Society', 'CBS') { } //MINT x amount of Chill Bears function mint(uint256 _num) public payable { uint supply = totalSupply(); require(supply.add(_num) < _totalAvailableForSale, "Supply exceeded!"); if(msg.sender != _giveawayWalletAddress) { require(msg.value >= getPrice() * _num, "ETH sent not correct!"); if(_presaleEnabled){ require(<FILL_ME>) require((_amountMintedByAddress[msg.sender].add(_num))<_tokensAllowedPerPresaleAddress, "Max Number of presale mints reached"); _amountMintedByAddress[msg.sender]+=_num; } else { require(_num < _tokensAllowedPerPublicMint, "You can only mint 20 Chill Bears with each transaction!"); require(!_paused, "Minting is currently paused!"); } } for(uint i = 0; i < _num; i++) { _safeMint(msg.sender, supply+i); } } function mintInitialReserve() private { } function addToWhitelist(address[] memory accounts) public onlyOwner { } function removeFromWhitelist(address[] memory accounts) public onlyOwner { } /*giveaway wallet can mint from reserve of 200 for contests / payment for influencers*/ function giveAwayFromReserve(address[] memory accounts) public { } /*owner should also be able to giveaway as backup*/ function ownerGiveAway(address[] memory accounts) public onlyOwner { } //CHANGE PAUSE STATE function pause(bool _value) public onlyOwner { } //GET PRICE function getPrice() public view returns (uint256) { } //RETURN ALL TOKENS OF A SPECIFIC ADDRESS function walletOfOwner(address _owner) external view returns (uint256[] memory) { } //RETURNS THE AMOUNT OF TOKES THAT HAVE BEEN MINTED ALREADY function returnSupply() external view returns (uint256) { } //WITHDRAW CONTRACT BALANCE TO DEFINED ADDRESS function withdraw() public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function togglePresaleEnabled(bool enabled) public onlyOwner{ } function canTransferBeforeMintingIsEnabled(address account) public view returns(bool) { } }
_canTransferBeforeMintingIsEnabled[msg.sender],"This Address has not been whitelisted"
295,465
_canTransferBeforeMintingIsEnabled[msg.sender]
"Max Number of presale mints reached"
pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { } /** * @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 { } } pragma solidity >=0.6.0 <0.8.0; //TODO // CHANGE WITHDRAW ADDRESS contract CBS is ERC721, Ownable { using SafeMath for uint256; uint256 public _price = 55000000000000000; uint256 private _tokensAllowedPerPresaleAddress = 9; uint256 private _tokensAllowedPerPublicMint = 21; uint256 public _maxTotalSupply = 8999; uint256 private _giveAwayReserve = 200; uint256 public _reserveAmountMinted = 0; uint256 public _totalAvailableForSale = _maxTotalSupply.sub(_giveAwayReserve); bool private _paused = true; address private _giveawayWalletAddress = 0x5a1b7bfA7C220cF020e3cF30F4561F7011339E45; address private _withdrawAddress = 0x966B0d7e79cE40191e914E9a28E019b6846F73ad; bool private _initialReserveMinted = false; bool private _presaleEnabled = false; mapping (address => bool) public _canTransferBeforeMintingIsEnabled; mapping (address => uint256) public _amountMintedByAddress; constructor() ERC721('Chill Bear Society', 'CBS') { } //MINT x amount of Chill Bears function mint(uint256 _num) public payable { uint supply = totalSupply(); require(supply.add(_num) < _totalAvailableForSale, "Supply exceeded!"); if(msg.sender != _giveawayWalletAddress) { require(msg.value >= getPrice() * _num, "ETH sent not correct!"); if(_presaleEnabled){ require(_canTransferBeforeMintingIsEnabled[msg.sender], "This Address has not been whitelisted"); require(<FILL_ME>) _amountMintedByAddress[msg.sender]+=_num; } else { require(_num < _tokensAllowedPerPublicMint, "You can only mint 20 Chill Bears with each transaction!"); require(!_paused, "Minting is currently paused!"); } } for(uint i = 0; i < _num; i++) { _safeMint(msg.sender, supply+i); } } function mintInitialReserve() private { } function addToWhitelist(address[] memory accounts) public onlyOwner { } function removeFromWhitelist(address[] memory accounts) public onlyOwner { } /*giveaway wallet can mint from reserve of 200 for contests / payment for influencers*/ function giveAwayFromReserve(address[] memory accounts) public { } /*owner should also be able to giveaway as backup*/ function ownerGiveAway(address[] memory accounts) public onlyOwner { } //CHANGE PAUSE STATE function pause(bool _value) public onlyOwner { } //GET PRICE function getPrice() public view returns (uint256) { } //RETURN ALL TOKENS OF A SPECIFIC ADDRESS function walletOfOwner(address _owner) external view returns (uint256[] memory) { } //RETURNS THE AMOUNT OF TOKES THAT HAVE BEEN MINTED ALREADY function returnSupply() external view returns (uint256) { } //WITHDRAW CONTRACT BALANCE TO DEFINED ADDRESS function withdraw() public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function togglePresaleEnabled(bool enabled) public onlyOwner{ } function canTransferBeforeMintingIsEnabled(address account) public view returns(bool) { } }
(_amountMintedByAddress[msg.sender].add(_num))<_tokensAllowedPerPresaleAddress,"Max Number of presale mints reached"
295,465
(_amountMintedByAddress[msg.sender].add(_num))<_tokensAllowedPerPresaleAddress
"Reserve has already been minted"
pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { } /** * @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 { } } pragma solidity >=0.6.0 <0.8.0; //TODO // CHANGE WITHDRAW ADDRESS contract CBS is ERC721, Ownable { using SafeMath for uint256; uint256 public _price = 55000000000000000; uint256 private _tokensAllowedPerPresaleAddress = 9; uint256 private _tokensAllowedPerPublicMint = 21; uint256 public _maxTotalSupply = 8999; uint256 private _giveAwayReserve = 200; uint256 public _reserveAmountMinted = 0; uint256 public _totalAvailableForSale = _maxTotalSupply.sub(_giveAwayReserve); bool private _paused = true; address private _giveawayWalletAddress = 0x5a1b7bfA7C220cF020e3cF30F4561F7011339E45; address private _withdrawAddress = 0x966B0d7e79cE40191e914E9a28E019b6846F73ad; bool private _initialReserveMinted = false; bool private _presaleEnabled = false; mapping (address => bool) public _canTransferBeforeMintingIsEnabled; mapping (address => uint256) public _amountMintedByAddress; constructor() ERC721('Chill Bear Society', 'CBS') { } //MINT x amount of Chill Bears function mint(uint256 _num) public payable { } function mintInitialReserve() private { require(<FILL_ME>) uint supply = totalSupply(); for(uint i = 0; i < 50; i++) { _safeMint(_giveawayWalletAddress, supply+i); } _initialReserveMinted = true; } function addToWhitelist(address[] memory accounts) public onlyOwner { } function removeFromWhitelist(address[] memory accounts) public onlyOwner { } /*giveaway wallet can mint from reserve of 200 for contests / payment for influencers*/ function giveAwayFromReserve(address[] memory accounts) public { } /*owner should also be able to giveaway as backup*/ function ownerGiveAway(address[] memory accounts) public onlyOwner { } //CHANGE PAUSE STATE function pause(bool _value) public onlyOwner { } //GET PRICE function getPrice() public view returns (uint256) { } //RETURN ALL TOKENS OF A SPECIFIC ADDRESS function walletOfOwner(address _owner) external view returns (uint256[] memory) { } //RETURNS THE AMOUNT OF TOKES THAT HAVE BEEN MINTED ALREADY function returnSupply() external view returns (uint256) { } //WITHDRAW CONTRACT BALANCE TO DEFINED ADDRESS function withdraw() public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function togglePresaleEnabled(bool enabled) public onlyOwner{ } function canTransferBeforeMintingIsEnabled(address account) public view returns(bool) { } }
!_initialReserveMinted,"Reserve has already been minted"
295,465
!_initialReserveMinted
"Already added to list"
pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { } /** * @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 { } } pragma solidity >=0.6.0 <0.8.0; //TODO // CHANGE WITHDRAW ADDRESS contract CBS is ERC721, Ownable { using SafeMath for uint256; uint256 public _price = 55000000000000000; uint256 private _tokensAllowedPerPresaleAddress = 9; uint256 private _tokensAllowedPerPublicMint = 21; uint256 public _maxTotalSupply = 8999; uint256 private _giveAwayReserve = 200; uint256 public _reserveAmountMinted = 0; uint256 public _totalAvailableForSale = _maxTotalSupply.sub(_giveAwayReserve); bool private _paused = true; address private _giveawayWalletAddress = 0x5a1b7bfA7C220cF020e3cF30F4561F7011339E45; address private _withdrawAddress = 0x966B0d7e79cE40191e914E9a28E019b6846F73ad; bool private _initialReserveMinted = false; bool private _presaleEnabled = false; mapping (address => bool) public _canTransferBeforeMintingIsEnabled; mapping (address => uint256) public _amountMintedByAddress; constructor() ERC721('Chill Bear Society', 'CBS') { } //MINT x amount of Chill Bears function mint(uint256 _num) public payable { } function mintInitialReserve() private { } function addToWhitelist(address[] memory accounts) public onlyOwner { for(uint i=0; i<accounts.length; i++){ require(<FILL_ME>) _canTransferBeforeMintingIsEnabled[accounts[i]] = true; } } function removeFromWhitelist(address[] memory accounts) public onlyOwner { } /*giveaway wallet can mint from reserve of 200 for contests / payment for influencers*/ function giveAwayFromReserve(address[] memory accounts) public { } /*owner should also be able to giveaway as backup*/ function ownerGiveAway(address[] memory accounts) public onlyOwner { } //CHANGE PAUSE STATE function pause(bool _value) public onlyOwner { } //GET PRICE function getPrice() public view returns (uint256) { } //RETURN ALL TOKENS OF A SPECIFIC ADDRESS function walletOfOwner(address _owner) external view returns (uint256[] memory) { } //RETURNS THE AMOUNT OF TOKES THAT HAVE BEEN MINTED ALREADY function returnSupply() external view returns (uint256) { } //WITHDRAW CONTRACT BALANCE TO DEFINED ADDRESS function withdraw() public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function togglePresaleEnabled(bool enabled) public onlyOwner{ } function canTransferBeforeMintingIsEnabled(address account) public view returns(bool) { } }
!_canTransferBeforeMintingIsEnabled[accounts[i]],"Already added to list"
295,465
!_canTransferBeforeMintingIsEnabled[accounts[i]]
"Account not whitelisted"
pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { } /** * @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 { } } pragma solidity >=0.6.0 <0.8.0; //TODO // CHANGE WITHDRAW ADDRESS contract CBS is ERC721, Ownable { using SafeMath for uint256; uint256 public _price = 55000000000000000; uint256 private _tokensAllowedPerPresaleAddress = 9; uint256 private _tokensAllowedPerPublicMint = 21; uint256 public _maxTotalSupply = 8999; uint256 private _giveAwayReserve = 200; uint256 public _reserveAmountMinted = 0; uint256 public _totalAvailableForSale = _maxTotalSupply.sub(_giveAwayReserve); bool private _paused = true; address private _giveawayWalletAddress = 0x5a1b7bfA7C220cF020e3cF30F4561F7011339E45; address private _withdrawAddress = 0x966B0d7e79cE40191e914E9a28E019b6846F73ad; bool private _initialReserveMinted = false; bool private _presaleEnabled = false; mapping (address => bool) public _canTransferBeforeMintingIsEnabled; mapping (address => uint256) public _amountMintedByAddress; constructor() ERC721('Chill Bear Society', 'CBS') { } //MINT x amount of Chill Bears function mint(uint256 _num) public payable { } function mintInitialReserve() private { } function addToWhitelist(address[] memory accounts) public onlyOwner { } function removeFromWhitelist(address[] memory accounts) public onlyOwner { for(uint i=0; i<accounts.length; i++){ require(<FILL_ME>) _canTransferBeforeMintingIsEnabled[accounts[i]] = false; } } /*giveaway wallet can mint from reserve of 200 for contests / payment for influencers*/ function giveAwayFromReserve(address[] memory accounts) public { } /*owner should also be able to giveaway as backup*/ function ownerGiveAway(address[] memory accounts) public onlyOwner { } //CHANGE PAUSE STATE function pause(bool _value) public onlyOwner { } //GET PRICE function getPrice() public view returns (uint256) { } //RETURN ALL TOKENS OF A SPECIFIC ADDRESS function walletOfOwner(address _owner) external view returns (uint256[] memory) { } //RETURNS THE AMOUNT OF TOKES THAT HAVE BEEN MINTED ALREADY function returnSupply() external view returns (uint256) { } //WITHDRAW CONTRACT BALANCE TO DEFINED ADDRESS function withdraw() public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function togglePresaleEnabled(bool enabled) public onlyOwner{ } function canTransferBeforeMintingIsEnabled(address account) public view returns(bool) { } }
_canTransferBeforeMintingIsEnabled[accounts[i]],"Account not whitelisted"
295,465
_canTransferBeforeMintingIsEnabled[accounts[i]]
null
pragma solidity ^0.4.24; // submitted by dev-xu // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol // @title SafeMath: overflow/underflow checks // @notice Math operations with safety checks that throw on error library SafeMath { // @notice Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Integer division of two numbers, truncating the quotient. function div(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). function sub(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Adds two numbers, throws on overflow. function add(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Returns fractional amount function getFractionalAmount(uint256 _amount, uint256 _percentage) internal pure returns (uint256) { } } // Database interface interface DBInterface { function setContractManager(address _contractManager) external; // --------------------Set Functions------------------------ function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint _value) external; function setString(bytes32 _key, string _value) external; function setBytes(bytes32 _key, bytes _value) external; function setBytes32(bytes32 _key, bytes32 _value) external; function setBool(bytes32 _key, bool _value) external; function setInt(bytes32 _key, int _value) external; // -------------- Deletion Functions ------------------ function deleteAddress(bytes32 _key) external; function deleteUint(bytes32 _key) external; function deleteString(bytes32 _key) external; function deleteBytes(bytes32 _key) external; function deleteBytes32(bytes32 _key) external; function deleteBool(bytes32 _key) external; function deleteInt(bytes32 _key) external; // ----------------Variable Getters--------------------- function uintStorage(bytes32 _key) external view returns (uint); function stringStorage(bytes32 _key) external view returns (string); function addressStorage(bytes32 _key) external view returns (address); function bytesStorage(bytes32 _key) external view returns (bytes); function bytes32Storage(bytes32 _key) external view returns (bytes32); function boolStorage(bytes32 _key) external view returns (bool); function intStorage(bytes32 _key) external view returns (bool); } contract Events { DBInterface public database; constructor(address _database) public{ } function message(string _message) external onlyApprovedContract { } function transaction(string _message, address _from, address _to, uint _amount, address _token) external onlyApprovedContract { } function registration(string _message, address _account) external onlyApprovedContract { } function contractChange(string _message, address _account, string _name) external onlyApprovedContract { } function asset(string _message, string _uri, address _assetAddress, address _manager) external onlyApprovedContract { } function escrow(string _message, address _assetAddress, bytes32 _escrowID, address _manager, uint _amount) external onlyApprovedContract { } function order(string _message, bytes32 _orderID, uint _amount, uint _price) external onlyApprovedContract { } function exchange(string _message, bytes32 _orderID, address _assetAddress, address _account) external onlyApprovedContract { } function operator(string _message, bytes32 _id, string _name, string _ipfs, address _account) external onlyApprovedContract { } function consensus(string _message, bytes32 _executionID, bytes32 _votesID, uint _votes, uint _tokens, uint _quorum) external onlyApprovedContract { } //Generalized events event LogEvent(string message, bytes32 indexed messageID, address indexed origin); event LogTransaction(string message, bytes32 indexed messageID, address indexed from, address indexed to, uint amount, address token, address origin); //amount and token will be empty on some events event LogAddress(string message, bytes32 indexed messageID, address indexed account, address indexed origin); event LogContractChange(string message, bytes32 indexed messageID, address indexed account, string name, address indexed origin); event LogAsset(string message, bytes32 indexed messageID, string uri, bytes32 indexed assetID, address asset, address manager, address indexed origin); event LogEscrow(string message, bytes32 indexed messageID, address asset, bytes32 escrowID, address indexed manager, uint amount, address indexed origin); event LogOrder(string message, bytes32 indexed messageID, bytes32 indexed orderID, uint amount, uint price, address indexed origin); event LogExchange(string message, bytes32 indexed messageID, bytes32 orderID, address indexed asset, address account, address indexed origin); event LogOperator(string message, bytes32 indexed messageID, bytes32 id, string name, string ipfs, address indexed account, address indexed origin); event LogConsensus(string message, bytes32 indexed messageID, bytes32 executionID, bytes32 votesID, uint votes, uint tokens, uint quorum, address indexed origin); // -------------------------------------------------------------------------------------- // Caller must be registered as a contract through ContractManager.sol // -------------------------------------------------------------------------------------- modifier onlyApprovedContract() { require(<FILL_ME>) _; } } // @notice Trade via the Kyber Proxy Contract interface KyberInterface { function getExpectedRate(address src, address dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function trade(address src, uint srcAmount, address dest, address destAddress, uint maxDestAmount,uint minConversionRate, address walletId) external payable returns(uint); } interface MinterInterface { function cloneToken(string _uri, address _erc20Address) external returns (address asset); function mintAssetTokens(address _assetAddress, address _receiver, uint256 _amount) external returns (bool); function changeTokenController(address _assetAddress, address _newController) external returns (bool); } interface CrowdsaleGeneratorERC20_ERC20 { function balanceOf(address _who) external view returns (uint256); function allowance(address _owner, address _spender) external view returns (uint256); function approve(address _spender, uint256 _value) external returns (bool); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); } // @title A crowdsale generator contract // @author Kyle Dewhurst & Peter Phillips, Roy Xu, MyBit Foundation // @notice AssetManagers can initiate a crowdsale that accepts ERC20 tokens as payment here contract CrowdsaleGeneratorERC20 { using SafeMath for uint256; DBInterface private database; Events private events; KyberInterface private kyber; MinterInterface private minter; //CrowdsaleGeneratorERC20_ERC20Burner private burner; //uint constant scalingFactor = 10**32; // @notice This contract // @param: The address for the database contract used by this platform constructor(address _database, address _events, address _kyber) public{ } // @notice Do not send ether to this contract, this is for kyber exchange to get return // @dev After collecting listing fee in token, remaining ether gets refunded from kyber function() public payable { } // @notice AssetManagers can initiate a crowdfund for a new asset here // @dev the crowdsaleERC20 contract is granted rights to mint asset-tokens as it receives funding // @param (string) _assetURI = The location where information about the asset can be found // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails // @param (uint) _amountToRaise = The amount of tokens required to raise for the crowdsale to be a success // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success // @param (address) _fundingToken = The ERC20 token to be used to fund the crowdsale (Operator must accept this token as payment) function createAssetOrderERC20(string _assetURI, string _ipfs, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc, uint _escrowAndFee, address _fundingToken, address _paymentToken) payable external { } function updateIPFS(address _assetAddress, string _ipfs) external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal/ Private Functions ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function setCrowdsaleValues(address _assetAddress, uint _fundingLength, uint _amountToRaise) private returns (bool){ } function setAssetValues(address _assetAddress, string _assetURI, string _ipfs, address _assetManager, uint _assetManagerPerc, uint _amountToRaise, address _fundingToken) private returns (bool){ } function processListingFee(address _paymentTokenAddress, uint _fromAmount) private returns (uint) { } function lockEscrowERC20(address _assetManager, address _assetAddress, address _paymentTokenAddress, address _fundingTokenAddress, uint _amount) private returns (bool) { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // @notice Sender must be a registered owner modifier onlyOwner { } modifier checkRequirements { } }
database.boolStorage(keccak256(abi.encodePacked("contract",msg.sender)))
295,525
database.boolStorage(keccak256(abi.encodePacked("contract",msg.sender)))
"Manager percent need to be less than 100"
pragma solidity ^0.4.24; // submitted by dev-xu // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol // @title SafeMath: overflow/underflow checks // @notice Math operations with safety checks that throw on error library SafeMath { // @notice Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Integer division of two numbers, truncating the quotient. function div(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). function sub(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Adds two numbers, throws on overflow. function add(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Returns fractional amount function getFractionalAmount(uint256 _amount, uint256 _percentage) internal pure returns (uint256) { } } // Database interface interface DBInterface { function setContractManager(address _contractManager) external; // --------------------Set Functions------------------------ function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint _value) external; function setString(bytes32 _key, string _value) external; function setBytes(bytes32 _key, bytes _value) external; function setBytes32(bytes32 _key, bytes32 _value) external; function setBool(bytes32 _key, bool _value) external; function setInt(bytes32 _key, int _value) external; // -------------- Deletion Functions ------------------ function deleteAddress(bytes32 _key) external; function deleteUint(bytes32 _key) external; function deleteString(bytes32 _key) external; function deleteBytes(bytes32 _key) external; function deleteBytes32(bytes32 _key) external; function deleteBool(bytes32 _key) external; function deleteInt(bytes32 _key) external; // ----------------Variable Getters--------------------- function uintStorage(bytes32 _key) external view returns (uint); function stringStorage(bytes32 _key) external view returns (string); function addressStorage(bytes32 _key) external view returns (address); function bytesStorage(bytes32 _key) external view returns (bytes); function bytes32Storage(bytes32 _key) external view returns (bytes32); function boolStorage(bytes32 _key) external view returns (bool); function intStorage(bytes32 _key) external view returns (bool); } contract Events { DBInterface public database; constructor(address _database) public{ } function message(string _message) external onlyApprovedContract { } function transaction(string _message, address _from, address _to, uint _amount, address _token) external onlyApprovedContract { } function registration(string _message, address _account) external onlyApprovedContract { } function contractChange(string _message, address _account, string _name) external onlyApprovedContract { } function asset(string _message, string _uri, address _assetAddress, address _manager) external onlyApprovedContract { } function escrow(string _message, address _assetAddress, bytes32 _escrowID, address _manager, uint _amount) external onlyApprovedContract { } function order(string _message, bytes32 _orderID, uint _amount, uint _price) external onlyApprovedContract { } function exchange(string _message, bytes32 _orderID, address _assetAddress, address _account) external onlyApprovedContract { } function operator(string _message, bytes32 _id, string _name, string _ipfs, address _account) external onlyApprovedContract { } function consensus(string _message, bytes32 _executionID, bytes32 _votesID, uint _votes, uint _tokens, uint _quorum) external onlyApprovedContract { } //Generalized events event LogEvent(string message, bytes32 indexed messageID, address indexed origin); event LogTransaction(string message, bytes32 indexed messageID, address indexed from, address indexed to, uint amount, address token, address origin); //amount and token will be empty on some events event LogAddress(string message, bytes32 indexed messageID, address indexed account, address indexed origin); event LogContractChange(string message, bytes32 indexed messageID, address indexed account, string name, address indexed origin); event LogAsset(string message, bytes32 indexed messageID, string uri, bytes32 indexed assetID, address asset, address manager, address indexed origin); event LogEscrow(string message, bytes32 indexed messageID, address asset, bytes32 escrowID, address indexed manager, uint amount, address indexed origin); event LogOrder(string message, bytes32 indexed messageID, bytes32 indexed orderID, uint amount, uint price, address indexed origin); event LogExchange(string message, bytes32 indexed messageID, bytes32 orderID, address indexed asset, address account, address indexed origin); event LogOperator(string message, bytes32 indexed messageID, bytes32 id, string name, string ipfs, address indexed account, address indexed origin); event LogConsensus(string message, bytes32 indexed messageID, bytes32 executionID, bytes32 votesID, uint votes, uint tokens, uint quorum, address indexed origin); // -------------------------------------------------------------------------------------- // Caller must be registered as a contract through ContractManager.sol // -------------------------------------------------------------------------------------- modifier onlyApprovedContract() { } } // @notice Trade via the Kyber Proxy Contract interface KyberInterface { function getExpectedRate(address src, address dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function trade(address src, uint srcAmount, address dest, address destAddress, uint maxDestAmount,uint minConversionRate, address walletId) external payable returns(uint); } interface MinterInterface { function cloneToken(string _uri, address _erc20Address) external returns (address asset); function mintAssetTokens(address _assetAddress, address _receiver, uint256 _amount) external returns (bool); function changeTokenController(address _assetAddress, address _newController) external returns (bool); } interface CrowdsaleGeneratorERC20_ERC20 { function balanceOf(address _who) external view returns (uint256); function allowance(address _owner, address _spender) external view returns (uint256); function approve(address _spender, uint256 _value) external returns (bool); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); } // @title A crowdsale generator contract // @author Kyle Dewhurst & Peter Phillips, Roy Xu, MyBit Foundation // @notice AssetManagers can initiate a crowdsale that accepts ERC20 tokens as payment here contract CrowdsaleGeneratorERC20 { using SafeMath for uint256; DBInterface private database; Events private events; KyberInterface private kyber; MinterInterface private minter; //CrowdsaleGeneratorERC20_ERC20Burner private burner; //uint constant scalingFactor = 10**32; // @notice This contract // @param: The address for the database contract used by this platform constructor(address _database, address _events, address _kyber) public{ } // @notice Do not send ether to this contract, this is for kyber exchange to get return // @dev After collecting listing fee in token, remaining ether gets refunded from kyber function() public payable { } // @notice AssetManagers can initiate a crowdfund for a new asset here // @dev the crowdsaleERC20 contract is granted rights to mint asset-tokens as it receives funding // @param (string) _assetURI = The location where information about the asset can be found // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails // @param (uint) _amountToRaise = The amount of tokens required to raise for the crowdsale to be a success // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success // @param (address) _fundingToken = The ERC20 token to be used to fund the crowdsale (Operator must accept this token as payment) function createAssetOrderERC20(string _assetURI, string _ipfs, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc, uint _escrowAndFee, address _fundingToken, address _paymentToken) payable external { if(_paymentToken == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ require(msg.value == _escrowAndFee, "ETH amount is not matching with escrow needed."); } else { require(msg.value == 0, "ETH is not required when paying with token"); CrowdsaleGeneratorERC20_ERC20(_paymentToken).transferFrom(msg.sender, address(this), _escrowAndFee); } require(_amountToRaise >= 100, "Crowdsale goal is too small"); require(<FILL_ME>) require(!database.boolStorage(keccak256(abi.encodePacked("asset.uri", _assetURI))), "Asset URI is not unique"); //Check that asset URI is unique uint escrow = processListingFee(_paymentToken, _escrowAndFee); address assetAddress = minter.cloneToken(_assetURI, _fundingToken); require(setCrowdsaleValues(assetAddress, _fundingLength, _amountToRaise), "Failed to set crowdsale values"); require(setAssetValues(assetAddress, _assetURI, _ipfs, msg.sender, _assetManagerPerc, _amountToRaise, _fundingToken), "Failed to set asset values"); //Lock escrow if (escrow > 0) { require(lockEscrowERC20(msg.sender, assetAddress, _paymentToken, _fundingToken, escrow), "Failed to lock ERC20 escrow"); } events.asset('Asset funding started', _assetURI, assetAddress, msg.sender); events.asset('New asset ipfs', _ipfs, assetAddress, msg.sender); } function updateIPFS(address _assetAddress, string _ipfs) external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal/ Private Functions ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function setCrowdsaleValues(address _assetAddress, uint _fundingLength, uint _amountToRaise) private returns (bool){ } function setAssetValues(address _assetAddress, string _assetURI, string _ipfs, address _assetManager, uint _assetManagerPerc, uint _amountToRaise, address _fundingToken) private returns (bool){ } function processListingFee(address _paymentTokenAddress, uint _fromAmount) private returns (uint) { } function lockEscrowERC20(address _assetManager, address _assetAddress, address _paymentTokenAddress, address _fundingTokenAddress, uint _amount) private returns (bool) { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // @notice Sender must be a registered owner modifier onlyOwner { } modifier checkRequirements { } }
(_assetManagerPerc+database.uintStorage(keccak256(abi.encodePacked("platform.percentage"))))<100,"Manager percent need to be less than 100"
295,525
(_assetManagerPerc+database.uintStorage(keccak256(abi.encodePacked("platform.percentage"))))<100
"Asset URI is not unique"
pragma solidity ^0.4.24; // submitted by dev-xu // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol // @title SafeMath: overflow/underflow checks // @notice Math operations with safety checks that throw on error library SafeMath { // @notice Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Integer division of two numbers, truncating the quotient. function div(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). function sub(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Adds two numbers, throws on overflow. function add(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Returns fractional amount function getFractionalAmount(uint256 _amount, uint256 _percentage) internal pure returns (uint256) { } } // Database interface interface DBInterface { function setContractManager(address _contractManager) external; // --------------------Set Functions------------------------ function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint _value) external; function setString(bytes32 _key, string _value) external; function setBytes(bytes32 _key, bytes _value) external; function setBytes32(bytes32 _key, bytes32 _value) external; function setBool(bytes32 _key, bool _value) external; function setInt(bytes32 _key, int _value) external; // -------------- Deletion Functions ------------------ function deleteAddress(bytes32 _key) external; function deleteUint(bytes32 _key) external; function deleteString(bytes32 _key) external; function deleteBytes(bytes32 _key) external; function deleteBytes32(bytes32 _key) external; function deleteBool(bytes32 _key) external; function deleteInt(bytes32 _key) external; // ----------------Variable Getters--------------------- function uintStorage(bytes32 _key) external view returns (uint); function stringStorage(bytes32 _key) external view returns (string); function addressStorage(bytes32 _key) external view returns (address); function bytesStorage(bytes32 _key) external view returns (bytes); function bytes32Storage(bytes32 _key) external view returns (bytes32); function boolStorage(bytes32 _key) external view returns (bool); function intStorage(bytes32 _key) external view returns (bool); } contract Events { DBInterface public database; constructor(address _database) public{ } function message(string _message) external onlyApprovedContract { } function transaction(string _message, address _from, address _to, uint _amount, address _token) external onlyApprovedContract { } function registration(string _message, address _account) external onlyApprovedContract { } function contractChange(string _message, address _account, string _name) external onlyApprovedContract { } function asset(string _message, string _uri, address _assetAddress, address _manager) external onlyApprovedContract { } function escrow(string _message, address _assetAddress, bytes32 _escrowID, address _manager, uint _amount) external onlyApprovedContract { } function order(string _message, bytes32 _orderID, uint _amount, uint _price) external onlyApprovedContract { } function exchange(string _message, bytes32 _orderID, address _assetAddress, address _account) external onlyApprovedContract { } function operator(string _message, bytes32 _id, string _name, string _ipfs, address _account) external onlyApprovedContract { } function consensus(string _message, bytes32 _executionID, bytes32 _votesID, uint _votes, uint _tokens, uint _quorum) external onlyApprovedContract { } //Generalized events event LogEvent(string message, bytes32 indexed messageID, address indexed origin); event LogTransaction(string message, bytes32 indexed messageID, address indexed from, address indexed to, uint amount, address token, address origin); //amount and token will be empty on some events event LogAddress(string message, bytes32 indexed messageID, address indexed account, address indexed origin); event LogContractChange(string message, bytes32 indexed messageID, address indexed account, string name, address indexed origin); event LogAsset(string message, bytes32 indexed messageID, string uri, bytes32 indexed assetID, address asset, address manager, address indexed origin); event LogEscrow(string message, bytes32 indexed messageID, address asset, bytes32 escrowID, address indexed manager, uint amount, address indexed origin); event LogOrder(string message, bytes32 indexed messageID, bytes32 indexed orderID, uint amount, uint price, address indexed origin); event LogExchange(string message, bytes32 indexed messageID, bytes32 orderID, address indexed asset, address account, address indexed origin); event LogOperator(string message, bytes32 indexed messageID, bytes32 id, string name, string ipfs, address indexed account, address indexed origin); event LogConsensus(string message, bytes32 indexed messageID, bytes32 executionID, bytes32 votesID, uint votes, uint tokens, uint quorum, address indexed origin); // -------------------------------------------------------------------------------------- // Caller must be registered as a contract through ContractManager.sol // -------------------------------------------------------------------------------------- modifier onlyApprovedContract() { } } // @notice Trade via the Kyber Proxy Contract interface KyberInterface { function getExpectedRate(address src, address dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function trade(address src, uint srcAmount, address dest, address destAddress, uint maxDestAmount,uint minConversionRate, address walletId) external payable returns(uint); } interface MinterInterface { function cloneToken(string _uri, address _erc20Address) external returns (address asset); function mintAssetTokens(address _assetAddress, address _receiver, uint256 _amount) external returns (bool); function changeTokenController(address _assetAddress, address _newController) external returns (bool); } interface CrowdsaleGeneratorERC20_ERC20 { function balanceOf(address _who) external view returns (uint256); function allowance(address _owner, address _spender) external view returns (uint256); function approve(address _spender, uint256 _value) external returns (bool); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); } // @title A crowdsale generator contract // @author Kyle Dewhurst & Peter Phillips, Roy Xu, MyBit Foundation // @notice AssetManagers can initiate a crowdsale that accepts ERC20 tokens as payment here contract CrowdsaleGeneratorERC20 { using SafeMath for uint256; DBInterface private database; Events private events; KyberInterface private kyber; MinterInterface private minter; //CrowdsaleGeneratorERC20_ERC20Burner private burner; //uint constant scalingFactor = 10**32; // @notice This contract // @param: The address for the database contract used by this platform constructor(address _database, address _events, address _kyber) public{ } // @notice Do not send ether to this contract, this is for kyber exchange to get return // @dev After collecting listing fee in token, remaining ether gets refunded from kyber function() public payable { } // @notice AssetManagers can initiate a crowdfund for a new asset here // @dev the crowdsaleERC20 contract is granted rights to mint asset-tokens as it receives funding // @param (string) _assetURI = The location where information about the asset can be found // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails // @param (uint) _amountToRaise = The amount of tokens required to raise for the crowdsale to be a success // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success // @param (address) _fundingToken = The ERC20 token to be used to fund the crowdsale (Operator must accept this token as payment) function createAssetOrderERC20(string _assetURI, string _ipfs, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc, uint _escrowAndFee, address _fundingToken, address _paymentToken) payable external { if(_paymentToken == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ require(msg.value == _escrowAndFee, "ETH amount is not matching with escrow needed."); } else { require(msg.value == 0, "ETH is not required when paying with token"); CrowdsaleGeneratorERC20_ERC20(_paymentToken).transferFrom(msg.sender, address(this), _escrowAndFee); } require(_amountToRaise >= 100, "Crowdsale goal is too small"); require((_assetManagerPerc + database.uintStorage(keccak256(abi.encodePacked("platform.percentage")))) < 100, "Manager percent need to be less than 100"); require(<FILL_ME>) //Check that asset URI is unique uint escrow = processListingFee(_paymentToken, _escrowAndFee); address assetAddress = minter.cloneToken(_assetURI, _fundingToken); require(setCrowdsaleValues(assetAddress, _fundingLength, _amountToRaise), "Failed to set crowdsale values"); require(setAssetValues(assetAddress, _assetURI, _ipfs, msg.sender, _assetManagerPerc, _amountToRaise, _fundingToken), "Failed to set asset values"); //Lock escrow if (escrow > 0) { require(lockEscrowERC20(msg.sender, assetAddress, _paymentToken, _fundingToken, escrow), "Failed to lock ERC20 escrow"); } events.asset('Asset funding started', _assetURI, assetAddress, msg.sender); events.asset('New asset ipfs', _ipfs, assetAddress, msg.sender); } function updateIPFS(address _assetAddress, string _ipfs) external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal/ Private Functions ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function setCrowdsaleValues(address _assetAddress, uint _fundingLength, uint _amountToRaise) private returns (bool){ } function setAssetValues(address _assetAddress, string _assetURI, string _ipfs, address _assetManager, uint _assetManagerPerc, uint _amountToRaise, address _fundingToken) private returns (bool){ } function processListingFee(address _paymentTokenAddress, uint _fromAmount) private returns (uint) { } function lockEscrowERC20(address _assetManager, address _assetAddress, address _paymentTokenAddress, address _fundingTokenAddress, uint _amount) private returns (bool) { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // @notice Sender must be a registered owner modifier onlyOwner { } modifier checkRequirements { } }
!database.boolStorage(keccak256(abi.encodePacked("asset.uri",_assetURI))),"Asset URI is not unique"
295,525
!database.boolStorage(keccak256(abi.encodePacked("asset.uri",_assetURI)))
"Failed to set crowdsale values"
pragma solidity ^0.4.24; // submitted by dev-xu // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol // @title SafeMath: overflow/underflow checks // @notice Math operations with safety checks that throw on error library SafeMath { // @notice Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Integer division of two numbers, truncating the quotient. function div(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). function sub(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Adds two numbers, throws on overflow. function add(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Returns fractional amount function getFractionalAmount(uint256 _amount, uint256 _percentage) internal pure returns (uint256) { } } // Database interface interface DBInterface { function setContractManager(address _contractManager) external; // --------------------Set Functions------------------------ function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint _value) external; function setString(bytes32 _key, string _value) external; function setBytes(bytes32 _key, bytes _value) external; function setBytes32(bytes32 _key, bytes32 _value) external; function setBool(bytes32 _key, bool _value) external; function setInt(bytes32 _key, int _value) external; // -------------- Deletion Functions ------------------ function deleteAddress(bytes32 _key) external; function deleteUint(bytes32 _key) external; function deleteString(bytes32 _key) external; function deleteBytes(bytes32 _key) external; function deleteBytes32(bytes32 _key) external; function deleteBool(bytes32 _key) external; function deleteInt(bytes32 _key) external; // ----------------Variable Getters--------------------- function uintStorage(bytes32 _key) external view returns (uint); function stringStorage(bytes32 _key) external view returns (string); function addressStorage(bytes32 _key) external view returns (address); function bytesStorage(bytes32 _key) external view returns (bytes); function bytes32Storage(bytes32 _key) external view returns (bytes32); function boolStorage(bytes32 _key) external view returns (bool); function intStorage(bytes32 _key) external view returns (bool); } contract Events { DBInterface public database; constructor(address _database) public{ } function message(string _message) external onlyApprovedContract { } function transaction(string _message, address _from, address _to, uint _amount, address _token) external onlyApprovedContract { } function registration(string _message, address _account) external onlyApprovedContract { } function contractChange(string _message, address _account, string _name) external onlyApprovedContract { } function asset(string _message, string _uri, address _assetAddress, address _manager) external onlyApprovedContract { } function escrow(string _message, address _assetAddress, bytes32 _escrowID, address _manager, uint _amount) external onlyApprovedContract { } function order(string _message, bytes32 _orderID, uint _amount, uint _price) external onlyApprovedContract { } function exchange(string _message, bytes32 _orderID, address _assetAddress, address _account) external onlyApprovedContract { } function operator(string _message, bytes32 _id, string _name, string _ipfs, address _account) external onlyApprovedContract { } function consensus(string _message, bytes32 _executionID, bytes32 _votesID, uint _votes, uint _tokens, uint _quorum) external onlyApprovedContract { } //Generalized events event LogEvent(string message, bytes32 indexed messageID, address indexed origin); event LogTransaction(string message, bytes32 indexed messageID, address indexed from, address indexed to, uint amount, address token, address origin); //amount and token will be empty on some events event LogAddress(string message, bytes32 indexed messageID, address indexed account, address indexed origin); event LogContractChange(string message, bytes32 indexed messageID, address indexed account, string name, address indexed origin); event LogAsset(string message, bytes32 indexed messageID, string uri, bytes32 indexed assetID, address asset, address manager, address indexed origin); event LogEscrow(string message, bytes32 indexed messageID, address asset, bytes32 escrowID, address indexed manager, uint amount, address indexed origin); event LogOrder(string message, bytes32 indexed messageID, bytes32 indexed orderID, uint amount, uint price, address indexed origin); event LogExchange(string message, bytes32 indexed messageID, bytes32 orderID, address indexed asset, address account, address indexed origin); event LogOperator(string message, bytes32 indexed messageID, bytes32 id, string name, string ipfs, address indexed account, address indexed origin); event LogConsensus(string message, bytes32 indexed messageID, bytes32 executionID, bytes32 votesID, uint votes, uint tokens, uint quorum, address indexed origin); // -------------------------------------------------------------------------------------- // Caller must be registered as a contract through ContractManager.sol // -------------------------------------------------------------------------------------- modifier onlyApprovedContract() { } } // @notice Trade via the Kyber Proxy Contract interface KyberInterface { function getExpectedRate(address src, address dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function trade(address src, uint srcAmount, address dest, address destAddress, uint maxDestAmount,uint minConversionRate, address walletId) external payable returns(uint); } interface MinterInterface { function cloneToken(string _uri, address _erc20Address) external returns (address asset); function mintAssetTokens(address _assetAddress, address _receiver, uint256 _amount) external returns (bool); function changeTokenController(address _assetAddress, address _newController) external returns (bool); } interface CrowdsaleGeneratorERC20_ERC20 { function balanceOf(address _who) external view returns (uint256); function allowance(address _owner, address _spender) external view returns (uint256); function approve(address _spender, uint256 _value) external returns (bool); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); } // @title A crowdsale generator contract // @author Kyle Dewhurst & Peter Phillips, Roy Xu, MyBit Foundation // @notice AssetManagers can initiate a crowdsale that accepts ERC20 tokens as payment here contract CrowdsaleGeneratorERC20 { using SafeMath for uint256; DBInterface private database; Events private events; KyberInterface private kyber; MinterInterface private minter; //CrowdsaleGeneratorERC20_ERC20Burner private burner; //uint constant scalingFactor = 10**32; // @notice This contract // @param: The address for the database contract used by this platform constructor(address _database, address _events, address _kyber) public{ } // @notice Do not send ether to this contract, this is for kyber exchange to get return // @dev After collecting listing fee in token, remaining ether gets refunded from kyber function() public payable { } // @notice AssetManagers can initiate a crowdfund for a new asset here // @dev the crowdsaleERC20 contract is granted rights to mint asset-tokens as it receives funding // @param (string) _assetURI = The location where information about the asset can be found // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails // @param (uint) _amountToRaise = The amount of tokens required to raise for the crowdsale to be a success // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success // @param (address) _fundingToken = The ERC20 token to be used to fund the crowdsale (Operator must accept this token as payment) function createAssetOrderERC20(string _assetURI, string _ipfs, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc, uint _escrowAndFee, address _fundingToken, address _paymentToken) payable external { if(_paymentToken == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ require(msg.value == _escrowAndFee, "ETH amount is not matching with escrow needed."); } else { require(msg.value == 0, "ETH is not required when paying with token"); CrowdsaleGeneratorERC20_ERC20(_paymentToken).transferFrom(msg.sender, address(this), _escrowAndFee); } require(_amountToRaise >= 100, "Crowdsale goal is too small"); require((_assetManagerPerc + database.uintStorage(keccak256(abi.encodePacked("platform.percentage")))) < 100, "Manager percent need to be less than 100"); require(!database.boolStorage(keccak256(abi.encodePacked("asset.uri", _assetURI))), "Asset URI is not unique"); //Check that asset URI is unique uint escrow = processListingFee(_paymentToken, _escrowAndFee); address assetAddress = minter.cloneToken(_assetURI, _fundingToken); require(<FILL_ME>) require(setAssetValues(assetAddress, _assetURI, _ipfs, msg.sender, _assetManagerPerc, _amountToRaise, _fundingToken), "Failed to set asset values"); //Lock escrow if (escrow > 0) { require(lockEscrowERC20(msg.sender, assetAddress, _paymentToken, _fundingToken, escrow), "Failed to lock ERC20 escrow"); } events.asset('Asset funding started', _assetURI, assetAddress, msg.sender); events.asset('New asset ipfs', _ipfs, assetAddress, msg.sender); } function updateIPFS(address _assetAddress, string _ipfs) external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal/ Private Functions ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function setCrowdsaleValues(address _assetAddress, uint _fundingLength, uint _amountToRaise) private returns (bool){ } function setAssetValues(address _assetAddress, string _assetURI, string _ipfs, address _assetManager, uint _assetManagerPerc, uint _amountToRaise, address _fundingToken) private returns (bool){ } function processListingFee(address _paymentTokenAddress, uint _fromAmount) private returns (uint) { } function lockEscrowERC20(address _assetManager, address _assetAddress, address _paymentTokenAddress, address _fundingTokenAddress, uint _amount) private returns (bool) { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // @notice Sender must be a registered owner modifier onlyOwner { } modifier checkRequirements { } }
setCrowdsaleValues(assetAddress,_fundingLength,_amountToRaise),"Failed to set crowdsale values"
295,525
setCrowdsaleValues(assetAddress,_fundingLength,_amountToRaise)
"Failed to set asset values"
pragma solidity ^0.4.24; // submitted by dev-xu // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol // @title SafeMath: overflow/underflow checks // @notice Math operations with safety checks that throw on error library SafeMath { // @notice Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Integer division of two numbers, truncating the quotient. function div(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). function sub(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Adds two numbers, throws on overflow. function add(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Returns fractional amount function getFractionalAmount(uint256 _amount, uint256 _percentage) internal pure returns (uint256) { } } // Database interface interface DBInterface { function setContractManager(address _contractManager) external; // --------------------Set Functions------------------------ function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint _value) external; function setString(bytes32 _key, string _value) external; function setBytes(bytes32 _key, bytes _value) external; function setBytes32(bytes32 _key, bytes32 _value) external; function setBool(bytes32 _key, bool _value) external; function setInt(bytes32 _key, int _value) external; // -------------- Deletion Functions ------------------ function deleteAddress(bytes32 _key) external; function deleteUint(bytes32 _key) external; function deleteString(bytes32 _key) external; function deleteBytes(bytes32 _key) external; function deleteBytes32(bytes32 _key) external; function deleteBool(bytes32 _key) external; function deleteInt(bytes32 _key) external; // ----------------Variable Getters--------------------- function uintStorage(bytes32 _key) external view returns (uint); function stringStorage(bytes32 _key) external view returns (string); function addressStorage(bytes32 _key) external view returns (address); function bytesStorage(bytes32 _key) external view returns (bytes); function bytes32Storage(bytes32 _key) external view returns (bytes32); function boolStorage(bytes32 _key) external view returns (bool); function intStorage(bytes32 _key) external view returns (bool); } contract Events { DBInterface public database; constructor(address _database) public{ } function message(string _message) external onlyApprovedContract { } function transaction(string _message, address _from, address _to, uint _amount, address _token) external onlyApprovedContract { } function registration(string _message, address _account) external onlyApprovedContract { } function contractChange(string _message, address _account, string _name) external onlyApprovedContract { } function asset(string _message, string _uri, address _assetAddress, address _manager) external onlyApprovedContract { } function escrow(string _message, address _assetAddress, bytes32 _escrowID, address _manager, uint _amount) external onlyApprovedContract { } function order(string _message, bytes32 _orderID, uint _amount, uint _price) external onlyApprovedContract { } function exchange(string _message, bytes32 _orderID, address _assetAddress, address _account) external onlyApprovedContract { } function operator(string _message, bytes32 _id, string _name, string _ipfs, address _account) external onlyApprovedContract { } function consensus(string _message, bytes32 _executionID, bytes32 _votesID, uint _votes, uint _tokens, uint _quorum) external onlyApprovedContract { } //Generalized events event LogEvent(string message, bytes32 indexed messageID, address indexed origin); event LogTransaction(string message, bytes32 indexed messageID, address indexed from, address indexed to, uint amount, address token, address origin); //amount and token will be empty on some events event LogAddress(string message, bytes32 indexed messageID, address indexed account, address indexed origin); event LogContractChange(string message, bytes32 indexed messageID, address indexed account, string name, address indexed origin); event LogAsset(string message, bytes32 indexed messageID, string uri, bytes32 indexed assetID, address asset, address manager, address indexed origin); event LogEscrow(string message, bytes32 indexed messageID, address asset, bytes32 escrowID, address indexed manager, uint amount, address indexed origin); event LogOrder(string message, bytes32 indexed messageID, bytes32 indexed orderID, uint amount, uint price, address indexed origin); event LogExchange(string message, bytes32 indexed messageID, bytes32 orderID, address indexed asset, address account, address indexed origin); event LogOperator(string message, bytes32 indexed messageID, bytes32 id, string name, string ipfs, address indexed account, address indexed origin); event LogConsensus(string message, bytes32 indexed messageID, bytes32 executionID, bytes32 votesID, uint votes, uint tokens, uint quorum, address indexed origin); // -------------------------------------------------------------------------------------- // Caller must be registered as a contract through ContractManager.sol // -------------------------------------------------------------------------------------- modifier onlyApprovedContract() { } } // @notice Trade via the Kyber Proxy Contract interface KyberInterface { function getExpectedRate(address src, address dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function trade(address src, uint srcAmount, address dest, address destAddress, uint maxDestAmount,uint minConversionRate, address walletId) external payable returns(uint); } interface MinterInterface { function cloneToken(string _uri, address _erc20Address) external returns (address asset); function mintAssetTokens(address _assetAddress, address _receiver, uint256 _amount) external returns (bool); function changeTokenController(address _assetAddress, address _newController) external returns (bool); } interface CrowdsaleGeneratorERC20_ERC20 { function balanceOf(address _who) external view returns (uint256); function allowance(address _owner, address _spender) external view returns (uint256); function approve(address _spender, uint256 _value) external returns (bool); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); } // @title A crowdsale generator contract // @author Kyle Dewhurst & Peter Phillips, Roy Xu, MyBit Foundation // @notice AssetManagers can initiate a crowdsale that accepts ERC20 tokens as payment here contract CrowdsaleGeneratorERC20 { using SafeMath for uint256; DBInterface private database; Events private events; KyberInterface private kyber; MinterInterface private minter; //CrowdsaleGeneratorERC20_ERC20Burner private burner; //uint constant scalingFactor = 10**32; // @notice This contract // @param: The address for the database contract used by this platform constructor(address _database, address _events, address _kyber) public{ } // @notice Do not send ether to this contract, this is for kyber exchange to get return // @dev After collecting listing fee in token, remaining ether gets refunded from kyber function() public payable { } // @notice AssetManagers can initiate a crowdfund for a new asset here // @dev the crowdsaleERC20 contract is granted rights to mint asset-tokens as it receives funding // @param (string) _assetURI = The location where information about the asset can be found // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails // @param (uint) _amountToRaise = The amount of tokens required to raise for the crowdsale to be a success // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success // @param (address) _fundingToken = The ERC20 token to be used to fund the crowdsale (Operator must accept this token as payment) function createAssetOrderERC20(string _assetURI, string _ipfs, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc, uint _escrowAndFee, address _fundingToken, address _paymentToken) payable external { if(_paymentToken == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ require(msg.value == _escrowAndFee, "ETH amount is not matching with escrow needed."); } else { require(msg.value == 0, "ETH is not required when paying with token"); CrowdsaleGeneratorERC20_ERC20(_paymentToken).transferFrom(msg.sender, address(this), _escrowAndFee); } require(_amountToRaise >= 100, "Crowdsale goal is too small"); require((_assetManagerPerc + database.uintStorage(keccak256(abi.encodePacked("platform.percentage")))) < 100, "Manager percent need to be less than 100"); require(!database.boolStorage(keccak256(abi.encodePacked("asset.uri", _assetURI))), "Asset URI is not unique"); //Check that asset URI is unique uint escrow = processListingFee(_paymentToken, _escrowAndFee); address assetAddress = minter.cloneToken(_assetURI, _fundingToken); require(setCrowdsaleValues(assetAddress, _fundingLength, _amountToRaise), "Failed to set crowdsale values"); require(<FILL_ME>) //Lock escrow if (escrow > 0) { require(lockEscrowERC20(msg.sender, assetAddress, _paymentToken, _fundingToken, escrow), "Failed to lock ERC20 escrow"); } events.asset('Asset funding started', _assetURI, assetAddress, msg.sender); events.asset('New asset ipfs', _ipfs, assetAddress, msg.sender); } function updateIPFS(address _assetAddress, string _ipfs) external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal/ Private Functions ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function setCrowdsaleValues(address _assetAddress, uint _fundingLength, uint _amountToRaise) private returns (bool){ } function setAssetValues(address _assetAddress, string _assetURI, string _ipfs, address _assetManager, uint _assetManagerPerc, uint _amountToRaise, address _fundingToken) private returns (bool){ } function processListingFee(address _paymentTokenAddress, uint _fromAmount) private returns (uint) { } function lockEscrowERC20(address _assetManager, address _assetAddress, address _paymentTokenAddress, address _fundingTokenAddress, uint _amount) private returns (bool) { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // @notice Sender must be a registered owner modifier onlyOwner { } modifier checkRequirements { } }
setAssetValues(assetAddress,_assetURI,_ipfs,msg.sender,_assetManagerPerc,_amountToRaise,_fundingToken),"Failed to set asset values"
295,525
setAssetValues(assetAddress,_assetURI,_ipfs,msg.sender,_assetManagerPerc,_amountToRaise,_fundingToken)
"Failed to lock ERC20 escrow"
pragma solidity ^0.4.24; // submitted by dev-xu // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol // @title SafeMath: overflow/underflow checks // @notice Math operations with safety checks that throw on error library SafeMath { // @notice Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Integer division of two numbers, truncating the quotient. function div(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). function sub(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Adds two numbers, throws on overflow. function add(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Returns fractional amount function getFractionalAmount(uint256 _amount, uint256 _percentage) internal pure returns (uint256) { } } // Database interface interface DBInterface { function setContractManager(address _contractManager) external; // --------------------Set Functions------------------------ function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint _value) external; function setString(bytes32 _key, string _value) external; function setBytes(bytes32 _key, bytes _value) external; function setBytes32(bytes32 _key, bytes32 _value) external; function setBool(bytes32 _key, bool _value) external; function setInt(bytes32 _key, int _value) external; // -------------- Deletion Functions ------------------ function deleteAddress(bytes32 _key) external; function deleteUint(bytes32 _key) external; function deleteString(bytes32 _key) external; function deleteBytes(bytes32 _key) external; function deleteBytes32(bytes32 _key) external; function deleteBool(bytes32 _key) external; function deleteInt(bytes32 _key) external; // ----------------Variable Getters--------------------- function uintStorage(bytes32 _key) external view returns (uint); function stringStorage(bytes32 _key) external view returns (string); function addressStorage(bytes32 _key) external view returns (address); function bytesStorage(bytes32 _key) external view returns (bytes); function bytes32Storage(bytes32 _key) external view returns (bytes32); function boolStorage(bytes32 _key) external view returns (bool); function intStorage(bytes32 _key) external view returns (bool); } contract Events { DBInterface public database; constructor(address _database) public{ } function message(string _message) external onlyApprovedContract { } function transaction(string _message, address _from, address _to, uint _amount, address _token) external onlyApprovedContract { } function registration(string _message, address _account) external onlyApprovedContract { } function contractChange(string _message, address _account, string _name) external onlyApprovedContract { } function asset(string _message, string _uri, address _assetAddress, address _manager) external onlyApprovedContract { } function escrow(string _message, address _assetAddress, bytes32 _escrowID, address _manager, uint _amount) external onlyApprovedContract { } function order(string _message, bytes32 _orderID, uint _amount, uint _price) external onlyApprovedContract { } function exchange(string _message, bytes32 _orderID, address _assetAddress, address _account) external onlyApprovedContract { } function operator(string _message, bytes32 _id, string _name, string _ipfs, address _account) external onlyApprovedContract { } function consensus(string _message, bytes32 _executionID, bytes32 _votesID, uint _votes, uint _tokens, uint _quorum) external onlyApprovedContract { } //Generalized events event LogEvent(string message, bytes32 indexed messageID, address indexed origin); event LogTransaction(string message, bytes32 indexed messageID, address indexed from, address indexed to, uint amount, address token, address origin); //amount and token will be empty on some events event LogAddress(string message, bytes32 indexed messageID, address indexed account, address indexed origin); event LogContractChange(string message, bytes32 indexed messageID, address indexed account, string name, address indexed origin); event LogAsset(string message, bytes32 indexed messageID, string uri, bytes32 indexed assetID, address asset, address manager, address indexed origin); event LogEscrow(string message, bytes32 indexed messageID, address asset, bytes32 escrowID, address indexed manager, uint amount, address indexed origin); event LogOrder(string message, bytes32 indexed messageID, bytes32 indexed orderID, uint amount, uint price, address indexed origin); event LogExchange(string message, bytes32 indexed messageID, bytes32 orderID, address indexed asset, address account, address indexed origin); event LogOperator(string message, bytes32 indexed messageID, bytes32 id, string name, string ipfs, address indexed account, address indexed origin); event LogConsensus(string message, bytes32 indexed messageID, bytes32 executionID, bytes32 votesID, uint votes, uint tokens, uint quorum, address indexed origin); // -------------------------------------------------------------------------------------- // Caller must be registered as a contract through ContractManager.sol // -------------------------------------------------------------------------------------- modifier onlyApprovedContract() { } } // @notice Trade via the Kyber Proxy Contract interface KyberInterface { function getExpectedRate(address src, address dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function trade(address src, uint srcAmount, address dest, address destAddress, uint maxDestAmount,uint minConversionRate, address walletId) external payable returns(uint); } interface MinterInterface { function cloneToken(string _uri, address _erc20Address) external returns (address asset); function mintAssetTokens(address _assetAddress, address _receiver, uint256 _amount) external returns (bool); function changeTokenController(address _assetAddress, address _newController) external returns (bool); } interface CrowdsaleGeneratorERC20_ERC20 { function balanceOf(address _who) external view returns (uint256); function allowance(address _owner, address _spender) external view returns (uint256); function approve(address _spender, uint256 _value) external returns (bool); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); } // @title A crowdsale generator contract // @author Kyle Dewhurst & Peter Phillips, Roy Xu, MyBit Foundation // @notice AssetManagers can initiate a crowdsale that accepts ERC20 tokens as payment here contract CrowdsaleGeneratorERC20 { using SafeMath for uint256; DBInterface private database; Events private events; KyberInterface private kyber; MinterInterface private minter; //CrowdsaleGeneratorERC20_ERC20Burner private burner; //uint constant scalingFactor = 10**32; // @notice This contract // @param: The address for the database contract used by this platform constructor(address _database, address _events, address _kyber) public{ } // @notice Do not send ether to this contract, this is for kyber exchange to get return // @dev After collecting listing fee in token, remaining ether gets refunded from kyber function() public payable { } // @notice AssetManagers can initiate a crowdfund for a new asset here // @dev the crowdsaleERC20 contract is granted rights to mint asset-tokens as it receives funding // @param (string) _assetURI = The location where information about the asset can be found // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails // @param (uint) _amountToRaise = The amount of tokens required to raise for the crowdsale to be a success // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success // @param (address) _fundingToken = The ERC20 token to be used to fund the crowdsale (Operator must accept this token as payment) function createAssetOrderERC20(string _assetURI, string _ipfs, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc, uint _escrowAndFee, address _fundingToken, address _paymentToken) payable external { if(_paymentToken == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ require(msg.value == _escrowAndFee, "ETH amount is not matching with escrow needed."); } else { require(msg.value == 0, "ETH is not required when paying with token"); CrowdsaleGeneratorERC20_ERC20(_paymentToken).transferFrom(msg.sender, address(this), _escrowAndFee); } require(_amountToRaise >= 100, "Crowdsale goal is too small"); require((_assetManagerPerc + database.uintStorage(keccak256(abi.encodePacked("platform.percentage")))) < 100, "Manager percent need to be less than 100"); require(!database.boolStorage(keccak256(abi.encodePacked("asset.uri", _assetURI))), "Asset URI is not unique"); //Check that asset URI is unique uint escrow = processListingFee(_paymentToken, _escrowAndFee); address assetAddress = minter.cloneToken(_assetURI, _fundingToken); require(setCrowdsaleValues(assetAddress, _fundingLength, _amountToRaise), "Failed to set crowdsale values"); require(setAssetValues(assetAddress, _assetURI, _ipfs, msg.sender, _assetManagerPerc, _amountToRaise, _fundingToken), "Failed to set asset values"); //Lock escrow if (escrow > 0) { require(<FILL_ME>) } events.asset('Asset funding started', _assetURI, assetAddress, msg.sender); events.asset('New asset ipfs', _ipfs, assetAddress, msg.sender); } function updateIPFS(address _assetAddress, string _ipfs) external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal/ Private Functions ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function setCrowdsaleValues(address _assetAddress, uint _fundingLength, uint _amountToRaise) private returns (bool){ } function setAssetValues(address _assetAddress, string _assetURI, string _ipfs, address _assetManager, uint _assetManagerPerc, uint _amountToRaise, address _fundingToken) private returns (bool){ } function processListingFee(address _paymentTokenAddress, uint _fromAmount) private returns (uint) { } function lockEscrowERC20(address _assetManager, address _assetAddress, address _paymentTokenAddress, address _fundingTokenAddress, uint _amount) private returns (bool) { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // @notice Sender must be a registered owner modifier onlyOwner { } modifier checkRequirements { } }
lockEscrowERC20(msg.sender,assetAddress,_paymentToken,_fundingToken,escrow),"Failed to lock ERC20 escrow"
295,525
lockEscrowERC20(msg.sender,assetAddress,_paymentToken,_fundingToken,escrow)
null
pragma solidity ^0.4.24; // submitted by dev-xu // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol // @title SafeMath: overflow/underflow checks // @notice Math operations with safety checks that throw on error library SafeMath { // @notice Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Integer division of two numbers, truncating the quotient. function div(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). function sub(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Adds two numbers, throws on overflow. function add(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Returns fractional amount function getFractionalAmount(uint256 _amount, uint256 _percentage) internal pure returns (uint256) { } } // Database interface interface DBInterface { function setContractManager(address _contractManager) external; // --------------------Set Functions------------------------ function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint _value) external; function setString(bytes32 _key, string _value) external; function setBytes(bytes32 _key, bytes _value) external; function setBytes32(bytes32 _key, bytes32 _value) external; function setBool(bytes32 _key, bool _value) external; function setInt(bytes32 _key, int _value) external; // -------------- Deletion Functions ------------------ function deleteAddress(bytes32 _key) external; function deleteUint(bytes32 _key) external; function deleteString(bytes32 _key) external; function deleteBytes(bytes32 _key) external; function deleteBytes32(bytes32 _key) external; function deleteBool(bytes32 _key) external; function deleteInt(bytes32 _key) external; // ----------------Variable Getters--------------------- function uintStorage(bytes32 _key) external view returns (uint); function stringStorage(bytes32 _key) external view returns (string); function addressStorage(bytes32 _key) external view returns (address); function bytesStorage(bytes32 _key) external view returns (bytes); function bytes32Storage(bytes32 _key) external view returns (bytes32); function boolStorage(bytes32 _key) external view returns (bool); function intStorage(bytes32 _key) external view returns (bool); } contract Events { DBInterface public database; constructor(address _database) public{ } function message(string _message) external onlyApprovedContract { } function transaction(string _message, address _from, address _to, uint _amount, address _token) external onlyApprovedContract { } function registration(string _message, address _account) external onlyApprovedContract { } function contractChange(string _message, address _account, string _name) external onlyApprovedContract { } function asset(string _message, string _uri, address _assetAddress, address _manager) external onlyApprovedContract { } function escrow(string _message, address _assetAddress, bytes32 _escrowID, address _manager, uint _amount) external onlyApprovedContract { } function order(string _message, bytes32 _orderID, uint _amount, uint _price) external onlyApprovedContract { } function exchange(string _message, bytes32 _orderID, address _assetAddress, address _account) external onlyApprovedContract { } function operator(string _message, bytes32 _id, string _name, string _ipfs, address _account) external onlyApprovedContract { } function consensus(string _message, bytes32 _executionID, bytes32 _votesID, uint _votes, uint _tokens, uint _quorum) external onlyApprovedContract { } //Generalized events event LogEvent(string message, bytes32 indexed messageID, address indexed origin); event LogTransaction(string message, bytes32 indexed messageID, address indexed from, address indexed to, uint amount, address token, address origin); //amount and token will be empty on some events event LogAddress(string message, bytes32 indexed messageID, address indexed account, address indexed origin); event LogContractChange(string message, bytes32 indexed messageID, address indexed account, string name, address indexed origin); event LogAsset(string message, bytes32 indexed messageID, string uri, bytes32 indexed assetID, address asset, address manager, address indexed origin); event LogEscrow(string message, bytes32 indexed messageID, address asset, bytes32 escrowID, address indexed manager, uint amount, address indexed origin); event LogOrder(string message, bytes32 indexed messageID, bytes32 indexed orderID, uint amount, uint price, address indexed origin); event LogExchange(string message, bytes32 indexed messageID, bytes32 orderID, address indexed asset, address account, address indexed origin); event LogOperator(string message, bytes32 indexed messageID, bytes32 id, string name, string ipfs, address indexed account, address indexed origin); event LogConsensus(string message, bytes32 indexed messageID, bytes32 executionID, bytes32 votesID, uint votes, uint tokens, uint quorum, address indexed origin); // -------------------------------------------------------------------------------------- // Caller must be registered as a contract through ContractManager.sol // -------------------------------------------------------------------------------------- modifier onlyApprovedContract() { } } // @notice Trade via the Kyber Proxy Contract interface KyberInterface { function getExpectedRate(address src, address dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function trade(address src, uint srcAmount, address dest, address destAddress, uint maxDestAmount,uint minConversionRate, address walletId) external payable returns(uint); } interface MinterInterface { function cloneToken(string _uri, address _erc20Address) external returns (address asset); function mintAssetTokens(address _assetAddress, address _receiver, uint256 _amount) external returns (bool); function changeTokenController(address _assetAddress, address _newController) external returns (bool); } interface CrowdsaleGeneratorERC20_ERC20 { function balanceOf(address _who) external view returns (uint256); function allowance(address _owner, address _spender) external view returns (uint256); function approve(address _spender, uint256 _value) external returns (bool); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); } // @title A crowdsale generator contract // @author Kyle Dewhurst & Peter Phillips, Roy Xu, MyBit Foundation // @notice AssetManagers can initiate a crowdsale that accepts ERC20 tokens as payment here contract CrowdsaleGeneratorERC20 { using SafeMath for uint256; DBInterface private database; Events private events; KyberInterface private kyber; MinterInterface private minter; //CrowdsaleGeneratorERC20_ERC20Burner private burner; //uint constant scalingFactor = 10**32; // @notice This contract // @param: The address for the database contract used by this platform constructor(address _database, address _events, address _kyber) public{ } // @notice Do not send ether to this contract, this is for kyber exchange to get return // @dev After collecting listing fee in token, remaining ether gets refunded from kyber function() public payable { } // @notice AssetManagers can initiate a crowdfund for a new asset here // @dev the crowdsaleERC20 contract is granted rights to mint asset-tokens as it receives funding // @param (string) _assetURI = The location where information about the asset can be found // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails // @param (uint) _amountToRaise = The amount of tokens required to raise for the crowdsale to be a success // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success // @param (address) _fundingToken = The ERC20 token to be used to fund the crowdsale (Operator must accept this token as payment) function createAssetOrderERC20(string _assetURI, string _ipfs, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc, uint _escrowAndFee, address _fundingToken, address _paymentToken) payable external { } function updateIPFS(address _assetAddress, string _ipfs) external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal/ Private Functions ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function setCrowdsaleValues(address _assetAddress, uint _fundingLength, uint _amountToRaise) private returns (bool){ } function setAssetValues(address _assetAddress, string _assetURI, string _ipfs, address _assetManager, uint _assetManagerPerc, uint _amountToRaise, address _fundingToken) private returns (bool){ } function processListingFee(address _paymentTokenAddress, uint _fromAmount) private returns (uint) { // returns left amount uint listingFee = database.uintStorage(keccak256(abi.encodePacked("platform.listingFee"))); address listingFeeTokenAddress = database.addressStorage(keccak256(abi.encodePacked("platform.listingFeeToken"))); address platformFundsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.funds"))); uint usedAmount; uint balanceBefore; uint listingFeePaid; uint expectedRate; uint estimation; CrowdsaleGeneratorERC20_ERC20 paymentToken; if (_paymentTokenAddress != listingFeeTokenAddress) { //Convert the payment token into the listing fee token ( expectedRate, ) = kyber.getExpectedRate(listingFeeTokenAddress, _paymentTokenAddress, listingFee); estimation = expectedRate * listingFee / 0.8 ether; // giving slippage rate of 0.8 if(_paymentTokenAddress == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ balanceBefore = address(this).balance; listingFeePaid = kyber.trade.value(estimation)(_paymentTokenAddress, estimation, listingFeeTokenAddress, platformFundsWallet, listingFee, 0, 0); usedAmount = balanceBefore - address(this).balance; // used eth by kyber for swapping with token } else { paymentToken = CrowdsaleGeneratorERC20_ERC20(_paymentTokenAddress); balanceBefore = paymentToken.balanceOf(address(this)); require(<FILL_ME>) listingFeePaid = kyber.trade(_paymentTokenAddress, estimation, listingFeeTokenAddress, platformFundsWallet, listingFee, 0, 0); //Currently no minimum rate is set, so watch out for slippage! paymentToken.approve(address(kyber), 0); usedAmount = balanceBefore - paymentToken.balanceOf(address(this)); } } else { paymentToken = CrowdsaleGeneratorERC20_ERC20(_paymentTokenAddress); require(paymentToken.transfer(platformFundsWallet, listingFee), "Listing fee not paid"); usedAmount = listingFee; listingFeePaid = listingFee; } require(_fromAmount >= usedAmount && listingFeePaid >= listingFee, "Listing fee not paid"); return _fromAmount - usedAmount; } function lockEscrowERC20(address _assetManager, address _assetAddress, address _paymentTokenAddress, address _fundingTokenAddress, uint _amount) private returns (bool) { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // @notice Sender must be a registered owner modifier onlyOwner { } modifier checkRequirements { } }
paymentToken.approve(address(kyber),estimation)
295,525
paymentToken.approve(address(kyber),estimation)
"Listing fee not paid"
pragma solidity ^0.4.24; // submitted by dev-xu // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol // @title SafeMath: overflow/underflow checks // @notice Math operations with safety checks that throw on error library SafeMath { // @notice Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Integer division of two numbers, truncating the quotient. function div(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). function sub(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Adds two numbers, throws on overflow. function add(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Returns fractional amount function getFractionalAmount(uint256 _amount, uint256 _percentage) internal pure returns (uint256) { } } // Database interface interface DBInterface { function setContractManager(address _contractManager) external; // --------------------Set Functions------------------------ function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint _value) external; function setString(bytes32 _key, string _value) external; function setBytes(bytes32 _key, bytes _value) external; function setBytes32(bytes32 _key, bytes32 _value) external; function setBool(bytes32 _key, bool _value) external; function setInt(bytes32 _key, int _value) external; // -------------- Deletion Functions ------------------ function deleteAddress(bytes32 _key) external; function deleteUint(bytes32 _key) external; function deleteString(bytes32 _key) external; function deleteBytes(bytes32 _key) external; function deleteBytes32(bytes32 _key) external; function deleteBool(bytes32 _key) external; function deleteInt(bytes32 _key) external; // ----------------Variable Getters--------------------- function uintStorage(bytes32 _key) external view returns (uint); function stringStorage(bytes32 _key) external view returns (string); function addressStorage(bytes32 _key) external view returns (address); function bytesStorage(bytes32 _key) external view returns (bytes); function bytes32Storage(bytes32 _key) external view returns (bytes32); function boolStorage(bytes32 _key) external view returns (bool); function intStorage(bytes32 _key) external view returns (bool); } contract Events { DBInterface public database; constructor(address _database) public{ } function message(string _message) external onlyApprovedContract { } function transaction(string _message, address _from, address _to, uint _amount, address _token) external onlyApprovedContract { } function registration(string _message, address _account) external onlyApprovedContract { } function contractChange(string _message, address _account, string _name) external onlyApprovedContract { } function asset(string _message, string _uri, address _assetAddress, address _manager) external onlyApprovedContract { } function escrow(string _message, address _assetAddress, bytes32 _escrowID, address _manager, uint _amount) external onlyApprovedContract { } function order(string _message, bytes32 _orderID, uint _amount, uint _price) external onlyApprovedContract { } function exchange(string _message, bytes32 _orderID, address _assetAddress, address _account) external onlyApprovedContract { } function operator(string _message, bytes32 _id, string _name, string _ipfs, address _account) external onlyApprovedContract { } function consensus(string _message, bytes32 _executionID, bytes32 _votesID, uint _votes, uint _tokens, uint _quorum) external onlyApprovedContract { } //Generalized events event LogEvent(string message, bytes32 indexed messageID, address indexed origin); event LogTransaction(string message, bytes32 indexed messageID, address indexed from, address indexed to, uint amount, address token, address origin); //amount and token will be empty on some events event LogAddress(string message, bytes32 indexed messageID, address indexed account, address indexed origin); event LogContractChange(string message, bytes32 indexed messageID, address indexed account, string name, address indexed origin); event LogAsset(string message, bytes32 indexed messageID, string uri, bytes32 indexed assetID, address asset, address manager, address indexed origin); event LogEscrow(string message, bytes32 indexed messageID, address asset, bytes32 escrowID, address indexed manager, uint amount, address indexed origin); event LogOrder(string message, bytes32 indexed messageID, bytes32 indexed orderID, uint amount, uint price, address indexed origin); event LogExchange(string message, bytes32 indexed messageID, bytes32 orderID, address indexed asset, address account, address indexed origin); event LogOperator(string message, bytes32 indexed messageID, bytes32 id, string name, string ipfs, address indexed account, address indexed origin); event LogConsensus(string message, bytes32 indexed messageID, bytes32 executionID, bytes32 votesID, uint votes, uint tokens, uint quorum, address indexed origin); // -------------------------------------------------------------------------------------- // Caller must be registered as a contract through ContractManager.sol // -------------------------------------------------------------------------------------- modifier onlyApprovedContract() { } } // @notice Trade via the Kyber Proxy Contract interface KyberInterface { function getExpectedRate(address src, address dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function trade(address src, uint srcAmount, address dest, address destAddress, uint maxDestAmount,uint minConversionRate, address walletId) external payable returns(uint); } interface MinterInterface { function cloneToken(string _uri, address _erc20Address) external returns (address asset); function mintAssetTokens(address _assetAddress, address _receiver, uint256 _amount) external returns (bool); function changeTokenController(address _assetAddress, address _newController) external returns (bool); } interface CrowdsaleGeneratorERC20_ERC20 { function balanceOf(address _who) external view returns (uint256); function allowance(address _owner, address _spender) external view returns (uint256); function approve(address _spender, uint256 _value) external returns (bool); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); } // @title A crowdsale generator contract // @author Kyle Dewhurst & Peter Phillips, Roy Xu, MyBit Foundation // @notice AssetManagers can initiate a crowdsale that accepts ERC20 tokens as payment here contract CrowdsaleGeneratorERC20 { using SafeMath for uint256; DBInterface private database; Events private events; KyberInterface private kyber; MinterInterface private minter; //CrowdsaleGeneratorERC20_ERC20Burner private burner; //uint constant scalingFactor = 10**32; // @notice This contract // @param: The address for the database contract used by this platform constructor(address _database, address _events, address _kyber) public{ } // @notice Do not send ether to this contract, this is for kyber exchange to get return // @dev After collecting listing fee in token, remaining ether gets refunded from kyber function() public payable { } // @notice AssetManagers can initiate a crowdfund for a new asset here // @dev the crowdsaleERC20 contract is granted rights to mint asset-tokens as it receives funding // @param (string) _assetURI = The location where information about the asset can be found // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails // @param (uint) _amountToRaise = The amount of tokens required to raise for the crowdsale to be a success // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success // @param (address) _fundingToken = The ERC20 token to be used to fund the crowdsale (Operator must accept this token as payment) function createAssetOrderERC20(string _assetURI, string _ipfs, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc, uint _escrowAndFee, address _fundingToken, address _paymentToken) payable external { } function updateIPFS(address _assetAddress, string _ipfs) external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal/ Private Functions ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function setCrowdsaleValues(address _assetAddress, uint _fundingLength, uint _amountToRaise) private returns (bool){ } function setAssetValues(address _assetAddress, string _assetURI, string _ipfs, address _assetManager, uint _assetManagerPerc, uint _amountToRaise, address _fundingToken) private returns (bool){ } function processListingFee(address _paymentTokenAddress, uint _fromAmount) private returns (uint) { // returns left amount uint listingFee = database.uintStorage(keccak256(abi.encodePacked("platform.listingFee"))); address listingFeeTokenAddress = database.addressStorage(keccak256(abi.encodePacked("platform.listingFeeToken"))); address platformFundsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.funds"))); uint usedAmount; uint balanceBefore; uint listingFeePaid; uint expectedRate; uint estimation; CrowdsaleGeneratorERC20_ERC20 paymentToken; if (_paymentTokenAddress != listingFeeTokenAddress) { //Convert the payment token into the listing fee token ( expectedRate, ) = kyber.getExpectedRate(listingFeeTokenAddress, _paymentTokenAddress, listingFee); estimation = expectedRate * listingFee / 0.8 ether; // giving slippage rate of 0.8 if(_paymentTokenAddress == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ balanceBefore = address(this).balance; listingFeePaid = kyber.trade.value(estimation)(_paymentTokenAddress, estimation, listingFeeTokenAddress, platformFundsWallet, listingFee, 0, 0); usedAmount = balanceBefore - address(this).balance; // used eth by kyber for swapping with token } else { paymentToken = CrowdsaleGeneratorERC20_ERC20(_paymentTokenAddress); balanceBefore = paymentToken.balanceOf(address(this)); require(paymentToken.approve(address(kyber), estimation)); listingFeePaid = kyber.trade(_paymentTokenAddress, estimation, listingFeeTokenAddress, platformFundsWallet, listingFee, 0, 0); //Currently no minimum rate is set, so watch out for slippage! paymentToken.approve(address(kyber), 0); usedAmount = balanceBefore - paymentToken.balanceOf(address(this)); } } else { paymentToken = CrowdsaleGeneratorERC20_ERC20(_paymentTokenAddress); require(<FILL_ME>) usedAmount = listingFee; listingFeePaid = listingFee; } require(_fromAmount >= usedAmount && listingFeePaid >= listingFee, "Listing fee not paid"); return _fromAmount - usedAmount; } function lockEscrowERC20(address _assetManager, address _assetAddress, address _paymentTokenAddress, address _fundingTokenAddress, uint _amount) private returns (bool) { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // @notice Sender must be a registered owner modifier onlyOwner { } modifier checkRequirements { } }
paymentToken.transfer(platformFundsWallet,listingFee),"Listing fee not paid"
295,525
paymentToken.transfer(platformFundsWallet,listingFee)
null
pragma solidity ^0.4.24; // submitted by dev-xu // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol // @title SafeMath: overflow/underflow checks // @notice Math operations with safety checks that throw on error library SafeMath { // @notice Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Integer division of two numbers, truncating the quotient. function div(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). function sub(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Adds two numbers, throws on overflow. function add(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Returns fractional amount function getFractionalAmount(uint256 _amount, uint256 _percentage) internal pure returns (uint256) { } } // Database interface interface DBInterface { function setContractManager(address _contractManager) external; // --------------------Set Functions------------------------ function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint _value) external; function setString(bytes32 _key, string _value) external; function setBytes(bytes32 _key, bytes _value) external; function setBytes32(bytes32 _key, bytes32 _value) external; function setBool(bytes32 _key, bool _value) external; function setInt(bytes32 _key, int _value) external; // -------------- Deletion Functions ------------------ function deleteAddress(bytes32 _key) external; function deleteUint(bytes32 _key) external; function deleteString(bytes32 _key) external; function deleteBytes(bytes32 _key) external; function deleteBytes32(bytes32 _key) external; function deleteBool(bytes32 _key) external; function deleteInt(bytes32 _key) external; // ----------------Variable Getters--------------------- function uintStorage(bytes32 _key) external view returns (uint); function stringStorage(bytes32 _key) external view returns (string); function addressStorage(bytes32 _key) external view returns (address); function bytesStorage(bytes32 _key) external view returns (bytes); function bytes32Storage(bytes32 _key) external view returns (bytes32); function boolStorage(bytes32 _key) external view returns (bool); function intStorage(bytes32 _key) external view returns (bool); } contract Events { DBInterface public database; constructor(address _database) public{ } function message(string _message) external onlyApprovedContract { } function transaction(string _message, address _from, address _to, uint _amount, address _token) external onlyApprovedContract { } function registration(string _message, address _account) external onlyApprovedContract { } function contractChange(string _message, address _account, string _name) external onlyApprovedContract { } function asset(string _message, string _uri, address _assetAddress, address _manager) external onlyApprovedContract { } function escrow(string _message, address _assetAddress, bytes32 _escrowID, address _manager, uint _amount) external onlyApprovedContract { } function order(string _message, bytes32 _orderID, uint _amount, uint _price) external onlyApprovedContract { } function exchange(string _message, bytes32 _orderID, address _assetAddress, address _account) external onlyApprovedContract { } function operator(string _message, bytes32 _id, string _name, string _ipfs, address _account) external onlyApprovedContract { } function consensus(string _message, bytes32 _executionID, bytes32 _votesID, uint _votes, uint _tokens, uint _quorum) external onlyApprovedContract { } //Generalized events event LogEvent(string message, bytes32 indexed messageID, address indexed origin); event LogTransaction(string message, bytes32 indexed messageID, address indexed from, address indexed to, uint amount, address token, address origin); //amount and token will be empty on some events event LogAddress(string message, bytes32 indexed messageID, address indexed account, address indexed origin); event LogContractChange(string message, bytes32 indexed messageID, address indexed account, string name, address indexed origin); event LogAsset(string message, bytes32 indexed messageID, string uri, bytes32 indexed assetID, address asset, address manager, address indexed origin); event LogEscrow(string message, bytes32 indexed messageID, address asset, bytes32 escrowID, address indexed manager, uint amount, address indexed origin); event LogOrder(string message, bytes32 indexed messageID, bytes32 indexed orderID, uint amount, uint price, address indexed origin); event LogExchange(string message, bytes32 indexed messageID, bytes32 orderID, address indexed asset, address account, address indexed origin); event LogOperator(string message, bytes32 indexed messageID, bytes32 id, string name, string ipfs, address indexed account, address indexed origin); event LogConsensus(string message, bytes32 indexed messageID, bytes32 executionID, bytes32 votesID, uint votes, uint tokens, uint quorum, address indexed origin); // -------------------------------------------------------------------------------------- // Caller must be registered as a contract through ContractManager.sol // -------------------------------------------------------------------------------------- modifier onlyApprovedContract() { } } // @notice Trade via the Kyber Proxy Contract interface KyberInterface { function getExpectedRate(address src, address dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function trade(address src, uint srcAmount, address dest, address destAddress, uint maxDestAmount,uint minConversionRate, address walletId) external payable returns(uint); } interface MinterInterface { function cloneToken(string _uri, address _erc20Address) external returns (address asset); function mintAssetTokens(address _assetAddress, address _receiver, uint256 _amount) external returns (bool); function changeTokenController(address _assetAddress, address _newController) external returns (bool); } interface CrowdsaleGeneratorERC20_ERC20 { function balanceOf(address _who) external view returns (uint256); function allowance(address _owner, address _spender) external view returns (uint256); function approve(address _spender, uint256 _value) external returns (bool); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); } // @title A crowdsale generator contract // @author Kyle Dewhurst & Peter Phillips, Roy Xu, MyBit Foundation // @notice AssetManagers can initiate a crowdsale that accepts ERC20 tokens as payment here contract CrowdsaleGeneratorERC20 { using SafeMath for uint256; DBInterface private database; Events private events; KyberInterface private kyber; MinterInterface private minter; //CrowdsaleGeneratorERC20_ERC20Burner private burner; //uint constant scalingFactor = 10**32; // @notice This contract // @param: The address for the database contract used by this platform constructor(address _database, address _events, address _kyber) public{ } // @notice Do not send ether to this contract, this is for kyber exchange to get return // @dev After collecting listing fee in token, remaining ether gets refunded from kyber function() public payable { } // @notice AssetManagers can initiate a crowdfund for a new asset here // @dev the crowdsaleERC20 contract is granted rights to mint asset-tokens as it receives funding // @param (string) _assetURI = The location where information about the asset can be found // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails // @param (uint) _amountToRaise = The amount of tokens required to raise for the crowdsale to be a success // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success // @param (address) _fundingToken = The ERC20 token to be used to fund the crowdsale (Operator must accept this token as payment) function createAssetOrderERC20(string _assetURI, string _ipfs, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc, uint _escrowAndFee, address _fundingToken, address _paymentToken) payable external { } function updateIPFS(address _assetAddress, string _ipfs) external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal/ Private Functions ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function setCrowdsaleValues(address _assetAddress, uint _fundingLength, uint _amountToRaise) private returns (bool){ } function setAssetValues(address _assetAddress, string _assetURI, string _ipfs, address _assetManager, uint _assetManagerPerc, uint _amountToRaise, address _fundingToken) private returns (bool){ } function processListingFee(address _paymentTokenAddress, uint _fromAmount) private returns (uint) { } function lockEscrowERC20(address _assetManager, address _assetAddress, address _paymentTokenAddress, address _fundingTokenAddress, uint _amount) private returns (bool) { uint amount; bytes32 assetManagerEscrowID = keccak256(abi.encodePacked(_assetAddress, _assetManager)); address platformTokenAddress = database.addressStorage(keccak256(abi.encodePacked("platform.token"))); if(_paymentTokenAddress != platformTokenAddress){ //Convert the payment token into the platform token if(_paymentTokenAddress == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ amount = kyber.trade.value(_amount)(_paymentTokenAddress, _amount, platformTokenAddress, address(this), 2**255, 0, 0); //Currently no minimum rate is set, so watch out for slippage! } else { CrowdsaleGeneratorERC20_ERC20 paymentToken = CrowdsaleGeneratorERC20_ERC20(_paymentTokenAddress); require(<FILL_ME>) amount = kyber.trade(_paymentTokenAddress, _amount, platformTokenAddress, address(this), 2**255, 0, 0); //Currently no minimum rate is set, so watch out for slippage! } } else { amount = _amount; } require(CrowdsaleGeneratorERC20_ERC20(platformTokenAddress).transfer(database.addressStorage(keccak256(abi.encodePacked("contract", "EscrowReserve"))), amount)); database.setUint(keccak256(abi.encodePacked("asset.escrow", assetManagerEscrowID)), amount); events.escrow('Escrow locked', _assetAddress, assetManagerEscrowID, _assetManager, amount); return true; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // @notice Sender must be a registered owner modifier onlyOwner { } modifier checkRequirements { } }
paymentToken.approve(address(kyber),_amount)
295,525
paymentToken.approve(address(kyber),_amount)
null
pragma solidity ^0.4.24; // submitted by dev-xu // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol // @title SafeMath: overflow/underflow checks // @notice Math operations with safety checks that throw on error library SafeMath { // @notice Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Integer division of two numbers, truncating the quotient. function div(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). function sub(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Adds two numbers, throws on overflow. function add(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Returns fractional amount function getFractionalAmount(uint256 _amount, uint256 _percentage) internal pure returns (uint256) { } } // Database interface interface DBInterface { function setContractManager(address _contractManager) external; // --------------------Set Functions------------------------ function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint _value) external; function setString(bytes32 _key, string _value) external; function setBytes(bytes32 _key, bytes _value) external; function setBytes32(bytes32 _key, bytes32 _value) external; function setBool(bytes32 _key, bool _value) external; function setInt(bytes32 _key, int _value) external; // -------------- Deletion Functions ------------------ function deleteAddress(bytes32 _key) external; function deleteUint(bytes32 _key) external; function deleteString(bytes32 _key) external; function deleteBytes(bytes32 _key) external; function deleteBytes32(bytes32 _key) external; function deleteBool(bytes32 _key) external; function deleteInt(bytes32 _key) external; // ----------------Variable Getters--------------------- function uintStorage(bytes32 _key) external view returns (uint); function stringStorage(bytes32 _key) external view returns (string); function addressStorage(bytes32 _key) external view returns (address); function bytesStorage(bytes32 _key) external view returns (bytes); function bytes32Storage(bytes32 _key) external view returns (bytes32); function boolStorage(bytes32 _key) external view returns (bool); function intStorage(bytes32 _key) external view returns (bool); } contract Events { DBInterface public database; constructor(address _database) public{ } function message(string _message) external onlyApprovedContract { } function transaction(string _message, address _from, address _to, uint _amount, address _token) external onlyApprovedContract { } function registration(string _message, address _account) external onlyApprovedContract { } function contractChange(string _message, address _account, string _name) external onlyApprovedContract { } function asset(string _message, string _uri, address _assetAddress, address _manager) external onlyApprovedContract { } function escrow(string _message, address _assetAddress, bytes32 _escrowID, address _manager, uint _amount) external onlyApprovedContract { } function order(string _message, bytes32 _orderID, uint _amount, uint _price) external onlyApprovedContract { } function exchange(string _message, bytes32 _orderID, address _assetAddress, address _account) external onlyApprovedContract { } function operator(string _message, bytes32 _id, string _name, string _ipfs, address _account) external onlyApprovedContract { } function consensus(string _message, bytes32 _executionID, bytes32 _votesID, uint _votes, uint _tokens, uint _quorum) external onlyApprovedContract { } //Generalized events event LogEvent(string message, bytes32 indexed messageID, address indexed origin); event LogTransaction(string message, bytes32 indexed messageID, address indexed from, address indexed to, uint amount, address token, address origin); //amount and token will be empty on some events event LogAddress(string message, bytes32 indexed messageID, address indexed account, address indexed origin); event LogContractChange(string message, bytes32 indexed messageID, address indexed account, string name, address indexed origin); event LogAsset(string message, bytes32 indexed messageID, string uri, bytes32 indexed assetID, address asset, address manager, address indexed origin); event LogEscrow(string message, bytes32 indexed messageID, address asset, bytes32 escrowID, address indexed manager, uint amount, address indexed origin); event LogOrder(string message, bytes32 indexed messageID, bytes32 indexed orderID, uint amount, uint price, address indexed origin); event LogExchange(string message, bytes32 indexed messageID, bytes32 orderID, address indexed asset, address account, address indexed origin); event LogOperator(string message, bytes32 indexed messageID, bytes32 id, string name, string ipfs, address indexed account, address indexed origin); event LogConsensus(string message, bytes32 indexed messageID, bytes32 executionID, bytes32 votesID, uint votes, uint tokens, uint quorum, address indexed origin); // -------------------------------------------------------------------------------------- // Caller must be registered as a contract through ContractManager.sol // -------------------------------------------------------------------------------------- modifier onlyApprovedContract() { } } // @notice Trade via the Kyber Proxy Contract interface KyberInterface { function getExpectedRate(address src, address dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function trade(address src, uint srcAmount, address dest, address destAddress, uint maxDestAmount,uint minConversionRate, address walletId) external payable returns(uint); } interface MinterInterface { function cloneToken(string _uri, address _erc20Address) external returns (address asset); function mintAssetTokens(address _assetAddress, address _receiver, uint256 _amount) external returns (bool); function changeTokenController(address _assetAddress, address _newController) external returns (bool); } interface CrowdsaleGeneratorERC20_ERC20 { function balanceOf(address _who) external view returns (uint256); function allowance(address _owner, address _spender) external view returns (uint256); function approve(address _spender, uint256 _value) external returns (bool); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); } // @title A crowdsale generator contract // @author Kyle Dewhurst & Peter Phillips, Roy Xu, MyBit Foundation // @notice AssetManagers can initiate a crowdsale that accepts ERC20 tokens as payment here contract CrowdsaleGeneratorERC20 { using SafeMath for uint256; DBInterface private database; Events private events; KyberInterface private kyber; MinterInterface private minter; //CrowdsaleGeneratorERC20_ERC20Burner private burner; //uint constant scalingFactor = 10**32; // @notice This contract // @param: The address for the database contract used by this platform constructor(address _database, address _events, address _kyber) public{ } // @notice Do not send ether to this contract, this is for kyber exchange to get return // @dev After collecting listing fee in token, remaining ether gets refunded from kyber function() public payable { } // @notice AssetManagers can initiate a crowdfund for a new asset here // @dev the crowdsaleERC20 contract is granted rights to mint asset-tokens as it receives funding // @param (string) _assetURI = The location where information about the asset can be found // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails // @param (uint) _amountToRaise = The amount of tokens required to raise for the crowdsale to be a success // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success // @param (address) _fundingToken = The ERC20 token to be used to fund the crowdsale (Operator must accept this token as payment) function createAssetOrderERC20(string _assetURI, string _ipfs, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc, uint _escrowAndFee, address _fundingToken, address _paymentToken) payable external { } function updateIPFS(address _assetAddress, string _ipfs) external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal/ Private Functions ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function setCrowdsaleValues(address _assetAddress, uint _fundingLength, uint _amountToRaise) private returns (bool){ } function setAssetValues(address _assetAddress, string _assetURI, string _ipfs, address _assetManager, uint _assetManagerPerc, uint _amountToRaise, address _fundingToken) private returns (bool){ } function processListingFee(address _paymentTokenAddress, uint _fromAmount) private returns (uint) { } function lockEscrowERC20(address _assetManager, address _assetAddress, address _paymentTokenAddress, address _fundingTokenAddress, uint _amount) private returns (bool) { uint amount; bytes32 assetManagerEscrowID = keccak256(abi.encodePacked(_assetAddress, _assetManager)); address platformTokenAddress = database.addressStorage(keccak256(abi.encodePacked("platform.token"))); if(_paymentTokenAddress != platformTokenAddress){ //Convert the payment token into the platform token if(_paymentTokenAddress == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ amount = kyber.trade.value(_amount)(_paymentTokenAddress, _amount, platformTokenAddress, address(this), 2**255, 0, 0); //Currently no minimum rate is set, so watch out for slippage! } else { CrowdsaleGeneratorERC20_ERC20 paymentToken = CrowdsaleGeneratorERC20_ERC20(_paymentTokenAddress); require(paymentToken.approve(address(kyber), _amount)); amount = kyber.trade(_paymentTokenAddress, _amount, platformTokenAddress, address(this), 2**255, 0, 0); //Currently no minimum rate is set, so watch out for slippage! } } else { amount = _amount; } require(<FILL_ME>) database.setUint(keccak256(abi.encodePacked("asset.escrow", assetManagerEscrowID)), amount); events.escrow('Escrow locked', _assetAddress, assetManagerEscrowID, _assetManager, amount); return true; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // @notice Sender must be a registered owner modifier onlyOwner { } modifier checkRequirements { } }
CrowdsaleGeneratorERC20_ERC20(platformTokenAddress).transfer(database.addressStorage(keccak256(abi.encodePacked("contract","EscrowReserve"))),amount)
295,525
CrowdsaleGeneratorERC20_ERC20(platformTokenAddress).transfer(database.addressStorage(keccak256(abi.encodePacked("contract","EscrowReserve"))),amount)
"Not owner"
pragma solidity ^0.4.24; // submitted by dev-xu // https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol // @title SafeMath: overflow/underflow checks // @notice Math operations with safety checks that throw on error library SafeMath { // @notice Multiplies two numbers, throws on overflow. function mul(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Integer division of two numbers, truncating the quotient. function div(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). function sub(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Adds two numbers, throws on overflow. function add(uint256 a, uint256 b) internal pure returns (uint256) { } // @notice Returns fractional amount function getFractionalAmount(uint256 _amount, uint256 _percentage) internal pure returns (uint256) { } } // Database interface interface DBInterface { function setContractManager(address _contractManager) external; // --------------------Set Functions------------------------ function setAddress(bytes32 _key, address _value) external; function setUint(bytes32 _key, uint _value) external; function setString(bytes32 _key, string _value) external; function setBytes(bytes32 _key, bytes _value) external; function setBytes32(bytes32 _key, bytes32 _value) external; function setBool(bytes32 _key, bool _value) external; function setInt(bytes32 _key, int _value) external; // -------------- Deletion Functions ------------------ function deleteAddress(bytes32 _key) external; function deleteUint(bytes32 _key) external; function deleteString(bytes32 _key) external; function deleteBytes(bytes32 _key) external; function deleteBytes32(bytes32 _key) external; function deleteBool(bytes32 _key) external; function deleteInt(bytes32 _key) external; // ----------------Variable Getters--------------------- function uintStorage(bytes32 _key) external view returns (uint); function stringStorage(bytes32 _key) external view returns (string); function addressStorage(bytes32 _key) external view returns (address); function bytesStorage(bytes32 _key) external view returns (bytes); function bytes32Storage(bytes32 _key) external view returns (bytes32); function boolStorage(bytes32 _key) external view returns (bool); function intStorage(bytes32 _key) external view returns (bool); } contract Events { DBInterface public database; constructor(address _database) public{ } function message(string _message) external onlyApprovedContract { } function transaction(string _message, address _from, address _to, uint _amount, address _token) external onlyApprovedContract { } function registration(string _message, address _account) external onlyApprovedContract { } function contractChange(string _message, address _account, string _name) external onlyApprovedContract { } function asset(string _message, string _uri, address _assetAddress, address _manager) external onlyApprovedContract { } function escrow(string _message, address _assetAddress, bytes32 _escrowID, address _manager, uint _amount) external onlyApprovedContract { } function order(string _message, bytes32 _orderID, uint _amount, uint _price) external onlyApprovedContract { } function exchange(string _message, bytes32 _orderID, address _assetAddress, address _account) external onlyApprovedContract { } function operator(string _message, bytes32 _id, string _name, string _ipfs, address _account) external onlyApprovedContract { } function consensus(string _message, bytes32 _executionID, bytes32 _votesID, uint _votes, uint _tokens, uint _quorum) external onlyApprovedContract { } //Generalized events event LogEvent(string message, bytes32 indexed messageID, address indexed origin); event LogTransaction(string message, bytes32 indexed messageID, address indexed from, address indexed to, uint amount, address token, address origin); //amount and token will be empty on some events event LogAddress(string message, bytes32 indexed messageID, address indexed account, address indexed origin); event LogContractChange(string message, bytes32 indexed messageID, address indexed account, string name, address indexed origin); event LogAsset(string message, bytes32 indexed messageID, string uri, bytes32 indexed assetID, address asset, address manager, address indexed origin); event LogEscrow(string message, bytes32 indexed messageID, address asset, bytes32 escrowID, address indexed manager, uint amount, address indexed origin); event LogOrder(string message, bytes32 indexed messageID, bytes32 indexed orderID, uint amount, uint price, address indexed origin); event LogExchange(string message, bytes32 indexed messageID, bytes32 orderID, address indexed asset, address account, address indexed origin); event LogOperator(string message, bytes32 indexed messageID, bytes32 id, string name, string ipfs, address indexed account, address indexed origin); event LogConsensus(string message, bytes32 indexed messageID, bytes32 executionID, bytes32 votesID, uint votes, uint tokens, uint quorum, address indexed origin); // -------------------------------------------------------------------------------------- // Caller must be registered as a contract through ContractManager.sol // -------------------------------------------------------------------------------------- modifier onlyApprovedContract() { } } // @notice Trade via the Kyber Proxy Contract interface KyberInterface { function getExpectedRate(address src, address dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function trade(address src, uint srcAmount, address dest, address destAddress, uint maxDestAmount,uint minConversionRate, address walletId) external payable returns(uint); } interface MinterInterface { function cloneToken(string _uri, address _erc20Address) external returns (address asset); function mintAssetTokens(address _assetAddress, address _receiver, uint256 _amount) external returns (bool); function changeTokenController(address _assetAddress, address _newController) external returns (bool); } interface CrowdsaleGeneratorERC20_ERC20 { function balanceOf(address _who) external view returns (uint256); function allowance(address _owner, address _spender) external view returns (uint256); function approve(address _spender, uint256 _value) external returns (bool); function transfer(address _to, uint256 _value) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool); } // @title A crowdsale generator contract // @author Kyle Dewhurst & Peter Phillips, Roy Xu, MyBit Foundation // @notice AssetManagers can initiate a crowdsale that accepts ERC20 tokens as payment here contract CrowdsaleGeneratorERC20 { using SafeMath for uint256; DBInterface private database; Events private events; KyberInterface private kyber; MinterInterface private minter; //CrowdsaleGeneratorERC20_ERC20Burner private burner; //uint constant scalingFactor = 10**32; // @notice This contract // @param: The address for the database contract used by this platform constructor(address _database, address _events, address _kyber) public{ } // @notice Do not send ether to this contract, this is for kyber exchange to get return // @dev After collecting listing fee in token, remaining ether gets refunded from kyber function() public payable { } // @notice AssetManagers can initiate a crowdfund for a new asset here // @dev the crowdsaleERC20 contract is granted rights to mint asset-tokens as it receives funding // @param (string) _assetURI = The location where information about the asset can be found // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails // @param (uint) _amountToRaise = The amount of tokens required to raise for the crowdsale to be a success // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success // @param (address) _fundingToken = The ERC20 token to be used to fund the crowdsale (Operator must accept this token as payment) function createAssetOrderERC20(string _assetURI, string _ipfs, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc, uint _escrowAndFee, address _fundingToken, address _paymentToken) payable external { } function updateIPFS(address _assetAddress, string _ipfs) external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal/ Private Functions ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function setCrowdsaleValues(address _assetAddress, uint _fundingLength, uint _amountToRaise) private returns (bool){ } function setAssetValues(address _assetAddress, string _assetURI, string _ipfs, address _assetManager, uint _assetManagerPerc, uint _amountToRaise, address _fundingToken) private returns (bool){ } function processListingFee(address _paymentTokenAddress, uint _fromAmount) private returns (uint) { } function lockEscrowERC20(address _assetManager, address _assetAddress, address _paymentTokenAddress, address _fundingTokenAddress, uint _amount) private returns (bool) { } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // @notice Sender must be a registered owner modifier onlyOwner { require(<FILL_ME>) _; } modifier checkRequirements { } }
database.boolStorage(keccak256(abi.encodePacked("owner",msg.sender))),"Not owner"
295,525
database.boolStorage(keccak256(abi.encodePacked("owner",msg.sender)))
"Transfers aren't enabled"
// // // // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ // @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ // @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@/ // @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@@ // @@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ // // // // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@ (@@@@@@@@@@% // @@@@@@@@ @@@@@@@@@@@ // @@@@@@@@ @@@@@@@@@@@@@@@@@ // @@@@@@@@ @@@@@@@@@@@@@@@@@ // @@@@@@@@ @@@@@@@@@@@@@@@@@ // @@@@@@@@ @@@@@@@@ @@@@@@@@ // @@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // @@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ // // // // // SPDX-License-Identifier: MIT pragma solidity >=0.8.4; import "hardhat/console.sol"; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract ART3 is ERC20, Ownable { bool public transfersEnabled; /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public ERC20("ART3", "ART3") { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { require(<FILL_ME>) _transfer(_msgSender(), recipient, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { } function approve(address spender, uint256 amount) public virtual override returns (bool) { } function enableTransfers(bool _transfersEnabled) onlyOwner public { } function decimals() public view virtual override returns (uint8) { } }
transfersEnabled||_msgSender()==owner(),"Transfers aren't enabled"
295,531
transfersEnabled||_msgSender()==owner()
"DirectBonus: must have direct bonus manager role to set direct bonus fee"
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./AccountStorage.sol"; abstract contract DirectBonus is AccountStorage { using SafeMath for uint256; uint256 private DIRECT_BONUS_FEE = 10; uint256 private MINIMUM_SELF_BUY_FOR_DIRECT_BONUS = 0.001 ether; bytes32 public constant DIRECT_BONUS_MANAGER_ROLE = keccak256("DIRECT_BONUS_MANAGER_ROLE"); event MinimumSelfBuyForDirectBonusUpdate(uint256 amount); event DirectBonusFeeUpdate(uint256 fee); function getDirectBonusFee() public view returns(uint256) { } function setDirectBonusFee(uint256 fee) public { require(<FILL_ME>) DIRECT_BONUS_FEE = fee; emit DirectBonusFeeUpdate(fee); } function getMinimumSelfBuyForDirectBonus() public view returns(uint256) { } function setMinimumSelfBuyForDirectBonus(uint256 amount) public { } function calculateDirectBonus(uint256 amount) internal view returns(uint256) { } function isEligibleForDirectBonus(address sponsor) internal view returns(bool) { } }
hasRole(DIRECT_BONUS_MANAGER_ROLE,msg.sender),"DirectBonus: must have direct bonus manager role to set direct bonus fee"
295,536
hasRole(DIRECT_BONUS_MANAGER_ROLE,msg.sender)
"Founder: must have founder manager role set investment cap bonus for founders"
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "./DirectBonus.sol"; abstract contract Founder is AccountStorage { using EnumerableSet for EnumerableSet.AddressSet; uint256 private FOUNDER_INVESTMENT_CAP_BONUS = 20 ether; bytes32 constant public FOUNDER_MANAGER_ROLE = keccak256("FOUNDER_MANAGER_ROLE"); EnumerableSet.AddressSet private _founderAccounts; event FounderInvestmentCapBonusUpdate(uint256 newInvestmentCapBonus); function isFounder(address account) public view returns(bool) { } function getFoundersCount() public view returns(uint256) { } function setFounderInvestmentCapBonus(uint256 investmentCapBonus) public { require(<FILL_ME>) FOUNDER_INVESTMENT_CAP_BONUS = investmentCapBonus; emit FounderInvestmentCapBonusUpdate(investmentCapBonus); } function getFounderInvestmentCapBonus() public view returns(uint256){ } function addFounder(address account) public returns(bool) { } function removeFounder(address account) public returns(bool) { } function dropFounderOnSell(address account) internal returns(bool) { } function founderInvestmentBonusCapFor(address account) internal view returns(uint256) { } }
hasRole(FOUNDER_MANAGER_ROLE,msg.sender),"Founder: must have founder manager role set investment cap bonus for founders"
295,538
hasRole(FOUNDER_MANAGER_ROLE,msg.sender)
"Staking: must have staking manager role to set staking fee"
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./AccountStorage.sol"; import "./Price.sol"; abstract contract Staking is AccountStorage, Price { using SafeMath for uint256; uint256 private _stakingProfitPerShare; bytes32 public constant STAKING_MANAGER_ROLE = keccak256("STAKING_MANAGER_ROLE"); bytes32 public constant LOYALTY_BONUS_MANAGER_ROLE = keccak256("LOYALTY_BONUS_MANAGER_ROLE"); uint256 constant private MAGNITUDE = 2 ** 64; uint256 private STAKING_FEE = 8; event StakingFeeUpdate(uint256 fee); event LoyaltyBonusStaked(uint256 amount); function getStakingFee() public view returns(uint256) { } function setStakingFee(uint256 fee) public { require(<FILL_ME>) STAKING_FEE = fee; emit StakingFeeUpdate(fee); } function stakeLoyaltyBonus() public payable { } function stakingBonusOf(address account) public override view returns(uint256) { } function calculateStakingFee(uint256 amount) internal view returns(uint256) { } function increaseStakingProfitPerShare(uint256 stakingBonus) internal { } function processStakingOnBuy(address account, uint256 amountOfTokens, uint256 stakingBonus) internal { } function processStakingOnSell(address account, uint256 amountOfTokens) internal returns(uint256) { } function processDistributionOnTransfer(address sender, uint256 amountOfTokens, address recipient, uint256 taxedTokens) internal { } }
hasRole(STAKING_MANAGER_ROLE,msg.sender),"Staking: must have staking manager role to set staking fee"
295,541
hasRole(STAKING_MANAGER_ROLE,msg.sender)
"Staking: must have loyalty bonus manager role to stake bonuses"
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "./AccountStorage.sol"; import "./Price.sol"; abstract contract Staking is AccountStorage, Price { using SafeMath for uint256; uint256 private _stakingProfitPerShare; bytes32 public constant STAKING_MANAGER_ROLE = keccak256("STAKING_MANAGER_ROLE"); bytes32 public constant LOYALTY_BONUS_MANAGER_ROLE = keccak256("LOYALTY_BONUS_MANAGER_ROLE"); uint256 constant private MAGNITUDE = 2 ** 64; uint256 private STAKING_FEE = 8; event StakingFeeUpdate(uint256 fee); event LoyaltyBonusStaked(uint256 amount); function getStakingFee() public view returns(uint256) { } function setStakingFee(uint256 fee) public { } function stakeLoyaltyBonus() public payable { require(<FILL_ME>) increaseStakingProfitPerShare(msg.value); emit LoyaltyBonusStaked(msg.value); } function stakingBonusOf(address account) public override view returns(uint256) { } function calculateStakingFee(uint256 amount) internal view returns(uint256) { } function increaseStakingProfitPerShare(uint256 stakingBonus) internal { } function processStakingOnBuy(address account, uint256 amountOfTokens, uint256 stakingBonus) internal { } function processStakingOnSell(address account, uint256 amountOfTokens) internal returns(uint256) { } function processDistributionOnTransfer(address sender, uint256 amountOfTokens, address recipient, uint256 taxedTokens) internal { } }
hasRole(LOYALTY_BONUS_MANAGER_ROLE,msg.sender),"Staking: must have loyalty bonus manager role to stake bonuses"
295,541
hasRole(LOYALTY_BONUS_MANAGER_ROLE,msg.sender)
"does not own required token in additional contract"
// SPDX-License-Identifier: MIT pragma solidity >=0.7.6; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/introspection/ERC165.sol"; import '@openzeppelin/contracts/math/SafeMath.sol'; contract Raffle is Ownable, IERC721Receiver, ERC165, ERC721Holder { using SafeMath for uint; event DrawResult(address indexed owner); mapping (bytes32 => bool) isRegistered; uint32 raffleVersion; TokenContract public tokenContract; TokenContract public secondContract; uint private raffle_end_timestamp; uint raffleActivationBlock; uint rn; uint tokenId; uint[] registeredTokens; bool requireSecondNFT; constructor() public { } function register(uint[] calldata tokenIDs) external { require(block.timestamp < raffle_end_timestamp, "registration period expired"); if(requireSecondNFT) { require(<FILL_ME>) } for (uint i=0; i < tokenIDs.length; i++) { require(tokenContract.ownerOf(tokenIDs[i]) == msg.sender , "sender not owner"); bytes32 key = keccak256(abi.encodePacked(raffleVersion, tokenIDs[i])); require(!isRegistered[key], "already used for registration"); isRegistered[key] = true; registeredTokens.push(tokenIDs[i]); } } function hasRegistered(uint256[] calldata tokenIDs) external view returns (bool[] memory) { } function newRaffle(uint _endTimestamp, uint _tokenId, bool _requireSecondNFT) external onlyOwner { } function setContracts(address contractAddress, address _secondContract) external onlyOwner { } function prepareDraw() external { } function draw() external { } function getTotalParticipants() external view returns (uint) { } function getVersion() external view returns (uint) { } function getTokenToWin() external view returns (uint) { } function getRaffleEnd() external view returns (uint) { } function setRaffleEnd(uint timestamp) external onlyOwner { } } interface TokenContract { function safeTransferFrom(address from, address to, uint256 tokenId) external; function ownerOf(uint256 tokenId) external view returns (address); function balanceOf(address owner) external view returns (uint); }
secondContract.balanceOf(msg.sender)>0,"does not own required token in additional contract"
295,583
secondContract.balanceOf(msg.sender)>0
"sender not owner"
// SPDX-License-Identifier: MIT pragma solidity >=0.7.6; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/introspection/ERC165.sol"; import '@openzeppelin/contracts/math/SafeMath.sol'; contract Raffle is Ownable, IERC721Receiver, ERC165, ERC721Holder { using SafeMath for uint; event DrawResult(address indexed owner); mapping (bytes32 => bool) isRegistered; uint32 raffleVersion; TokenContract public tokenContract; TokenContract public secondContract; uint private raffle_end_timestamp; uint raffleActivationBlock; uint rn; uint tokenId; uint[] registeredTokens; bool requireSecondNFT; constructor() public { } function register(uint[] calldata tokenIDs) external { require(block.timestamp < raffle_end_timestamp, "registration period expired"); if(requireSecondNFT) { require(secondContract.balanceOf(msg.sender) > 0, "does not own required token in additional contract"); } for (uint i=0; i < tokenIDs.length; i++) { require(<FILL_ME>) bytes32 key = keccak256(abi.encodePacked(raffleVersion, tokenIDs[i])); require(!isRegistered[key], "already used for registration"); isRegistered[key] = true; registeredTokens.push(tokenIDs[i]); } } function hasRegistered(uint256[] calldata tokenIDs) external view returns (bool[] memory) { } function newRaffle(uint _endTimestamp, uint _tokenId, bool _requireSecondNFT) external onlyOwner { } function setContracts(address contractAddress, address _secondContract) external onlyOwner { } function prepareDraw() external { } function draw() external { } function getTotalParticipants() external view returns (uint) { } function getVersion() external view returns (uint) { } function getTokenToWin() external view returns (uint) { } function getRaffleEnd() external view returns (uint) { } function setRaffleEnd(uint timestamp) external onlyOwner { } } interface TokenContract { function safeTransferFrom(address from, address to, uint256 tokenId) external; function ownerOf(uint256 tokenId) external view returns (address); function balanceOf(address owner) external view returns (uint); }
tokenContract.ownerOf(tokenIDs[i])==msg.sender,"sender not owner"
295,583
tokenContract.ownerOf(tokenIDs[i])==msg.sender
"already used for registration"
// SPDX-License-Identifier: MIT pragma solidity >=0.7.6; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/introspection/ERC165.sol"; import '@openzeppelin/contracts/math/SafeMath.sol'; contract Raffle is Ownable, IERC721Receiver, ERC165, ERC721Holder { using SafeMath for uint; event DrawResult(address indexed owner); mapping (bytes32 => bool) isRegistered; uint32 raffleVersion; TokenContract public tokenContract; TokenContract public secondContract; uint private raffle_end_timestamp; uint raffleActivationBlock; uint rn; uint tokenId; uint[] registeredTokens; bool requireSecondNFT; constructor() public { } function register(uint[] calldata tokenIDs) external { require(block.timestamp < raffle_end_timestamp, "registration period expired"); if(requireSecondNFT) { require(secondContract.balanceOf(msg.sender) > 0, "does not own required token in additional contract"); } for (uint i=0; i < tokenIDs.length; i++) { require(tokenContract.ownerOf(tokenIDs[i]) == msg.sender , "sender not owner"); bytes32 key = keccak256(abi.encodePacked(raffleVersion, tokenIDs[i])); require(<FILL_ME>) isRegistered[key] = true; registeredTokens.push(tokenIDs[i]); } } function hasRegistered(uint256[] calldata tokenIDs) external view returns (bool[] memory) { } function newRaffle(uint _endTimestamp, uint _tokenId, bool _requireSecondNFT) external onlyOwner { } function setContracts(address contractAddress, address _secondContract) external onlyOwner { } function prepareDraw() external { } function draw() external { } function getTotalParticipants() external view returns (uint) { } function getVersion() external view returns (uint) { } function getTokenToWin() external view returns (uint) { } function getRaffleEnd() external view returns (uint) { } function setRaffleEnd(uint timestamp) external onlyOwner { } } interface TokenContract { function safeTransferFrom(address from, address to, uint256 tokenId) external; function ownerOf(uint256 tokenId) external view returns (address); function balanceOf(address owner) external view returns (uint); }
!isRegistered[key],"already used for registration"
295,583
!isRegistered[key]
"Vote: access unauthorized"
pragma solidity >=0.6.0; interface IPRA { function raters(address who) external view returns (bool); } interface IConfig { function ratingCandidates(address proposal) external view returns (bool); function depositDuration() external view returns (uint256); function professionalRatingWeightRatio() external view returns (uint256); function communityRatingWeightRatio() external view returns (uint256); function investDuration() external view returns (uint256); function communityRatingLine() external view returns (uint256); } interface IACL { function accessible(address sender, address to, bytes4 sig) external view returns (bool); } interface IRating { function risk() external view returns (uint256); function fine() external view returns (bool); } contract Vote is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; event MonitorEvent( address indexed who, address indexed bond, bytes32 indexed funcName, bytes ); function MonitorEventCallback(address who, address bond, bytes32 funcName, bytes calldata payload) external auth { } address public router; address public config; address public ACL; address public PRA; modifier auth { require(<FILL_ME>) _; } constructor(address _ACL, address _router, address _config, address _PRA) public { } function setACL( address _ACL) external { } //专业评级时调用 function prcast(uint256 id, address proposal, uint256 reason) external nonReentrant { } //仅能被 data.vote 回调, 社区投票时调用 function cast(uint256 id, address who, address proposal, uint256 amount) external auth { } //仅能被 data.take 回调 function take(uint256 id, address who) external auth returns (uint256) { } function rating(uint256 id) external { } //取回后页面获得手续费保留原值不变 function profitOf(uint256 id, address who) public view returns (uint256) { } //取回评级收益,被bondData调用 function profit(uint256 id, address who) external auth returns (uint256) { } }
IACL(ACL).accessible(msg.sender,address(this),msg.sig),"Vote: access unauthorized"
295,647
IACL(ACL).accessible(msg.sender,address(this),msg.sig)
"vote is expired"
pragma solidity >=0.6.0; interface IPRA { function raters(address who) external view returns (bool); } interface IConfig { function ratingCandidates(address proposal) external view returns (bool); function depositDuration() external view returns (uint256); function professionalRatingWeightRatio() external view returns (uint256); function communityRatingWeightRatio() external view returns (uint256); function investDuration() external view returns (uint256); function communityRatingLine() external view returns (uint256); } interface IACL { function accessible(address sender, address to, bytes4 sig) external view returns (bool); } interface IRating { function risk() external view returns (uint256); function fine() external view returns (bool); } contract Vote is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; event MonitorEvent( address indexed who, address indexed bond, bytes32 indexed funcName, bytes ); function MonitorEventCallback(address who, address bond, bytes32 funcName, bytes calldata payload) external auth { } address public router; address public config; address public ACL; address public PRA; modifier auth { } constructor(address _ACL, address _router, address _config, address _PRA) public { } function setACL( address _ACL) external { } //专业评级时调用 function prcast(uint256 id, address proposal, uint256 reason) external nonReentrant { IBondData data = IBondData(IRouter(router).defaultDataContract(id)); require(<FILL_ME>) require( IPRA(PRA).raters(msg.sender), "sender is not a professional rater" ); IBondData.prwhat memory pr = data.pr(); require(pr.proposal == address(0), "already professional rating"); IBondData.what memory _what = data.votes(msg.sender); require(_what.proposal == address(0), "already community rating"); require(data.issuer() != msg.sender, "issuer can't vote for self bond"); require( IConfig(config).ratingCandidates(proposal), "proposal is not permissive" ); data.setPr(msg.sender, proposal, reason); emit MonitorEvent( msg.sender, address(data), "prcast", abi.encodePacked(proposal) ); } //仅能被 data.vote 回调, 社区投票时调用 function cast(uint256 id, address who, address proposal, uint256 amount) external auth { } //仅能被 data.take 回调 function take(uint256 id, address who) external auth returns (uint256) { } function rating(uint256 id) external { } //取回后页面获得手续费保留原值不变 function profitOf(uint256 id, address who) public view returns (uint256) { } //取回评级收益,被bondData调用 function profit(uint256 id, address who) external auth returns (uint256) { } }
data.voteExpired()>now,"vote is expired"
295,647
data.voteExpired()>now
"sender is not a professional rater"
pragma solidity >=0.6.0; interface IPRA { function raters(address who) external view returns (bool); } interface IConfig { function ratingCandidates(address proposal) external view returns (bool); function depositDuration() external view returns (uint256); function professionalRatingWeightRatio() external view returns (uint256); function communityRatingWeightRatio() external view returns (uint256); function investDuration() external view returns (uint256); function communityRatingLine() external view returns (uint256); } interface IACL { function accessible(address sender, address to, bytes4 sig) external view returns (bool); } interface IRating { function risk() external view returns (uint256); function fine() external view returns (bool); } contract Vote is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; event MonitorEvent( address indexed who, address indexed bond, bytes32 indexed funcName, bytes ); function MonitorEventCallback(address who, address bond, bytes32 funcName, bytes calldata payload) external auth { } address public router; address public config; address public ACL; address public PRA; modifier auth { } constructor(address _ACL, address _router, address _config, address _PRA) public { } function setACL( address _ACL) external { } //专业评级时调用 function prcast(uint256 id, address proposal, uint256 reason) external nonReentrant { IBondData data = IBondData(IRouter(router).defaultDataContract(id)); require(data.voteExpired() > now, "vote is expired"); require(<FILL_ME>) IBondData.prwhat memory pr = data.pr(); require(pr.proposal == address(0), "already professional rating"); IBondData.what memory _what = data.votes(msg.sender); require(_what.proposal == address(0), "already community rating"); require(data.issuer() != msg.sender, "issuer can't vote for self bond"); require( IConfig(config).ratingCandidates(proposal), "proposal is not permissive" ); data.setPr(msg.sender, proposal, reason); emit MonitorEvent( msg.sender, address(data), "prcast", abi.encodePacked(proposal) ); } //仅能被 data.vote 回调, 社区投票时调用 function cast(uint256 id, address who, address proposal, uint256 amount) external auth { } //仅能被 data.take 回调 function take(uint256 id, address who) external auth returns (uint256) { } function rating(uint256 id) external { } //取回后页面获得手续费保留原值不变 function profitOf(uint256 id, address who) public view returns (uint256) { } //取回评级收益,被bondData调用 function profit(uint256 id, address who) external auth returns (uint256) { } }
IPRA(PRA).raters(msg.sender),"sender is not a professional rater"
295,647
IPRA(PRA).raters(msg.sender)
"issuer can't vote for self bond"
pragma solidity >=0.6.0; interface IPRA { function raters(address who) external view returns (bool); } interface IConfig { function ratingCandidates(address proposal) external view returns (bool); function depositDuration() external view returns (uint256); function professionalRatingWeightRatio() external view returns (uint256); function communityRatingWeightRatio() external view returns (uint256); function investDuration() external view returns (uint256); function communityRatingLine() external view returns (uint256); } interface IACL { function accessible(address sender, address to, bytes4 sig) external view returns (bool); } interface IRating { function risk() external view returns (uint256); function fine() external view returns (bool); } contract Vote is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; event MonitorEvent( address indexed who, address indexed bond, bytes32 indexed funcName, bytes ); function MonitorEventCallback(address who, address bond, bytes32 funcName, bytes calldata payload) external auth { } address public router; address public config; address public ACL; address public PRA; modifier auth { } constructor(address _ACL, address _router, address _config, address _PRA) public { } function setACL( address _ACL) external { } //专业评级时调用 function prcast(uint256 id, address proposal, uint256 reason) external nonReentrant { IBondData data = IBondData(IRouter(router).defaultDataContract(id)); require(data.voteExpired() > now, "vote is expired"); require( IPRA(PRA).raters(msg.sender), "sender is not a professional rater" ); IBondData.prwhat memory pr = data.pr(); require(pr.proposal == address(0), "already professional rating"); IBondData.what memory _what = data.votes(msg.sender); require(_what.proposal == address(0), "already community rating"); require(<FILL_ME>) require( IConfig(config).ratingCandidates(proposal), "proposal is not permissive" ); data.setPr(msg.sender, proposal, reason); emit MonitorEvent( msg.sender, address(data), "prcast", abi.encodePacked(proposal) ); } //仅能被 data.vote 回调, 社区投票时调用 function cast(uint256 id, address who, address proposal, uint256 amount) external auth { } //仅能被 data.take 回调 function take(uint256 id, address who) external auth returns (uint256) { } function rating(uint256 id) external { } //取回后页面获得手续费保留原值不变 function profitOf(uint256 id, address who) public view returns (uint256) { } //取回评级收益,被bondData调用 function profit(uint256 id, address who) external auth returns (uint256) { } }
data.issuer()!=msg.sender,"issuer can't vote for self bond"
295,647
data.issuer()!=msg.sender
"proposal is not permissive"
pragma solidity >=0.6.0; interface IPRA { function raters(address who) external view returns (bool); } interface IConfig { function ratingCandidates(address proposal) external view returns (bool); function depositDuration() external view returns (uint256); function professionalRatingWeightRatio() external view returns (uint256); function communityRatingWeightRatio() external view returns (uint256); function investDuration() external view returns (uint256); function communityRatingLine() external view returns (uint256); } interface IACL { function accessible(address sender, address to, bytes4 sig) external view returns (bool); } interface IRating { function risk() external view returns (uint256); function fine() external view returns (bool); } contract Vote is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; event MonitorEvent( address indexed who, address indexed bond, bytes32 indexed funcName, bytes ); function MonitorEventCallback(address who, address bond, bytes32 funcName, bytes calldata payload) external auth { } address public router; address public config; address public ACL; address public PRA; modifier auth { } constructor(address _ACL, address _router, address _config, address _PRA) public { } function setACL( address _ACL) external { } //专业评级时调用 function prcast(uint256 id, address proposal, uint256 reason) external nonReentrant { IBondData data = IBondData(IRouter(router).defaultDataContract(id)); require(data.voteExpired() > now, "vote is expired"); require( IPRA(PRA).raters(msg.sender), "sender is not a professional rater" ); IBondData.prwhat memory pr = data.pr(); require(pr.proposal == address(0), "already professional rating"); IBondData.what memory _what = data.votes(msg.sender); require(_what.proposal == address(0), "already community rating"); require(data.issuer() != msg.sender, "issuer can't vote for self bond"); require(<FILL_ME>) data.setPr(msg.sender, proposal, reason); emit MonitorEvent( msg.sender, address(data), "prcast", abi.encodePacked(proposal) ); } //仅能被 data.vote 回调, 社区投票时调用 function cast(uint256 id, address who, address proposal, uint256 amount) external auth { } //仅能被 data.take 回调 function take(uint256 id, address who) external auth returns (uint256) { } function rating(uint256 id) external { } //取回后页面获得手续费保留原值不变 function profitOf(uint256 id, address who) public view returns (uint256) { } //取回评级收益,被bondData调用 function profit(uint256 id, address who) external auth returns (uint256) { } }
IConfig(config).ratingCandidates(proposal),"proposal is not permissive"
295,647
IConfig(config).ratingCandidates(proposal)
"sender is a professional rater"
pragma solidity >=0.6.0; interface IPRA { function raters(address who) external view returns (bool); } interface IConfig { function ratingCandidates(address proposal) external view returns (bool); function depositDuration() external view returns (uint256); function professionalRatingWeightRatio() external view returns (uint256); function communityRatingWeightRatio() external view returns (uint256); function investDuration() external view returns (uint256); function communityRatingLine() external view returns (uint256); } interface IACL { function accessible(address sender, address to, bytes4 sig) external view returns (bool); } interface IRating { function risk() external view returns (uint256); function fine() external view returns (bool); } contract Vote is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; event MonitorEvent( address indexed who, address indexed bond, bytes32 indexed funcName, bytes ); function MonitorEventCallback(address who, address bond, bytes32 funcName, bytes calldata payload) external auth { } address public router; address public config; address public ACL; address public PRA; modifier auth { } constructor(address _ACL, address _router, address _config, address _PRA) public { } function setACL( address _ACL) external { } //专业评级时调用 function prcast(uint256 id, address proposal, uint256 reason) external nonReentrant { } //仅能被 data.vote 回调, 社区投票时调用 function cast(uint256 id, address who, address proposal, uint256 amount) external auth { IBondData data = IBondData(IRouter(router).defaultDataContract(id)); require(data.voteExpired() > now, "vote is expired"); require(<FILL_ME>) require(data.issuer() != who, "issuer can't vote for self bond"); require( IConfig(config).ratingCandidates(proposal), "proposal is not permissive" ); IBondData.what memory what = data.votes(who); address p = what.proposal; uint256 w = what.weight; //多次投票但是本次投票的提案与前次投票的提案不同 if (p != address(0) && p != proposal) { data.setBondParamMapping("weights", p, data.weights(p).sub(w)); data.setBondParamMapping("weights", proposal, data.weights(proposal).add(w)); } data.setVotes(who, proposal, w.add(amount)); data.setBondParamMapping("weights", proposal, data.weights(proposal).add(amount)); data.setBondParam("totalWeights", data.totalWeights().add(amount)); //同票数情况下后投出来的为胜 if (data.weights(proposal) >= data.weights(data.top())) { // data.setTop(proposal); data.setBondParamAddress("top", proposal); } } //仅能被 data.take 回调 function take(uint256 id, address who) external auth returns (uint256) { } function rating(uint256 id) external { } //取回后页面获得手续费保留原值不变 function profitOf(uint256 id, address who) public view returns (uint256) { } //取回评级收益,被bondData调用 function profit(uint256 id, address who) external auth returns (uint256) { } }
!IPRA(PRA).raters(who),"sender is a professional rater"
295,647
!IPRA(PRA).raters(who)
"issuer can't vote for self bond"
pragma solidity >=0.6.0; interface IPRA { function raters(address who) external view returns (bool); } interface IConfig { function ratingCandidates(address proposal) external view returns (bool); function depositDuration() external view returns (uint256); function professionalRatingWeightRatio() external view returns (uint256); function communityRatingWeightRatio() external view returns (uint256); function investDuration() external view returns (uint256); function communityRatingLine() external view returns (uint256); } interface IACL { function accessible(address sender, address to, bytes4 sig) external view returns (bool); } interface IRating { function risk() external view returns (uint256); function fine() external view returns (bool); } contract Vote is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; event MonitorEvent( address indexed who, address indexed bond, bytes32 indexed funcName, bytes ); function MonitorEventCallback(address who, address bond, bytes32 funcName, bytes calldata payload) external auth { } address public router; address public config; address public ACL; address public PRA; modifier auth { } constructor(address _ACL, address _router, address _config, address _PRA) public { } function setACL( address _ACL) external { } //专业评级时调用 function prcast(uint256 id, address proposal, uint256 reason) external nonReentrant { } //仅能被 data.vote 回调, 社区投票时调用 function cast(uint256 id, address who, address proposal, uint256 amount) external auth { IBondData data = IBondData(IRouter(router).defaultDataContract(id)); require(data.voteExpired() > now, "vote is expired"); require(!IPRA(PRA).raters(who), "sender is a professional rater"); require(<FILL_ME>) require( IConfig(config).ratingCandidates(proposal), "proposal is not permissive" ); IBondData.what memory what = data.votes(who); address p = what.proposal; uint256 w = what.weight; //多次投票但是本次投票的提案与前次投票的提案不同 if (p != address(0) && p != proposal) { data.setBondParamMapping("weights", p, data.weights(p).sub(w)); data.setBondParamMapping("weights", proposal, data.weights(proposal).add(w)); } data.setVotes(who, proposal, w.add(amount)); data.setBondParamMapping("weights", proposal, data.weights(proposal).add(amount)); data.setBondParam("totalWeights", data.totalWeights().add(amount)); //同票数情况下后投出来的为胜 if (data.weights(proposal) >= data.weights(data.top())) { // data.setTop(proposal); data.setBondParamAddress("top", proposal); } } //仅能被 data.take 回调 function take(uint256 id, address who) external auth returns (uint256) { } function rating(uint256 id) external { } //取回后页面获得手续费保留原值不变 function profitOf(uint256 id, address who) public view returns (uint256) { } //取回评级收益,被bondData调用 function profit(uint256 id, address who) external auth returns (uint256) { } }
data.issuer()!=who,"issuer can't vote for self bond"
295,647
data.issuer()!=who
"vote is not winner"
pragma solidity >=0.6.0; interface IPRA { function raters(address who) external view returns (bool); } interface IConfig { function ratingCandidates(address proposal) external view returns (bool); function depositDuration() external view returns (uint256); function professionalRatingWeightRatio() external view returns (uint256); function communityRatingWeightRatio() external view returns (uint256); function investDuration() external view returns (uint256); function communityRatingLine() external view returns (uint256); } interface IACL { function accessible(address sender, address to, bytes4 sig) external view returns (bool); } interface IRating { function risk() external view returns (uint256); function fine() external view returns (bool); } contract Vote is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; event MonitorEvent( address indexed who, address indexed bond, bytes32 indexed funcName, bytes ); function MonitorEventCallback(address who, address bond, bytes32 funcName, bytes calldata payload) external auth { } address public router; address public config; address public ACL; address public PRA; modifier auth { } constructor(address _ACL, address _router, address _config, address _PRA) public { } function setACL( address _ACL) external { } //专业评级时调用 function prcast(uint256 id, address proposal, uint256 reason) external nonReentrant { } //仅能被 data.vote 回调, 社区投票时调用 function cast(uint256 id, address who, address proposal, uint256 amount) external auth { } //仅能被 data.take 回调 function take(uint256 id, address who) external auth returns (uint256) { IBondData data = IBondData(IRouter(router).defaultDataContract(id)); require(now > data.voteExpired(), "vote is expired"); require(<FILL_ME>) uint256 amount = data.voteLedger(who); return amount; } function rating(uint256 id) external { } //取回后页面获得手续费保留原值不变 function profitOf(uint256 id, address who) public view returns (uint256) { } //取回评级收益,被bondData调用 function profit(uint256 id, address who) external auth returns (uint256) { } }
data.top()!=address(0),"vote is not winner"
295,647
data.top()!=address(0)
"voting profit withdrawed"
pragma solidity >=0.6.0; interface IPRA { function raters(address who) external view returns (bool); } interface IConfig { function ratingCandidates(address proposal) external view returns (bool); function depositDuration() external view returns (uint256); function professionalRatingWeightRatio() external view returns (uint256); function communityRatingWeightRatio() external view returns (uint256); function investDuration() external view returns (uint256); function communityRatingLine() external view returns (uint256); } interface IACL { function accessible(address sender, address to, bytes4 sig) external view returns (bool); } interface IRating { function risk() external view returns (uint256); function fine() external view returns (bool); } contract Vote is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; event MonitorEvent( address indexed who, address indexed bond, bytes32 indexed funcName, bytes ); function MonitorEventCallback(address who, address bond, bytes32 funcName, bytes calldata payload) external auth { } address public router; address public config; address public ACL; address public PRA; modifier auth { } constructor(address _ACL, address _router, address _config, address _PRA) public { } function setACL( address _ACL) external { } //专业评级时调用 function prcast(uint256 id, address proposal, uint256 reason) external nonReentrant { } //仅能被 data.vote 回调, 社区投票时调用 function cast(uint256 id, address who, address proposal, uint256 amount) external auth { } //仅能被 data.take 回调 function take(uint256 id, address who) external auth returns (uint256) { } function rating(uint256 id) external { } //取回后页面获得手续费保留原值不变 function profitOf(uint256 id, address who) public view returns (uint256) { } //取回评级收益,被bondData调用 function profit(uint256 id, address who) external auth returns (uint256) { IBondData data = IBondData(IRouter(router).defaultDataContract(id)); uint256 _bondStage = data.bondStage(); require( _bondStage == uint256(BondStage.RepaySuccess) || _bondStage == uint256(BondStage.DebtClosed), "bond is unrepay or unliquidate" ); require(<FILL_ME>) IBondData.prwhat memory pr = data.pr(); IBondData.what memory what = data.votes(who); require(what.proposal != address(0) || pr.who == who, "user is not rating vote"); uint256 _profit = profitOf(id, who); data.setBondParamMapping("profits", who, _profit); data.setBondParam("totalProfits", data.totalProfits().add(_profit)); return _profit; } }
data.profits(who)==0,"voting profit withdrawed"
295,647
data.profits(who)==0
"buy: exchange arbitrary call failed"
contract MultiBuyer is CanReclaimToken { using SafeMath for uint256; function buyOnApprove( IMultiToken _mtkn, uint256 _minimumReturn, ERC20 _throughToken, address[] _exchanges, bytes _datas, uint[] _datasIndexes, // including 0 and LENGTH values uint256[] _values ) public payable { require(_datasIndexes.length == _exchanges.length + 1, "buy: _datasIndexes should start with 0 and end with LENGTH"); require(_values.length == _exchanges.length, "buy: _values should have the same length as _exchanges"); for (uint i = 0; i < _exchanges.length; i++) { bytes memory data = new bytes(_datasIndexes[i + 1] - _datasIndexes[i]); for (uint j = _datasIndexes[i]; j < _datasIndexes[i + 1]; j++) { data[j - _datasIndexes[i]] = _datas[j]; } if (_throughToken != address(0) && i > 0) { _throughToken.approve(_exchanges[i], 0); _throughToken.approve(_exchanges[i], _throughToken.balanceOf(this)); } require(<FILL_ME>) if (_throughToken != address(0)) { _throughToken.approve(_exchanges[i], 0); } } j = _mtkn.totalSupply(); // optimization totalSupply uint256 bestAmount = uint256(-1); for (i = _mtkn.tokensCount(); i > 0; i--) { ERC20 token = _mtkn.tokens(i - 1); token.approve(_mtkn, 0); token.approve(_mtkn, token.balanceOf(this)); uint256 amount = j.mul(token.balanceOf(this)).div(token.balanceOf(_mtkn)); if (amount < bestAmount) { bestAmount = amount; } } require(bestAmount >= _minimumReturn, "buy: return value is too low"); _mtkn.bundle(msg.sender, bestAmount); if (address(this).balance > 0) { msg.sender.transfer(address(this).balance); } if (_throughToken != address(0) && _throughToken.balanceOf(this) > 0) { _throughToken.transfer(msg.sender, _throughToken.balanceOf(this)); } } function buyOnTransfer( IMultiToken _mtkn, uint256 _minimumReturn, ERC20 _throughToken, address[] _exchanges, bytes _datas, uint[] _datasIndexes, // including 0 and LENGTH values uint256[] _values ) public payable { } function buyFirstTokensOnApprove( IMultiToken _mtkn, ERC20 _throughToken, address[] _exchanges, bytes _datas, uint[] _datasIndexes, // including 0 and LENGTH values uint256[] _values ) public payable { } function buyFirstTokensOnTransfer( IMultiToken _mtkn, ERC20 _throughToken, address[] _exchanges, bytes _datas, uint[] _datasIndexes, // including 0 and LENGTH values uint256[] _values ) public payable { } }
_exchanges[i].call.value(_values[i])(data),"buy: exchange arbitrary call failed"
295,660
_exchanges[i].call.value(_values[i])(data)
null
contract ExpectedRate is Withdrawable, ExpectedRateInterface, Utils2 { KyberNetwork public kyberNetwork; uint public quantityFactor = 2; uint public worstCaseRateFactorInBps = 50; uint constant UNIT_QTY_FOR_FEE_BURNER = 10 ** 18; ERC20 public knc; function ExpectedRate(KyberNetwork _kyberNetwork, ERC20 _knc, address _admin) public { } event QuantityFactorSet (uint newFactor, uint oldFactor, address sender); function setQuantityFactor(uint newFactor) public onlyOperator { } event MinSlippageFactorSet (uint newMin, uint oldMin, address sender); function setWorstCaseRateFactor(uint bps) public onlyOperator { } //@dev when srcQty too small or 0 the expected rate will be calculated without quantity, // will enable rate reference before committing to any quantity //@dev when srcQty too small (no actual dest qty) slippage rate will be 0. function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty, bool usePermissionless) public view returns (uint expectedRate, uint slippageRate) { require(quantityFactor != 0); require(srcQty <= MAX_QTY); require(<FILL_ME>) if (srcQty == 0) srcQty = 1; bool didRevert = false; (didRevert, expectedRate, slippageRate) = safeFindBestRate(src, dest, srcQty, usePermissionless); if (didRevert) return (0, 0); if (expectedRate == 0) { expectedRate = expectedRateSmallQty(src, dest, srcQty, usePermissionless); } if (src == knc && dest == ETH_TOKEN_ADDRESS && srcQty == UNIT_QTY_FOR_FEE_BURNER ) { if (checkKncArbitrageRate(expectedRate)) expectedRate = 0; } if (expectedRate > MAX_RATE) return (0, 0); uint worstCaseSlippageRate = ((10000 - worstCaseRateFactorInBps) * expectedRate) / 10000; if (slippageRate >= worstCaseSlippageRate) { slippageRate = worstCaseSlippageRate; } return (expectedRate, slippageRate); } function checkKncArbitrageRate(uint currentKncToEthRate) public view returns(bool) { } //@dev for small src quantities dest qty might be 0, then returned rate is zero. //@dev for backward compatibility we would like to return non zero rate (correct one) for small src qty function expectedRateSmallQty(ERC20 src, ERC20 dest, uint srcQty, bool usePermissionless) internal view returns(uint) { } function safeFindBestRate(ERC20 src, ERC20 dest, uint srcQty, bool usePermissionless) internal view returns (bool didRevert, uint expectedRate, uint slippageRate) { } function assemblyFindBestRate(ERC20 src, ERC20 dest, uint srcQty, bytes4 sig) internal view returns (bool didRevert, uint rate) { } }
srcQty*quantityFactor<=MAX_QTY
295,697
srcQty*quantityFactor<=MAX_QTY
"Limit reached"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract Obits is ERC721, ERC721Enumerable, Ownable { using Counters for Counters.Counter; using SafeMath for uint256; Counters.Counter private _tokenIds; constructor() ERC721("0bits", "0bits") { } mapping (uint256 => address) previousOwner; mapping (uint256 => address) firstOwner; uint256 private tokenPrice = 50000000000000000; // 0.05 Eth uint256 private maxCap = 7134; // (7132 + 2) string public baseUri = "ipfs://QmZfSeZMrJHFVEi5Zffw5fMBQzRbKkjkq4ToGjzY7hYKV9#"; bool salesIsOpen = false; bool metadataLocked = false; function safeMint(uint256 amountToMint) public payable { require(salesIsOpen == true, "Sales is not open"); uint256 currentToken = _tokenIds.current(); require(amountToMint < 11, "Can't mint too much at once!"); require(<FILL_ME>) require(msg.value == tokenPrice.mul(amountToMint), "That is not the right price!"); for(uint256 i = 0; i < amountToMint; i++){ firstOwner[_tokenIds.current()] = msg.sender; _safeMint(msg.sender, _tokenIds.current()); _tokenIds.increment(); } } function devMint(address to, uint256 amountToMint) public onlyOwner { } function toggleSales() public onlyOwner { } function customBurn(uint256 tokenId) public { } function withdrawFunds() public onlyOwner { } function getFirstOwner(uint256 tokenId) public view returns(address) { } function getPreviousOwner(uint256 tokenId) public view returns(address) { } function setBaseUri(string memory newUri) public onlyOwner { } function lockMetadata() public onlyOwner { } function _baseURI() internal override view returns (string memory) { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } }
currentToken+amountToMint<maxCap,"Limit reached"
295,710
currentToken+amountToMint<maxCap
null
pragma solidity 0.5.7; /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert 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 mod(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address internal _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor(address initialOwner) internal { } function owner() public view returns (address) { } modifier onlyOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } } /** * @title ERC20 interface * @dev see https://eips.ethereum.org/EIPS/eip-20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function balanceOf(address who) external view returns (uint256); } /** * @dev Contract module that helps prevent reentrant calls to a function. */ contract ReentrancyGuard { uint256 private _guardCounter; constructor () internal { } modifier nonReentrant() { } } /** * @title GoldRubleBonusStorage interface */ interface GoldRubleBonusStorage { function sendBonus(address account, uint256 amount) external; function RS_transferOwnership(address newOwner) external; function RS_changeInterval(uint256 newInterval) external; function RS_addReferrer(address referrer) external; function RS_referrerOf(address player) external view returns(address); function RS_interval() external view returns(uint256); } /** * @title Invest contract. */ contract INVEST is ReentrancyGuard, Ownable { using SafeMath for uint256; // The token being sold IERC20 private _token; // GoldRubleBonusStorage contract GoldRubleBonusStorage private _GRBS; // Address where funds are collected address payable private _wallet; // Amount of wei raised uint256 private _weiRaised; // Amount of reserved tokens uint256 private _reserve; // How many token units a buyer gets per 1 ether uint256 private _rate = 2e15; // Minimum amount of wei to invest uint256 private _minimum = 0.5 ether; // Token amount set as share uint256 private _share = 1000000000000000; // Ref Bonus per share uint256 private _bonusPerShare = 50000000000000; // Delay period (UNIX time) uint256 private _delay; // User data mapping (address => User) users; struct User { Deposit[] deposits; uint256 checkpoint; uint256 reserved; } struct Deposit { uint256 amount; uint256 endtime; uint256 delay; } // Pause of recieving new deposits bool public paused; modifier notPaused() { } // Requiring of referrer bool public refRequired; // Enable of referral programm enum ReferrerSystem {OFF, ON} ReferrerSystem public RS = ReferrerSystem.OFF; // Sending bonus to referral bool public referralMode; // Events event TokensPurchased(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount, uint256 delay); event Withdrawn(address indexed account, uint256 amount); /** * @param rate Number of token units a buyer gets per wei * @param wallet Address where collected funds will be forwarded to * @param token Address of the token being sold */ constructor(uint256 rate, address payable wallet, IERC20 token, address initialOwner, address GRBSAddr) public Ownable(initialOwner) { } /** * @dev fallback function */ function() external payable { } /** * @dev low level token purchase * This function has a non-reentrancy guard * @param beneficiary Recipient of the token purchase */ function buyTokens(address beneficiary) public notPaused nonReentrant payable { require(beneficiary != address(0), "Beneficiary is the zero address"); require(msg.value >= _minimum, "Wei amount is less than minimum"); if (refRequired) { require(<FILL_ME>) } uint256 weiAmount = msg.value; uint256 tokens = getTokenAmount(weiAmount); require(tokens <= _token.balanceOf(address(this)).sub(_reserve)); _weiRaised = _weiRaised.add(weiAmount); _wallet.transfer(weiAmount); if (_delay == 0) { _token.transfer(beneficiary, tokens); } else { createDeposit(beneficiary, tokens); } if (_GRBS.RS_referrerOf(beneficiary) != address(0)) { if (RS == ReferrerSystem.ON) { _GRBS.sendBonus(_GRBS.RS_referrerOf(beneficiary), tokens.div(_share).mul(_bonusPerShare)); if (referralMode) { _GRBS.sendBonus(beneficiary, tokens.div(_share).mul(_bonusPerShare)); } } } else if (msg.data.length == 20) { addReferrer(); } emit TokensPurchased(msg.sender, beneficiary, weiAmount, tokens, _delay); } /** * @dev internal invest function * @param account address of users * @param amount amount of tokens to deposit */ function createDeposit(address account, uint256 amount) internal { } /** * @dev withdraw available dividens */ function withdraw() public { } /** * @dev internal addReferrer function */ function addReferrer() internal { } /** * @dev internal function to convert bytes type to address */ function bytesToAddress(bytes memory source) internal pure returns(address parsedReferrer) { } /** * @dev Calculate amount of tokens to recieve for a given amount of wei * @param weiAmount Value in wei to be converted into tokens * @return Number of tokens that can be purchased with the specified _weiAmount */ function getTokenAmount(uint256 weiAmount) public view returns(uint256) { } /** * @dev Calculate amount of tokens to recieve for a given account at current time * @param account Address of user * @return Number of tokens that can be withdrawn */ function getDividends(address account) public view returns(uint256) { } /** * @dev Function to change the rate. * Available only to the owner. * @param newRate new value. */ function setRate(uint256 newRate) external onlyOwner { } /** * @dev Function to change the share value * Available only to the owner. * @param newShare new value. */ function setShare(uint256 newShare) external onlyOwner { } /** * @dev Function to change the bonusPerShare value * Available only to the owner. * @param newBonus new value. */ function setBonus(uint256 newBonus) external onlyOwner { } /** * @dev Function to change the address to receive ether. * Available only to the owner. * @param newWallet new address. */ function setWallet(address payable newWallet) external onlyOwner { } /** * @dev Function to change the delay period of recieving tokens. * Available only to the owner. * @param newDelay new value (UNIX time). */ function setDelayPeriod(uint256 newDelay) external onlyOwner { } /** * @dev Function to change the minimum amount (wei). * Available only to the owner. * @param newMinimum new minimum value (wei). */ function setMinimum(uint256 newMinimum) external onlyOwner { } /** * @dev Function to pause recieving of deposits. * Available only to the owner. */ function pause() external onlyOwner { } /** * @dev Function to unpause recieving of deposits. * Available only to the owner. */ function unpause() external onlyOwner { } /** * @dev Function to switch if referrer is required. * Available only to the owner. */ function switchRefSys() external onlyOwner { } /** * @dev Function to switch the requiring of referrers state * Available only to the owner. */ function switchRequiringOfRef() external onlyOwner { } /** * @dev Function to switch if referral gets bonus * Available only to the owner. */ function switchReferralMode() external onlyOwner { } /** * @dev Allows to withdraw needed ERC20 token from this contract (promo or bounties for example). * Available only to the owner. * @param ERC20Token Address of ERC20 token. * @param recipient Account to receive tokens. */ function withdrawERC20(address ERC20Token, address recipient) external onlyOwner { } /** * @return the token being sold. */ function token() public view returns (IERC20) { } /** * @return address of GoldRubleBonusStorage. */ function GRBS() public view returns (GoldRubleBonusStorage) { } /** * @return the address where funds are collected. */ function wallet() public view returns (address payable) { } /** * @return the number of token units a buyer gets per wei. */ function rate() public view returns (uint256) { } /** * @return the number of token set as share. */ function share() public view returns (uint256) { } /** * @return the number of token units a referrer gets per share. */ function bonusPerShare() public view returns (uint256) { } /** * @return minimum amount of wei to invest. */ function minimum() public view returns (uint256) { } /** * @return the amount of wei raised. */ function weiRaised() public view returns (uint256) { } /** * @return the amount of reserved tokens. */ function reserved() public view returns (uint256) { } /** * @return delay time (UNIX time). */ function delay() public view returns (uint256) { } }
_GRBS.RS_referrerOf(beneficiary)!=address(0)
295,724
_GRBS.RS_referrerOf(beneficiary)!=address(0)
null
pragma solidity ^0.4.25; /** * @title SafeMath */ library SafeMath { /** * Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract AltcoinToken { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } 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); } contract IDCToken is ERC20 { using SafeMath for uint256; address owner = msg.sender; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; string public constant name = "INDOCHAIN"; string public constant symbol = "IDC"; uint public constant decimals = 8; uint256 public totalSupply = 9000000000e8; uint256 public totalDistributed = 0; uint256 public tokensPerEth = 30000; uint256 public tokensPer2Eth = 35000; uint256 public tokensPer3Eth = 40000; uint256 public startPase = 1541548800; uint public maxPhase1 = 875000000e8; uint public maxPhase2 = 1750000000e8; uint public maxPhase3 = 2685000000e8; uint public currentPhase = 0; uint public soldPhase1 = 0; uint public soldPhase2 = 0; uint public soldPhase3 = 0; uint256 public pase1 = startPase + 1 * 30 days; uint256 public pase2 = pase1 + 1 * 30 days; uint256 public pase3 = pase2 + 1 * 30 days; uint256 public constant minContribution = 1 ether / 1000; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Distr(address indexed to, uint256 amount); event DistrFinished(); event Airdrop(address indexed _owner, uint _amount, uint _balance); event StartPaseUpdated(uint256 _time); event TokensPerEthUpdated(uint _tokensPerEth); event TokensPerEth2Updated(uint _tokensPerEth); event TokensPerEth3Updated(uint _tokensPerEth); event MaxPhase1Updated(uint _maxPhase1); event MaxPhase2Updated(uint _maxPhase2); event MaxPhase3Updated(uint _maxPhase3); event Burn(address indexed burner, uint256 value); bool public distributionFinished = false; modifier canDistr() { } modifier onlyOwner() { } constructor() public { } function transferOwnership(address newOwner) onlyOwner public { } function finishDistribution() onlyOwner canDistr public returns (bool) { } function distr(address _to, uint256 _amount) canDistr private returns (bool) { } function doAirdrop(address _participant, uint _amount) internal { } function adminClaimAirdrop(address _participant, uint _amount) public onlyOwner { } function adminClaimAirdropMultiple(address[] _addresses, uint _amount) public onlyOwner { } function () external payable { } function getTokens() payable canDistr public { uint256 tokens = 0; uint256 sold = 0; require( msg.value >= minContribution ); require( msg.value > 0 ); require( now > startPase && now < pase3); if(now > startPase && now < pase1 && soldPhase1 <= maxPhase1 ){ tokens = msg.value / tokensPerEth; }else if(now >= pase1 && now < pase2 && soldPhase2 <= maxPhase2 ){ tokens = msg.value / tokensPer2Eth; }else if(now >= pase2 && now < pase3 && soldPhase3 <= maxPhase3 ){ tokens = msg.value / tokensPer3Eth; } address investor = msg.sender; if (tokens > 0) { if(now > startPase && now <= pase1 && soldPhase1 <= maxPhase1 ){ sold = soldPhase1 + tokens; require(<FILL_ME>) soldPhase1 += tokens; }else if(now > pase1 && now <= pase2 && soldPhase2 <= maxPhase2 ){ sold = soldPhase2 + tokens; require(sold + tokens <= maxPhase2); soldPhase2 += tokens; }else if(now > pase2 && now <= pase3 && soldPhase3 <= maxPhase3 ){ sold = soldPhase3 + tokens; require(sold + tokens <= maxPhase3); soldPhase3 += tokens; } distr(investor, tokens); } if (totalDistributed >= totalSupply) { distributionFinished = true; } } function balanceOf(address _owner) constant public returns (uint256) { } // mitigates the ERC20 short address attack modifier onlyPayloadSize(uint size) { } function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) { } function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function allowance(address _owner, address _spender) constant public returns (uint256) { } function getTokenBalance(address tokenAddress, address who) constant public returns (uint){ } function withdraw() onlyOwner public { } function burn(uint256 _value) onlyOwner public { } function withdrawAltcoinTokens(address _tokenContract) onlyOwner public returns (bool) { } function updateTokensPerEth(uint _tokensPerEth) public onlyOwner { } function updateTokens2PerEth(uint _tokensPerEth) public onlyOwner { } function updateTokens3PerEth(uint _tokensPerEth) public onlyOwner { } function updateMaxPhase1(uint _maxPhase1) public onlyOwner { } function updateMaxPhase2(uint _maxPhase2) public onlyOwner { } function updateMaxPhase3(uint _maxPhase3) public onlyOwner { } function updateStartPhase(uint256 _time) public onlyOwner { } }
sold+tokens<=maxPhase1
295,813
sold+tokens<=maxPhase1
null
pragma solidity ^0.4.25; /** * @title SafeMath */ library SafeMath { /** * Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract AltcoinToken { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } 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); } contract IDCToken is ERC20 { using SafeMath for uint256; address owner = msg.sender; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; string public constant name = "INDOCHAIN"; string public constant symbol = "IDC"; uint public constant decimals = 8; uint256 public totalSupply = 9000000000e8; uint256 public totalDistributed = 0; uint256 public tokensPerEth = 30000; uint256 public tokensPer2Eth = 35000; uint256 public tokensPer3Eth = 40000; uint256 public startPase = 1541548800; uint public maxPhase1 = 875000000e8; uint public maxPhase2 = 1750000000e8; uint public maxPhase3 = 2685000000e8; uint public currentPhase = 0; uint public soldPhase1 = 0; uint public soldPhase2 = 0; uint public soldPhase3 = 0; uint256 public pase1 = startPase + 1 * 30 days; uint256 public pase2 = pase1 + 1 * 30 days; uint256 public pase3 = pase2 + 1 * 30 days; uint256 public constant minContribution = 1 ether / 1000; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Distr(address indexed to, uint256 amount); event DistrFinished(); event Airdrop(address indexed _owner, uint _amount, uint _balance); event StartPaseUpdated(uint256 _time); event TokensPerEthUpdated(uint _tokensPerEth); event TokensPerEth2Updated(uint _tokensPerEth); event TokensPerEth3Updated(uint _tokensPerEth); event MaxPhase1Updated(uint _maxPhase1); event MaxPhase2Updated(uint _maxPhase2); event MaxPhase3Updated(uint _maxPhase3); event Burn(address indexed burner, uint256 value); bool public distributionFinished = false; modifier canDistr() { } modifier onlyOwner() { } constructor() public { } function transferOwnership(address newOwner) onlyOwner public { } function finishDistribution() onlyOwner canDistr public returns (bool) { } function distr(address _to, uint256 _amount) canDistr private returns (bool) { } function doAirdrop(address _participant, uint _amount) internal { } function adminClaimAirdrop(address _participant, uint _amount) public onlyOwner { } function adminClaimAirdropMultiple(address[] _addresses, uint _amount) public onlyOwner { } function () external payable { } function getTokens() payable canDistr public { uint256 tokens = 0; uint256 sold = 0; require( msg.value >= minContribution ); require( msg.value > 0 ); require( now > startPase && now < pase3); if(now > startPase && now < pase1 && soldPhase1 <= maxPhase1 ){ tokens = msg.value / tokensPerEth; }else if(now >= pase1 && now < pase2 && soldPhase2 <= maxPhase2 ){ tokens = msg.value / tokensPer2Eth; }else if(now >= pase2 && now < pase3 && soldPhase3 <= maxPhase3 ){ tokens = msg.value / tokensPer3Eth; } address investor = msg.sender; if (tokens > 0) { if(now > startPase && now <= pase1 && soldPhase1 <= maxPhase1 ){ sold = soldPhase1 + tokens; require(sold + tokens <= maxPhase1); soldPhase1 += tokens; }else if(now > pase1 && now <= pase2 && soldPhase2 <= maxPhase2 ){ sold = soldPhase2 + tokens; require(<FILL_ME>) soldPhase2 += tokens; }else if(now > pase2 && now <= pase3 && soldPhase3 <= maxPhase3 ){ sold = soldPhase3 + tokens; require(sold + tokens <= maxPhase3); soldPhase3 += tokens; } distr(investor, tokens); } if (totalDistributed >= totalSupply) { distributionFinished = true; } } function balanceOf(address _owner) constant public returns (uint256) { } // mitigates the ERC20 short address attack modifier onlyPayloadSize(uint size) { } function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) { } function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function allowance(address _owner, address _spender) constant public returns (uint256) { } function getTokenBalance(address tokenAddress, address who) constant public returns (uint){ } function withdraw() onlyOwner public { } function burn(uint256 _value) onlyOwner public { } function withdrawAltcoinTokens(address _tokenContract) onlyOwner public returns (bool) { } function updateTokensPerEth(uint _tokensPerEth) public onlyOwner { } function updateTokens2PerEth(uint _tokensPerEth) public onlyOwner { } function updateTokens3PerEth(uint _tokensPerEth) public onlyOwner { } function updateMaxPhase1(uint _maxPhase1) public onlyOwner { } function updateMaxPhase2(uint _maxPhase2) public onlyOwner { } function updateMaxPhase3(uint _maxPhase3) public onlyOwner { } function updateStartPhase(uint256 _time) public onlyOwner { } }
sold+tokens<=maxPhase2
295,813
sold+tokens<=maxPhase2
null
pragma solidity ^0.4.25; /** * @title SafeMath */ library SafeMath { /** * Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } contract AltcoinToken { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } 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); } contract IDCToken is ERC20 { using SafeMath for uint256; address owner = msg.sender; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; string public constant name = "INDOCHAIN"; string public constant symbol = "IDC"; uint public constant decimals = 8; uint256 public totalSupply = 9000000000e8; uint256 public totalDistributed = 0; uint256 public tokensPerEth = 30000; uint256 public tokensPer2Eth = 35000; uint256 public tokensPer3Eth = 40000; uint256 public startPase = 1541548800; uint public maxPhase1 = 875000000e8; uint public maxPhase2 = 1750000000e8; uint public maxPhase3 = 2685000000e8; uint public currentPhase = 0; uint public soldPhase1 = 0; uint public soldPhase2 = 0; uint public soldPhase3 = 0; uint256 public pase1 = startPase + 1 * 30 days; uint256 public pase2 = pase1 + 1 * 30 days; uint256 public pase3 = pase2 + 1 * 30 days; uint256 public constant minContribution = 1 ether / 1000; event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Distr(address indexed to, uint256 amount); event DistrFinished(); event Airdrop(address indexed _owner, uint _amount, uint _balance); event StartPaseUpdated(uint256 _time); event TokensPerEthUpdated(uint _tokensPerEth); event TokensPerEth2Updated(uint _tokensPerEth); event TokensPerEth3Updated(uint _tokensPerEth); event MaxPhase1Updated(uint _maxPhase1); event MaxPhase2Updated(uint _maxPhase2); event MaxPhase3Updated(uint _maxPhase3); event Burn(address indexed burner, uint256 value); bool public distributionFinished = false; modifier canDistr() { } modifier onlyOwner() { } constructor() public { } function transferOwnership(address newOwner) onlyOwner public { } function finishDistribution() onlyOwner canDistr public returns (bool) { } function distr(address _to, uint256 _amount) canDistr private returns (bool) { } function doAirdrop(address _participant, uint _amount) internal { } function adminClaimAirdrop(address _participant, uint _amount) public onlyOwner { } function adminClaimAirdropMultiple(address[] _addresses, uint _amount) public onlyOwner { } function () external payable { } function getTokens() payable canDistr public { uint256 tokens = 0; uint256 sold = 0; require( msg.value >= minContribution ); require( msg.value > 0 ); require( now > startPase && now < pase3); if(now > startPase && now < pase1 && soldPhase1 <= maxPhase1 ){ tokens = msg.value / tokensPerEth; }else if(now >= pase1 && now < pase2 && soldPhase2 <= maxPhase2 ){ tokens = msg.value / tokensPer2Eth; }else if(now >= pase2 && now < pase3 && soldPhase3 <= maxPhase3 ){ tokens = msg.value / tokensPer3Eth; } address investor = msg.sender; if (tokens > 0) { if(now > startPase && now <= pase1 && soldPhase1 <= maxPhase1 ){ sold = soldPhase1 + tokens; require(sold + tokens <= maxPhase1); soldPhase1 += tokens; }else if(now > pase1 && now <= pase2 && soldPhase2 <= maxPhase2 ){ sold = soldPhase2 + tokens; require(sold + tokens <= maxPhase2); soldPhase2 += tokens; }else if(now > pase2 && now <= pase3 && soldPhase3 <= maxPhase3 ){ sold = soldPhase3 + tokens; require(<FILL_ME>) soldPhase3 += tokens; } distr(investor, tokens); } if (totalDistributed >= totalSupply) { distributionFinished = true; } } function balanceOf(address _owner) constant public returns (uint256) { } // mitigates the ERC20 short address attack modifier onlyPayloadSize(uint size) { } function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) { } function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function allowance(address _owner, address _spender) constant public returns (uint256) { } function getTokenBalance(address tokenAddress, address who) constant public returns (uint){ } function withdraw() onlyOwner public { } function burn(uint256 _value) onlyOwner public { } function withdrawAltcoinTokens(address _tokenContract) onlyOwner public returns (bool) { } function updateTokensPerEth(uint _tokensPerEth) public onlyOwner { } function updateTokens2PerEth(uint _tokensPerEth) public onlyOwner { } function updateTokens3PerEth(uint _tokensPerEth) public onlyOwner { } function updateMaxPhase1(uint _maxPhase1) public onlyOwner { } function updateMaxPhase2(uint _maxPhase2) public onlyOwner { } function updateMaxPhase3(uint _maxPhase3) public onlyOwner { } function updateStartPhase(uint256 _time) public onlyOwner { } }
sold+tokens<=maxPhase3
295,813
sold+tokens<=maxPhase3
null
// ___ _ ___ _ // | _ ) _ _ __| | __ _ __ __ ___ | _ \ ___ ___ | |_ // | _ \ | || | / _` | / _` | \ V / (_-< | _/ / -_) (_-< | _| // |___/ \_,_| \__,_| \__,_| \_/ /__/ |_| \___| /__/ \__| // Buda vs Pest // the most ridiculous Rock-Scissor-Paper game on Ethereum // Copyright 2018 www.budapestgame.com pragma solidity ^0.4.18; contract RSPScienceInterface { function isRSPScience() public pure returns (bool); function calcPoseBits (uint256 sek, uint256 posesek0, uint256 posesek1) public pure returns (uint256); } contract RockScissorPaper is StandardToken, Ownable { using SafeMath for uint256; string public name = 'RockScissorPaper'; string public symbol = 'RSP'; uint8 public decimals = 18; uint8 public version = 7; // uint256 public initialAmount = 5 * 10**uint(decimals+6); RSPScienceInterface public rspScience; function _setRSPScienceAddress (address addr) internal { RSPScienceInterface candidate = RSPScienceInterface (addr); require(<FILL_ME>) rspScience = candidate; } function setRSPScienceAddress (address addr) public onlyOwner { } // Constructor is not called multiple times, fortunately function RockScissorPaper (address addr) public { } function () public payable { } mapping (address => uint256) public weiInvested; mapping (address => uint256) public weiRefunded; mapping (address => address) public referrals; mapping (address => uint256) public nRefs; mapping (address => uint256) public weiFromRefs; event TokenInvest (address indexed purchaser, uint256 nWeis, uint256 nTokens, address referral); event TokenRefund (address indexed purchaser, uint256 nWeis, uint256 nTokens); // Buying and selling incur minting and burning function _mint (address tokenOwner, uint256 amount) internal { } function _burn (address tokenOwner, uint256 amount) internal { } // Only owner is allowed to do this function mint (uint256 amount) onlyOwner public { } function buyTokens (address referral) public payable { } function sellTokens (uint256 amount) public { } // Gamings struct GameRSP { address creator; uint256 creatorPose; // uint256 uint256 nTokens; address player; uint256 playerPose; uint256 sek; uint256 posebits; } GameRSP[] games; // mapping (address => uint256) public lastGameId; function totalGames () public view returns (uint256) { } function gameInfo (uint256 gameId) public view returns (address, uint256, uint256, address, uint256, uint256, uint256) { } uint8 public ownerCut = 5; // 5 percent uint8 public referralCut = 5; // 5 percent function changeFeeCut (uint8 ownCut, uint8 refCut) onlyOwner public { } event GameCreated (address indexed creator, uint256 gameId, uint256 pose); event GamePlayed (address indexed player, uint256 gameId, uint256 pose); event GameSolved (address indexed solver, uint256 gameId, uint256 posebits, address referral, uint256 solverFee); function createGame (uint256 amount, uint256 pose) public { } function playGame (uint256 gameId, uint256 pose) public { } // Convenience functions function buyAndCreateGame (uint256 amount, uint256 pose, address referral) public payable { } function buyAndPlayGame (uint256 gameId, uint256 pose, address referral) public payable { } function _solveGame (uint256 gameId, uint256 sek, uint256 solFee) public { } // Anyone could call this to claim the prize (an pay gas himself) function solveGame (uint256 gameId, uint256 sek) public { } // Or the game could be automatically solved a few moments later by the owner, // charging a 'solverFee' function autoSolveGame (uint256 gameId, uint256 sek, uint256 solFee) onlyOwner public { } }
candidate.isRSPScience()
295,832
candidate.isRSPScience()
null
// ___ _ ___ _ // | _ ) _ _ __| | __ _ __ __ ___ | _ \ ___ ___ | |_ // | _ \ | || | / _` | / _` | \ V / (_-< | _/ / -_) (_-< | _| // |___/ \_,_| \__,_| \__,_| \_/ /__/ |_| \___| /__/ \__| // Buda vs Pest // the most ridiculous Rock-Scissor-Paper game on Ethereum // Copyright 2018 www.budapestgame.com pragma solidity ^0.4.18; contract RSPScienceInterface { function isRSPScience() public pure returns (bool); function calcPoseBits (uint256 sek, uint256 posesek0, uint256 posesek1) public pure returns (uint256); } contract RockScissorPaper is StandardToken, Ownable { using SafeMath for uint256; string public name = 'RockScissorPaper'; string public symbol = 'RSP'; uint8 public decimals = 18; uint8 public version = 7; // uint256 public initialAmount = 5 * 10**uint(decimals+6); RSPScienceInterface public rspScience; function _setRSPScienceAddress (address addr) internal { } function setRSPScienceAddress (address addr) public onlyOwner { } // Constructor is not called multiple times, fortunately function RockScissorPaper (address addr) public { } function () public payable { } mapping (address => uint256) public weiInvested; mapping (address => uint256) public weiRefunded; mapping (address => address) public referrals; mapping (address => uint256) public nRefs; mapping (address => uint256) public weiFromRefs; event TokenInvest (address indexed purchaser, uint256 nWeis, uint256 nTokens, address referral); event TokenRefund (address indexed purchaser, uint256 nWeis, uint256 nTokens); // Buying and selling incur minting and burning function _mint (address tokenOwner, uint256 amount) internal { } function _burn (address tokenOwner, uint256 amount) internal { } // Only owner is allowed to do this function mint (uint256 amount) onlyOwner public { } function buyTokens (address referral) public payable { } function sellTokens (uint256 amount) public { } // Gamings struct GameRSP { address creator; uint256 creatorPose; // uint256 uint256 nTokens; address player; uint256 playerPose; uint256 sek; uint256 posebits; } GameRSP[] games; // mapping (address => uint256) public lastGameId; function totalGames () public view returns (uint256) { } function gameInfo (uint256 gameId) public view returns (address, uint256, uint256, address, uint256, uint256, uint256) { } uint8 public ownerCut = 5; // 5 percent uint8 public referralCut = 5; // 5 percent function changeFeeCut (uint8 ownCut, uint8 refCut) onlyOwner public { } event GameCreated (address indexed creator, uint256 gameId, uint256 pose); event GamePlayed (address indexed player, uint256 gameId, uint256 pose); event GameSolved (address indexed solver, uint256 gameId, uint256 posebits, address referral, uint256 solverFee); function createGame (uint256 amount, uint256 pose) public { // Will check tokenBalance of sender in transfer () // require (_tokenBalances[msg.sender] >= amount && amount >= 100 * 10**uint(decimals)); require(<FILL_ME>) // We set 1 as the minimal token required, but 100 tokens probably is the minimum viable require (amount >= 1 * 10**uint(decimals)); // escrew tokens; _transfer (this, amount); GameRSP memory game = GameRSP ({ creator: msg.sender, creatorPose: pose, nTokens: amount, player: address (0), playerPose: 0, sek: 0, posebits: 0 }); uint256 gameId = games.push (game) - 1; // lastGameId[msg.sender] = gameId; // Todo: Last GameId // Let's be absolutely sure array don't hit its limits require (gameId == uint256(uint32(gameId))); GameCreated (msg.sender, gameId, pose); } function playGame (uint256 gameId, uint256 pose) public { } // Convenience functions function buyAndCreateGame (uint256 amount, uint256 pose, address referral) public payable { } function buyAndPlayGame (uint256 gameId, uint256 pose, address referral) public payable { } function _solveGame (uint256 gameId, uint256 sek, uint256 solFee) public { } // Anyone could call this to claim the prize (an pay gas himself) function solveGame (uint256 gameId, uint256 sek) public { } // Or the game could be automatically solved a few moments later by the owner, // charging a 'solverFee' function autoSolveGame (uint256 gameId, uint256 sek, uint256 solFee) onlyOwner public { } }
_tokenBalances[msg.sender]>=amount
295,832
_tokenBalances[msg.sender]>=amount
null
// ___ _ ___ _ // | _ ) _ _ __| | __ _ __ __ ___ | _ \ ___ ___ | |_ // | _ \ | || | / _` | / _` | \ V / (_-< | _/ / -_) (_-< | _| // |___/ \_,_| \__,_| \__,_| \_/ /__/ |_| \___| /__/ \__| // Buda vs Pest // the most ridiculous Rock-Scissor-Paper game on Ethereum // Copyright 2018 www.budapestgame.com pragma solidity ^0.4.18; contract RSPScienceInterface { function isRSPScience() public pure returns (bool); function calcPoseBits (uint256 sek, uint256 posesek0, uint256 posesek1) public pure returns (uint256); } contract RockScissorPaper is StandardToken, Ownable { using SafeMath for uint256; string public name = 'RockScissorPaper'; string public symbol = 'RSP'; uint8 public decimals = 18; uint8 public version = 7; // uint256 public initialAmount = 5 * 10**uint(decimals+6); RSPScienceInterface public rspScience; function _setRSPScienceAddress (address addr) internal { } function setRSPScienceAddress (address addr) public onlyOwner { } // Constructor is not called multiple times, fortunately function RockScissorPaper (address addr) public { } function () public payable { } mapping (address => uint256) public weiInvested; mapping (address => uint256) public weiRefunded; mapping (address => address) public referrals; mapping (address => uint256) public nRefs; mapping (address => uint256) public weiFromRefs; event TokenInvest (address indexed purchaser, uint256 nWeis, uint256 nTokens, address referral); event TokenRefund (address indexed purchaser, uint256 nWeis, uint256 nTokens); // Buying and selling incur minting and burning function _mint (address tokenOwner, uint256 amount) internal { } function _burn (address tokenOwner, uint256 amount) internal { } // Only owner is allowed to do this function mint (uint256 amount) onlyOwner public { } function buyTokens (address referral) public payable { } function sellTokens (uint256 amount) public { } // Gamings struct GameRSP { address creator; uint256 creatorPose; // uint256 uint256 nTokens; address player; uint256 playerPose; uint256 sek; uint256 posebits; } GameRSP[] games; // mapping (address => uint256) public lastGameId; function totalGames () public view returns (uint256) { } function gameInfo (uint256 gameId) public view returns (address, uint256, uint256, address, uint256, uint256, uint256) { } uint8 public ownerCut = 5; // 5 percent uint8 public referralCut = 5; // 5 percent function changeFeeCut (uint8 ownCut, uint8 refCut) onlyOwner public { } event GameCreated (address indexed creator, uint256 gameId, uint256 pose); event GamePlayed (address indexed player, uint256 gameId, uint256 pose); event GameSolved (address indexed solver, uint256 gameId, uint256 posebits, address referral, uint256 solverFee); function createGame (uint256 amount, uint256 pose) public { } function playGame (uint256 gameId, uint256 pose) public { GameRSP storage game = games[gameId]; require (msg.sender != game.creator); require (game.player == address (0)); uint256 nTokens = game.nTokens; // Will check tokenBalance of sender in transfer () require(<FILL_ME>) // escrew tokens; _transfer (this, nTokens); game.player = msg.sender; game.playerPose = pose; GamePlayed (msg.sender, gameId, pose); } // Convenience functions function buyAndCreateGame (uint256 amount, uint256 pose, address referral) public payable { } function buyAndPlayGame (uint256 gameId, uint256 pose, address referral) public payable { } function _solveGame (uint256 gameId, uint256 sek, uint256 solFee) public { } // Anyone could call this to claim the prize (an pay gas himself) function solveGame (uint256 gameId, uint256 sek) public { } // Or the game could be automatically solved a few moments later by the owner, // charging a 'solverFee' function autoSolveGame (uint256 gameId, uint256 sek, uint256 solFee) onlyOwner public { } }
_tokenBalances[msg.sender]>=nTokens
295,832
_tokenBalances[msg.sender]>=nTokens
null
// ___ _ ___ _ // | _ ) _ _ __| | __ _ __ __ ___ | _ \ ___ ___ | |_ // | _ \ | || | / _` | / _` | \ V / (_-< | _/ / -_) (_-< | _| // |___/ \_,_| \__,_| \__,_| \_/ /__/ |_| \___| /__/ \__| // Buda vs Pest // the most ridiculous Rock-Scissor-Paper game on Ethereum // Copyright 2018 www.budapestgame.com pragma solidity ^0.4.18; contract RSPScienceInterface { function isRSPScience() public pure returns (bool); function calcPoseBits (uint256 sek, uint256 posesek0, uint256 posesek1) public pure returns (uint256); } contract RockScissorPaper is StandardToken, Ownable { using SafeMath for uint256; string public name = 'RockScissorPaper'; string public symbol = 'RSP'; uint8 public decimals = 18; uint8 public version = 7; // uint256 public initialAmount = 5 * 10**uint(decimals+6); RSPScienceInterface public rspScience; function _setRSPScienceAddress (address addr) internal { } function setRSPScienceAddress (address addr) public onlyOwner { } // Constructor is not called multiple times, fortunately function RockScissorPaper (address addr) public { } function () public payable { } mapping (address => uint256) public weiInvested; mapping (address => uint256) public weiRefunded; mapping (address => address) public referrals; mapping (address => uint256) public nRefs; mapping (address => uint256) public weiFromRefs; event TokenInvest (address indexed purchaser, uint256 nWeis, uint256 nTokens, address referral); event TokenRefund (address indexed purchaser, uint256 nWeis, uint256 nTokens); // Buying and selling incur minting and burning function _mint (address tokenOwner, uint256 amount) internal { } function _burn (address tokenOwner, uint256 amount) internal { } // Only owner is allowed to do this function mint (uint256 amount) onlyOwner public { } function buyTokens (address referral) public payable { } function sellTokens (uint256 amount) public { } // Gamings struct GameRSP { address creator; uint256 creatorPose; // uint256 uint256 nTokens; address player; uint256 playerPose; uint256 sek; uint256 posebits; } GameRSP[] games; // mapping (address => uint256) public lastGameId; function totalGames () public view returns (uint256) { } function gameInfo (uint256 gameId) public view returns (address, uint256, uint256, address, uint256, uint256, uint256) { } uint8 public ownerCut = 5; // 5 percent uint8 public referralCut = 5; // 5 percent function changeFeeCut (uint8 ownCut, uint8 refCut) onlyOwner public { } event GameCreated (address indexed creator, uint256 gameId, uint256 pose); event GamePlayed (address indexed player, uint256 gameId, uint256 pose); event GameSolved (address indexed solver, uint256 gameId, uint256 posebits, address referral, uint256 solverFee); function createGame (uint256 amount, uint256 pose) public { } function playGame (uint256 gameId, uint256 pose) public { } // Convenience functions function buyAndCreateGame (uint256 amount, uint256 pose, address referral) public payable { } function buyAndPlayGame (uint256 gameId, uint256 pose, address referral) public payable { } function _solveGame (uint256 gameId, uint256 sek, uint256 solFee) public { GameRSP storage game = games[gameId]; require (game.player != address (0)); uint256 nTokens = game.nTokens; require(<FILL_ME>) uint256 ownerFee = nTokens * 2 * ownerCut / 100; uint256 referralFee = nTokens * 2 * referralCut / 100; uint256 winnerPrize = nTokens * 2 - ownerFee - referralFee - solFee; uint256 drawPrize = nTokens - solFee/2; require (game.sek == 0 && sek != 0); game.sek = sek; address referral; // Let's start solving the game uint256 posebits = rspScience.calcPoseBits (sek, game.creatorPose, game.playerPose); // RK, SC, PA, RK, SC, PA // 1, 2, 4, 8, 16, 32 if ((posebits % 9) == 0) { // 9, 18 or 36 require (drawPrize >= 0); // draw (we don't take any fees - fair enough?) _transferFrom (this, game.creator, drawPrize); _transferFrom (this, game.player, drawPrize); } else if ((posebits % 17) == 0 || posebits == 12) { // 12, 17, or 34 require (winnerPrize >= 0); referral = referrals[game.creator]; if (referral == address(0)) { referral = owner; } // creator wins _transferFrom (this, game.creator, winnerPrize); _transferFrom (this, referral, referralFee); _transferFrom (this, owner, ownerFee); weiFromRefs[referral] += referralFee; } else if ((posebits % 10) == 0 || posebits == 33) { // 10, 20, or 33 require (winnerPrize >= 0); referral = referrals[game.player]; if (referral == address(0)) { referral = owner; } // player wins _transferFrom (this, game.player, winnerPrize); _transferFrom (this, referral, referralFee); _transferFrom (this, owner, ownerFee); weiFromRefs[referral] += referralFee; } if (solFee > 0) { _transferFrom (this, msg.sender, solFee); } game.posebits = posebits; GameSolved (msg.sender, gameId, game.posebits, referral, solFee); } // Anyone could call this to claim the prize (an pay gas himself) function solveGame (uint256 gameId, uint256 sek) public { } // Or the game could be automatically solved a few moments later by the owner, // charging a 'solverFee' function autoSolveGame (uint256 gameId, uint256 sek, uint256 solFee) onlyOwner public { } }
_tokenBalances[this]>=nTokens*2
295,832
_tokenBalances[this]>=nTokens*2
"You must own at least one Samot NFT to participate in the pre-sale."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-solidity/contracts/utils/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/access/Ownable.sol"; import "openzeppelin-solidity/contracts/utils/Context.sol"; // ██╗ ██╗██╗ ██╗ ██████╗ ██╗███████╗ ▄▄███▄▄· █████╗ ███╗ ███╗ ██████╗ ████████╗ ██████╗ // ██║ ██║██║ ██║██╔═══██╗ ██║██╔════╝ ██╔════╝██╔══██╗████╗ ████║██╔═══██╗╚══██╔══╝ ╚════██╗ // ██║ █╗ ██║███████║██║ ██║ ██║███████╗ ███████╗███████║██╔████╔██║██║ ██║ ██║ ▄███╔╝ // ██║███╗██║██╔══██║██║ ██║ ██║╚════██║ ╚════██║██╔══██║██║╚██╔╝██║██║ ██║ ██║ ▀▀══╝ // ╚███╔███╔╝██║ ██║╚██████╔╝ ██║███████║ ███████║██║ ██║██║ ╚═╝ ██║╚██████╔╝ ██║ ██╗ // ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝╚══════╝ ╚═▀▀▀══╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ /** * @title Samot Token * SamotToken - a contract for the Samot Token */ abstract contract SamotNFT { function ownerOf(uint256 tokenId) public view virtual returns (address); function balanceOf(address owner) public view virtual returns (uint256 balance); } contract SamotTokenF is ERC20, Ownable { using SafeMath for uint256; address constant WALLET1 = 0xffe5CBCDdF2bd1b4Dc3c00455d4cdCcf20F77587; address constant WALLET2 = 0xD9CC8af4E8ac5Cb5e7DdFffD138A58Bac49dAEd5; address stakingAddress; uint256 public maxToMintPerNFT = 100; uint256 public maxToMint = 50000; uint256 public maxSupply = 6000000; bool public preSaleIsActive = true; bool public saleIsActive = false; uint256 public mintPrice = 200000000000000; uint256 initialSupply = 1000000; SamotNFT nft; constructor( string memory _name, string memory _symbol, address _contractAddress ) ERC20(_name, _symbol) { } function flipSaleState() public onlyOwner { } function flipPreSaleState() public onlyOwner { } function setStakingContract(address _stakingAddress) external onlyOwner { } function setNFTContract(address _contractAddress) external onlyOwner { } function setMintPrice(uint256 _price) external onlyOwner { } function setMaxSupply(uint256 _maxSupply) external onlyOwner { } function setMaxToMint(uint256 _maxToMint) external onlyOwner { } function setMaxToMintPerNFT(uint256 _maxToMint) external onlyOwner { } function getPrice() public view returns (uint256) { } function mint(uint256 numberOfTokens) public payable { require(saleIsActive, "Sale is not active."); require(numberOfTokens > 0, "numberOfTokens cannot be 0"); uint256 balance = balanceOf(msg.sender).div(10**18); if (preSaleIsActive) { require( getPrice().mul(numberOfTokens) <= msg.value, "ETH sent is incorrect." ); require(<FILL_ME>) require( numberOfTokens <= maxToMintPerNFT.mul(nft.balanceOf(msg.sender)), "Exceeds limit for pre-sale." ); require( balance.add(numberOfTokens) <= maxToMintPerNFT.mul(nft.balanceOf(msg.sender)), "Exceeds limit for pre-sale." ); } else { require( getPrice().mul(numberOfTokens) <= msg.value, "ETH sent is incorrect." ); require( numberOfTokens <= maxToMint, "Exceeds limit for public sale." ); require(balance <= maxToMint, "Exceeds limit for public sale."); } _mint(msg.sender, numberOfTokens.mul(10**18)); } modifier onlyVaultorOwner() { } function claim(address _claimer, uint256 _reward) external onlyVaultorOwner { } function withdraw() external onlyOwner { } }
nft.balanceOf(msg.sender)>0,"You must own at least one Samot NFT to participate in the pre-sale."
295,846
nft.balanceOf(msg.sender)>0
"Exceeds limit for pre-sale."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; import "openzeppelin-solidity/contracts/utils/math/SafeMath.sol"; import "openzeppelin-solidity/contracts/access/Ownable.sol"; import "openzeppelin-solidity/contracts/utils/Context.sol"; // ██╗ ██╗██╗ ██╗ ██████╗ ██╗███████╗ ▄▄███▄▄· █████╗ ███╗ ███╗ ██████╗ ████████╗ ██████╗ // ██║ ██║██║ ██║██╔═══██╗ ██║██╔════╝ ██╔════╝██╔══██╗████╗ ████║██╔═══██╗╚══██╔══╝ ╚════██╗ // ██║ █╗ ██║███████║██║ ██║ ██║███████╗ ███████╗███████║██╔████╔██║██║ ██║ ██║ ▄███╔╝ // ██║███╗██║██╔══██║██║ ██║ ██║╚════██║ ╚════██║██╔══██║██║╚██╔╝██║██║ ██║ ██║ ▀▀══╝ // ╚███╔███╔╝██║ ██║╚██████╔╝ ██║███████║ ███████║██║ ██║██║ ╚═╝ ██║╚██████╔╝ ██║ ██╗ // ╚══╝╚══╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝╚══════╝ ╚═▀▀▀══╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ /** * @title Samot Token * SamotToken - a contract for the Samot Token */ abstract contract SamotNFT { function ownerOf(uint256 tokenId) public view virtual returns (address); function balanceOf(address owner) public view virtual returns (uint256 balance); } contract SamotTokenF is ERC20, Ownable { using SafeMath for uint256; address constant WALLET1 = 0xffe5CBCDdF2bd1b4Dc3c00455d4cdCcf20F77587; address constant WALLET2 = 0xD9CC8af4E8ac5Cb5e7DdFffD138A58Bac49dAEd5; address stakingAddress; uint256 public maxToMintPerNFT = 100; uint256 public maxToMint = 50000; uint256 public maxSupply = 6000000; bool public preSaleIsActive = true; bool public saleIsActive = false; uint256 public mintPrice = 200000000000000; uint256 initialSupply = 1000000; SamotNFT nft; constructor( string memory _name, string memory _symbol, address _contractAddress ) ERC20(_name, _symbol) { } function flipSaleState() public onlyOwner { } function flipPreSaleState() public onlyOwner { } function setStakingContract(address _stakingAddress) external onlyOwner { } function setNFTContract(address _contractAddress) external onlyOwner { } function setMintPrice(uint256 _price) external onlyOwner { } function setMaxSupply(uint256 _maxSupply) external onlyOwner { } function setMaxToMint(uint256 _maxToMint) external onlyOwner { } function setMaxToMintPerNFT(uint256 _maxToMint) external onlyOwner { } function getPrice() public view returns (uint256) { } function mint(uint256 numberOfTokens) public payable { require(saleIsActive, "Sale is not active."); require(numberOfTokens > 0, "numberOfTokens cannot be 0"); uint256 balance = balanceOf(msg.sender).div(10**18); if (preSaleIsActive) { require( getPrice().mul(numberOfTokens) <= msg.value, "ETH sent is incorrect." ); require( nft.balanceOf(msg.sender) > 0, "You must own at least one Samot NFT to participate in the pre-sale." ); require( numberOfTokens <= maxToMintPerNFT.mul(nft.balanceOf(msg.sender)), "Exceeds limit for pre-sale." ); require(<FILL_ME>) } else { require( getPrice().mul(numberOfTokens) <= msg.value, "ETH sent is incorrect." ); require( numberOfTokens <= maxToMint, "Exceeds limit for public sale." ); require(balance <= maxToMint, "Exceeds limit for public sale."); } _mint(msg.sender, numberOfTokens.mul(10**18)); } modifier onlyVaultorOwner() { } function claim(address _claimer, uint256 _reward) external onlyVaultorOwner { } function withdraw() external onlyOwner { } }
balance.add(numberOfTokens)<=maxToMintPerNFT.mul(nft.balanceOf(msg.sender)),"Exceeds limit for pre-sale."
295,846
balance.add(numberOfTokens)<=maxToMintPerNFT.mul(nft.balanceOf(msg.sender))
"You can not free mint! You do not own enough CRTK tokens"
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() { } // function Counter() public { // for(uint i=1; i <=4500;i++){ // arr2.push(i); // } // } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } pragma solidity >=0.7.0 <0.9.0; //Todo: BUradaki CrypTicket'in Refactor edilmesi gerekiyor!!! contract CrypTicket is ERC20{ constructor() ERC20("Token06","TKN6"){ } function mint(address to,uint256 value) internal{ } function specialBurn(address from,uint256 amount) public { } } contract CrypTotems is ERC721Enumerable, Ownable,ReentrancyGuard { using Strings for uint256; string baseURI; string public baseExtension = ".json"; address payable _contractOwner; uint256 private maxPublicSaleMint = 2; uint256 public maxSupply = 4444; uint256 public cost = 0.04 ether; bool public paused = true; bool public revealed; string public notRevealedUri; bool public preSale ; constructor( string memory _initNotRevealedUri) ERC721("CrypTotems", "TOTEMS") { } function setPresale(bool _data) external onlyOwner { } // internal function _baseURI() internal view virtual override returns (string memory) { } function publicMint(uint256 mintAmount) external payable nonReentrant { } // public function mint(uint256 mintAmount) external { uint256 supply = totalSupply(); require(!paused,"Contract minting is paused."); require(supply + mintAmount <= maxSupply,"Error : Max supply exceeded!"); require(preSale,"Error: Presale is closed!"); require(<FILL_ME>) decrease(mintAmount); for(uint256 i =0;i<mintAmount;i++){ _safeMint(msg.sender, supply + 1); supply+=1; } } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setNotRevealedURI(string memory _notRevealedURI) internal onlyOwner { } function setBaseURI(string memory _newBaseURI) external onlyOwner { } function pause(bool _state) external onlyOwner { } function balanceOfTickets() public view returns(uint){ } CrypTicket private token; function decrease(uint256 amount) internal { } function withdrawBalance() external{ } function showContractBalance() external onlyOwner view returns (uint256) { } }
token.balanceOf(msg.sender)>=mintAmount*10**18,"You can not free mint! You do not own enough CRTK tokens"
295,882
token.balanceOf(msg.sender)>=mintAmount*10**18
"too much"
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 { } } pragma solidity ^0.8.0; contract DiddlyDoodleApes is ERC721URIStorage, Ownable{ event mintDoodleApes (address indexed minter, uint256 startWith, uint256 times); uint256 public totalDoodleApe; uint256 public totalCount = 2500; //bruhTotal uint256 public maxBatch = 20; // bruhBatch uint256 public price = 0.1 ether; string public baseURI; bool public started; uint addressRegistryCount; constructor() ERC721("DiddlyDoodleApes", "DDA") { } modifier mintEnabled() { } function totalSupply() public view virtual returns (uint256) { } function _baseURI() internal view virtual override returns (string memory){ } function setBaseURI(string memory _newURI) public onlyOwner { } function changePrice(uint256 _newPrice) public onlyOwner { } function setTokenURI(uint256 _tokenId, string memory _tokenURI) public onlyOwner { } function setNormalStart(bool _start) public onlyOwner { } function mintDoodleApe(uint256 _times) payable public mintEnabled { require(_times >0 && _times <= maxBatch, "mint wrong number"); require(<FILL_ME>) require(msg.value == _times * price, "value error"); payable(owner()).transfer(msg.value); emit mintDoodleApes(_msgSender(), totalDoodleApe+1, _times); for(uint256 i=0; i< _times; i++){ _mint(_msgSender(), 1 + totalDoodleApe++); } } function adminMint(uint256 _times) payable public onlyOwner { } function adminMintGiveaways(address _addr) public onlyOwner { } }
totalDoodleApe+_times<=totalCount,"too much"
295,933
totalDoodleApe+_times<=totalCount
"Mint amount will exceed total collection amount."
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 { } } pragma solidity ^0.8.0; contract DiddlyDoodleApes is ERC721URIStorage, Ownable{ event mintDoodleApes (address indexed minter, uint256 startWith, uint256 times); uint256 public totalDoodleApe; uint256 public totalCount = 2500; //bruhTotal uint256 public maxBatch = 20; // bruhBatch uint256 public price = 0.1 ether; string public baseURI; bool public started; uint addressRegistryCount; constructor() ERC721("DiddlyDoodleApes", "DDA") { } modifier mintEnabled() { } function totalSupply() public view virtual returns (uint256) { } function _baseURI() internal view virtual override returns (string memory){ } function setBaseURI(string memory _newURI) public onlyOwner { } function changePrice(uint256 _newPrice) public onlyOwner { } function setTokenURI(uint256 _tokenId, string memory _tokenURI) public onlyOwner { } function setNormalStart(bool _start) public onlyOwner { } function mintDoodleApe(uint256 _times) payable public mintEnabled { } function adminMint(uint256 _times) payable public onlyOwner { } function adminMintGiveaways(address _addr) public onlyOwner { require(<FILL_ME>) emit mintDoodleApes(_addr, totalDoodleApe+1, 1); _mint(_addr, 1 + totalDoodleApe++); } }
totalDoodleApe+1<=totalCount,"Mint amount will exceed total collection amount."
295,933
totalDoodleApe+1<=totalCount
"card not found"
pragma solidity ^0.5.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { } } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { } function _msgData() internal view returns (bytes memory) { } } /** * @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. * * 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. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { } /** * @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 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 onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { } } interface SmolStudio { function mint(address _to, uint256 _id, uint256 _quantity, bytes calldata _data) external; function totalSupply(uint256 _id) external view returns (uint256); function maxSupply(uint256 _id) external view returns (uint256); } contract SmolMart2 is Ownable { SmolStudio public smolStudio; mapping(uint256 => uint256) public cardCosts; mapping(uint256 => bool) public isGiveAwayCard; event CardAdded(uint256 card, uint256 points); event Redeemed(address indexed user, uint256 amount); constructor(SmolStudio _SmolStudioAddress) public { } function addCard(uint256 cardId, uint256 amount) public onlyOwner { } function addGiveAwayCard(uint256 cardId) public onlyOwner { } function redeem(uint256 card) payable public { if(isGiveAwayCard[card] == false) { require(<FILL_ME>) } require(msg.value == cardCosts[card], "wrong price"); require(smolStudio.totalSupply(card) < smolStudio.maxSupply(card), "max cards minted"); smolStudio.mint(msg.sender, card, 1, ""); emit Redeemed(msg.sender, cardCosts[card]); } function harvestDonations(address payable _to) public onlyOwner { } }
cardCosts[card]!=0,"card not found"
295,936
cardCosts[card]!=0
"max cards minted"
pragma solidity ^0.5.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { } } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { } function _msgData() internal view returns (bytes memory) { } } /** * @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. * * 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. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { } /** * @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 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 onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal { } } interface SmolStudio { function mint(address _to, uint256 _id, uint256 _quantity, bytes calldata _data) external; function totalSupply(uint256 _id) external view returns (uint256); function maxSupply(uint256 _id) external view returns (uint256); } contract SmolMart2 is Ownable { SmolStudio public smolStudio; mapping(uint256 => uint256) public cardCosts; mapping(uint256 => bool) public isGiveAwayCard; event CardAdded(uint256 card, uint256 points); event Redeemed(address indexed user, uint256 amount); constructor(SmolStudio _SmolStudioAddress) public { } function addCard(uint256 cardId, uint256 amount) public onlyOwner { } function addGiveAwayCard(uint256 cardId) public onlyOwner { } function redeem(uint256 card) payable public { if(isGiveAwayCard[card] == false) { require(cardCosts[card] != 0, "card not found"); } require(msg.value == cardCosts[card], "wrong price"); require(<FILL_ME>) smolStudio.mint(msg.sender, card, 1, ""); emit Redeemed(msg.sender, cardCosts[card]); } function harvestDonations(address payable _to) public onlyOwner { } }
smolStudio.totalSupply(card)<smolStudio.maxSupply(card),"max cards minted"
295,936
smolStudio.totalSupply(card)<smolStudio.maxSupply(card)
null
// SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../interfaces/IAddressProvider.sol"; import "../interfaces/IVaultsDataProvider.sol"; import "../interfaces/IVaultsCore.sol"; contract RepayVault { using SafeERC20 for IERC20; using SafeMath for uint256; uint256 public constant REPAY_PER_VAULT = 10 ether; IAddressProvider public a; constructor(IAddressProvider _addresses) public { require(<FILL_ME>) a = _addresses; } modifier onlyManager() { } function repay() public onlyManager { } }
address(_addresses)!=address(0)
296,111
address(_addresses)!=address(0)
"Caller is not Manager"
// SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../interfaces/IAddressProvider.sol"; import "../interfaces/IVaultsDataProvider.sol"; import "../interfaces/IVaultsCore.sol"; contract RepayVault { using SafeERC20 for IERC20; using SafeMath for uint256; uint256 public constant REPAY_PER_VAULT = 10 ether; IAddressProvider public a; constructor(IAddressProvider _addresses) public { } modifier onlyManager() { require(<FILL_ME>) _; } function repay() public onlyManager { } }
a.controller().hasRole(a.controller().MANAGER_ROLE(),msg.sender),"Caller is not Manager"
296,111
a.controller().hasRole(a.controller().MANAGER_ROLE(),msg.sender)
null
// SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../libraries/WadRayMath.sol"; import "../governance/interfaces/IGovernanceAddressProvider.sol"; import "./interfaces/IMIMODistributor.sol"; import "./BaseDistributor.sol"; contract MIMODistributorV2 is BaseDistributor, IMIMODistributorExtension { using SafeMath for uint256; using WadRayMath for uint256; uint256 private constant _SECONDS_PER_YEAR = 365 days; uint256 private constant _SECONDS_PER_WEEK = 7 days; uint256 private constant _WEEKLY_R = 986125e21; // -1.3875% per week (-5.55% / 4) uint256 private _FIRST_WEEK_TOKENS; uint256 public override startTime; uint256 public alreadyMinted; constructor( IGovernanceAddressProvider _a, uint256 _startTime, IMIMODistributor _mimoDistributor ) public { require(<FILL_ME>) require(address(_mimoDistributor) != address(0)); a = _a; startTime = _startTime; alreadyMinted = _mimoDistributor.totalSupplyAt(startTime); uint256 weeklyIssuanceV1 = _mimoDistributor.weeklyIssuanceAt(startTime); _FIRST_WEEK_TOKENS = weeklyIssuanceV1 / 4; // reduce weeky issuance by 4 } /** Get current monthly issuance of new MIMO tokens. @return number of monthly issued tokens currently`. */ function currentIssuance() public view override returns (uint256) { } /** Get monthly issuance of new MIMO tokens at `timestamp`. @dev invalid for timestamps before deployment @param timestamp for which to calculate the monthly issuance @return number of monthly issued tokens at `timestamp`. */ function weeklyIssuanceAt(uint256 timestamp) public view override returns (uint256) { } /** Calculates how many MIMO tokens can be minted since the last time tokens were minted @return number of mintable tokens available right now. */ function mintableTokens() public view override returns (uint256) { } /** Calculates the totalSupply for any point after `startTime` @param timestamp for which to calculate the totalSupply @return totalSupply at timestamp. */ function totalSupplyAt(uint256 timestamp) public view override returns (uint256) { } /** Internal function to release a percentage of newTokens to a specific payee @dev uses totalShares to calculate correct share @param _totalnewTokensReceived Total newTokens for all payees, will be split according to shares @param _payee The address of the payee to whom to distribute the fees. */ function _release(uint256 _totalnewTokensReceived, address _payee) internal override { } }
address(_a)!=address(0)
296,119
address(_a)!=address(0)
null
// SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity 0.6.12; import "@openzeppelin/contracts/math/SafeMath.sol"; import "../libraries/WadRayMath.sol"; import "../governance/interfaces/IGovernanceAddressProvider.sol"; import "./interfaces/IMIMODistributor.sol"; import "./BaseDistributor.sol"; contract MIMODistributorV2 is BaseDistributor, IMIMODistributorExtension { using SafeMath for uint256; using WadRayMath for uint256; uint256 private constant _SECONDS_PER_YEAR = 365 days; uint256 private constant _SECONDS_PER_WEEK = 7 days; uint256 private constant _WEEKLY_R = 986125e21; // -1.3875% per week (-5.55% / 4) uint256 private _FIRST_WEEK_TOKENS; uint256 public override startTime; uint256 public alreadyMinted; constructor( IGovernanceAddressProvider _a, uint256 _startTime, IMIMODistributor _mimoDistributor ) public { require(address(_a) != address(0)); require(<FILL_ME>) a = _a; startTime = _startTime; alreadyMinted = _mimoDistributor.totalSupplyAt(startTime); uint256 weeklyIssuanceV1 = _mimoDistributor.weeklyIssuanceAt(startTime); _FIRST_WEEK_TOKENS = weeklyIssuanceV1 / 4; // reduce weeky issuance by 4 } /** Get current monthly issuance of new MIMO tokens. @return number of monthly issued tokens currently`. */ function currentIssuance() public view override returns (uint256) { } /** Get monthly issuance of new MIMO tokens at `timestamp`. @dev invalid for timestamps before deployment @param timestamp for which to calculate the monthly issuance @return number of monthly issued tokens at `timestamp`. */ function weeklyIssuanceAt(uint256 timestamp) public view override returns (uint256) { } /** Calculates how many MIMO tokens can be minted since the last time tokens were minted @return number of mintable tokens available right now. */ function mintableTokens() public view override returns (uint256) { } /** Calculates the totalSupply for any point after `startTime` @param timestamp for which to calculate the totalSupply @return totalSupply at timestamp. */ function totalSupplyAt(uint256 timestamp) public view override returns (uint256) { } /** Internal function to release a percentage of newTokens to a specific payee @dev uses totalShares to calculate correct share @param _totalnewTokensReceived Total newTokens for all payees, will be split according to shares @param _payee The address of the payee to whom to distribute the fees. */ function _release(uint256 _totalnewTokensReceived, address _payee) internal override { } }
address(_mimoDistributor)!=address(0)
296,119
address(_mimoDistributor)!=address(0)
"Not Authorised"
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; import "hardhat/console.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; // /$$ /$$ /$$ /$$$$$$$ // | $$$ /$$$ | $$ | $$__ $$ // | $$$$ /$$$$ /$$ /$$ /$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$| $$ \ $$ /$$$$$$ /$$ /$$ // | $$ $$/$$ $$| $$ | $$ /$$_____/|_ $$_/ /$$__ $$ /$$__ $$| $$ | $$| $$$$$$$ /$$__ $$| $$ /$$/ // | $$ $$$| $$| $$ | $$| $$$$$$ | $$ | $$$$$$$$| $$ \__/| $$ | $$| $$__ $$| $$ \ $$ \ $$$$/ // | $$\ $ | $$| $$ | $$ \____ $$ | $$ /$$| $$_____/| $$ | $$ | $$| $$ \ $$| $$ | $$ >$$ $$ // | $$ \/ | $$| $$$$$$$ /$$$$$$$/ | $$$$/| $$$$$$$| $$ | $$$$$$$| $$$$$$$/| $$$$$$/ /$$/\ $$ // |__/ |__/ \____ $$|_______/ \___/ \_______/|__/ \____ $$|_______/ \______/ |__/ \__/ // /$$ | $$ /$$ | $$ // | $$$$$$/ | $$$$$$/ // \______/ \______/ interface ILoomi { function spendLoomi(address user, uint256 amount) external; } contract MysteryBox is Context, Ownable, ReentrancyGuard { int256[10][] public points; uint256 private constant WEEK_LENGTH = 1 weeks; uint256 public constant SHARDS_INDEX = 4; uint256 public constant ITEMS_PER_WEEK = 10; uint256 public startTimestamp; uint256 public pointLoomiPrice; uint256 public shardsPrice; uint256 public spinPrice; uint256 private _nonce; bool public boxOpened; bool public isPaused; bool public shardSaleIsActive; ILoomi public loomi; mapping(uint256 => mapping(address => uint256)) private _tokenToUserBalance; mapping(address => int256) public userPoints; mapping (address => bool) private _isAuthorised; event SpinMysteryBox(address indexed user); event SacrificeLoomi(address indexed user); event AddPoints(address indexed user); event RemovePoints(address indexed user); event Authorise(address indexed user, bool isAuth); constructor (address _loomi) { } /* MODIFIERS */ modifier whenNotPaused { } modifier authorised { require(<FILL_ME>) _; } /* PUBLIC FUNCTIONS */ function random() internal view returns(uint){ } /** * @dev Function allows user to spin the mystery box and get points */ function spinMysteryBox(uint256 numberOfSpins) public nonReentrant whenNotPaused { } /** * @dev Function allows user to sacrifice loomi and get points */ function sacrifice(uint256 numberOfPoints) public nonReentrant whenNotPaused { } /** * @dev Function allows user to purchase shards */ function purchaseShards(uint256 shardId, uint256 shardsNumber) public nonReentrant { } /** * @dev Function returns current week */ function getCurrentWeek() internal view returns(uint256) { } /** * @dev Function returns user artifacts and it's amount */ function getUserItems(address user) public view returns (uint256[] memory) { } /** * @dev Function returns user points balance */ function getUserBalance(address user) public view returns (int256) { } /** * @dev Function returns user shards */ function getUserShards(address user) public view returns (uint256[] memory) { } /* AUTHORISED FUNCTIONS */ /** * @dev Function auth address to add/remove shards to the user */ function addShards(uint256 shardId, uint256 shardsNumber, address user) public authorised { } function removeShards(uint256 shardId, uint256 shardsNumber, address user) public authorised { } /** * @dev Function auth address to add/remove points to the user */ function addPoints(address user, int256 pointsToAdd) public authorised { } function removePoints(address user, int256 pointsToRemove) public authorised { } /* OWNER FUNCTIONS */ /** * @dev Function allows admin add authorised address. The function also logs what addresses were authorised for transparancy. */ function authorise(address addressToAuth) public onlyOwner { } /** * @dev Function allows admin add unauthorised address. */ function unauthorise(address addressToUnAuth) public onlyOwner { } /** * @dev Function allows admin to launch mystery box */ function openMysteryBox() public onlyOwner { } /** * @dev Function allows admin to pause contract */ function pause(bool _pause) public onlyOwner { } /** * @dev Function allows admin to turn on/off shards sale */ function updateShardSaleStatus(bool _isActive) public onlyOwner { } /** * @dev Function allows admin to update spin price */ function updateSpinPrice(uint256 _newPrice) public onlyOwner { } /** * @dev Function allows admin to update point price */ function updatePointPrice(uint256 _newPrice) public onlyOwner { } /** * @dev Function allows admin to update shard price */ function updateShardsPrice(uint256 _newPrice) public onlyOwner { } /** * @dev Function allows admin to add points to the next week */ function addItemsForNextWeek(int256[10] memory itemsPoints) public onlyOwner { } /** * @dev Function allows admin to remove points for the next week */ function removeItemsForLastWeek() public onlyOwner { } }
_isAuthorised[_msgSender()],"Not Authorised"
296,383
_isAuthorised[_msgSender()]
"Cannot remove this week items"
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.7; import "hardhat/console.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; // /$$ /$$ /$$ /$$$$$$$ // | $$$ /$$$ | $$ | $$__ $$ // | $$$$ /$$$$ /$$ /$$ /$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$| $$ \ $$ /$$$$$$ /$$ /$$ // | $$ $$/$$ $$| $$ | $$ /$$_____/|_ $$_/ /$$__ $$ /$$__ $$| $$ | $$| $$$$$$$ /$$__ $$| $$ /$$/ // | $$ $$$| $$| $$ | $$| $$$$$$ | $$ | $$$$$$$$| $$ \__/| $$ | $$| $$__ $$| $$ \ $$ \ $$$$/ // | $$\ $ | $$| $$ | $$ \____ $$ | $$ /$$| $$_____/| $$ | $$ | $$| $$ \ $$| $$ | $$ >$$ $$ // | $$ \/ | $$| $$$$$$$ /$$$$$$$/ | $$$$/| $$$$$$$| $$ | $$$$$$$| $$$$$$$/| $$$$$$/ /$$/\ $$ // |__/ |__/ \____ $$|_______/ \___/ \_______/|__/ \____ $$|_______/ \______/ |__/ \__/ // /$$ | $$ /$$ | $$ // | $$$$$$/ | $$$$$$/ // \______/ \______/ interface ILoomi { function spendLoomi(address user, uint256 amount) external; } contract MysteryBox is Context, Ownable, ReentrancyGuard { int256[10][] public points; uint256 private constant WEEK_LENGTH = 1 weeks; uint256 public constant SHARDS_INDEX = 4; uint256 public constant ITEMS_PER_WEEK = 10; uint256 public startTimestamp; uint256 public pointLoomiPrice; uint256 public shardsPrice; uint256 public spinPrice; uint256 private _nonce; bool public boxOpened; bool public isPaused; bool public shardSaleIsActive; ILoomi public loomi; mapping(uint256 => mapping(address => uint256)) private _tokenToUserBalance; mapping(address => int256) public userPoints; mapping (address => bool) private _isAuthorised; event SpinMysteryBox(address indexed user); event SacrificeLoomi(address indexed user); event AddPoints(address indexed user); event RemovePoints(address indexed user); event Authorise(address indexed user, bool isAuth); constructor (address _loomi) { } /* MODIFIERS */ modifier whenNotPaused { } modifier authorised { } /* PUBLIC FUNCTIONS */ function random() internal view returns(uint){ } /** * @dev Function allows user to spin the mystery box and get points */ function spinMysteryBox(uint256 numberOfSpins) public nonReentrant whenNotPaused { } /** * @dev Function allows user to sacrifice loomi and get points */ function sacrifice(uint256 numberOfPoints) public nonReentrant whenNotPaused { } /** * @dev Function allows user to purchase shards */ function purchaseShards(uint256 shardId, uint256 shardsNumber) public nonReentrant { } /** * @dev Function returns current week */ function getCurrentWeek() internal view returns(uint256) { } /** * @dev Function returns user artifacts and it's amount */ function getUserItems(address user) public view returns (uint256[] memory) { } /** * @dev Function returns user points balance */ function getUserBalance(address user) public view returns (int256) { } /** * @dev Function returns user shards */ function getUserShards(address user) public view returns (uint256[] memory) { } /* AUTHORISED FUNCTIONS */ /** * @dev Function auth address to add/remove shards to the user */ function addShards(uint256 shardId, uint256 shardsNumber, address user) public authorised { } function removeShards(uint256 shardId, uint256 shardsNumber, address user) public authorised { } /** * @dev Function auth address to add/remove points to the user */ function addPoints(address user, int256 pointsToAdd) public authorised { } function removePoints(address user, int256 pointsToRemove) public authorised { } /* OWNER FUNCTIONS */ /** * @dev Function allows admin add authorised address. The function also logs what addresses were authorised for transparancy. */ function authorise(address addressToAuth) public onlyOwner { } /** * @dev Function allows admin add unauthorised address. */ function unauthorise(address addressToUnAuth) public onlyOwner { } /** * @dev Function allows admin to launch mystery box */ function openMysteryBox() public onlyOwner { } /** * @dev Function allows admin to pause contract */ function pause(bool _pause) public onlyOwner { } /** * @dev Function allows admin to turn on/off shards sale */ function updateShardSaleStatus(bool _isActive) public onlyOwner { } /** * @dev Function allows admin to update spin price */ function updateSpinPrice(uint256 _newPrice) public onlyOwner { } /** * @dev Function allows admin to update point price */ function updatePointPrice(uint256 _newPrice) public onlyOwner { } /** * @dev Function allows admin to update shard price */ function updateShardsPrice(uint256 _newPrice) public onlyOwner { } /** * @dev Function allows admin to add points to the next week */ function addItemsForNextWeek(int256[10] memory itemsPoints) public onlyOwner { } /** * @dev Function allows admin to remove points for the next week */ function removeItemsForLastWeek() public onlyOwner { require(<FILL_ME>) points.pop(); } }
getCurrentWeek()<points.length-1,"Cannot remove this week items"
296,383
getCurrentWeek()<points.length-1
null
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; // /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } // /** * @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. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { } /** * @dev Returns the address of the current owner. */ function owner() public view 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 { } } // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // contract CentaurLiquidityMining is Ownable { using SafeMath for uint; // Events event Deposit(uint256 _timestmap, address indexed _address, uint256 indexed _pid, uint256 _amount); event Withdraw(uint256 _timestamp, address indexed _address, uint256 indexed _pid, uint256 _amount); event EmergencyWithdraw(uint256 _timestamp, address indexed _address, uint256 indexed _pid, uint256 _amount); // CNTR Token Contract & Funding Address IERC20 public constant CNTR = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B); address public fundingAddress = 0xf6B13425d1F7D920E3F6EF43F7c5DdbC2E59AbF6; struct LPInfo { // Address of LP token contract IERC20 lpToken; // LP reward per block uint256 rewardPerBlock; // Last reward block uint256 lastRewardBlock; // Accumulated reward per share (times 1e12 to minimize rounding errors) uint256 accRewardPerShare; } struct Staker { // Total Amount Staked uint256 amountStaked; // Reward Debt (pending reward = (staker.amountStaked * pool.accRewardPerShare) - staker.rewardDebt) uint256 rewardDebt; } // Liquidity Pools LPInfo[] public liquidityPools; // Info of each user that stakes LP tokens. // poolId => address => staker mapping (uint256 => mapping (address => Staker)) public stakers; // Starting block for mining uint256 public startBlock; // End block for mining (Will be ongoing if unset/0) uint256 public endBlock; /** * @dev Constructor */ constructor(uint256 _startBlock) public { } /** * @dev Contract Modifiers */ function updateFundingAddress(address _address) public onlyOwner { } function updateStartBlock(uint256 _startBlock) public onlyOwner { } function updateEndBlock(uint256 _endBlock) public onlyOwner { } /** * @dev Liquidity Pool functions */ // Add liquidity pool function addLiquidityPool(IERC20 _lpToken, uint256 _rewardPerBlock) public onlyOwner { } // Update LP rewardPerBlock function updateRewardPerBlock(uint256 _pid, uint256 _rewardPerBlock) public onlyOwner { } // Update pool rewards variables function updatePoolRewards(uint256 _pid) public { } /** * @dev Stake functions */ // Deposit LP tokens into the liquidity pool function deposit(uint256 _pid, uint256 _amount) public { require(block.number < endBlock || endBlock == 0); LPInfo storage pool = liquidityPools[_pid]; Staker storage user = stakers[_pid][msg.sender]; updatePoolRewards(_pid); // Issue accrued rewards to user if (user.amountStaked > 0) { uint256 pending = user.amountStaked.mul(pool.accRewardPerShare).div(1e12).sub(user.rewardDebt); if(pending > 0) { _issueRewards(msg.sender, pending); } } // Process deposit if(_amount > 0) { require(<FILL_ME>) user.amountStaked = user.amountStaked.add(_amount); } // Update user reward debt user.rewardDebt = user.amountStaked.mul(pool.accRewardPerShare).div(1e12); emit Deposit(block.timestamp, msg.sender, _pid, _amount); } // Withdraw LP tokens from liquidity pool function withdraw(uint256 _pid, uint256 _amount) public { } // Withdraw without caring about rewards. EMERGENCY ONLY. function emergencyWithdraw(uint256 _pid) public { } // Function to issue rewards from funding address to user function _issueRewards(address _to, uint256 _amount) internal { } // View function to see pending rewards on frontend. function pendingRewards(uint256 _pid, address _user) external view returns (uint256) { } }
pool.lpToken.transferFrom(msg.sender,address(this),_amount)
296,418
pool.lpToken.transferFrom(msg.sender,address(this),_amount)
null
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; // /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } // /** * @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. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { } /** * @dev Returns the address of the current owner. */ function owner() public view 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 { } } // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // contract CentaurLiquidityMining is Ownable { using SafeMath for uint; // Events event Deposit(uint256 _timestmap, address indexed _address, uint256 indexed _pid, uint256 _amount); event Withdraw(uint256 _timestamp, address indexed _address, uint256 indexed _pid, uint256 _amount); event EmergencyWithdraw(uint256 _timestamp, address indexed _address, uint256 indexed _pid, uint256 _amount); // CNTR Token Contract & Funding Address IERC20 public constant CNTR = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B); address public fundingAddress = 0xf6B13425d1F7D920E3F6EF43F7c5DdbC2E59AbF6; struct LPInfo { // Address of LP token contract IERC20 lpToken; // LP reward per block uint256 rewardPerBlock; // Last reward block uint256 lastRewardBlock; // Accumulated reward per share (times 1e12 to minimize rounding errors) uint256 accRewardPerShare; } struct Staker { // Total Amount Staked uint256 amountStaked; // Reward Debt (pending reward = (staker.amountStaked * pool.accRewardPerShare) - staker.rewardDebt) uint256 rewardDebt; } // Liquidity Pools LPInfo[] public liquidityPools; // Info of each user that stakes LP tokens. // poolId => address => staker mapping (uint256 => mapping (address => Staker)) public stakers; // Starting block for mining uint256 public startBlock; // End block for mining (Will be ongoing if unset/0) uint256 public endBlock; /** * @dev Constructor */ constructor(uint256 _startBlock) public { } /** * @dev Contract Modifiers */ function updateFundingAddress(address _address) public onlyOwner { } function updateStartBlock(uint256 _startBlock) public onlyOwner { } function updateEndBlock(uint256 _endBlock) public onlyOwner { } /** * @dev Liquidity Pool functions */ // Add liquidity pool function addLiquidityPool(IERC20 _lpToken, uint256 _rewardPerBlock) public onlyOwner { } // Update LP rewardPerBlock function updateRewardPerBlock(uint256 _pid, uint256 _rewardPerBlock) public onlyOwner { } // Update pool rewards variables function updatePoolRewards(uint256 _pid) public { } /** * @dev Stake functions */ // Deposit LP tokens into the liquidity pool function deposit(uint256 _pid, uint256 _amount) public { } // Withdraw LP tokens from liquidity pool function withdraw(uint256 _pid, uint256 _amount) public { LPInfo storage pool = liquidityPools[_pid]; Staker storage user = stakers[_pid][msg.sender]; require(user.amountStaked >= _amount, "Amount to withdraw more than amount staked"); updatePoolRewards(_pid); // Issue accrued rewards to user if (user.amountStaked > 0) { uint256 pending = user.amountStaked.mul(pool.accRewardPerShare).div(1e12).sub(user.rewardDebt); if(pending > 0) { _issueRewards(msg.sender, pending); } } // Process withdraw if(_amount > 0) { user.amountStaked = user.amountStaked.sub(_amount); require(<FILL_ME>) } // Update user reward debt user.rewardDebt = user.amountStaked.mul(pool.accRewardPerShare).div(1e12); emit Withdraw(block.timestamp, msg.sender, _pid, _amount); } // Withdraw without caring about rewards. EMERGENCY ONLY. function emergencyWithdraw(uint256 _pid) public { } // Function to issue rewards from funding address to user function _issueRewards(address _to, uint256 _amount) internal { } // View function to see pending rewards on frontend. function pendingRewards(uint256 _pid, address _user) external view returns (uint256) { } }
pool.lpToken.transfer(msg.sender,_amount)
296,418
pool.lpToken.transfer(msg.sender,_amount)