comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"All NFTs have been minted"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract Coyote is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_NFTS = 10000; uint256 public constant PRICE_PRE_SALE = 0.1 ether; uint256 public constant PRICE_PUBLIC_SALE = 0.2 ether; uint256 public constant PRICE_FLOOR = 0.1 ether; uint256 public constant PRICE_TICK = 0.02 ether; uint256 public constant SECONDS_BETWEEN_TICK = 3600; // 1 hour uint256 public constant MAX_PER_MINT = 7; uint256 public constant PRESALE_MAX_MINT = 3; uint256 public constant MAX_NFTS_MINT = 70; uint256 public constant RESERVED_NFTS = 250; address public constant daoAddress = 0xa78AdA29f1c8cBECdb3FAf5f00CEa5b661ab7013; address public constant teamAddress = 0x2ED93945571344675038fBF92C06094E608bB2FC; address public constant founderAddress = 0x46391ED2FC671FF3D76cB3475C742f8691a3c9Cf; address public constant projectAddress = 0xb9f2eB35ed71fA2ee90Fa6b08AB16c2828b4D58D; uint256 private pricePublicSale = PRICE_PUBLIC_SALE; bool private customPrice; uint256 public publicSaleStartDate; uint256 public reservedClaimed; uint256 public numNftsMinted; string public baseTokenURI; bool public publicSaleStarted; bool public presaleStarted; mapping(address => bool) private _presaleEligible; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PresaleMint(address minter, uint256 amountOfNfts); event PublicSaleMint(address minter, uint256 amountOfNfts); modifier whenPresaleStarted() { } modifier whenPublicSaleStarted() { } constructor(string memory baseURI) ERC721("Billionaire Coyote Cartel", "BCC") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { require(reservedClaimed != RESERVED_NFTS, "You have already claimed all reserved nfts"); require(reservedClaimed + amount <= RESERVED_NFTS, "Mint exceeds max reserved nfts"); require(recipient != address(0), "Cannot add null address"); require(<FILL_ME>) require(totalSupply() + amount <= MAX_NFTS, "Mint exceeds max supply"); uint256 _nextTokenId = numNftsMinted + 1; for (uint256 i = 0; i < amount; i++) { _safeMint(recipient, _nextTokenId + i); } numNftsMinted += amount; reservedClaimed += amount; } function addToPresale(address[] calldata addresses) external onlyOwner { } function getPublicSalePrice() public view returns(uint256) { } function checkPresaleEligiblity(address addr) external view returns (bool) { } function amountClaimedBy(address owner) external view returns (uint256) { } function mintPresale(uint256 amountOfNfts) external payable whenPresaleStarted { } function updatePrice() private { } function mint(uint256 amountOfNfts) external payable whenPublicSaleStarted { } function togglePresaleStarted() external onlyOwner { } function setPrice(uint256 _price) external onlyOwner { } function togglePublicSaleStarted() external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdrawAll() public onlyOwner { } function _widthdraw(address _address, uint256 _amount) private { } }
totalSupply()<MAX_NFTS,"All NFTs have been minted"
333,165
totalSupply()<MAX_NFTS
"Mint exceeds max supply"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract Coyote is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_NFTS = 10000; uint256 public constant PRICE_PRE_SALE = 0.1 ether; uint256 public constant PRICE_PUBLIC_SALE = 0.2 ether; uint256 public constant PRICE_FLOOR = 0.1 ether; uint256 public constant PRICE_TICK = 0.02 ether; uint256 public constant SECONDS_BETWEEN_TICK = 3600; // 1 hour uint256 public constant MAX_PER_MINT = 7; uint256 public constant PRESALE_MAX_MINT = 3; uint256 public constant MAX_NFTS_MINT = 70; uint256 public constant RESERVED_NFTS = 250; address public constant daoAddress = 0xa78AdA29f1c8cBECdb3FAf5f00CEa5b661ab7013; address public constant teamAddress = 0x2ED93945571344675038fBF92C06094E608bB2FC; address public constant founderAddress = 0x46391ED2FC671FF3D76cB3475C742f8691a3c9Cf; address public constant projectAddress = 0xb9f2eB35ed71fA2ee90Fa6b08AB16c2828b4D58D; uint256 private pricePublicSale = PRICE_PUBLIC_SALE; bool private customPrice; uint256 public publicSaleStartDate; uint256 public reservedClaimed; uint256 public numNftsMinted; string public baseTokenURI; bool public publicSaleStarted; bool public presaleStarted; mapping(address => bool) private _presaleEligible; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PresaleMint(address minter, uint256 amountOfNfts); event PublicSaleMint(address minter, uint256 amountOfNfts); modifier whenPresaleStarted() { } modifier whenPublicSaleStarted() { } constructor(string memory baseURI) ERC721("Billionaire Coyote Cartel", "BCC") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { require(reservedClaimed != RESERVED_NFTS, "You have already claimed all reserved nfts"); require(reservedClaimed + amount <= RESERVED_NFTS, "Mint exceeds max reserved nfts"); require(recipient != address(0), "Cannot add null address"); require(totalSupply() < MAX_NFTS, "All NFTs have been minted"); require(<FILL_ME>) uint256 _nextTokenId = numNftsMinted + 1; for (uint256 i = 0; i < amount; i++) { _safeMint(recipient, _nextTokenId + i); } numNftsMinted += amount; reservedClaimed += amount; } function addToPresale(address[] calldata addresses) external onlyOwner { } function getPublicSalePrice() public view returns(uint256) { } function checkPresaleEligiblity(address addr) external view returns (bool) { } function amountClaimedBy(address owner) external view returns (uint256) { } function mintPresale(uint256 amountOfNfts) external payable whenPresaleStarted { } function updatePrice() private { } function mint(uint256 amountOfNfts) external payable whenPublicSaleStarted { } function togglePresaleStarted() external onlyOwner { } function setPrice(uint256 _price) external onlyOwner { } function togglePublicSaleStarted() external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdrawAll() public onlyOwner { } function _widthdraw(address _address, uint256 _amount) private { } }
totalSupply()+amount<=MAX_NFTS,"Mint exceeds max supply"
333,165
totalSupply()+amount<=MAX_NFTS
"Mint exceeds max supply"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract Coyote is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_NFTS = 10000; uint256 public constant PRICE_PRE_SALE = 0.1 ether; uint256 public constant PRICE_PUBLIC_SALE = 0.2 ether; uint256 public constant PRICE_FLOOR = 0.1 ether; uint256 public constant PRICE_TICK = 0.02 ether; uint256 public constant SECONDS_BETWEEN_TICK = 3600; // 1 hour uint256 public constant MAX_PER_MINT = 7; uint256 public constant PRESALE_MAX_MINT = 3; uint256 public constant MAX_NFTS_MINT = 70; uint256 public constant RESERVED_NFTS = 250; address public constant daoAddress = 0xa78AdA29f1c8cBECdb3FAf5f00CEa5b661ab7013; address public constant teamAddress = 0x2ED93945571344675038fBF92C06094E608bB2FC; address public constant founderAddress = 0x46391ED2FC671FF3D76cB3475C742f8691a3c9Cf; address public constant projectAddress = 0xb9f2eB35ed71fA2ee90Fa6b08AB16c2828b4D58D; uint256 private pricePublicSale = PRICE_PUBLIC_SALE; bool private customPrice; uint256 public publicSaleStartDate; uint256 public reservedClaimed; uint256 public numNftsMinted; string public baseTokenURI; bool public publicSaleStarted; bool public presaleStarted; mapping(address => bool) private _presaleEligible; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PresaleMint(address minter, uint256 amountOfNfts); event PublicSaleMint(address minter, uint256 amountOfNfts); modifier whenPresaleStarted() { } modifier whenPublicSaleStarted() { } constructor(string memory baseURI) ERC721("Billionaire Coyote Cartel", "BCC") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { } function addToPresale(address[] calldata addresses) external onlyOwner { } function getPublicSalePrice() public view returns(uint256) { } function checkPresaleEligiblity(address addr) external view returns (bool) { } function amountClaimedBy(address owner) external view returns (uint256) { } function mintPresale(uint256 amountOfNfts) external payable whenPresaleStarted { require(_presaleEligible[msg.sender], "You are not whitelisted for the presale"); require(totalSupply() < MAX_NFTS, "All NFTs have been minted"); require(amountOfNfts <= PRESALE_MAX_MINT, "Purchase exceeds presale limit"); require(<FILL_ME>) require(_totalClaimed[msg.sender] + amountOfNfts <= PRESALE_MAX_MINT, "Purchase exceeds max allowed"); require(amountOfNfts > 0, "Must mint at least one NFT"); require(PRICE_PRE_SALE * amountOfNfts == msg.value, "ETH amount is incorrect"); for (uint256 i = 0; i < amountOfNfts; i++) { uint256 tokenId = numNftsMinted + 1; numNftsMinted += 1; _totalClaimed[msg.sender] += 1; _safeMint(msg.sender, tokenId); } emit PresaleMint(msg.sender, amountOfNfts); } function updatePrice() private { } function mint(uint256 amountOfNfts) external payable whenPublicSaleStarted { } function togglePresaleStarted() external onlyOwner { } function setPrice(uint256 _price) external onlyOwner { } function togglePublicSaleStarted() external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdrawAll() public onlyOwner { } function _widthdraw(address _address, uint256 _amount) private { } }
totalSupply()+amountOfNfts<=MAX_NFTS,"Mint exceeds max supply"
333,165
totalSupply()+amountOfNfts<=MAX_NFTS
"Purchase exceeds max allowed"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract Coyote is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_NFTS = 10000; uint256 public constant PRICE_PRE_SALE = 0.1 ether; uint256 public constant PRICE_PUBLIC_SALE = 0.2 ether; uint256 public constant PRICE_FLOOR = 0.1 ether; uint256 public constant PRICE_TICK = 0.02 ether; uint256 public constant SECONDS_BETWEEN_TICK = 3600; // 1 hour uint256 public constant MAX_PER_MINT = 7; uint256 public constant PRESALE_MAX_MINT = 3; uint256 public constant MAX_NFTS_MINT = 70; uint256 public constant RESERVED_NFTS = 250; address public constant daoAddress = 0xa78AdA29f1c8cBECdb3FAf5f00CEa5b661ab7013; address public constant teamAddress = 0x2ED93945571344675038fBF92C06094E608bB2FC; address public constant founderAddress = 0x46391ED2FC671FF3D76cB3475C742f8691a3c9Cf; address public constant projectAddress = 0xb9f2eB35ed71fA2ee90Fa6b08AB16c2828b4D58D; uint256 private pricePublicSale = PRICE_PUBLIC_SALE; bool private customPrice; uint256 public publicSaleStartDate; uint256 public reservedClaimed; uint256 public numNftsMinted; string public baseTokenURI; bool public publicSaleStarted; bool public presaleStarted; mapping(address => bool) private _presaleEligible; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PresaleMint(address minter, uint256 amountOfNfts); event PublicSaleMint(address minter, uint256 amountOfNfts); modifier whenPresaleStarted() { } modifier whenPublicSaleStarted() { } constructor(string memory baseURI) ERC721("Billionaire Coyote Cartel", "BCC") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { } function addToPresale(address[] calldata addresses) external onlyOwner { } function getPublicSalePrice() public view returns(uint256) { } function checkPresaleEligiblity(address addr) external view returns (bool) { } function amountClaimedBy(address owner) external view returns (uint256) { } function mintPresale(uint256 amountOfNfts) external payable whenPresaleStarted { require(_presaleEligible[msg.sender], "You are not whitelisted for the presale"); require(totalSupply() < MAX_NFTS, "All NFTs have been minted"); require(amountOfNfts <= PRESALE_MAX_MINT, "Purchase exceeds presale limit"); require(totalSupply() + amountOfNfts <= MAX_NFTS, "Mint exceeds max supply"); require(<FILL_ME>) require(amountOfNfts > 0, "Must mint at least one NFT"); require(PRICE_PRE_SALE * amountOfNfts == msg.value, "ETH amount is incorrect"); for (uint256 i = 0; i < amountOfNfts; i++) { uint256 tokenId = numNftsMinted + 1; numNftsMinted += 1; _totalClaimed[msg.sender] += 1; _safeMint(msg.sender, tokenId); } emit PresaleMint(msg.sender, amountOfNfts); } function updatePrice() private { } function mint(uint256 amountOfNfts) external payable whenPublicSaleStarted { } function togglePresaleStarted() external onlyOwner { } function setPrice(uint256 _price) external onlyOwner { } function togglePublicSaleStarted() external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdrawAll() public onlyOwner { } function _widthdraw(address _address, uint256 _amount) private { } }
_totalClaimed[msg.sender]+amountOfNfts<=PRESALE_MAX_MINT,"Purchase exceeds max allowed"
333,165
_totalClaimed[msg.sender]+amountOfNfts<=PRESALE_MAX_MINT
"ETH amount is incorrect"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract Coyote is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_NFTS = 10000; uint256 public constant PRICE_PRE_SALE = 0.1 ether; uint256 public constant PRICE_PUBLIC_SALE = 0.2 ether; uint256 public constant PRICE_FLOOR = 0.1 ether; uint256 public constant PRICE_TICK = 0.02 ether; uint256 public constant SECONDS_BETWEEN_TICK = 3600; // 1 hour uint256 public constant MAX_PER_MINT = 7; uint256 public constant PRESALE_MAX_MINT = 3; uint256 public constant MAX_NFTS_MINT = 70; uint256 public constant RESERVED_NFTS = 250; address public constant daoAddress = 0xa78AdA29f1c8cBECdb3FAf5f00CEa5b661ab7013; address public constant teamAddress = 0x2ED93945571344675038fBF92C06094E608bB2FC; address public constant founderAddress = 0x46391ED2FC671FF3D76cB3475C742f8691a3c9Cf; address public constant projectAddress = 0xb9f2eB35ed71fA2ee90Fa6b08AB16c2828b4D58D; uint256 private pricePublicSale = PRICE_PUBLIC_SALE; bool private customPrice; uint256 public publicSaleStartDate; uint256 public reservedClaimed; uint256 public numNftsMinted; string public baseTokenURI; bool public publicSaleStarted; bool public presaleStarted; mapping(address => bool) private _presaleEligible; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PresaleMint(address minter, uint256 amountOfNfts); event PublicSaleMint(address minter, uint256 amountOfNfts); modifier whenPresaleStarted() { } modifier whenPublicSaleStarted() { } constructor(string memory baseURI) ERC721("Billionaire Coyote Cartel", "BCC") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { } function addToPresale(address[] calldata addresses) external onlyOwner { } function getPublicSalePrice() public view returns(uint256) { } function checkPresaleEligiblity(address addr) external view returns (bool) { } function amountClaimedBy(address owner) external view returns (uint256) { } function mintPresale(uint256 amountOfNfts) external payable whenPresaleStarted { require(_presaleEligible[msg.sender], "You are not whitelisted for the presale"); require(totalSupply() < MAX_NFTS, "All NFTs have been minted"); require(amountOfNfts <= PRESALE_MAX_MINT, "Purchase exceeds presale limit"); require(totalSupply() + amountOfNfts <= MAX_NFTS, "Mint exceeds max supply"); require(_totalClaimed[msg.sender] + amountOfNfts <= PRESALE_MAX_MINT, "Purchase exceeds max allowed"); require(amountOfNfts > 0, "Must mint at least one NFT"); require(<FILL_ME>) for (uint256 i = 0; i < amountOfNfts; i++) { uint256 tokenId = numNftsMinted + 1; numNftsMinted += 1; _totalClaimed[msg.sender] += 1; _safeMint(msg.sender, tokenId); } emit PresaleMint(msg.sender, amountOfNfts); } function updatePrice() private { } function mint(uint256 amountOfNfts) external payable whenPublicSaleStarted { } function togglePresaleStarted() external onlyOwner { } function setPrice(uint256 _price) external onlyOwner { } function togglePublicSaleStarted() external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdrawAll() public onlyOwner { } function _widthdraw(address _address, uint256 _amount) private { } }
PRICE_PRE_SALE*amountOfNfts==msg.value,"ETH amount is incorrect"
333,165
PRICE_PRE_SALE*amountOfNfts==msg.value
"Amount exceeds max NFTs per wallet"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract Coyote is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_NFTS = 10000; uint256 public constant PRICE_PRE_SALE = 0.1 ether; uint256 public constant PRICE_PUBLIC_SALE = 0.2 ether; uint256 public constant PRICE_FLOOR = 0.1 ether; uint256 public constant PRICE_TICK = 0.02 ether; uint256 public constant SECONDS_BETWEEN_TICK = 3600; // 1 hour uint256 public constant MAX_PER_MINT = 7; uint256 public constant PRESALE_MAX_MINT = 3; uint256 public constant MAX_NFTS_MINT = 70; uint256 public constant RESERVED_NFTS = 250; address public constant daoAddress = 0xa78AdA29f1c8cBECdb3FAf5f00CEa5b661ab7013; address public constant teamAddress = 0x2ED93945571344675038fBF92C06094E608bB2FC; address public constant founderAddress = 0x46391ED2FC671FF3D76cB3475C742f8691a3c9Cf; address public constant projectAddress = 0xb9f2eB35ed71fA2ee90Fa6b08AB16c2828b4D58D; uint256 private pricePublicSale = PRICE_PUBLIC_SALE; bool private customPrice; uint256 public publicSaleStartDate; uint256 public reservedClaimed; uint256 public numNftsMinted; string public baseTokenURI; bool public publicSaleStarted; bool public presaleStarted; mapping(address => bool) private _presaleEligible; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PresaleMint(address minter, uint256 amountOfNfts); event PublicSaleMint(address minter, uint256 amountOfNfts); modifier whenPresaleStarted() { } modifier whenPublicSaleStarted() { } constructor(string memory baseURI) ERC721("Billionaire Coyote Cartel", "BCC") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { } function addToPresale(address[] calldata addresses) external onlyOwner { } function getPublicSalePrice() public view returns(uint256) { } function checkPresaleEligiblity(address addr) external view returns (bool) { } function amountClaimedBy(address owner) external view returns (uint256) { } function mintPresale(uint256 amountOfNfts) external payable whenPresaleStarted { } function updatePrice() private { } function mint(uint256 amountOfNfts) external payable whenPublicSaleStarted { updatePrice(); require(totalSupply() < MAX_NFTS, "All NFTs have been minted"); require(amountOfNfts <= MAX_PER_MINT, "Amount exceeds NFTs per transaction"); require(totalSupply() + amountOfNfts <= MAX_NFTS, "Mint exceeds max supply"); require(<FILL_ME>) require(amountOfNfts > 0, "Must mint at least one NFT"); require(pricePublicSale * amountOfNfts == msg.value, "Amount of ETH is incorrect"); for (uint256 i = 0; i < amountOfNfts; i++) { uint256 tokenId = numNftsMinted + 1; numNftsMinted += 1; _totalClaimed[msg.sender] += 1; _safeMint(msg.sender, tokenId); } emit PublicSaleMint(msg.sender, amountOfNfts); } function togglePresaleStarted() external onlyOwner { } function setPrice(uint256 _price) external onlyOwner { } function togglePublicSaleStarted() external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdrawAll() public onlyOwner { } function _widthdraw(address _address, uint256 _amount) private { } }
_totalClaimed[msg.sender]+amountOfNfts<=MAX_NFTS_MINT,"Amount exceeds max NFTs per wallet"
333,165
_totalClaimed[msg.sender]+amountOfNfts<=MAX_NFTS_MINT
"Amount of ETH is incorrect"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract Coyote is ERC721Enumerable, Ownable { using Strings for uint256; uint256 public constant MAX_NFTS = 10000; uint256 public constant PRICE_PRE_SALE = 0.1 ether; uint256 public constant PRICE_PUBLIC_SALE = 0.2 ether; uint256 public constant PRICE_FLOOR = 0.1 ether; uint256 public constant PRICE_TICK = 0.02 ether; uint256 public constant SECONDS_BETWEEN_TICK = 3600; // 1 hour uint256 public constant MAX_PER_MINT = 7; uint256 public constant PRESALE_MAX_MINT = 3; uint256 public constant MAX_NFTS_MINT = 70; uint256 public constant RESERVED_NFTS = 250; address public constant daoAddress = 0xa78AdA29f1c8cBECdb3FAf5f00CEa5b661ab7013; address public constant teamAddress = 0x2ED93945571344675038fBF92C06094E608bB2FC; address public constant founderAddress = 0x46391ED2FC671FF3D76cB3475C742f8691a3c9Cf; address public constant projectAddress = 0xb9f2eB35ed71fA2ee90Fa6b08AB16c2828b4D58D; uint256 private pricePublicSale = PRICE_PUBLIC_SALE; bool private customPrice; uint256 public publicSaleStartDate; uint256 public reservedClaimed; uint256 public numNftsMinted; string public baseTokenURI; bool public publicSaleStarted; bool public presaleStarted; mapping(address => bool) private _presaleEligible; mapping(address => uint256) private _totalClaimed; event BaseURIChanged(string baseURI); event PresaleMint(address minter, uint256 amountOfNfts); event PublicSaleMint(address minter, uint256 amountOfNfts); modifier whenPresaleStarted() { } modifier whenPublicSaleStarted() { } constructor(string memory baseURI) ERC721("Billionaire Coyote Cartel", "BCC") { } function claimReserved(address recipient, uint256 amount) external onlyOwner { } function addToPresale(address[] calldata addresses) external onlyOwner { } function getPublicSalePrice() public view returns(uint256) { } function checkPresaleEligiblity(address addr) external view returns (bool) { } function amountClaimedBy(address owner) external view returns (uint256) { } function mintPresale(uint256 amountOfNfts) external payable whenPresaleStarted { } function updatePrice() private { } function mint(uint256 amountOfNfts) external payable whenPublicSaleStarted { updatePrice(); require(totalSupply() < MAX_NFTS, "All NFTs have been minted"); require(amountOfNfts <= MAX_PER_MINT, "Amount exceeds NFTs per transaction"); require(totalSupply() + amountOfNfts <= MAX_NFTS, "Mint exceeds max supply"); require(_totalClaimed[msg.sender] + amountOfNfts <= MAX_NFTS_MINT, "Amount exceeds max NFTs per wallet"); require(amountOfNfts > 0, "Must mint at least one NFT"); require(<FILL_ME>) for (uint256 i = 0; i < amountOfNfts; i++) { uint256 tokenId = numNftsMinted + 1; numNftsMinted += 1; _totalClaimed[msg.sender] += 1; _safeMint(msg.sender, tokenId); } emit PublicSaleMint(msg.sender, amountOfNfts); } function togglePresaleStarted() external onlyOwner { } function setPrice(uint256 _price) external onlyOwner { } function togglePublicSaleStarted() external onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function withdrawAll() public onlyOwner { } function _widthdraw(address _address, uint256 _amount) private { } }
pricePublicSale*amountOfNfts==msg.value,"Amount of ETH is incorrect"
333,165
pricePublicSale*amountOfNfts==msg.value
"User-not-KYC"
pragma solidity ^0.7.0; contract SaleManager is Ownable, Pausable { function pause() public onlyOwner { } function unPause() public onlyOwner { } } interface IUniswapV2Router02 { function swapExactETHForTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external virtual payable returns (uint[] memory amounts); } contract Presale is SaleManager { using SafeMath for uint; using SafeERC20 for ERC20; uint public constant ZOOM_SOTA = 10 ** 18; uint public constant ZOOM_USDT = 10 ** 6; uint public price = 10 ** 5; // price / zoom = 0.1 uint public MIN_AMOUNT = 200 * 10 ** 6; // 200 usdt uint public MAX_AMOUNT = 20000 * 10 ** 6; // 10000 usdt address public usdt = 0xdAC17F958D2ee523a2206206994597C13D831ec7; address public uniRouterV2 = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address public sota = 0x0DDe6F6e345bfd23f3F419F0DFe04E93143b44FB; address public hot_wallet; mapping (address => uint) public totalBuy; mapping (address => bool) public whiteListSigner; event Buy( address indexed buyer, uint indexed usdtAmount, uint indexed sotaAmount); modifier isBuyable(bytes memory sign) { require(!paused(), "Paused"); require(<FILL_ME>) _; } constructor() public { } function isValidAmount(uint usdtAmout) private returns (bool) { } /** * @dev calculate sota token amount * @param usdtAmount amount USDT user deposit to buy */ function calSota(uint usdtAmount) private returns (uint) { } /** * @dev calculate usdt token amount * @param sotaAmount amount SOTA user buy */ function calUSDT(uint sotaAmount) private returns (uint) { } /** * @dev allow user buy SOTA with USDT * @param usdtAmount amount USDT user deposit to buy */ function buyWithUSDT( uint usdtAmount, bytes memory sign ) isBuyable(sign) public returns (bool) { } /** * @dev get path for exchange ETH->WETH->USDT via Uniswap */ function getPathUSDTWETH() private pure returns (address[] memory) { } /** * @dev allow user buy SOTA with ETH, swap ETH to USDT though uniswap * @param expectedUSDT is min amount USDT user expect when swap from ETH * @param deadline is deadline of transaction can be process */ function buyWithETH( uint expectedUSDT, uint deadline, bytes memory sign ) payable isBuyable(sign) public returns (bool){ } // ADMIN FEATURES /** * @dev admin set hot wallet */ function changeHotWallet(address _newWallet) public onlyOwner returns (bool) { } function adminTransferSota(address _to, uint _sotaAmount) public returns (bool) { } function adminWhiteList(address _signer, bool _whiteList) public onlyOwner returns (bool) { } function isKYC(bytes memory signature) private returns (bool) { } function getRecoveredAddress(bytes memory sig, bytes32 dataHash) private pure returns (address) { } }
isKYC(sign),"User-not-KYC"
333,345
isKYC(sign)
"Invalid-amount-USDT"
pragma solidity ^0.7.0; contract SaleManager is Ownable, Pausable { function pause() public onlyOwner { } function unPause() public onlyOwner { } } interface IUniswapV2Router02 { function swapExactETHForTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external virtual payable returns (uint[] memory amounts); } contract Presale is SaleManager { using SafeMath for uint; using SafeERC20 for ERC20; uint public constant ZOOM_SOTA = 10 ** 18; uint public constant ZOOM_USDT = 10 ** 6; uint public price = 10 ** 5; // price / zoom = 0.1 uint public MIN_AMOUNT = 200 * 10 ** 6; // 200 usdt uint public MAX_AMOUNT = 20000 * 10 ** 6; // 10000 usdt address public usdt = 0xdAC17F958D2ee523a2206206994597C13D831ec7; address public uniRouterV2 = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address public sota = 0x0DDe6F6e345bfd23f3F419F0DFe04E93143b44FB; address public hot_wallet; mapping (address => uint) public totalBuy; mapping (address => bool) public whiteListSigner; event Buy( address indexed buyer, uint indexed usdtAmount, uint indexed sotaAmount); modifier isBuyable(bytes memory sign) { } constructor() public { } function isValidAmount(uint usdtAmout) private returns (bool) { } /** * @dev calculate sota token amount * @param usdtAmount amount USDT user deposit to buy */ function calSota(uint usdtAmount) private returns (uint) { } /** * @dev calculate usdt token amount * @param sotaAmount amount SOTA user buy */ function calUSDT(uint sotaAmount) private returns (uint) { } /** * @dev allow user buy SOTA with USDT * @param usdtAmount amount USDT user deposit to buy */ function buyWithUSDT( uint usdtAmount, bytes memory sign ) isBuyable(sign) public returns (bool) { require(<FILL_ME>) //transfer USDT to hot_wallet directly ERC20(usdt).safeTransferFrom(msg.sender, hot_wallet, usdtAmount); uint sotaAmount = calSota(usdtAmount); IERC20(sota).transfer(msg.sender, sotaAmount); totalBuy[msg.sender] = totalBuy[msg.sender].add(usdtAmount); emit Buy(msg.sender, usdtAmount, sotaAmount); return true; } /** * @dev get path for exchange ETH->WETH->USDT via Uniswap */ function getPathUSDTWETH() private pure returns (address[] memory) { } /** * @dev allow user buy SOTA with ETH, swap ETH to USDT though uniswap * @param expectedUSDT is min amount USDT user expect when swap from ETH * @param deadline is deadline of transaction can be process */ function buyWithETH( uint expectedUSDT, uint deadline, bytes memory sign ) payable isBuyable(sign) public returns (bool){ } // ADMIN FEATURES /** * @dev admin set hot wallet */ function changeHotWallet(address _newWallet) public onlyOwner returns (bool) { } function adminTransferSota(address _to, uint _sotaAmount) public returns (bool) { } function adminWhiteList(address _signer, bool _whiteList) public onlyOwner returns (bool) { } function isKYC(bytes memory signature) private returns (bool) { } function getRecoveredAddress(bytes memory sig, bytes32 dataHash) private pure returns (address) { } }
isValidAmount(usdtAmount),"Invalid-amount-USDT"
333,345
isValidAmount(usdtAmount)
"Invalid-amount-USDT"
pragma solidity ^0.7.0; contract SaleManager is Ownable, Pausable { function pause() public onlyOwner { } function unPause() public onlyOwner { } } interface IUniswapV2Router02 { function swapExactETHForTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external virtual payable returns (uint[] memory amounts); } contract Presale is SaleManager { using SafeMath for uint; using SafeERC20 for ERC20; uint public constant ZOOM_SOTA = 10 ** 18; uint public constant ZOOM_USDT = 10 ** 6; uint public price = 10 ** 5; // price / zoom = 0.1 uint public MIN_AMOUNT = 200 * 10 ** 6; // 200 usdt uint public MAX_AMOUNT = 20000 * 10 ** 6; // 10000 usdt address public usdt = 0xdAC17F958D2ee523a2206206994597C13D831ec7; address public uniRouterV2 = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address public sota = 0x0DDe6F6e345bfd23f3F419F0DFe04E93143b44FB; address public hot_wallet; mapping (address => uint) public totalBuy; mapping (address => bool) public whiteListSigner; event Buy( address indexed buyer, uint indexed usdtAmount, uint indexed sotaAmount); modifier isBuyable(bytes memory sign) { } constructor() public { } function isValidAmount(uint usdtAmout) private returns (bool) { } /** * @dev calculate sota token amount * @param usdtAmount amount USDT user deposit to buy */ function calSota(uint usdtAmount) private returns (uint) { } /** * @dev calculate usdt token amount * @param sotaAmount amount SOTA user buy */ function calUSDT(uint sotaAmount) private returns (uint) { } /** * @dev allow user buy SOTA with USDT * @param usdtAmount amount USDT user deposit to buy */ function buyWithUSDT( uint usdtAmount, bytes memory sign ) isBuyable(sign) public returns (bool) { } /** * @dev get path for exchange ETH->WETH->USDT via Uniswap */ function getPathUSDTWETH() private pure returns (address[] memory) { } /** * @dev allow user buy SOTA with ETH, swap ETH to USDT though uniswap * @param expectedUSDT is min amount USDT user expect when swap from ETH * @param deadline is deadline of transaction can be process */ function buyWithETH( uint expectedUSDT, uint deadline, bytes memory sign ) payable isBuyable(sign) public returns (bool){ // swap ETH for USDT via Uniswap return amounts receive if success // transfer USDT to hot_wallet directly uint[] memory amounts = IUniswapV2Router02(uniRouterV2).swapExactETHForTokens{value: msg.value}( expectedUSDT, getPathUSDTWETH(), hot_wallet, deadline ); // amounts[0] = WETH, amounts[1] = USDT // calculate sota token amount from usdt received require(<FILL_ME>) uint sotaAmount = calSota(amounts[1]); // IERC20(sota).transfer(msg.sender, sotaAmount); totalBuy[msg.sender] = totalBuy[msg.sender].add(amounts[1]); emit Buy(msg.sender, amounts[1], sotaAmount); return true; } // ADMIN FEATURES /** * @dev admin set hot wallet */ function changeHotWallet(address _newWallet) public onlyOwner returns (bool) { } function adminTransferSota(address _to, uint _sotaAmount) public returns (bool) { } function adminWhiteList(address _signer, bool _whiteList) public onlyOwner returns (bool) { } function isKYC(bytes memory signature) private returns (bool) { } function getRecoveredAddress(bytes memory sig, bytes32 dataHash) private pure returns (address) { } }
isValidAmount(amounts[1]),"Invalid-amount-USDT"
333,345
isValidAmount(amounts[1])
"Only-whitelist"
pragma solidity ^0.7.0; contract SaleManager is Ownable, Pausable { function pause() public onlyOwner { } function unPause() public onlyOwner { } } interface IUniswapV2Router02 { function swapExactETHForTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external virtual payable returns (uint[] memory amounts); } contract Presale is SaleManager { using SafeMath for uint; using SafeERC20 for ERC20; uint public constant ZOOM_SOTA = 10 ** 18; uint public constant ZOOM_USDT = 10 ** 6; uint public price = 10 ** 5; // price / zoom = 0.1 uint public MIN_AMOUNT = 200 * 10 ** 6; // 200 usdt uint public MAX_AMOUNT = 20000 * 10 ** 6; // 10000 usdt address public usdt = 0xdAC17F958D2ee523a2206206994597C13D831ec7; address public uniRouterV2 = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address public sota = 0x0DDe6F6e345bfd23f3F419F0DFe04E93143b44FB; address public hot_wallet; mapping (address => uint) public totalBuy; mapping (address => bool) public whiteListSigner; event Buy( address indexed buyer, uint indexed usdtAmount, uint indexed sotaAmount); modifier isBuyable(bytes memory sign) { } constructor() public { } function isValidAmount(uint usdtAmout) private returns (bool) { } /** * @dev calculate sota token amount * @param usdtAmount amount USDT user deposit to buy */ function calSota(uint usdtAmount) private returns (uint) { } /** * @dev calculate usdt token amount * @param sotaAmount amount SOTA user buy */ function calUSDT(uint sotaAmount) private returns (uint) { } /** * @dev allow user buy SOTA with USDT * @param usdtAmount amount USDT user deposit to buy */ function buyWithUSDT( uint usdtAmount, bytes memory sign ) isBuyable(sign) public returns (bool) { } /** * @dev get path for exchange ETH->WETH->USDT via Uniswap */ function getPathUSDTWETH() private pure returns (address[] memory) { } /** * @dev allow user buy SOTA with ETH, swap ETH to USDT though uniswap * @param expectedUSDT is min amount USDT user expect when swap from ETH * @param deadline is deadline of transaction can be process */ function buyWithETH( uint expectedUSDT, uint deadline, bytes memory sign ) payable isBuyable(sign) public returns (bool){ } // ADMIN FEATURES /** * @dev admin set hot wallet */ function changeHotWallet(address _newWallet) public onlyOwner returns (bool) { } function adminTransferSota(address _to, uint _sotaAmount) public returns (bool) { require(<FILL_ME>) IERC20(sota).transfer(_to, _sotaAmount); uint amountUSDT = calUSDT(_sotaAmount); require(isValidAmount(amountUSDT), "Invalid-amount-USDT"); totalBuy[_to] = totalBuy[_to].add(amountUSDT); emit Buy(_to, amountUSDT, _sotaAmount); return true; } function adminWhiteList(address _signer, bool _whiteList) public onlyOwner returns (bool) { } function isKYC(bytes memory signature) private returns (bool) { } function getRecoveredAddress(bytes memory sig, bytes32 dataHash) private pure returns (address) { } }
whiteListSigner[msg.sender],"Only-whitelist"
333,345
whiteListSigner[msg.sender]
"Invalid-amount-USDT"
pragma solidity ^0.7.0; contract SaleManager is Ownable, Pausable { function pause() public onlyOwner { } function unPause() public onlyOwner { } } interface IUniswapV2Router02 { function swapExactETHForTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external virtual payable returns (uint[] memory amounts); } contract Presale is SaleManager { using SafeMath for uint; using SafeERC20 for ERC20; uint public constant ZOOM_SOTA = 10 ** 18; uint public constant ZOOM_USDT = 10 ** 6; uint public price = 10 ** 5; // price / zoom = 0.1 uint public MIN_AMOUNT = 200 * 10 ** 6; // 200 usdt uint public MAX_AMOUNT = 20000 * 10 ** 6; // 10000 usdt address public usdt = 0xdAC17F958D2ee523a2206206994597C13D831ec7; address public uniRouterV2 = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address public sota = 0x0DDe6F6e345bfd23f3F419F0DFe04E93143b44FB; address public hot_wallet; mapping (address => uint) public totalBuy; mapping (address => bool) public whiteListSigner; event Buy( address indexed buyer, uint indexed usdtAmount, uint indexed sotaAmount); modifier isBuyable(bytes memory sign) { } constructor() public { } function isValidAmount(uint usdtAmout) private returns (bool) { } /** * @dev calculate sota token amount * @param usdtAmount amount USDT user deposit to buy */ function calSota(uint usdtAmount) private returns (uint) { } /** * @dev calculate usdt token amount * @param sotaAmount amount SOTA user buy */ function calUSDT(uint sotaAmount) private returns (uint) { } /** * @dev allow user buy SOTA with USDT * @param usdtAmount amount USDT user deposit to buy */ function buyWithUSDT( uint usdtAmount, bytes memory sign ) isBuyable(sign) public returns (bool) { } /** * @dev get path for exchange ETH->WETH->USDT via Uniswap */ function getPathUSDTWETH() private pure returns (address[] memory) { } /** * @dev allow user buy SOTA with ETH, swap ETH to USDT though uniswap * @param expectedUSDT is min amount USDT user expect when swap from ETH * @param deadline is deadline of transaction can be process */ function buyWithETH( uint expectedUSDT, uint deadline, bytes memory sign ) payable isBuyable(sign) public returns (bool){ } // ADMIN FEATURES /** * @dev admin set hot wallet */ function changeHotWallet(address _newWallet) public onlyOwner returns (bool) { } function adminTransferSota(address _to, uint _sotaAmount) public returns (bool) { require(whiteListSigner[msg.sender], "Only-whitelist"); IERC20(sota).transfer(_to, _sotaAmount); uint amountUSDT = calUSDT(_sotaAmount); require(<FILL_ME>) totalBuy[_to] = totalBuy[_to].add(amountUSDT); emit Buy(_to, amountUSDT, _sotaAmount); return true; } function adminWhiteList(address _signer, bool _whiteList) public onlyOwner returns (bool) { } function isKYC(bytes memory signature) private returns (bool) { } function getRecoveredAddress(bytes memory sig, bytes32 dataHash) private pure returns (address) { } }
isValidAmount(amountUSDT),"Invalid-amount-USDT"
333,345
isValidAmount(amountUSDT)
"Cannot exceed max supply"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.6; import "./Owner.sol"; import "./Dilithium.sol"; import "./libraries/token/ERC20/ERC20.sol"; /// @dev Latinum ERC20 contract contract Latinum is ERC20("Latinum", "LTN"), Owner { Dilithium public dil; // maxSupply is the initial maximum number of Latinum uint256 public maxSupply = 150000000000000000000000000; /// @dev constructor. /// @dev dilAddr is the Dilithium token contract. constructor(address dilAddr) public { } /// @dev mint mints and allocates new Latinum to an account. /// @param account is the recipient account. /// @param amt is the amount of Latinum minted. function mint(address account, uint256 amt) public isOwner() { require(<FILL_ME>) _mint(account, amt); } }
totalSupply()+amt<=maxSupply,"Cannot exceed max supply"
333,446
totalSupply()+amt<=maxSupply
"No tokens to transfer"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.12; import { IERC20 } from "./IERC20.sol"; import { Context } from "./Context.sol"; abstract contract UtilitiesBase is Context { modifier NonZeroAmount(uint256 _amount) { } modifier NonZeroTokenBalance(address _address) { require(<FILL_ME>) _; } modifier NonZeroETHBalance(address _address) { } modifier OnlyOrigin { } }
IERC20(_address).balanceOf(address(this))>0,"No tokens to transfer"
333,527
IERC20(_address).balanceOf(address(this))>0
"Exceeds maximum Souls supply"
// SPDX-License-Identifier: MIT // Lost Souls Sanctuary's research has lead us to uncover earth shattering truths about how our souls navigate in the after-life. // What we've found is truly shocking, something that various three letter agencies won't like, or worse try to supress/slander if the information was released via mutable channels. // Souls roam this very earth frantically trying to make whole with the universe before their time is up and they are forever striken to the bowels of the underworld. // All hope is not lost! Though the discovery of the Higgs boson particle a group of ghost-savers have established communication with 10,000 Lost Souls and struck a deal. // The deal: a Sanctuary will be setup to help the Souls discover their mistakes, changes their lives and pass through to the elusive good place, // in return the Lost Souls Sanctuary will be given exclusive access to study the ectoplasmic layer the Soul's reside in so we may better understand our mortal role here on Earth. // // <3 LS Sanctuary team // @glu pragma solidity ^0.8.0; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; contract LostSoulsSanctuary is ERC721Enumerable, Ownable { string public SOUL_PROVENANCE = ""; string _baseTokenURI; uint256 public constant MAX_SOULS = 9999; uint256 private soulReserved = 125; uint256 public constant maxSoulsPurchase = 20; uint256 private soulPrice = 0.03 ether; bool public salePaused = true; // Team - 50% address t1; address t2; address t3; address t4; // 50% - MUTLISIG // 40% MUTLISIG, 10% Charity address t5; constructor( address _t1, address _t2, address _t3, address _t4, address _t5 ) ERC721("LostSoulsSanctuary", "LSS") { } function saveLostSoul(uint256 num) public payable { uint256 supply = totalSupply(); require( !salePaused, "Sale paused" ); require( num <= maxSoulsPurchase, "You can adopt a maximum of 20 Souls" ); require(<FILL_ME>) require( msg.value >= soulPrice * num, "Ether sent is not correct" ); for(uint256 i; i < num; i++){ _safeMint( msg.sender, supply + i ); } } function walletOfOwner(address _owner) public view returns(uint256[] memory) { } function setProvenanceHash(string memory provenanceHash) public onlyOwner { } function setPrice(uint256 _newPrice) public onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function getPrice() public view returns (uint256){ } function reserveSouls(address _to, uint256 _amount) external onlyOwner { } function pause(bool val) public onlyOwner { } function withdrawAll() public payable onlyOwner { } }
supply+num<=MAX_SOULS-soulReserved,"Exceeds maximum Souls supply"
333,544
supply+num<=MAX_SOULS-soulReserved
"Ether value sent is not correct"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721Enumerable.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./Strings.sol"; contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } contract SoulCafe is ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; address proxyRegistryAddress; uint256 public mintPrice = 0.03 ether; uint256 public maxSupply = 3333; uint256 public saleTimeStamp; uint256 public revealTimeStamp; string private BASE_URI = ""; address private sc = 0x78Cd6C571DeA180529C86ed42689dBDd0e5319ce; address private dev = 0xe97D9622C7189C2A2e7eC39A71cf77Bb25344082; constructor( string memory name, string memory symbol, uint256 maxNftSupply, uint256 saleStart, address proxyRegistryAddress_ ) ERC721(name, symbol) { } function withdraw() public onlyOwner { } function reserve(uint256 num, address _to) public onlyOwner { } function setSaleTimestamp(uint256 timeStamp) public onlyOwner { } function setRevealTimestamp(uint256 timeStamp) public onlyOwner { } function setMintPrice(uint256 price) public onlyOwner { } function setMaxSupply(uint256 supply) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function mint(uint256 numberOfTokens) public payable { require(block.timestamp >= saleTimeStamp, "Sale must be active to mint"); require( totalSupply().add(numberOfTokens) <= maxSupply, "Purchase would exceed max supply" ); require(<FILL_ME>) for (uint256 i = 0; i < numberOfTokens; i++) { uint256 mintIndex = totalSupply(); if (totalSupply() < maxSupply) { _mint(msg.sender, mintIndex); } } } function tokenURI(uint256 _tokenId) public view override returns (string memory) { } function isApprovedForAll(address owner, address operator) public view override returns (bool) { } function contractURI() public pure returns (string memory) { } }
mintPrice.mul(numberOfTokens)<=msg.value,"Ether value sent is not correct"
333,661
mintPrice.mul(numberOfTokens)<=msg.value
null
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping(address => mapping(address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { } } /** * @title TREON token * @dev Token for tokensale. */ contract TXOtoken is StandardToken { string public constant name = "TREON"; string public constant symbol = "TXO"; uint8 public constant decimals = 18; // Total Supply 1 Billion uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives the wallet all of existing tokens. */ function TXOtoken(address wallet) public { } } /** * @title TREON token sale * @dev This contract receives money. Redirects money to the wallet. Verifies the correctness of transactions. * @dev Does not produce tokens. All tokens are sent manually, after approval. */ contract TXOsale is Ownable { event ReceiveEther(address indexed from, uint256 value); TXOtoken public token; bool public goalAchieved = false; address public constant wallet = 0x8dA7477d56c90CF2C5b78f36F9E39395ADb2Ae63; // Monday, May 21, 2018 12:00:00 AM uint public constant saleStart = 1526860800; // Tuesday, July 17, 2018 11:59:59 PM uint public constant saleEnd = 1531871999; function TXOsale() public { } /** * @dev fallback function */ function() public payable { require(now >= saleStart && now <= saleEnd); require(<FILL_ME>) require(msg.value >= 0.1 ether); wallet.transfer(msg.value); emit ReceiveEther(msg.sender, msg.value); } /** * @dev The owner can suspend the sale if the HardCap has been achieved. */ function setGoalAchieved(bool _goalAchieved) public onlyOwner { } }
!goalAchieved
333,711
!goalAchieved
"Listing already whitelisted"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { require(<FILL_ME>) require(!appWasMade(listingAddress), "Application already made for this address"); require(_amount >= parameterizer.get("minDeposit"), "Deposit amount not above minDeposit"); // Sets owner Listing storage listing = listings[listingAddress]; listing.owner = msg.sender; // Sets apply stage end time listing.applicationExpiry = block.timestamp.add(parameterizer.get("applyStageLen")); listing.unstakedDeposit = _amount; // Transfers tokens from user to Registry contract require(token.transferFrom(listing.owner, this, _amount), "Token transfer failed"); emit _Application(listingAddress, _amount, listing.applicationExpiry, _data, msg.sender); } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
!isWhitelisted(listingAddress),"Listing already whitelisted"
333,811
!isWhitelisted(listingAddress)
"Application already made for this address"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { require(!isWhitelisted(listingAddress), "Listing already whitelisted"); require(<FILL_ME>) require(_amount >= parameterizer.get("minDeposit"), "Deposit amount not above minDeposit"); // Sets owner Listing storage listing = listings[listingAddress]; listing.owner = msg.sender; // Sets apply stage end time listing.applicationExpiry = block.timestamp.add(parameterizer.get("applyStageLen")); listing.unstakedDeposit = _amount; // Transfers tokens from user to Registry contract require(token.transferFrom(listing.owner, this, _amount), "Token transfer failed"); emit _Application(listingAddress, _amount, listing.applicationExpiry, _data, msg.sender); } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
!appWasMade(listingAddress),"Application already made for this address"
333,811
!appWasMade(listingAddress)
"Token transfer failed"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { require(!isWhitelisted(listingAddress), "Listing already whitelisted"); require(!appWasMade(listingAddress), "Application already made for this address"); require(_amount >= parameterizer.get("minDeposit"), "Deposit amount not above minDeposit"); // Sets owner Listing storage listing = listings[listingAddress]; listing.owner = msg.sender; // Sets apply stage end time listing.applicationExpiry = block.timestamp.add(parameterizer.get("applyStageLen")); listing.unstakedDeposit = _amount; // Transfers tokens from user to Registry contract require(<FILL_ME>) emit _Application(listingAddress, _amount, listing.applicationExpiry, _data, msg.sender); } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
token.transferFrom(listing.owner,this,_amount),"Token transfer failed"
333,811
token.transferFrom(listing.owner,this,_amount)
"Token transfer failed"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { Listing storage listing = listings[listingAddress]; require(listing.owner == msg.sender, "Sender is not owner of Listing"); listing.unstakedDeposit += _amount; require(<FILL_ME>) emit _Deposit(listingAddress, _amount, listing.unstakedDeposit, msg.sender); } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
token.transferFrom(msg.sender,this,_amount),"Token transfer failed"
333,811
token.transferFrom(msg.sender,this,_amount)
"Withdrawal prohibitied as it would put Listing unstaked deposit below minDeposit"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { Listing storage listing = listings[listingAddress]; require(listing.owner == msg.sender, "Sender is not owner of listing"); require(_amount <= listing.unstakedDeposit, "Cannot withdraw more than current unstaked deposit"); if (listing.challengeID == 0 || challenges[listing.challengeID].resolved) { // ok to withdraw entire unstakedDeposit when challenge active as described here: https://github.com/skmgoldin/tcr/issues/55 require(<FILL_ME>) } listing.unstakedDeposit -= _amount; require(token.transfer(msg.sender, _amount), "Token transfer failed"); emit _Withdrawal(listingAddress, _amount, listing.unstakedDeposit, msg.sender); } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
listing.unstakedDeposit-_amount>=parameterizer.get("minDeposit"),"Withdrawal prohibitied as it would put Listing unstaked deposit below minDeposit"
333,811
listing.unstakedDeposit-_amount>=parameterizer.get("minDeposit")
"Listing must be whitelisted to be exited"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { Listing storage listing = listings[listingAddress]; require(msg.sender == listing.owner, "Sender is not owner of listing"); require(<FILL_ME>) // Cannot exit during ongoing challenge require(listing.challengeID == 0 || challenges[listing.challengeID].resolved, "Listing must not have an active challenge to be exited"); // Remove listingHash & return tokens resetListing(listingAddress); emit _ListingWithdrawn(listingAddress); } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
isWhitelisted(listingAddress),"Listing must be whitelisted to be exited"
333,811
isWhitelisted(listingAddress)
"Listing must be in application phase or already whitelisted to be challenged"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { Listing storage listing = listings[listingAddress]; uint minDeposit = parameterizer.get("minDeposit"); // Listing must be in apply stage or already on the whitelist require(<FILL_ME>) // Prevent multiple challenges require(listing.challengeID == 0 || challenges[listing.challengeID].resolved, "Listing must not have active challenge to be challenged"); if (listing.unstakedDeposit < minDeposit) { // Not enough tokens, listingHash auto-delisted resetListing(listingAddress); emit _TouchAndRemoved(listingAddress); return 0; } // Starts poll uint pollID = voting.startPoll( parameterizer.get("voteQuorum"), parameterizer.get("commitStageLen"), parameterizer.get("revealStageLen") ); uint oneHundred = 100; // Kludge that we need to use SafeMath challenges[pollID] = Challenge({ challenger: msg.sender, rewardPool: ((oneHundred.sub(parameterizer.get("dispensationPct"))).mul(minDeposit)).div(100), stake: minDeposit, resolved: false, totalTokens: 0 }); // Updates listingHash to store most recent challenge listing.challengeID = pollID; // Locks tokens for listingHash during challenge listing.unstakedDeposit -= minDeposit; // Takes tokens from challenger require(token.transferFrom(msg.sender, this, minDeposit), "Token transfer failed"); var (commitEndDate, revealEndDate,) = voting.pollMap(pollID); emit _Challenge(listingAddress, pollID, _data, commitEndDate, revealEndDate, msg.sender); return pollID; } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
appWasMade(listingAddress)||listing.whitelisted,"Listing must be in application phase or already whitelisted to be challenged"
333,811
appWasMade(listingAddress)||listing.whitelisted
"Token transfer failed"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { Listing storage listing = listings[listingAddress]; uint minDeposit = parameterizer.get("minDeposit"); // Listing must be in apply stage or already on the whitelist require(appWasMade(listingAddress) || listing.whitelisted, "Listing must be in application phase or already whitelisted to be challenged"); // Prevent multiple challenges require(listing.challengeID == 0 || challenges[listing.challengeID].resolved, "Listing must not have active challenge to be challenged"); if (listing.unstakedDeposit < minDeposit) { // Not enough tokens, listingHash auto-delisted resetListing(listingAddress); emit _TouchAndRemoved(listingAddress); return 0; } // Starts poll uint pollID = voting.startPoll( parameterizer.get("voteQuorum"), parameterizer.get("commitStageLen"), parameterizer.get("revealStageLen") ); uint oneHundred = 100; // Kludge that we need to use SafeMath challenges[pollID] = Challenge({ challenger: msg.sender, rewardPool: ((oneHundred.sub(parameterizer.get("dispensationPct"))).mul(minDeposit)).div(100), stake: minDeposit, resolved: false, totalTokens: 0 }); // Updates listingHash to store most recent challenge listing.challengeID = pollID; // Locks tokens for listingHash during challenge listing.unstakedDeposit -= minDeposit; // Takes tokens from challenger require(<FILL_ME>) var (commitEndDate, revealEndDate,) = voting.pollMap(pollID); emit _Challenge(listingAddress, pollID, _data, commitEndDate, revealEndDate, msg.sender); return pollID; } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
token.transferFrom(msg.sender,this,minDeposit),"Token transfer failed"
333,811
token.transferFrom(msg.sender,this,minDeposit)
"Reward already claimed"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { // Ensures the voter has not already claimed tokens and challenge results have been processed require(<FILL_ME>) require(challenges[_challengeID].resolved == true, "Challenge not yet resolved"); uint voterTokens = voting.getNumPassingTokens(msg.sender, _challengeID, _salt); uint reward = voterReward(msg.sender, _challengeID, _salt); // Subtracts the voter's information to preserve the participation ratios // of other voters compared to the remaining pool of rewards challenges[_challengeID].totalTokens -= voterTokens; challenges[_challengeID].rewardPool -= reward; // Ensures a voter cannot claim tokens again challenges[_challengeID].tokenClaims[msg.sender] = true; require(token.transfer(msg.sender, reward), "Token transfer failed"); emit _RewardClaimed(_challengeID, reward, msg.sender); } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
challenges[_challengeID].tokenClaims[msg.sender]==false,"Reward already claimed"
333,811
challenges[_challengeID].tokenClaims[msg.sender]==false
"Challenge not yet resolved"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { // Ensures the voter has not already claimed tokens and challenge results have been processed require(challenges[_challengeID].tokenClaims[msg.sender] == false, "Reward already claimed"); require(<FILL_ME>) uint voterTokens = voting.getNumPassingTokens(msg.sender, _challengeID, _salt); uint reward = voterReward(msg.sender, _challengeID, _salt); // Subtracts the voter's information to preserve the participation ratios // of other voters compared to the remaining pool of rewards challenges[_challengeID].totalTokens -= voterTokens; challenges[_challengeID].rewardPool -= reward; // Ensures a voter cannot claim tokens again challenges[_challengeID].tokenClaims[msg.sender] = true; require(token.transfer(msg.sender, reward), "Token transfer failed"); emit _RewardClaimed(_challengeID, reward, msg.sender); } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
challenges[_challengeID].resolved==true,"Challenge not yet resolved"
333,811
challenges[_challengeID].resolved==true
"Challenge does not exist for Listing"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { uint challengeID = listings[listingAddress].challengeID; require(<FILL_ME>) return voting.pollEnded(challengeID); } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
challengeExists(listingAddress),"Challenge does not exist for Listing"
333,811
challengeExists(listingAddress)
"Challenge already resolved"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { require(<FILL_ME>) require(voting.pollEnded(_challengeID), "Poll for challenge has not ended"); // Edge case, nobody voted, give all tokens to the challenger. if (voting.getTotalNumberOfTokensForWinningOption(_challengeID) == 0) { return 2 * challenges[_challengeID].stake; } return (2 * challenges[_challengeID].stake) - challenges[_challengeID].rewardPool; } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
!challenges[_challengeID].resolved,"Challenge already resolved"
333,811
!challenges[_challengeID].resolved
"Poll for challenge has not ended"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { require(!challenges[_challengeID].resolved, "Challenge already resolved"); require(<FILL_ME>) // Edge case, nobody voted, give all tokens to the challenger. if (voting.getTotalNumberOfTokensForWinningOption(_challengeID) == 0) { return 2 * challenges[_challengeID].stake; } return (2 * challenges[_challengeID].stake) - challenges[_challengeID].rewardPool; } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
voting.pollEnded(_challengeID),"Poll for challenge has not ended"
333,811
voting.pollEnded(_challengeID)
"Token transfer failure"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { uint challengeID = listings[listingAddress].challengeID; // Calculates the winner's reward, // which is: (winner's full stake) + (dispensationPct * loser's stake) uint reward = determineReward(challengeID); // Sets flag on challenge being processed challenges[challengeID].resolved = true; // Stores the total tokens used for voting by the winning side for reward purposes challenges[challengeID].totalTokens = voting.getTotalNumberOfTokensForWinningOption(challengeID); // Case: challenge failed if (voting.isPassed(challengeID)) { whitelistApplication(listingAddress); // Unlock stake so that it can be retrieved by the applicant listings[listingAddress].unstakedDeposit += reward; emit _ChallengeFailed(listingAddress, challengeID, challenges[challengeID].rewardPool, challenges[challengeID].totalTokens); } // Case: challenge succeeded or nobody voted else { resetListing(listingAddress); // Transfer the reward to the challenger require(<FILL_ME>) emit _ChallengeSucceeded(listingAddress, challengeID, challenges[challengeID].rewardPool, challenges[challengeID].totalTokens); } } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { } }
token.transfer(challenges[challengeID].challenger,reward),"Token transfer failure"
333,811
token.transfer(challenges[challengeID].challenger,reward)
"Token transfer failure"
// solium-disable pragma solidity ^0.4.24; contract AddressRegistry { // ------ // EVENTS // ------ event _Application(address indexed listingAddress, uint deposit, uint appEndDate, string data, address indexed applicant); event _Challenge(address indexed listingAddress, uint indexed challengeID, string data, uint commitEndDate, uint revealEndDate, address indexed challenger); event _Deposit(address indexed listingAddress, uint added, uint newTotal, address indexed owner); event _Withdrawal(address indexed listingAddress, uint withdrew, uint newTotal, address indexed owner); event _ApplicationWhitelisted(address indexed listingAddress); event _ApplicationRemoved(address indexed listingAddress); event _ListingRemoved(address indexed listingAddress); event _ListingWithdrawn(address indexed listingAddress); event _TouchAndRemoved(address indexed listingAddress); event _ChallengeFailed(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _ChallengeSucceeded(address indexed listingAddress, uint indexed challengeID, uint rewardPool, uint totalTokens); event _RewardClaimed(uint indexed challengeID, uint reward, address indexed voter); using SafeMath for uint; struct Listing { uint applicationExpiry; // Expiration date of apply stage bool whitelisted; // Indicates registry status address owner; // Owner of Listing uint unstakedDeposit; // Number of tokens in the listing not locked in a challenge uint challengeID; // Corresponds to a PollID in PLCRVoting } struct Challenge { uint rewardPool; // (remaining) Pool of tokens to be distributed to winning voters address challenger; // Owner of Challenge bool resolved; // Indication of if challenge is resolved uint stake; // Number of tokens at stake for either party during challenge uint totalTokens; // (remaining) Number of tokens used in voting by the winning side mapping(address => bool) tokenClaims; // Indicates whether a voter has claimed a reward yet } // Maps challengeIDs to associated challenge data mapping(uint => Challenge) public challenges; // Maps listingHashes to associated listingHash data mapping(address => Listing) public listings; // Global Variables IERC20 public token; PLCRVoting public voting; Parameterizer public parameterizer; string public name; /** @dev Initializer. Can only be called once. @param _token The address where the ERC20 token contract is deployed */ constructor(address _token, address _voting, address _parameterizer, string _name) public { } // -------------------- // PUBLISHER INTERFACE: // -------------------- /** @dev Allows a user to start an application. Takes tokens from user and sets apply stage end time. @param listingAddress The hash of a potential listing a user is applying to add to the registry @param _amount The number of ERC20 tokens a user is willing to potentially stake @param _data Extra data relevant to the application. Think IPFS hashes. */ function apply(address listingAddress, uint _amount, string _data) public { } /** @dev Allows the owner of a listingHash to increase their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of @param _amount The number of ERC20 tokens to increase a user's unstaked deposit */ function deposit(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to decrease their unstaked deposit. @param listingAddress A listingHash msg.sender is the owner of. @param _amount The number of ERC20 tokens to withdraw from the unstaked deposit. */ function withdraw(address listingAddress, uint _amount) external { } /** @dev Allows the owner of a listingHash to remove the listingHash from the whitelist Returns all tokens to the owner of the listingHash @param listingAddress A listingHash msg.sender is the owner of. */ function exit(address listingAddress) external { } // ----------------------- // TOKEN HOLDER INTERFACE: // ----------------------- /** @dev Starts a poll for a listingHash which is either in the apply stage or already in the whitelist. Tokens are taken from the challenger and the applicant's deposits are locked. @param listingAddress The listingHash being challenged, whether listed or in application @param _data Extra data relevant to the challenge. Think IPFS hashes. */ function challenge(address listingAddress, string _data) public returns (uint challengeID) { } /** @dev Updates a listingHash's status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddress The listingHash whose status is being updated */ function updateStatus(address listingAddress) public { } /** @dev Updates an array of listingHashes' status from 'application' to 'listing' or resolves a challenge if one exists. @param listingAddresses The listingHashes whose status are being updated */ function updateStatuses(address[] listingAddresses) public { } // ---------------- // TOKEN FUNCTIONS: // ---------------- /** @dev Called by a voter to claim their reward for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeID The PLCR pollID of the challenge a reward is being claimed for @param _salt The salt of a voter's commit hash in the given poll */ function claimReward(uint _challengeID, uint _salt) public { } /** @dev Called by a voter to claim their rewards for each completed vote. Someone must call updateStatus() before this can be called. @param _challengeIDs The PLCR pollIDs of the challenges rewards are being claimed for @param _salts The salts of a voter's commit hashes in the given polls */ function claimRewards(uint[] _challengeIDs, uint[] _salts) public { } // -------- // GETTERS: // -------- /** @dev Calculates the provided voter's token reward for the given poll. @param _voter The address of the voter whose reward balance is to be returned @param _challengeID The pollID of the challenge a reward balance is being queried for @param _salt The salt of the voter's commit hash in the given poll @return The uint indicating the voter's reward */ function voterReward(address _voter, uint _challengeID, uint _salt) public view returns (uint) { } /** @dev Determines whether the given listingHash be whitelisted. @param listingAddress The listingHash whose status is to be examined */ function canBeWhitelisted(address listingAddress) view public returns (bool) { } /** @dev Returns true if the provided listingHash is whitelisted @param listingAddress The listingHash whose status is to be examined */ function isWhitelisted(address listingAddress) view public returns (bool whitelisted) { } /** @dev Returns true if apply was called for this listingHash @param listingAddress The listingHash whose status is to be examined */ function appWasMade(address listingAddress) view public returns (bool exists) { } /** @dev Returns true if the application/listingHash has an unresolved challenge @param listingAddress The listingHash whose status is to be examined */ function challengeExists(address listingAddress) view public returns (bool) { } /** @dev Determines whether voting has concluded in a challenge for a given listingHash. Throws if no challenge exists. @param listingAddress A listingHash with an unresolved challenge */ function challengeCanBeResolved(address listingAddress) view public returns (bool) { } /** @dev Determines the number of tokens awarded to the winning party in a challenge. @param _challengeID The challengeID to determine a reward for */ function determineReward(uint _challengeID) public view returns (uint) { } /** @dev Getter for Challenge tokenClaims mappings @param _challengeID The challengeID to query @param _voter The voter whose claim status to query for the provided challengeID */ function tokenClaims(uint _challengeID, address _voter) public view returns (bool) { } // ---------------- // PRIVATE FUNCTIONS: // ---------------- /** @dev Determines the winner in a challenge. Rewards the winner tokens and either whitelists or de-whitelists the listingHash. @param listingAddress A listingHash with a challenge that is to be resolved */ function resolveChallenge(address listingAddress) internal { } /** @dev Called by updateStatus() if the applicationExpiry date passed without a challenge being made. Called by resolveChallenge() if an application/listing beat a challenge. @param listingAddress The listingHash of an application/listingHash to be whitelisted */ function whitelistApplication(address listingAddress) internal { } /** @dev Deletes a listingHash from the whitelist and transfers tokens back to owner @param listingAddress The listing hash to delete */ function resetListing(address listingAddress) internal { Listing storage listing = listings[listingAddress]; // Emit events before deleting listing to check whether is whitelisted if (listing.whitelisted) { emit _ListingRemoved(listingAddress); } else { emit _ApplicationRemoved(listingAddress); } // Deleting listing to prevent reentry address owner = listing.owner; uint unstakedDeposit = listing.unstakedDeposit; delete listings[listingAddress]; // Transfers any remaining balance back to the owner if (unstakedDeposit > 0){ require(<FILL_ME>) } } }
token.transfer(owner,unstakedDeposit),"Token transfer failure"
333,811
token.transfer(owner,unstakedDeposit)
"Not eligible for burn"
pragma solidity 0.7.6; contract KIDz is ERC721Burnable, Ownable { using SafeMath for uint256; uint256 constant public MAX_SUPPLY = 3000; uint256 public tier1Price = 0.14 ether; uint256 public tier2Price = 0.13 ether; uint256 public tier3Price = 0.12 ether; uint256 public kidzMinted; address public fundWallet; ERC721Burnable public goatz; bool public isSaleActive; // 0-> not eligible for claim | 1-> ready for claim | 2-> claimed mapping(uint256 => uint256) public claimedStatus; constructor (string memory _tokenBaseUri, address _fundWallet, ERC721Burnable _goatz) ERC721("KIDz", "KIDZ") { } //////////////////// // Action methods // //////////////////// function addForgedGoatz(uint256[] memory _tokenId) external onlyOwner { } function removeForgedGoatz(uint256[] memory _tokenId) external onlyOwner { } function _beforeMint(uint256 _howMany) private view { } //purchase multiple kidz at once function purchaseKidz(uint256 _howMany) public payable { } function burnToEarn(uint256[] memory _tokenId) external { _beforeMint(_tokenId.length); for (uint256 i = 0; i < _tokenId.length; i++) { require(<FILL_ME>) goatz.transferFrom(_msgSender(), address(this), _tokenId[i]); goatz.burn(_tokenId[i]); _mintKidz(_msgSender()); } } function claim(uint256[] memory _tokenId) external { } function _mintKidz(address _to) private { } /////////////////// // Query methods // /////////////////// function checkClaimStatus(uint256 _tokenId) external view returns (string memory) { } function exists(uint256 _tokenId) external view returns (bool) { } function kidzRemainingToBeMinted() public view returns (uint256) { } function isAllTokenMinted() public view returns (bool) { } function isApprovedOrOwner(address _spender, uint256 _tokenId) external view returns (bool) { } function tokensOfOwner(address owner) public view returns (uint256[] memory) { } ///////////// // Setters // ///////////// function stopSale() external onlyOwner { } function startSale() external onlyOwner { } function changeFundWallet(address _fundWallet) external onlyOwner { } function updatePrice(uint256 _tier1Price, uint256 _tier2Price, uint256 _tier3Price) external onlyOwner { } function withdrawETH(uint256 _amount) external onlyOwner { } function setTokenURI(uint256 _tokenId, string memory _uri) external onlyOwner { } function setBaseURI(string memory _baseURI) external onlyOwner { } function _beforeTokenTransfer(address _from, address _to, uint256 _tokenId) internal virtual override(ERC721) { } }
claimedStatus[_tokenId[i]]==0,"Not eligible for burn"
333,918
claimedStatus[_tokenId[i]]==0
"Not eligible for claim"
pragma solidity 0.7.6; contract KIDz is ERC721Burnable, Ownable { using SafeMath for uint256; uint256 constant public MAX_SUPPLY = 3000; uint256 public tier1Price = 0.14 ether; uint256 public tier2Price = 0.13 ether; uint256 public tier3Price = 0.12 ether; uint256 public kidzMinted; address public fundWallet; ERC721Burnable public goatz; bool public isSaleActive; // 0-> not eligible for claim | 1-> ready for claim | 2-> claimed mapping(uint256 => uint256) public claimedStatus; constructor (string memory _tokenBaseUri, address _fundWallet, ERC721Burnable _goatz) ERC721("KIDz", "KIDZ") { } //////////////////// // Action methods // //////////////////// function addForgedGoatz(uint256[] memory _tokenId) external onlyOwner { } function removeForgedGoatz(uint256[] memory _tokenId) external onlyOwner { } function _beforeMint(uint256 _howMany) private view { } //purchase multiple kidz at once function purchaseKidz(uint256 _howMany) public payable { } function burnToEarn(uint256[] memory _tokenId) external { } function claim(uint256[] memory _tokenId) external { _beforeMint(_tokenId.length); for (uint256 i = 0; i < _tokenId.length; i++) { require(<FILL_ME>) claimedStatus[_tokenId[i]] = 2; _mintKidz(_msgSender()); } } function _mintKidz(address _to) private { } /////////////////// // Query methods // /////////////////// function checkClaimStatus(uint256 _tokenId) external view returns (string memory) { } function exists(uint256 _tokenId) external view returns (bool) { } function kidzRemainingToBeMinted() public view returns (uint256) { } function isAllTokenMinted() public view returns (bool) { } function isApprovedOrOwner(address _spender, uint256 _tokenId) external view returns (bool) { } function tokensOfOwner(address owner) public view returns (uint256[] memory) { } ///////////// // Setters // ///////////// function stopSale() external onlyOwner { } function startSale() external onlyOwner { } function changeFundWallet(address _fundWallet) external onlyOwner { } function updatePrice(uint256 _tier1Price, uint256 _tier2Price, uint256 _tier3Price) external onlyOwner { } function withdrawETH(uint256 _amount) external onlyOwner { } function setTokenURI(uint256 _tokenId, string memory _uri) external onlyOwner { } function setBaseURI(string memory _baseURI) external onlyOwner { } function _beforeTokenTransfer(address _from, address _to, uint256 _tokenId) internal virtual override(ERC721) { } }
claimedStatus[_tokenId[i]]==1,"Not eligible for claim"
333,918
claimedStatus[_tokenId[i]]==1
null
pragma solidity 0.4.25; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function decimals() public view returns (uint256); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } library ERC20SafeTransfer { function safeTransfer(address _tokenAddress, address _to, uint256 _value) internal returns (bool success) { require(<FILL_ME>) return fetchReturnData(); } function safeTransferFrom(address _tokenAddress, address _from, address _to, uint256 _value) internal returns (bool success) { } function safeApprove(address _tokenAddress, address _spender, uint256 _value) internal returns (bool success) { } function fetchReturnData() internal returns (bool success){ } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { } } /* Copyright 2018 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.25; /// @title TokenTransferProxy - Transfers tokens on behalf of contracts that have been approved via decentralized governance. /// @author Amir Bandeali - <[email protected]>, Will Warren - <[email protected]> contract TokenTransferProxy is Ownable { /// @dev Only authorized addresses can invoke functions with this modifier. modifier onlyAuthorized { } modifier targetAuthorized(address target) { } modifier targetNotAuthorized(address target) { } mapping (address => bool) public authorized; address[] public authorities; event LogAuthorizedAddressAdded(address indexed target, address indexed caller); event LogAuthorizedAddressRemoved(address indexed target, address indexed caller); /* * Public functions */ /// @dev Authorizes an address. /// @param target Address to authorize. function addAuthorizedAddress(address target) public onlyOwner targetNotAuthorized(target) { } /// @dev Removes authorizion of an address. /// @param target Address to remove authorization from. function removeAuthorizedAddress(address target) public onlyOwner targetAuthorized(target) { } /// @dev Calls into ERC20 Token contract, invoking transferFrom. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. /// @return Success of transfer. function transferFrom( address token, address from, address to, uint value) public onlyAuthorized returns (bool) { } /* * Public constant functions */ /// @dev Gets all authorized addresses. /// @return Array of authorized addresses. function getAuthorizedAddresses() public view returns (address[]) { } }
_tokenAddress.call(bytes4(keccak256("transfer(address,uint256)")),_to,_value)
334,042
_tokenAddress.call(bytes4(keccak256("transfer(address,uint256)")),_to,_value)
null
pragma solidity 0.4.25; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function decimals() public view returns (uint256); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } library ERC20SafeTransfer { function safeTransfer(address _tokenAddress, address _to, uint256 _value) internal returns (bool success) { } function safeTransferFrom(address _tokenAddress, address _from, address _to, uint256 _value) internal returns (bool success) { require(<FILL_ME>) return fetchReturnData(); } function safeApprove(address _tokenAddress, address _spender, uint256 _value) internal returns (bool success) { } function fetchReturnData() internal returns (bool success){ } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { } } /* Copyright 2018 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.25; /// @title TokenTransferProxy - Transfers tokens on behalf of contracts that have been approved via decentralized governance. /// @author Amir Bandeali - <[email protected]>, Will Warren - <[email protected]> contract TokenTransferProxy is Ownable { /// @dev Only authorized addresses can invoke functions with this modifier. modifier onlyAuthorized { } modifier targetAuthorized(address target) { } modifier targetNotAuthorized(address target) { } mapping (address => bool) public authorized; address[] public authorities; event LogAuthorizedAddressAdded(address indexed target, address indexed caller); event LogAuthorizedAddressRemoved(address indexed target, address indexed caller); /* * Public functions */ /// @dev Authorizes an address. /// @param target Address to authorize. function addAuthorizedAddress(address target) public onlyOwner targetNotAuthorized(target) { } /// @dev Removes authorizion of an address. /// @param target Address to remove authorization from. function removeAuthorizedAddress(address target) public onlyOwner targetAuthorized(target) { } /// @dev Calls into ERC20 Token contract, invoking transferFrom. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. /// @return Success of transfer. function transferFrom( address token, address from, address to, uint value) public onlyAuthorized returns (bool) { } /* * Public constant functions */ /// @dev Gets all authorized addresses. /// @return Array of authorized addresses. function getAuthorizedAddresses() public view returns (address[]) { } }
_tokenAddress.call(bytes4(keccak256("transferFrom(address,address,uint256)")),_from,_to,_value)
334,042
_tokenAddress.call(bytes4(keccak256("transferFrom(address,address,uint256)")),_from,_to,_value)
null
pragma solidity 0.4.25; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function decimals() public view returns (uint256); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } library ERC20SafeTransfer { function safeTransfer(address _tokenAddress, address _to, uint256 _value) internal returns (bool success) { } function safeTransferFrom(address _tokenAddress, address _from, address _to, uint256 _value) internal returns (bool success) { } function safeApprove(address _tokenAddress, address _spender, uint256 _value) internal returns (bool success) { require(<FILL_ME>) return fetchReturnData(); } function fetchReturnData() internal returns (bool success){ } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { } } /* Copyright 2018 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.25; /// @title TokenTransferProxy - Transfers tokens on behalf of contracts that have been approved via decentralized governance. /// @author Amir Bandeali - <[email protected]>, Will Warren - <[email protected]> contract TokenTransferProxy is Ownable { /// @dev Only authorized addresses can invoke functions with this modifier. modifier onlyAuthorized { } modifier targetAuthorized(address target) { } modifier targetNotAuthorized(address target) { } mapping (address => bool) public authorized; address[] public authorities; event LogAuthorizedAddressAdded(address indexed target, address indexed caller); event LogAuthorizedAddressRemoved(address indexed target, address indexed caller); /* * Public functions */ /// @dev Authorizes an address. /// @param target Address to authorize. function addAuthorizedAddress(address target) public onlyOwner targetNotAuthorized(target) { } /// @dev Removes authorizion of an address. /// @param target Address to remove authorization from. function removeAuthorizedAddress(address target) public onlyOwner targetAuthorized(target) { } /// @dev Calls into ERC20 Token contract, invoking transferFrom. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. /// @return Success of transfer. function transferFrom( address token, address from, address to, uint value) public onlyAuthorized returns (bool) { } /* * Public constant functions */ /// @dev Gets all authorized addresses. /// @return Array of authorized addresses. function getAuthorizedAddresses() public view returns (address[]) { } }
_tokenAddress.call(bytes4(keccak256("approve(address,uint256)")),_spender,_value)
334,042
_tokenAddress.call(bytes4(keccak256("approve(address,uint256)")),_spender,_value)
null
pragma solidity 0.4.25; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function decimals() public view returns (uint256); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } library ERC20SafeTransfer { function safeTransfer(address _tokenAddress, address _to, uint256 _value) internal returns (bool success) { } function safeTransferFrom(address _tokenAddress, address _from, address _to, uint256 _value) internal returns (bool success) { } function safeApprove(address _tokenAddress, address _spender, uint256 _value) internal returns (bool success) { } function fetchReturnData() internal returns (bool success){ } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { } } /* Copyright 2018 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.25; /// @title TokenTransferProxy - Transfers tokens on behalf of contracts that have been approved via decentralized governance. /// @author Amir Bandeali - <[email protected]>, Will Warren - <[email protected]> contract TokenTransferProxy is Ownable { /// @dev Only authorized addresses can invoke functions with this modifier. modifier onlyAuthorized { } modifier targetAuthorized(address target) { require(<FILL_ME>) _; } modifier targetNotAuthorized(address target) { } mapping (address => bool) public authorized; address[] public authorities; event LogAuthorizedAddressAdded(address indexed target, address indexed caller); event LogAuthorizedAddressRemoved(address indexed target, address indexed caller); /* * Public functions */ /// @dev Authorizes an address. /// @param target Address to authorize. function addAuthorizedAddress(address target) public onlyOwner targetNotAuthorized(target) { } /// @dev Removes authorizion of an address. /// @param target Address to remove authorization from. function removeAuthorizedAddress(address target) public onlyOwner targetAuthorized(target) { } /// @dev Calls into ERC20 Token contract, invoking transferFrom. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. /// @return Success of transfer. function transferFrom( address token, address from, address to, uint value) public onlyAuthorized returns (bool) { } /* * Public constant functions */ /// @dev Gets all authorized addresses. /// @return Array of authorized addresses. function getAuthorizedAddresses() public view returns (address[]) { } }
authorized[target]
334,042
authorized[target]
null
pragma solidity 0.4.25; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function decimals() public view returns (uint256); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } library ERC20SafeTransfer { function safeTransfer(address _tokenAddress, address _to, uint256 _value) internal returns (bool success) { } function safeTransferFrom(address _tokenAddress, address _from, address _to, uint256 _value) internal returns (bool success) { } function safeApprove(address _tokenAddress, address _spender, uint256 _value) internal returns (bool success) { } function fetchReturnData() internal returns (bool success){ } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { } } /* Copyright 2018 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.25; /// @title TokenTransferProxy - Transfers tokens on behalf of contracts that have been approved via decentralized governance. /// @author Amir Bandeali - <[email protected]>, Will Warren - <[email protected]> contract TokenTransferProxy is Ownable { /// @dev Only authorized addresses can invoke functions with this modifier. modifier onlyAuthorized { } modifier targetAuthorized(address target) { } modifier targetNotAuthorized(address target) { require(<FILL_ME>) _; } mapping (address => bool) public authorized; address[] public authorities; event LogAuthorizedAddressAdded(address indexed target, address indexed caller); event LogAuthorizedAddressRemoved(address indexed target, address indexed caller); /* * Public functions */ /// @dev Authorizes an address. /// @param target Address to authorize. function addAuthorizedAddress(address target) public onlyOwner targetNotAuthorized(target) { } /// @dev Removes authorizion of an address. /// @param target Address to remove authorization from. function removeAuthorizedAddress(address target) public onlyOwner targetAuthorized(target) { } /// @dev Calls into ERC20 Token contract, invoking transferFrom. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. /// @return Success of transfer. function transferFrom( address token, address from, address to, uint value) public onlyAuthorized returns (bool) { } /* * Public constant functions */ /// @dev Gets all authorized addresses. /// @return Array of authorized addresses. function getAuthorizedAddresses() public view returns (address[]) { } }
!authorized[target]
334,042
!authorized[target]
null
pragma solidity 0.4.25; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function decimals() public view returns (uint256); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } library ERC20SafeTransfer { function safeTransfer(address _tokenAddress, address _to, uint256 _value) internal returns (bool success) { } function safeTransferFrom(address _tokenAddress, address _from, address _to, uint256 _value) internal returns (bool success) { } function safeApprove(address _tokenAddress, address _spender, uint256 _value) internal returns (bool success) { } function fetchReturnData() internal returns (bool success){ } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { } } /* Copyright 2018 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.25; /// @title TokenTransferProxy - Transfers tokens on behalf of contracts that have been approved via decentralized governance. /// @author Amir Bandeali - <[email protected]>, Will Warren - <[email protected]> contract TokenTransferProxy is Ownable { /// @dev Only authorized addresses can invoke functions with this modifier. modifier onlyAuthorized { } modifier targetAuthorized(address target) { } modifier targetNotAuthorized(address target) { } mapping (address => bool) public authorized; address[] public authorities; event LogAuthorizedAddressAdded(address indexed target, address indexed caller); event LogAuthorizedAddressRemoved(address indexed target, address indexed caller); /* * Public functions */ /// @dev Authorizes an address. /// @param target Address to authorize. function addAuthorizedAddress(address target) public onlyOwner targetNotAuthorized(target) { } /// @dev Removes authorizion of an address. /// @param target Address to remove authorization from. function removeAuthorizedAddress(address target) public onlyOwner targetAuthorized(target) { } /// @dev Calls into ERC20 Token contract, invoking transferFrom. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. /// @return Success of transfer. function transferFrom( address token, address from, address to, uint value) public onlyAuthorized returns (bool) { require(<FILL_ME>) } /* * Public constant functions */ /// @dev Gets all authorized addresses. /// @return Array of authorized addresses. function getAuthorizedAddresses() public view returns (address[]) { } }
ERC20SafeTransfer.safeTransferFrom(token,from,to,value)
334,042
ERC20SafeTransfer.safeTransferFrom(token,from,to,value)
"Contract does not exists"
pragma solidity 0.4.24; /** * Utility library of inline functions on addresses */ library Address { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { } /** * @return the address of the owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _transferOwnership(address newOwner) internal { } } /** * @dev Contract Version Manager for non-upgradeable contracts */ contract ContractManager is Ownable { event VersionAdded( string contractName, string versionName, address indexed implementation ); event VersionUpdated( string contractName, string versionName, Status status, BugLevel bugLevel ); event VersionRecommended(string contractName, string versionName); event RecommendedVersionRemoved(string contractName); /** * @dev Signifies the status of a version */ enum Status {BETA, RC, PRODUCTION, DEPRECATED} /** * @dev Indicated the highest level of bug found in the version */ enum BugLevel {NONE, LOW, MEDIUM, HIGH, CRITICAL} /** * @dev A struct to encode version details */ struct Version { // the version number string ex. "v1.0" string versionName; Status status; BugLevel bugLevel; // the address of the instantiation of the version address implementation; // the date when this version was registered with the contract uint256 dateAdded; } /** * @dev List of all contracts registered (append-only) */ string[] internal contracts; /** * @dev Mapping to keep track which contract names have been registered. * Used to save gas when checking for redundant contract names */ mapping(string=>bool) internal contractExists; /** * @dev Mapping to keep track of all version names for easch contract name */ mapping(string=>string[]) internal contractVsVersionString; /** * @dev Mapping from contract names to version names to version structs */ mapping(string=>mapping(string=>Version)) internal contractVsVersions; /** * @dev Mapping from contract names to the version names of their * recommended versions */ mapping(string=>string) internal contractVsRecommendedVersion; modifier nonZeroAddress(address _address) { } modifier contractRegistered(string contractName) { require(<FILL_ME>) _; } modifier versionExists(string contractName, string versionName) { } /** * @dev Allows owner to register a new version of a contract * @param contractName The contract name of the contract to be added * @param versionName The name of the version to be added * @param status Status of the version to be added * @param implementation The address of the implementation of the version */ function addVersion( string contractName, string versionName, Status status, address implementation ) external onlyOwner nonZeroAddress(implementation) { } /** * @dev Allows owner to update a contract version * @param contractName Name of the contract * @param versionName Version of the contract * @param status Status of the contract * @param bugLevel New bug level for the contract */ function updateVersion( string contractName, string versionName, Status status, BugLevel bugLevel ) external onlyOwner contractRegistered(contractName) versionExists(contractName, versionName) { } /** * @dev Allows owner to set the recommended version * @param contractName Name of the contract * @param versionName Version of the contract */ function markRecommendedVersion( string contractName, string versionName ) external onlyOwner contractRegistered(contractName) versionExists(contractName, versionName) { } /** * @dev Get recommended version for the contract. * @return Details of recommended version */ function getRecommendedVersion( string contractName ) external view contractRegistered(contractName) returns ( string versionName, Status status, BugLevel bugLevel, address implementation, uint256 dateAdded ) { } /** * @dev Allows owner to remove a version from being recommended * @param contractName Name of the contract */ function removeRecommendedVersion(string contractName) external onlyOwner contractRegistered(contractName) { } /** * @dev Get total count of contracts registered */ function getTotalContractCount() external view returns (uint256 count) { } /** * @dev Get total count of versions for the contract * @param contractName Name of the contract */ function getVersionCountForContract(string contractName) external view returns (uint256 count) { } /** * @dev Returns the contract at a given index in the contracts array * @param index The index to be searched for */ function getContractAtIndex(uint256 index) external view returns (string contractName) { } /** * @dev Returns the version name of a contract at specific index in a * contractVsVersionString[contractName] array * @param contractName Name of the contract * @param index The index to be searched for */ function getVersionAtIndex(string contractName, uint256 index) external view returns (string versionName) { } /** * @dev Returns the version details for the given contract and version name * @param contractName Name of the contract * @param versionName Version string for the contract */ function getVersionDetails(string contractName, string versionName) external view returns ( string versionString, Status status, BugLevel bugLevel, address implementation, uint256 dateAdded ) { } }
contractExists[contractName],"Contract does not exists"
334,122
contractExists[contractName]
"Version does not exists for contract"
pragma solidity 0.4.24; /** * Utility library of inline functions on addresses */ library Address { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { } /** * @return the address of the owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _transferOwnership(address newOwner) internal { } } /** * @dev Contract Version Manager for non-upgradeable contracts */ contract ContractManager is Ownable { event VersionAdded( string contractName, string versionName, address indexed implementation ); event VersionUpdated( string contractName, string versionName, Status status, BugLevel bugLevel ); event VersionRecommended(string contractName, string versionName); event RecommendedVersionRemoved(string contractName); /** * @dev Signifies the status of a version */ enum Status {BETA, RC, PRODUCTION, DEPRECATED} /** * @dev Indicated the highest level of bug found in the version */ enum BugLevel {NONE, LOW, MEDIUM, HIGH, CRITICAL} /** * @dev A struct to encode version details */ struct Version { // the version number string ex. "v1.0" string versionName; Status status; BugLevel bugLevel; // the address of the instantiation of the version address implementation; // the date when this version was registered with the contract uint256 dateAdded; } /** * @dev List of all contracts registered (append-only) */ string[] internal contracts; /** * @dev Mapping to keep track which contract names have been registered. * Used to save gas when checking for redundant contract names */ mapping(string=>bool) internal contractExists; /** * @dev Mapping to keep track of all version names for easch contract name */ mapping(string=>string[]) internal contractVsVersionString; /** * @dev Mapping from contract names to version names to version structs */ mapping(string=>mapping(string=>Version)) internal contractVsVersions; /** * @dev Mapping from contract names to the version names of their * recommended versions */ mapping(string=>string) internal contractVsRecommendedVersion; modifier nonZeroAddress(address _address) { } modifier contractRegistered(string contractName) { } modifier versionExists(string contractName, string versionName) { require(<FILL_ME>) _; } /** * @dev Allows owner to register a new version of a contract * @param contractName The contract name of the contract to be added * @param versionName The name of the version to be added * @param status Status of the version to be added * @param implementation The address of the implementation of the version */ function addVersion( string contractName, string versionName, Status status, address implementation ) external onlyOwner nonZeroAddress(implementation) { } /** * @dev Allows owner to update a contract version * @param contractName Name of the contract * @param versionName Version of the contract * @param status Status of the contract * @param bugLevel New bug level for the contract */ function updateVersion( string contractName, string versionName, Status status, BugLevel bugLevel ) external onlyOwner contractRegistered(contractName) versionExists(contractName, versionName) { } /** * @dev Allows owner to set the recommended version * @param contractName Name of the contract * @param versionName Version of the contract */ function markRecommendedVersion( string contractName, string versionName ) external onlyOwner contractRegistered(contractName) versionExists(contractName, versionName) { } /** * @dev Get recommended version for the contract. * @return Details of recommended version */ function getRecommendedVersion( string contractName ) external view contractRegistered(contractName) returns ( string versionName, Status status, BugLevel bugLevel, address implementation, uint256 dateAdded ) { } /** * @dev Allows owner to remove a version from being recommended * @param contractName Name of the contract */ function removeRecommendedVersion(string contractName) external onlyOwner contractRegistered(contractName) { } /** * @dev Get total count of contracts registered */ function getTotalContractCount() external view returns (uint256 count) { } /** * @dev Get total count of versions for the contract * @param contractName Name of the contract */ function getVersionCountForContract(string contractName) external view returns (uint256 count) { } /** * @dev Returns the contract at a given index in the contracts array * @param index The index to be searched for */ function getContractAtIndex(uint256 index) external view returns (string contractName) { } /** * @dev Returns the version name of a contract at specific index in a * contractVsVersionString[contractName] array * @param contractName Name of the contract * @param index The index to be searched for */ function getVersionAtIndex(string contractName, uint256 index) external view returns (string versionName) { } /** * @dev Returns the version details for the given contract and version name * @param contractName Name of the contract * @param versionName Version string for the contract */ function getVersionDetails(string contractName, string versionName) external view returns ( string versionString, Status status, BugLevel bugLevel, address implementation, uint256 dateAdded ) { } }
contractVsVersions[contractName][versionName].implementation!=address(0),"Version does not exists for contract"
334,122
contractVsVersions[contractName][versionName].implementation!=address(0)
"Empty string passed as version"
pragma solidity 0.4.24; /** * Utility library of inline functions on addresses */ library Address { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { } /** * @return the address of the owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _transferOwnership(address newOwner) internal { } } /** * @dev Contract Version Manager for non-upgradeable contracts */ contract ContractManager is Ownable { event VersionAdded( string contractName, string versionName, address indexed implementation ); event VersionUpdated( string contractName, string versionName, Status status, BugLevel bugLevel ); event VersionRecommended(string contractName, string versionName); event RecommendedVersionRemoved(string contractName); /** * @dev Signifies the status of a version */ enum Status {BETA, RC, PRODUCTION, DEPRECATED} /** * @dev Indicated the highest level of bug found in the version */ enum BugLevel {NONE, LOW, MEDIUM, HIGH, CRITICAL} /** * @dev A struct to encode version details */ struct Version { // the version number string ex. "v1.0" string versionName; Status status; BugLevel bugLevel; // the address of the instantiation of the version address implementation; // the date when this version was registered with the contract uint256 dateAdded; } /** * @dev List of all contracts registered (append-only) */ string[] internal contracts; /** * @dev Mapping to keep track which contract names have been registered. * Used to save gas when checking for redundant contract names */ mapping(string=>bool) internal contractExists; /** * @dev Mapping to keep track of all version names for easch contract name */ mapping(string=>string[]) internal contractVsVersionString; /** * @dev Mapping from contract names to version names to version structs */ mapping(string=>mapping(string=>Version)) internal contractVsVersions; /** * @dev Mapping from contract names to the version names of their * recommended versions */ mapping(string=>string) internal contractVsRecommendedVersion; modifier nonZeroAddress(address _address) { } modifier contractRegistered(string contractName) { } modifier versionExists(string contractName, string versionName) { } /** * @dev Allows owner to register a new version of a contract * @param contractName The contract name of the contract to be added * @param versionName The name of the version to be added * @param status Status of the version to be added * @param implementation The address of the implementation of the version */ function addVersion( string contractName, string versionName, Status status, address implementation ) external onlyOwner nonZeroAddress(implementation) { // version name must not be the empty string require(<FILL_ME>) // contract name must not be the empty string require( bytes(contractName).length>0, "Empty string passed as contract name" ); // implementation must be a contract require( Address.isContract(implementation), "Cannot set an implementation to a non-contract address" ); if (!contractExists[contractName]) { contracts.push(contractName); contractExists[contractName] = true; } // the version name should not already be registered for // the given contract require( contractVsVersions[contractName][versionName].implementation == address(0), "Version already exists for contract" ); contractVsVersionString[contractName].push(versionName); contractVsVersions[contractName][versionName] = Version({ versionName:versionName, status:status, bugLevel:BugLevel.NONE, implementation:implementation, dateAdded:block.timestamp }); emit VersionAdded(contractName, versionName, implementation); } /** * @dev Allows owner to update a contract version * @param contractName Name of the contract * @param versionName Version of the contract * @param status Status of the contract * @param bugLevel New bug level for the contract */ function updateVersion( string contractName, string versionName, Status status, BugLevel bugLevel ) external onlyOwner contractRegistered(contractName) versionExists(contractName, versionName) { } /** * @dev Allows owner to set the recommended version * @param contractName Name of the contract * @param versionName Version of the contract */ function markRecommendedVersion( string contractName, string versionName ) external onlyOwner contractRegistered(contractName) versionExists(contractName, versionName) { } /** * @dev Get recommended version for the contract. * @return Details of recommended version */ function getRecommendedVersion( string contractName ) external view contractRegistered(contractName) returns ( string versionName, Status status, BugLevel bugLevel, address implementation, uint256 dateAdded ) { } /** * @dev Allows owner to remove a version from being recommended * @param contractName Name of the contract */ function removeRecommendedVersion(string contractName) external onlyOwner contractRegistered(contractName) { } /** * @dev Get total count of contracts registered */ function getTotalContractCount() external view returns (uint256 count) { } /** * @dev Get total count of versions for the contract * @param contractName Name of the contract */ function getVersionCountForContract(string contractName) external view returns (uint256 count) { } /** * @dev Returns the contract at a given index in the contracts array * @param index The index to be searched for */ function getContractAtIndex(uint256 index) external view returns (string contractName) { } /** * @dev Returns the version name of a contract at specific index in a * contractVsVersionString[contractName] array * @param contractName Name of the contract * @param index The index to be searched for */ function getVersionAtIndex(string contractName, uint256 index) external view returns (string versionName) { } /** * @dev Returns the version details for the given contract and version name * @param contractName Name of the contract * @param versionName Version string for the contract */ function getVersionDetails(string contractName, string versionName) external view returns ( string versionString, Status status, BugLevel bugLevel, address implementation, uint256 dateAdded ) { } }
bytes(versionName).length>0,"Empty string passed as version"
334,122
bytes(versionName).length>0
"Empty string passed as contract name"
pragma solidity 0.4.24; /** * Utility library of inline functions on addresses */ library Address { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { } /** * @return the address of the owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _transferOwnership(address newOwner) internal { } } /** * @dev Contract Version Manager for non-upgradeable contracts */ contract ContractManager is Ownable { event VersionAdded( string contractName, string versionName, address indexed implementation ); event VersionUpdated( string contractName, string versionName, Status status, BugLevel bugLevel ); event VersionRecommended(string contractName, string versionName); event RecommendedVersionRemoved(string contractName); /** * @dev Signifies the status of a version */ enum Status {BETA, RC, PRODUCTION, DEPRECATED} /** * @dev Indicated the highest level of bug found in the version */ enum BugLevel {NONE, LOW, MEDIUM, HIGH, CRITICAL} /** * @dev A struct to encode version details */ struct Version { // the version number string ex. "v1.0" string versionName; Status status; BugLevel bugLevel; // the address of the instantiation of the version address implementation; // the date when this version was registered with the contract uint256 dateAdded; } /** * @dev List of all contracts registered (append-only) */ string[] internal contracts; /** * @dev Mapping to keep track which contract names have been registered. * Used to save gas when checking for redundant contract names */ mapping(string=>bool) internal contractExists; /** * @dev Mapping to keep track of all version names for easch contract name */ mapping(string=>string[]) internal contractVsVersionString; /** * @dev Mapping from contract names to version names to version structs */ mapping(string=>mapping(string=>Version)) internal contractVsVersions; /** * @dev Mapping from contract names to the version names of their * recommended versions */ mapping(string=>string) internal contractVsRecommendedVersion; modifier nonZeroAddress(address _address) { } modifier contractRegistered(string contractName) { } modifier versionExists(string contractName, string versionName) { } /** * @dev Allows owner to register a new version of a contract * @param contractName The contract name of the contract to be added * @param versionName The name of the version to be added * @param status Status of the version to be added * @param implementation The address of the implementation of the version */ function addVersion( string contractName, string versionName, Status status, address implementation ) external onlyOwner nonZeroAddress(implementation) { // version name must not be the empty string require(bytes(versionName).length>0, "Empty string passed as version"); // contract name must not be the empty string require(<FILL_ME>) // implementation must be a contract require( Address.isContract(implementation), "Cannot set an implementation to a non-contract address" ); if (!contractExists[contractName]) { contracts.push(contractName); contractExists[contractName] = true; } // the version name should not already be registered for // the given contract require( contractVsVersions[contractName][versionName].implementation == address(0), "Version already exists for contract" ); contractVsVersionString[contractName].push(versionName); contractVsVersions[contractName][versionName] = Version({ versionName:versionName, status:status, bugLevel:BugLevel.NONE, implementation:implementation, dateAdded:block.timestamp }); emit VersionAdded(contractName, versionName, implementation); } /** * @dev Allows owner to update a contract version * @param contractName Name of the contract * @param versionName Version of the contract * @param status Status of the contract * @param bugLevel New bug level for the contract */ function updateVersion( string contractName, string versionName, Status status, BugLevel bugLevel ) external onlyOwner contractRegistered(contractName) versionExists(contractName, versionName) { } /** * @dev Allows owner to set the recommended version * @param contractName Name of the contract * @param versionName Version of the contract */ function markRecommendedVersion( string contractName, string versionName ) external onlyOwner contractRegistered(contractName) versionExists(contractName, versionName) { } /** * @dev Get recommended version for the contract. * @return Details of recommended version */ function getRecommendedVersion( string contractName ) external view contractRegistered(contractName) returns ( string versionName, Status status, BugLevel bugLevel, address implementation, uint256 dateAdded ) { } /** * @dev Allows owner to remove a version from being recommended * @param contractName Name of the contract */ function removeRecommendedVersion(string contractName) external onlyOwner contractRegistered(contractName) { } /** * @dev Get total count of contracts registered */ function getTotalContractCount() external view returns (uint256 count) { } /** * @dev Get total count of versions for the contract * @param contractName Name of the contract */ function getVersionCountForContract(string contractName) external view returns (uint256 count) { } /** * @dev Returns the contract at a given index in the contracts array * @param index The index to be searched for */ function getContractAtIndex(uint256 index) external view returns (string contractName) { } /** * @dev Returns the version name of a contract at specific index in a * contractVsVersionString[contractName] array * @param contractName Name of the contract * @param index The index to be searched for */ function getVersionAtIndex(string contractName, uint256 index) external view returns (string versionName) { } /** * @dev Returns the version details for the given contract and version name * @param contractName Name of the contract * @param versionName Version string for the contract */ function getVersionDetails(string contractName, string versionName) external view returns ( string versionString, Status status, BugLevel bugLevel, address implementation, uint256 dateAdded ) { } }
bytes(contractName).length>0,"Empty string passed as contract name"
334,122
bytes(contractName).length>0
"Cannot set an implementation to a non-contract address"
pragma solidity 0.4.24; /** * Utility library of inline functions on addresses */ library Address { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { } /** * @return the address of the owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _transferOwnership(address newOwner) internal { } } /** * @dev Contract Version Manager for non-upgradeable contracts */ contract ContractManager is Ownable { event VersionAdded( string contractName, string versionName, address indexed implementation ); event VersionUpdated( string contractName, string versionName, Status status, BugLevel bugLevel ); event VersionRecommended(string contractName, string versionName); event RecommendedVersionRemoved(string contractName); /** * @dev Signifies the status of a version */ enum Status {BETA, RC, PRODUCTION, DEPRECATED} /** * @dev Indicated the highest level of bug found in the version */ enum BugLevel {NONE, LOW, MEDIUM, HIGH, CRITICAL} /** * @dev A struct to encode version details */ struct Version { // the version number string ex. "v1.0" string versionName; Status status; BugLevel bugLevel; // the address of the instantiation of the version address implementation; // the date when this version was registered with the contract uint256 dateAdded; } /** * @dev List of all contracts registered (append-only) */ string[] internal contracts; /** * @dev Mapping to keep track which contract names have been registered. * Used to save gas when checking for redundant contract names */ mapping(string=>bool) internal contractExists; /** * @dev Mapping to keep track of all version names for easch contract name */ mapping(string=>string[]) internal contractVsVersionString; /** * @dev Mapping from contract names to version names to version structs */ mapping(string=>mapping(string=>Version)) internal contractVsVersions; /** * @dev Mapping from contract names to the version names of their * recommended versions */ mapping(string=>string) internal contractVsRecommendedVersion; modifier nonZeroAddress(address _address) { } modifier contractRegistered(string contractName) { } modifier versionExists(string contractName, string versionName) { } /** * @dev Allows owner to register a new version of a contract * @param contractName The contract name of the contract to be added * @param versionName The name of the version to be added * @param status Status of the version to be added * @param implementation The address of the implementation of the version */ function addVersion( string contractName, string versionName, Status status, address implementation ) external onlyOwner nonZeroAddress(implementation) { // version name must not be the empty string require(bytes(versionName).length>0, "Empty string passed as version"); // contract name must not be the empty string require( bytes(contractName).length>0, "Empty string passed as contract name" ); // implementation must be a contract require(<FILL_ME>) if (!contractExists[contractName]) { contracts.push(contractName); contractExists[contractName] = true; } // the version name should not already be registered for // the given contract require( contractVsVersions[contractName][versionName].implementation == address(0), "Version already exists for contract" ); contractVsVersionString[contractName].push(versionName); contractVsVersions[contractName][versionName] = Version({ versionName:versionName, status:status, bugLevel:BugLevel.NONE, implementation:implementation, dateAdded:block.timestamp }); emit VersionAdded(contractName, versionName, implementation); } /** * @dev Allows owner to update a contract version * @param contractName Name of the contract * @param versionName Version of the contract * @param status Status of the contract * @param bugLevel New bug level for the contract */ function updateVersion( string contractName, string versionName, Status status, BugLevel bugLevel ) external onlyOwner contractRegistered(contractName) versionExists(contractName, versionName) { } /** * @dev Allows owner to set the recommended version * @param contractName Name of the contract * @param versionName Version of the contract */ function markRecommendedVersion( string contractName, string versionName ) external onlyOwner contractRegistered(contractName) versionExists(contractName, versionName) { } /** * @dev Get recommended version for the contract. * @return Details of recommended version */ function getRecommendedVersion( string contractName ) external view contractRegistered(contractName) returns ( string versionName, Status status, BugLevel bugLevel, address implementation, uint256 dateAdded ) { } /** * @dev Allows owner to remove a version from being recommended * @param contractName Name of the contract */ function removeRecommendedVersion(string contractName) external onlyOwner contractRegistered(contractName) { } /** * @dev Get total count of contracts registered */ function getTotalContractCount() external view returns (uint256 count) { } /** * @dev Get total count of versions for the contract * @param contractName Name of the contract */ function getVersionCountForContract(string contractName) external view returns (uint256 count) { } /** * @dev Returns the contract at a given index in the contracts array * @param index The index to be searched for */ function getContractAtIndex(uint256 index) external view returns (string contractName) { } /** * @dev Returns the version name of a contract at specific index in a * contractVsVersionString[contractName] array * @param contractName Name of the contract * @param index The index to be searched for */ function getVersionAtIndex(string contractName, uint256 index) external view returns (string versionName) { } /** * @dev Returns the version details for the given contract and version name * @param contractName Name of the contract * @param versionName Version string for the contract */ function getVersionDetails(string contractName, string versionName) external view returns ( string versionString, Status status, BugLevel bugLevel, address implementation, uint256 dateAdded ) { } }
Address.isContract(implementation),"Cannot set an implementation to a non-contract address"
334,122
Address.isContract(implementation)
"Version already exists for contract"
pragma solidity 0.4.24; /** * Utility library of inline functions on addresses */ library Address { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { } /** * @return the address of the owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _transferOwnership(address newOwner) internal { } } /** * @dev Contract Version Manager for non-upgradeable contracts */ contract ContractManager is Ownable { event VersionAdded( string contractName, string versionName, address indexed implementation ); event VersionUpdated( string contractName, string versionName, Status status, BugLevel bugLevel ); event VersionRecommended(string contractName, string versionName); event RecommendedVersionRemoved(string contractName); /** * @dev Signifies the status of a version */ enum Status {BETA, RC, PRODUCTION, DEPRECATED} /** * @dev Indicated the highest level of bug found in the version */ enum BugLevel {NONE, LOW, MEDIUM, HIGH, CRITICAL} /** * @dev A struct to encode version details */ struct Version { // the version number string ex. "v1.0" string versionName; Status status; BugLevel bugLevel; // the address of the instantiation of the version address implementation; // the date when this version was registered with the contract uint256 dateAdded; } /** * @dev List of all contracts registered (append-only) */ string[] internal contracts; /** * @dev Mapping to keep track which contract names have been registered. * Used to save gas when checking for redundant contract names */ mapping(string=>bool) internal contractExists; /** * @dev Mapping to keep track of all version names for easch contract name */ mapping(string=>string[]) internal contractVsVersionString; /** * @dev Mapping from contract names to version names to version structs */ mapping(string=>mapping(string=>Version)) internal contractVsVersions; /** * @dev Mapping from contract names to the version names of their * recommended versions */ mapping(string=>string) internal contractVsRecommendedVersion; modifier nonZeroAddress(address _address) { } modifier contractRegistered(string contractName) { } modifier versionExists(string contractName, string versionName) { } /** * @dev Allows owner to register a new version of a contract * @param contractName The contract name of the contract to be added * @param versionName The name of the version to be added * @param status Status of the version to be added * @param implementation The address of the implementation of the version */ function addVersion( string contractName, string versionName, Status status, address implementation ) external onlyOwner nonZeroAddress(implementation) { // version name must not be the empty string require(bytes(versionName).length>0, "Empty string passed as version"); // contract name must not be the empty string require( bytes(contractName).length>0, "Empty string passed as contract name" ); // implementation must be a contract require( Address.isContract(implementation), "Cannot set an implementation to a non-contract address" ); if (!contractExists[contractName]) { contracts.push(contractName); contractExists[contractName] = true; } // the version name should not already be registered for // the given contract require(<FILL_ME>) contractVsVersionString[contractName].push(versionName); contractVsVersions[contractName][versionName] = Version({ versionName:versionName, status:status, bugLevel:BugLevel.NONE, implementation:implementation, dateAdded:block.timestamp }); emit VersionAdded(contractName, versionName, implementation); } /** * @dev Allows owner to update a contract version * @param contractName Name of the contract * @param versionName Version of the contract * @param status Status of the contract * @param bugLevel New bug level for the contract */ function updateVersion( string contractName, string versionName, Status status, BugLevel bugLevel ) external onlyOwner contractRegistered(contractName) versionExists(contractName, versionName) { } /** * @dev Allows owner to set the recommended version * @param contractName Name of the contract * @param versionName Version of the contract */ function markRecommendedVersion( string contractName, string versionName ) external onlyOwner contractRegistered(contractName) versionExists(contractName, versionName) { } /** * @dev Get recommended version for the contract. * @return Details of recommended version */ function getRecommendedVersion( string contractName ) external view contractRegistered(contractName) returns ( string versionName, Status status, BugLevel bugLevel, address implementation, uint256 dateAdded ) { } /** * @dev Allows owner to remove a version from being recommended * @param contractName Name of the contract */ function removeRecommendedVersion(string contractName) external onlyOwner contractRegistered(contractName) { } /** * @dev Get total count of contracts registered */ function getTotalContractCount() external view returns (uint256 count) { } /** * @dev Get total count of versions for the contract * @param contractName Name of the contract */ function getVersionCountForContract(string contractName) external view returns (uint256 count) { } /** * @dev Returns the contract at a given index in the contracts array * @param index The index to be searched for */ function getContractAtIndex(uint256 index) external view returns (string contractName) { } /** * @dev Returns the version name of a contract at specific index in a * contractVsVersionString[contractName] array * @param contractName Name of the contract * @param index The index to be searched for */ function getVersionAtIndex(string contractName, uint256 index) external view returns (string versionName) { } /** * @dev Returns the version details for the given contract and version name * @param contractName Name of the contract * @param versionName Version string for the contract */ function getVersionDetails(string contractName, string versionName) external view returns ( string versionString, Status status, BugLevel bugLevel, address implementation, uint256 dateAdded ) { } }
contractVsVersions[contractName][versionName].implementation==address(0),"Version already exists for contract"
334,122
contractVsVersions[contractName][versionName].implementation==address(0)
"Exceeds maximum supply"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./FullERC721.sol"; contract CryptoMfers is ERC721Enumerable, Ownable { uint256 public _maxSupply = 10000; uint256 public _price = 0.069 ether; bool public _paused = false; string public constant _desc = "CryptoMfers - inspired by mfers, made for mfers"; string public constant _mferURI = "http://nft-launchpad.io/cryptomfers/cryptomfer-"; constructor() ERC721("CryptoMfers", "CRYPTOMFERS") Ownable() { } function _baseURI() override internal view virtual returns (string memory) { } function mint(uint256 num) external payable { uint256 supply = totalSupply(); require(!_paused, "Sale paused"); require(num < 101, "maximum of 100 cryptomfers"); require(<FILL_ME>) require(msg.value >= _price * num, "Ether sent is not correct"); for(uint256 i = 1; i <= num; i++) { _safeMint(msg.sender, supply + i); } } function setMaxSupply(uint256 newVal) external onlyOwner { } function setPrice(uint256 _newPrice) external onlyOwner { } function setPause(bool val) external onlyOwner { } function withdraw() external payable onlyOwner { } }
supply+num<=_maxSupply,"Exceeds maximum supply"
334,211
supply+num<=_maxSupply
"Allowance too low"
pragma solidity >=0.7.0 <0.9.0; pragma experimental ABIEncoderV2; //SPDX-License-Identifier: MIT interface IERC20 { function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } contract TransferExclusive is Ownable { IERC20 public _tokenContract; address public _tokenAddress; address public _ownerAddress; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; struct inputModel { address addr; uint256 val; } constructor (address contractAddress, address ownerAddress, inputModel[] memory allowAddresses) { } function setPrimaryContract(address contractAddress, address ownerAddress) public onlyOwner returns (uint256){ } function addAllowAddress(address allowAddress, uint256 value) public onlyOwner returns (uint256){ } function addAllowAddresses(inputModel[] memory allowAddresses) public onlyOwner returns (uint256){ } function getAllowance(address addr) public view returns (uint256){ } function getPrimaryAllowance() public onlyOwner view returns (uint256){ } function transferExclusive(uint256 amount) public returns (uint256){ require(<FILL_ME>) require(allowed[_tokenAddress][msg.sender] >= amount, "Not allowed"); _internalTransferFrom(_tokenContract, _ownerAddress, msg.sender, amount); return 1; } function _internalTransferFrom(IERC20 token, address sender, address recipient, uint256 amount) private { } }
_tokenContract.allowance(_ownerAddress,address(this))>=amount,"Allowance too low"
334,281
_tokenContract.allowance(_ownerAddress,address(this))>=amount
"Not allowed"
pragma solidity >=0.7.0 <0.9.0; pragma experimental ABIEncoderV2; //SPDX-License-Identifier: MIT interface IERC20 { function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } contract TransferExclusive is Ownable { IERC20 public _tokenContract; address public _tokenAddress; address public _ownerAddress; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; struct inputModel { address addr; uint256 val; } constructor (address contractAddress, address ownerAddress, inputModel[] memory allowAddresses) { } function setPrimaryContract(address contractAddress, address ownerAddress) public onlyOwner returns (uint256){ } function addAllowAddress(address allowAddress, uint256 value) public onlyOwner returns (uint256){ } function addAllowAddresses(inputModel[] memory allowAddresses) public onlyOwner returns (uint256){ } function getAllowance(address addr) public view returns (uint256){ } function getPrimaryAllowance() public onlyOwner view returns (uint256){ } function transferExclusive(uint256 amount) public returns (uint256){ require(_tokenContract.allowance(_ownerAddress, address(this)) >= amount, "Allowance too low"); require(<FILL_ME>) _internalTransferFrom(_tokenContract, _ownerAddress, msg.sender, amount); return 1; } function _internalTransferFrom(IERC20 token, address sender, address recipient, uint256 amount) private { } }
allowed[_tokenAddress][msg.sender]>=amount,"Not allowed"
334,281
allowed[_tokenAddress][msg.sender]>=amount
"Purchase would exceed max supply of tokens"
// SPDX-License-Identifier: MIT /* META SCRAPER CADET */ pragma solidity ^0.8.0; import "./Ownable.sol"; import "./ERC1155.sol"; import "./ERC1155Supply.sol"; contract MetaScraperCadet is ERC1155Supply, Ownable { bool public saleIsActive = false; uint constant TOKEN_ID = 8; uint constant NUM_RESERVED_TOKENS = 20; uint constant MAX_TOKENS_PER_PURCHASE = 5; uint constant MAX_TOKENS = 1000000; uint public tokenPrice = 0.5 ether; uint public saleLimit = 40; constructor(string memory uri) ERC1155(uri) { } function reserve() public onlyOwner { } function setSaleState(bool newState) public onlyOwner { } function mint(uint numberOfTokens) public payable { require(saleIsActive, "Sale must be active to mint Tokens"); require(numberOfTokens <= MAX_TOKENS_PER_PURCHASE, "Exceeded max token purchase"); require(<FILL_ME>) require(tokenPrice * numberOfTokens <= msg.value, "Ether value sent is not correct"); require(totalSupply(TOKEN_ID) + numberOfTokens <= saleLimit, "Purchase would exceed max supply of tokens for this sale round"); _mint(msg.sender, TOKEN_ID, numberOfTokens, ""); } function withdraw() public onlyOwner { } function setCurrentLimit(uint256 _limit) public onlyOwner{ } function setPrice(uint256 _price) public onlyOwner{ } function setURI(string memory newuri) onlyOwner public { } }
totalSupply(TOKEN_ID)+numberOfTokens<=MAX_TOKENS,"Purchase would exceed max supply of tokens"
334,286
totalSupply(TOKEN_ID)+numberOfTokens<=MAX_TOKENS
"Purchase would exceed max supply of tokens for this sale round"
// SPDX-License-Identifier: MIT /* META SCRAPER CADET */ pragma solidity ^0.8.0; import "./Ownable.sol"; import "./ERC1155.sol"; import "./ERC1155Supply.sol"; contract MetaScraperCadet is ERC1155Supply, Ownable { bool public saleIsActive = false; uint constant TOKEN_ID = 8; uint constant NUM_RESERVED_TOKENS = 20; uint constant MAX_TOKENS_PER_PURCHASE = 5; uint constant MAX_TOKENS = 1000000; uint public tokenPrice = 0.5 ether; uint public saleLimit = 40; constructor(string memory uri) ERC1155(uri) { } function reserve() public onlyOwner { } function setSaleState(bool newState) public onlyOwner { } function mint(uint numberOfTokens) public payable { require(saleIsActive, "Sale must be active to mint Tokens"); require(numberOfTokens <= MAX_TOKENS_PER_PURCHASE, "Exceeded max token purchase"); require(totalSupply(TOKEN_ID) + numberOfTokens <= MAX_TOKENS, "Purchase would exceed max supply of tokens"); require(tokenPrice * numberOfTokens <= msg.value, "Ether value sent is not correct"); require(<FILL_ME>) _mint(msg.sender, TOKEN_ID, numberOfTokens, ""); } function withdraw() public onlyOwner { } function setCurrentLimit(uint256 _limit) public onlyOwner{ } function setPrice(uint256 _price) public onlyOwner{ } function setURI(string memory newuri) onlyOwner public { } }
totalSupply(TOKEN_ID)+numberOfTokens<=saleLimit,"Purchase would exceed max supply of tokens for this sale round"
334,286
totalSupply(TOKEN_ID)+numberOfTokens<=saleLimit
"All Spikes has been minted!"
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract CryptoVerse is ERC721, Ownable { event SetPresaleMerkleRoot(bytes32 root); event SetOGMintMerkleRoot(bytes32 root); event CryptoVerseMinted(uint tokenId, address sender); uint256 public TOTAL_SUPPLY = 3333; uint256 public price = 0.03 ether; uint256 public presalePrice = 0.02 ether; uint256 public MAX_PURCHASE = 3; uint256 public MAX_PRESALE_TOKENS = 3; uint256 public MAX_OG_TOKENS = 4; bool public saleIsActive = false; bool public presaleIsActive = false; bool public ogMintIsActive = false; string private baseURI; uint256 private _currentTokenId = 0; bytes32 public merkleRoot; bytes32 public merkleRootOG; mapping(address => uint) public whitelistClaimed; mapping(address => uint) public whitelistOGClaimed; constructor(string memory _baseURI) ERC721("CryptoVerseSpike","CVSpike") { } //PUBLIC MINT function mintSpikesTo(uint numberOfTokens) external payable { require(saleIsActive, "Wait for sales to start!"); require(numberOfTokens <= MAX_PURCHASE, "Too many Spikes to mint!"); require(<FILL_ME>) require(msg.value >= price * numberOfTokens, "insufficient ETH"); for (uint i = 0; i < numberOfTokens; i++) { _safeMint(msg.sender, _currentTokenId+1); emit CryptoVerseMinted(_currentTokenId+1, msg.sender); _incrementTokenId(); } } //RESERVE MINT function reserveMint(uint numberOfTokens) external onlyOwner { } //OG MINT function ogMint(bytes32[] calldata _merkelProof, uint numberOfTokens) external payable { } //WHITELIST MINT function whitelistMint(bytes32[] calldata _merkelProof, uint numberOfTokens) external payable { } function assetsLeft() public view returns (uint256) { } function whilteListMintedQty(address userAddress) public view returns (uint) { } function OGMintedQty(address userAddress) public view returns (uint) { } function _incrementTokenId() private { } function supplyReached() public view returns (bool) { } function totalSupply() public view returns (uint256) { } function switchOGSaleIsActive() external onlyOwner { } function switchSaleIsActive() external onlyOwner { } function switchPresaleIsActive() external onlyOwner { } function setPresaleMerkleRoot(bytes32 root) external onlyOwner { } function setOGMintMerkleRoot(bytes32 root) external onlyOwner { } function baseTokenURI() private view returns (string memory) { } function getPrice() public view returns (uint256) { } function setBaseURI(string memory _newUri) public onlyOwner { } function tokenURI(uint256 _tokenId) override public view returns (string memory) { } function withdraw() external onlyOwner { } function uint2str(uint256 _i) internal pure returns (string memory _uintAsString) { } }
_currentTokenId+numberOfTokens<=TOTAL_SUPPLY,"All Spikes has been minted!"
334,458
_currentTokenId+numberOfTokens<=TOTAL_SUPPLY
string(abi.encodePacked("You have ",uint2str(MAX_OG_TOKENS-reserved)," tokens left to mint"))
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract CryptoVerse is ERC721, Ownable { event SetPresaleMerkleRoot(bytes32 root); event SetOGMintMerkleRoot(bytes32 root); event CryptoVerseMinted(uint tokenId, address sender); uint256 public TOTAL_SUPPLY = 3333; uint256 public price = 0.03 ether; uint256 public presalePrice = 0.02 ether; uint256 public MAX_PURCHASE = 3; uint256 public MAX_PRESALE_TOKENS = 3; uint256 public MAX_OG_TOKENS = 4; bool public saleIsActive = false; bool public presaleIsActive = false; bool public ogMintIsActive = false; string private baseURI; uint256 private _currentTokenId = 0; bytes32 public merkleRoot; bytes32 public merkleRootOG; mapping(address => uint) public whitelistClaimed; mapping(address => uint) public whitelistOGClaimed; constructor(string memory _baseURI) ERC721("CryptoVerseSpike","CVSpike") { } //PUBLIC MINT function mintSpikesTo(uint numberOfTokens) external payable { } //RESERVE MINT function reserveMint(uint numberOfTokens) external onlyOwner { } //OG MINT function ogMint(bytes32[] calldata _merkelProof, uint numberOfTokens) external payable { uint256 reserved = whitelistOGClaimed[msg.sender]; require(ogMintIsActive, "Wait for OG mint to start!"); require(_currentTokenId + numberOfTokens <= TOTAL_SUPPLY, "All Spikes has been minted!"); require(msg.value >= presalePrice * numberOfTokens, "insufficient ETH"); require(<FILL_ME>) require(numberOfTokens <= MAX_OG_TOKENS, "Too many Spikes to mint!"); bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(_merkelProof, merkleRootOG, leaf), "Invalid proof."); reserved = MAX_OG_TOKENS - numberOfTokens; for (uint i = 0; i < numberOfTokens; i++) { _safeMint(msg.sender, _currentTokenId+1); emit CryptoVerseMinted(_currentTokenId+1, msg.sender); _incrementTokenId(); whitelistOGClaimed[msg.sender] += 1; } } //WHITELIST MINT function whitelistMint(bytes32[] calldata _merkelProof, uint numberOfTokens) external payable { } function assetsLeft() public view returns (uint256) { } function whilteListMintedQty(address userAddress) public view returns (uint) { } function OGMintedQty(address userAddress) public view returns (uint) { } function _incrementTokenId() private { } function supplyReached() public view returns (bool) { } function totalSupply() public view returns (uint256) { } function switchOGSaleIsActive() external onlyOwner { } function switchSaleIsActive() external onlyOwner { } function switchPresaleIsActive() external onlyOwner { } function setPresaleMerkleRoot(bytes32 root) external onlyOwner { } function setOGMintMerkleRoot(bytes32 root) external onlyOwner { } function baseTokenURI() private view returns (string memory) { } function getPrice() public view returns (uint256) { } function setBaseURI(string memory _newUri) public onlyOwner { } function tokenURI(uint256 _tokenId) override public view returns (string memory) { } function withdraw() external onlyOwner { } function uint2str(uint256 _i) internal pure returns (string memory _uintAsString) { } }
reserved+numberOfTokens<=MAX_OG_TOKENS,string(abi.encodePacked("You have ",uint2str(MAX_OG_TOKENS-reserved)," tokens left to mint"))
334,458
reserved+numberOfTokens<=MAX_OG_TOKENS
"Invalid proof."
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract CryptoVerse is ERC721, Ownable { event SetPresaleMerkleRoot(bytes32 root); event SetOGMintMerkleRoot(bytes32 root); event CryptoVerseMinted(uint tokenId, address sender); uint256 public TOTAL_SUPPLY = 3333; uint256 public price = 0.03 ether; uint256 public presalePrice = 0.02 ether; uint256 public MAX_PURCHASE = 3; uint256 public MAX_PRESALE_TOKENS = 3; uint256 public MAX_OG_TOKENS = 4; bool public saleIsActive = false; bool public presaleIsActive = false; bool public ogMintIsActive = false; string private baseURI; uint256 private _currentTokenId = 0; bytes32 public merkleRoot; bytes32 public merkleRootOG; mapping(address => uint) public whitelistClaimed; mapping(address => uint) public whitelistOGClaimed; constructor(string memory _baseURI) ERC721("CryptoVerseSpike","CVSpike") { } //PUBLIC MINT function mintSpikesTo(uint numberOfTokens) external payable { } //RESERVE MINT function reserveMint(uint numberOfTokens) external onlyOwner { } //OG MINT function ogMint(bytes32[] calldata _merkelProof, uint numberOfTokens) external payable { uint256 reserved = whitelistOGClaimed[msg.sender]; require(ogMintIsActive, "Wait for OG mint to start!"); require(_currentTokenId + numberOfTokens <= TOTAL_SUPPLY, "All Spikes has been minted!"); require(msg.value >= presalePrice * numberOfTokens, "insufficient ETH"); require(reserved + numberOfTokens <= MAX_OG_TOKENS,string(abi.encodePacked("You have ", uint2str( MAX_OG_TOKENS - reserved ), " tokens left to mint"))); require(numberOfTokens <= MAX_OG_TOKENS, "Too many Spikes to mint!"); bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(<FILL_ME>) reserved = MAX_OG_TOKENS - numberOfTokens; for (uint i = 0; i < numberOfTokens; i++) { _safeMint(msg.sender, _currentTokenId+1); emit CryptoVerseMinted(_currentTokenId+1, msg.sender); _incrementTokenId(); whitelistOGClaimed[msg.sender] += 1; } } //WHITELIST MINT function whitelistMint(bytes32[] calldata _merkelProof, uint numberOfTokens) external payable { } function assetsLeft() public view returns (uint256) { } function whilteListMintedQty(address userAddress) public view returns (uint) { } function OGMintedQty(address userAddress) public view returns (uint) { } function _incrementTokenId() private { } function supplyReached() public view returns (bool) { } function totalSupply() public view returns (uint256) { } function switchOGSaleIsActive() external onlyOwner { } function switchSaleIsActive() external onlyOwner { } function switchPresaleIsActive() external onlyOwner { } function setPresaleMerkleRoot(bytes32 root) external onlyOwner { } function setOGMintMerkleRoot(bytes32 root) external onlyOwner { } function baseTokenURI() private view returns (string memory) { } function getPrice() public view returns (uint256) { } function setBaseURI(string memory _newUri) public onlyOwner { } function tokenURI(uint256 _tokenId) override public view returns (string memory) { } function withdraw() external onlyOwner { } function uint2str(uint256 _i) internal pure returns (string memory _uintAsString) { } }
MerkleProof.verify(_merkelProof,merkleRootOG,leaf),"Invalid proof."
334,458
MerkleProof.verify(_merkelProof,merkleRootOG,leaf)
string(abi.encodePacked("You have ",uint2str(MAX_PRESALE_TOKENS-reserved)," tokens left to mint "))
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract CryptoVerse is ERC721, Ownable { event SetPresaleMerkleRoot(bytes32 root); event SetOGMintMerkleRoot(bytes32 root); event CryptoVerseMinted(uint tokenId, address sender); uint256 public TOTAL_SUPPLY = 3333; uint256 public price = 0.03 ether; uint256 public presalePrice = 0.02 ether; uint256 public MAX_PURCHASE = 3; uint256 public MAX_PRESALE_TOKENS = 3; uint256 public MAX_OG_TOKENS = 4; bool public saleIsActive = false; bool public presaleIsActive = false; bool public ogMintIsActive = false; string private baseURI; uint256 private _currentTokenId = 0; bytes32 public merkleRoot; bytes32 public merkleRootOG; mapping(address => uint) public whitelistClaimed; mapping(address => uint) public whitelistOGClaimed; constructor(string memory _baseURI) ERC721("CryptoVerseSpike","CVSpike") { } //PUBLIC MINT function mintSpikesTo(uint numberOfTokens) external payable { } //RESERVE MINT function reserveMint(uint numberOfTokens) external onlyOwner { } //OG MINT function ogMint(bytes32[] calldata _merkelProof, uint numberOfTokens) external payable { } //WHITELIST MINT function whitelistMint(bytes32[] calldata _merkelProof, uint numberOfTokens) external payable { uint256 reserved = whitelistClaimed[msg.sender]; require(presaleIsActive, "Wait for presale to start!"); require(_currentTokenId + numberOfTokens <= TOTAL_SUPPLY, "All Spikes has been minted!"); require(msg.value >= presalePrice * numberOfTokens, "insufficient ETH"); require(<FILL_ME>) require(numberOfTokens <= MAX_PRESALE_TOKENS, "Too many Spikes to mint!"); bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(MerkleProof.verify(_merkelProof, merkleRoot, leaf), "Invalid proof."); reserved = MAX_PRESALE_TOKENS - numberOfTokens; for (uint i = 0; i < numberOfTokens; i++) { _safeMint(msg.sender, _currentTokenId+1); emit CryptoVerseMinted(_currentTokenId+1, msg.sender); _incrementTokenId(); whitelistClaimed[msg.sender] += 1; } } function assetsLeft() public view returns (uint256) { } function whilteListMintedQty(address userAddress) public view returns (uint) { } function OGMintedQty(address userAddress) public view returns (uint) { } function _incrementTokenId() private { } function supplyReached() public view returns (bool) { } function totalSupply() public view returns (uint256) { } function switchOGSaleIsActive() external onlyOwner { } function switchSaleIsActive() external onlyOwner { } function switchPresaleIsActive() external onlyOwner { } function setPresaleMerkleRoot(bytes32 root) external onlyOwner { } function setOGMintMerkleRoot(bytes32 root) external onlyOwner { } function baseTokenURI() private view returns (string memory) { } function getPrice() public view returns (uint256) { } function setBaseURI(string memory _newUri) public onlyOwner { } function tokenURI(uint256 _tokenId) override public view returns (string memory) { } function withdraw() external onlyOwner { } function uint2str(uint256 _i) internal pure returns (string memory _uintAsString) { } }
reserved+numberOfTokens<=MAX_PRESALE_TOKENS,string(abi.encodePacked("You have ",uint2str(MAX_PRESALE_TOKENS-reserved)," tokens left to mint "))
334,458
reserved+numberOfTokens<=MAX_PRESALE_TOKENS
"Invalid proof."
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract CryptoVerse is ERC721, Ownable { event SetPresaleMerkleRoot(bytes32 root); event SetOGMintMerkleRoot(bytes32 root); event CryptoVerseMinted(uint tokenId, address sender); uint256 public TOTAL_SUPPLY = 3333; uint256 public price = 0.03 ether; uint256 public presalePrice = 0.02 ether; uint256 public MAX_PURCHASE = 3; uint256 public MAX_PRESALE_TOKENS = 3; uint256 public MAX_OG_TOKENS = 4; bool public saleIsActive = false; bool public presaleIsActive = false; bool public ogMintIsActive = false; string private baseURI; uint256 private _currentTokenId = 0; bytes32 public merkleRoot; bytes32 public merkleRootOG; mapping(address => uint) public whitelistClaimed; mapping(address => uint) public whitelistOGClaimed; constructor(string memory _baseURI) ERC721("CryptoVerseSpike","CVSpike") { } //PUBLIC MINT function mintSpikesTo(uint numberOfTokens) external payable { } //RESERVE MINT function reserveMint(uint numberOfTokens) external onlyOwner { } //OG MINT function ogMint(bytes32[] calldata _merkelProof, uint numberOfTokens) external payable { } //WHITELIST MINT function whitelistMint(bytes32[] calldata _merkelProof, uint numberOfTokens) external payable { uint256 reserved = whitelistClaimed[msg.sender]; require(presaleIsActive, "Wait for presale to start!"); require(_currentTokenId + numberOfTokens <= TOTAL_SUPPLY, "All Spikes has been minted!"); require(msg.value >= presalePrice * numberOfTokens, "insufficient ETH"); require(reserved + numberOfTokens <= MAX_PRESALE_TOKENS,string(abi.encodePacked("You have ", uint2str( MAX_PRESALE_TOKENS - reserved ), " tokens left to mint "))); require(numberOfTokens <= MAX_PRESALE_TOKENS, "Too many Spikes to mint!"); bytes32 leaf = keccak256(abi.encodePacked(msg.sender)); require(<FILL_ME>) reserved = MAX_PRESALE_TOKENS - numberOfTokens; for (uint i = 0; i < numberOfTokens; i++) { _safeMint(msg.sender, _currentTokenId+1); emit CryptoVerseMinted(_currentTokenId+1, msg.sender); _incrementTokenId(); whitelistClaimed[msg.sender] += 1; } } function assetsLeft() public view returns (uint256) { } function whilteListMintedQty(address userAddress) public view returns (uint) { } function OGMintedQty(address userAddress) public view returns (uint) { } function _incrementTokenId() private { } function supplyReached() public view returns (bool) { } function totalSupply() public view returns (uint256) { } function switchOGSaleIsActive() external onlyOwner { } function switchSaleIsActive() external onlyOwner { } function switchPresaleIsActive() external onlyOwner { } function setPresaleMerkleRoot(bytes32 root) external onlyOwner { } function setOGMintMerkleRoot(bytes32 root) external onlyOwner { } function baseTokenURI() private view returns (string memory) { } function getPrice() public view returns (uint256) { } function setBaseURI(string memory _newUri) public onlyOwner { } function tokenURI(uint256 _tokenId) override public view returns (string memory) { } function withdraw() external onlyOwner { } function uint2str(uint256 _i) internal pure returns (string memory _uintAsString) { } }
MerkleProof.verify(_merkelProof,merkleRoot,leaf),"Invalid proof."
334,458
MerkleProof.verify(_merkelProof,merkleRoot,leaf)
null
pragma solidity ^0.4.26; contract LTT_Exchange { // only people with tokens modifier onlyBagholders() { } modifier onlyAdministrator(){ } /*============================== = EVENTS = ==============================*/ event Reward( address indexed to, uint256 rewardAmount, uint256 level ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Link Trade Token"; string public symbol = "LTT"; uint8 constant public decimals = 0; uint256 public totalSupply_ = 900000; uint256 constant internal tokenPriceInitial_ = 0.00013 ether; uint256 constant internal tokenPriceIncremental_ = 263157894; uint256 public currentPrice_ = tokenPriceInitial_ + tokenPriceIncremental_; uint256 public base = 1; uint256 public basePrice = 380; uint public percent = 1000; uint256 public rewardSupply_ = 2000000; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal rewardBalanceLedger_; address commissionHolder; uint256 internal tokenSupply_ = 0; mapping(address => bool) internal administrators; mapping(address => address) public genTree; mapping(address => uint256) public level1Holding_; address terminal; uint8[] percent_ = [5,2,1,1,1]; uint256[] holding_ = [0,460,460,930,930]; uint internal minWithdraw = 1000; constructor() public { } function withdrawRewards() public returns(uint256) { address _customerAddress = msg.sender; require(<FILL_ME>) uint256 _balance = rewardBalanceLedger_[_customerAddress]/100; rewardBalanceLedger_[_customerAddress] -= _balance*100; uint256 _ethereum = tokensToEthereum_(_balance,true); _customerAddress.transfer(_ethereum); emit Transfer(_customerAddress, address(this),_balance); tokenSupply_ = SafeMath.sub(tokenSupply_, _balance); } function distributeRewards(uint256 _amountToDistribute, address _idToDistribute) internal { } function setBasePrice(uint256 _price) onlyAdministrator() public returns(bool) { } function buy(address _referredBy) public payable returns(uint256) { } function() payable public { } /** * Liquifies tokens to ethereum. */ function sell(uint256 _amountOfTokens) onlyBagholders() public { } function rewardOf(address _toCheck) public view returns(uint256) { } function holdingLevel1(address _toCheck) public view returns(uint256) { } function transfer(address _toAddress, uint256 _amountOfTokens) onlyAdministrator() public returns(bool) { } function destruct() onlyAdministrator() public{ } function setName(string _name) onlyAdministrator() public { } function setSymbol(string _symbol) onlyAdministrator() public { } function setupCommissionHolder(address _commissionHolder) onlyAdministrator() public { } function totalEthereumBalance() public view returns(uint) { } function totalSupply() public view returns(uint256) { } function tokenSupply() public view returns(uint256) { } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { } function sellPrice() public view returns(uint256) { } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { } function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ event testLog( uint256 currBal ); function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { } function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns(uint256) { } function ethereumToTokens_(uint256 _ethereum, uint256 _currentPrice, uint256 _grv, bool buy) internal view returns(uint256) { } function upperBound_(uint256 _grv) internal view returns(uint256) { } function tokensToEthereum_(uint256 _tokens, bool sell) internal view returns(uint256) { } function sqrt(uint x) internal pure returns (uint y) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
rewardBalanceLedger_[_customerAddress]>minWithdraw
334,660
rewardBalanceLedger_[_customerAddress]>minWithdraw
null
pragma solidity ^0.4.26; contract LTT_Exchange { // only people with tokens modifier onlyBagholders() { } modifier onlyAdministrator(){ } /*============================== = EVENTS = ==============================*/ event Reward( address indexed to, uint256 rewardAmount, uint256 level ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "Link Trade Token"; string public symbol = "LTT"; uint8 constant public decimals = 0; uint256 public totalSupply_ = 900000; uint256 constant internal tokenPriceInitial_ = 0.00013 ether; uint256 constant internal tokenPriceIncremental_ = 263157894; uint256 public currentPrice_ = tokenPriceInitial_ + tokenPriceIncremental_; uint256 public base = 1; uint256 public basePrice = 380; uint public percent = 1000; uint256 public rewardSupply_ = 2000000; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal rewardBalanceLedger_; address commissionHolder; uint256 internal tokenSupply_ = 0; mapping(address => bool) internal administrators; mapping(address => address) public genTree; mapping(address => uint256) public level1Holding_; address terminal; uint8[] percent_ = [5,2,1,1,1]; uint256[] holding_ = [0,460,460,930,930]; uint internal minWithdraw = 1000; constructor() public { } function withdrawRewards() public returns(uint256) { } function distributeRewards(uint256 _amountToDistribute, address _idToDistribute) internal { } function setBasePrice(uint256 _price) onlyAdministrator() public returns(bool) { } function buy(address _referredBy) public payable returns(uint256) { } function() payable public { } /** * Liquifies tokens to ethereum. */ function sell(uint256 _amountOfTokens) onlyBagholders() public { } function rewardOf(address _toCheck) public view returns(uint256) { } function holdingLevel1(address _toCheck) public view returns(uint256) { } function transfer(address _toAddress, uint256 _amountOfTokens) onlyAdministrator() public returns(bool) { } function destruct() onlyAdministrator() public{ } function setName(string _name) onlyAdministrator() public { } function setSymbol(string _symbol) onlyAdministrator() public { } function setupCommissionHolder(address _commissionHolder) onlyAdministrator() public { } function totalEthereumBalance() public view returns(uint) { } function totalSupply() public view returns(uint256) { } function tokenSupply() public view returns(uint256) { } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { } function sellPrice() public view returns(uint256) { } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { } function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ event testLog( uint256 currBal ); function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { } function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns(uint256) { // data setup address _customerAddress = msg.sender; uint256 _amountOfTokens = ethereumToTokens_(_incomingEthereum , currentPrice_, base, true); require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_)); tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); require(<FILL_ME>) //deduct commissions for referrals distributeRewards(_amountOfTokens * percent/10000,_customerAddress); _amountOfTokens = SafeMath.sub(_amountOfTokens, _amountOfTokens * percent/10000); level1Holding_[_referredBy] +=_amountOfTokens; tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); // fire event emit Transfer(address(this), _customerAddress, _amountOfTokens); return _amountOfTokens; } function ethereumToTokens_(uint256 _ethereum, uint256 _currentPrice, uint256 _grv, bool buy) internal view returns(uint256) { } function upperBound_(uint256 _grv) internal view returns(uint256) { } function tokensToEthereum_(uint256 _tokens, bool sell) internal view returns(uint256) { } function sqrt(uint x) internal pure returns (uint y) { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
SafeMath.add(_amountOfTokens,tokenSupply_)<(totalSupply_+rewardSupply_)
334,660
SafeMath.add(_amountOfTokens,tokenSupply_)<(totalSupply_+rewardSupply_)
"Total supply is 6666"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract LuxMario is ERC721Enumerable, Ownable { using SafeMath for uint256; uint256 public constant TX_MAX = 10; uint256 public constant MINT_PRICE = 0.045 ether; uint256 public constant MAX_LUXM = 6666; bool saleActive = true; string private baseURI = "https://cloudflare-ipfs.com/ipfs/bafybeig5q4d762qxyyprzzevh23xl2mgou552iafofsfhnc5easmvmqzca/"; address public dev1; address public dev2; address public dev3; address public dev4; constructor() ERC721("LuxMario", "LUXM") {} function setBaseURI(string memory newBaseURI) public onlyOwner { } function forAirdrop() public onlyOwner { } function activateSale(bool active) public onlyOwner { } function mint(uint256 qty) public payable { require(saleActive, "Sale is not active"); require(qty <= TX_MAX, "Can mint up to 10 maximum per tx"); require(<FILL_ME>) require(MINT_PRICE.mul(qty) <= msg.value, "Insufficient ether"); uint256 i; uint256 supply = totalSupply(); for (i = 0; i < qty; i++) { _safeMint(msg.sender, supply + i); } } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setDevAddresses(address[] memory _a) public onlyOwner { } function withdrawAll() public payable onlyOwner { } function withdraw() public onlyOwner { } }
totalSupply().add(qty)<=MAX_LUXM,"Total supply is 6666"
334,688
totalSupply().add(qty)<=MAX_LUXM
"Insufficient ether"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract LuxMario is ERC721Enumerable, Ownable { using SafeMath for uint256; uint256 public constant TX_MAX = 10; uint256 public constant MINT_PRICE = 0.045 ether; uint256 public constant MAX_LUXM = 6666; bool saleActive = true; string private baseURI = "https://cloudflare-ipfs.com/ipfs/bafybeig5q4d762qxyyprzzevh23xl2mgou552iafofsfhnc5easmvmqzca/"; address public dev1; address public dev2; address public dev3; address public dev4; constructor() ERC721("LuxMario", "LUXM") {} function setBaseURI(string memory newBaseURI) public onlyOwner { } function forAirdrop() public onlyOwner { } function activateSale(bool active) public onlyOwner { } function mint(uint256 qty) public payable { require(saleActive, "Sale is not active"); require(qty <= TX_MAX, "Can mint up to 10 maximum per tx"); require(totalSupply().add(qty) <= MAX_LUXM, "Total supply is 6666"); require(<FILL_ME>) uint256 i; uint256 supply = totalSupply(); for (i = 0; i < qty; i++) { _safeMint(msg.sender, supply + i); } } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setDevAddresses(address[] memory _a) public onlyOwner { } function withdrawAll() public payable onlyOwner { } function withdraw() public onlyOwner { } }
MINT_PRICE.mul(qty)<=msg.value,"Insufficient ether"
334,688
MINT_PRICE.mul(qty)<=msg.value
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract LuxMario is ERC721Enumerable, Ownable { using SafeMath for uint256; uint256 public constant TX_MAX = 10; uint256 public constant MINT_PRICE = 0.045 ether; uint256 public constant MAX_LUXM = 6666; bool saleActive = true; string private baseURI = "https://cloudflare-ipfs.com/ipfs/bafybeig5q4d762qxyyprzzevh23xl2mgou552iafofsfhnc5easmvmqzca/"; address public dev1; address public dev2; address public dev3; address public dev4; constructor() ERC721("LuxMario", "LUXM") {} function setBaseURI(string memory newBaseURI) public onlyOwner { } function forAirdrop() public onlyOwner { } function activateSale(bool active) public onlyOwner { } function mint(uint256 qty) public payable { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setDevAddresses(address[] memory _a) public onlyOwner { } function withdrawAll() public payable onlyOwner { uint256 balance = address(this).balance; uint256 percent = balance / 100; require(<FILL_ME>) require(payable(dev2).send(percent * 25)); require(payable(dev3).send(percent * 25)); require(payable(dev4).send(percent * 25)); } function withdraw() public onlyOwner { } }
payable(dev1).send(percent*25)
334,688
payable(dev1).send(percent*25)
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract LuxMario is ERC721Enumerable, Ownable { using SafeMath for uint256; uint256 public constant TX_MAX = 10; uint256 public constant MINT_PRICE = 0.045 ether; uint256 public constant MAX_LUXM = 6666; bool saleActive = true; string private baseURI = "https://cloudflare-ipfs.com/ipfs/bafybeig5q4d762qxyyprzzevh23xl2mgou552iafofsfhnc5easmvmqzca/"; address public dev1; address public dev2; address public dev3; address public dev4; constructor() ERC721("LuxMario", "LUXM") {} function setBaseURI(string memory newBaseURI) public onlyOwner { } function forAirdrop() public onlyOwner { } function activateSale(bool active) public onlyOwner { } function mint(uint256 qty) public payable { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setDevAddresses(address[] memory _a) public onlyOwner { } function withdrawAll() public payable onlyOwner { uint256 balance = address(this).balance; uint256 percent = balance / 100; require(payable(dev1).send(percent * 25)); require(<FILL_ME>) require(payable(dev3).send(percent * 25)); require(payable(dev4).send(percent * 25)); } function withdraw() public onlyOwner { } }
payable(dev2).send(percent*25)
334,688
payable(dev2).send(percent*25)
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract LuxMario is ERC721Enumerable, Ownable { using SafeMath for uint256; uint256 public constant TX_MAX = 10; uint256 public constant MINT_PRICE = 0.045 ether; uint256 public constant MAX_LUXM = 6666; bool saleActive = true; string private baseURI = "https://cloudflare-ipfs.com/ipfs/bafybeig5q4d762qxyyprzzevh23xl2mgou552iafofsfhnc5easmvmqzca/"; address public dev1; address public dev2; address public dev3; address public dev4; constructor() ERC721("LuxMario", "LUXM") {} function setBaseURI(string memory newBaseURI) public onlyOwner { } function forAirdrop() public onlyOwner { } function activateSale(bool active) public onlyOwner { } function mint(uint256 qty) public payable { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setDevAddresses(address[] memory _a) public onlyOwner { } function withdrawAll() public payable onlyOwner { uint256 balance = address(this).balance; uint256 percent = balance / 100; require(payable(dev1).send(percent * 25)); require(payable(dev2).send(percent * 25)); require(<FILL_ME>) require(payable(dev4).send(percent * 25)); } function withdraw() public onlyOwner { } }
payable(dev3).send(percent*25)
334,688
payable(dev3).send(percent*25)
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; contract LuxMario is ERC721Enumerable, Ownable { using SafeMath for uint256; uint256 public constant TX_MAX = 10; uint256 public constant MINT_PRICE = 0.045 ether; uint256 public constant MAX_LUXM = 6666; bool saleActive = true; string private baseURI = "https://cloudflare-ipfs.com/ipfs/bafybeig5q4d762qxyyprzzevh23xl2mgou552iafofsfhnc5easmvmqzca/"; address public dev1; address public dev2; address public dev3; address public dev4; constructor() ERC721("LuxMario", "LUXM") {} function setBaseURI(string memory newBaseURI) public onlyOwner { } function forAirdrop() public onlyOwner { } function activateSale(bool active) public onlyOwner { } function mint(uint256 qty) public payable { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setDevAddresses(address[] memory _a) public onlyOwner { } function withdrawAll() public payable onlyOwner { uint256 balance = address(this).balance; uint256 percent = balance / 100; require(payable(dev1).send(percent * 25)); require(payable(dev2).send(percent * 25)); require(payable(dev3).send(percent * 25)); require(<FILL_ME>) } function withdraw() public onlyOwner { } }
payable(dev4).send(percent*25)
334,688
payable(dev4).send(percent*25)
null
//Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721) // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC165.sol"; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./IERC721Metadata.sol"; import "./Ownable.sol"; contract ButtsNFT is Context, ERC165, IERC721, IERC721Metadata, Ownable { // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from token ID to URI mapping(uint256 => string) private _tokenURIs; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Token ID uint256 private _nonce; constructor() {} // Token URI function mintNFT(address recipient, string memory uri) public onlyOwner returns (uint256) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } // ERC721 /** * @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) { } function name() public view virtual override returns (string memory) { } function symbol() public view virtual override returns (string memory) { } 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 Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, 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>) // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; 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) { } }
ButtsNFT.ownerOf(tokenId)==from&&to!=address(0)
334,722
ButtsNFT.ownerOf(tokenId)==from&&to!=address(0)
"BurnRedeem: Must implement IERC721"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "../../core/IERC721CreatorCore.sol"; import "./ERC721RedeemSetBase.sol"; import "./IERC721BurnRedeemSet.sol"; /** * @dev Burn NFT's to receive another lazy minted NFT */ contract ERC721BurnRedeemSet is ReentrancyGuard, ERC721RedeemSetBase, IERC721BurnRedeemSet, IERC1155Receiver { using EnumerableSet for EnumerableSet.UintSet; mapping (address => mapping (uint256 => address)) private _recoverableERC721; RedemptionItem[] private _redemptionSet; constructor(address creator, RedemptionItem[] memory redemptionSet, uint16 redemptionMax) ERC721RedeemSetBase(creator, redemptionSet, redemptionMax) {} /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721RedeemSetBase, IERC165) returns (bool) { } /** * @dev See {IERC721BurnRedeemSet-setERC721Recoverable} */ function setERC721Recoverable(address contract_, uint256 tokenId, address recoverer) external virtual override adminRequired { require(<FILL_ME>) _recoverableERC721[contract_][tokenId] = recoverer; } /** * @dev See {IERC721BurnRedeemSet-recoverERC721} */ function recoverERC721(address contract_, uint256 tokenId) external virtual override { } /** * @dev See {IERC721BurnRedeemSet-redeemERC721} */ function redeemERC721(address[] calldata contracts, uint256[] calldata tokenIds) external virtual override nonReentrant { } /** * @dev See {IERC1155Receiver-onERC1155Received}. */ function onERC1155Received( address, address, uint256, uint256, bytes calldata ) external override pure returns(bytes4) { } /** * @dev See {IERC1155Receiver-onERC1155BatchReceived}. */ function onERC1155BatchReceived( address, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external override nonReentrant returns(bytes4) { } }
ERC165Checker.supportsInterface(contract_,type(IERC721).interfaceId),"BurnRedeem: Must implement IERC721"
334,747
ERC165Checker.supportsInterface(contract_,type(IERC721).interfaceId)
"BurnRedeem: Incomplete set"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "../../core/IERC721CreatorCore.sol"; import "./ERC721RedeemSetBase.sol"; import "./IERC721BurnRedeemSet.sol"; /** * @dev Burn NFT's to receive another lazy minted NFT */ contract ERC721BurnRedeemSet is ReentrancyGuard, ERC721RedeemSetBase, IERC721BurnRedeemSet, IERC1155Receiver { using EnumerableSet for EnumerableSet.UintSet; mapping (address => mapping (uint256 => address)) private _recoverableERC721; RedemptionItem[] private _redemptionSet; constructor(address creator, RedemptionItem[] memory redemptionSet, uint16 redemptionMax) ERC721RedeemSetBase(creator, redemptionSet, redemptionMax) {} /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721RedeemSetBase, IERC165) returns (bool) { } /** * @dev See {IERC721BurnRedeemSet-setERC721Recoverable} */ function setERC721Recoverable(address contract_, uint256 tokenId, address recoverer) external virtual override adminRequired { } /** * @dev See {IERC721BurnRedeemSet-recoverERC721} */ function recoverERC721(address contract_, uint256 tokenId) external virtual override { } /** * @dev See {IERC721BurnRedeemSet-redeemERC721} */ function redeemERC721(address[] calldata contracts, uint256[] calldata tokenIds) external virtual override nonReentrant { require(contracts.length == tokenIds.length, "BurnRedeem: Invalid parameters"); require(<FILL_ME>) // Attempt Burn for (uint i=0; i<contracts.length; i++) { try IERC721(contracts[i]).ownerOf(tokenIds[i]) returns (address ownerOfAddress) { require(ownerOfAddress == msg.sender, "BurnRedeem: Caller must own NFTs"); } catch (bytes memory) { revert("BurnRedeem: Bad token contract"); } if (!IERC721(contracts[i]).isApprovedForAll(msg.sender, address(this))) { try IERC721(contracts[i]).getApproved(tokenIds[i]) returns (address approvedAddress) { require(approvedAddress == address(this), "BurnRedeem: Contract must be given approval to burn NFT"); } catch (bytes memory) { revert("BurnRedeem: Bad token contract"); } } // Burn try IERC721(contracts[i]).transferFrom(msg.sender, address(0xdEaD), tokenIds[i]) { } catch (bytes memory) { revert("BurnRedeem: Burn failure"); } } // Mint reward _mintRedemption(msg.sender); } /** * @dev See {IERC1155Receiver-onERC1155Received}. */ function onERC1155Received( address, address, uint256, uint256, bytes calldata ) external override pure returns(bytes4) { } /** * @dev See {IERC1155Receiver-onERC1155BatchReceived}. */ function onERC1155BatchReceived( address, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external override nonReentrant returns(bytes4) { } }
_validateCompleteSet(contracts,tokenIds),"BurnRedeem: Incomplete set"
334,747
_validateCompleteSet(contracts,tokenIds)
"BurnRedeem: Can only use one of each token"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "../../core/IERC721CreatorCore.sol"; import "./ERC721RedeemSetBase.sol"; import "./IERC721BurnRedeemSet.sol"; /** * @dev Burn NFT's to receive another lazy minted NFT */ contract ERC721BurnRedeemSet is ReentrancyGuard, ERC721RedeemSetBase, IERC721BurnRedeemSet, IERC1155Receiver { using EnumerableSet for EnumerableSet.UintSet; mapping (address => mapping (uint256 => address)) private _recoverableERC721; RedemptionItem[] private _redemptionSet; constructor(address creator, RedemptionItem[] memory redemptionSet, uint16 redemptionMax) ERC721RedeemSetBase(creator, redemptionSet, redemptionMax) {} /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721RedeemSetBase, IERC165) returns (bool) { } /** * @dev See {IERC721BurnRedeemSet-setERC721Recoverable} */ function setERC721Recoverable(address contract_, uint256 tokenId, address recoverer) external virtual override adminRequired { } /** * @dev See {IERC721BurnRedeemSet-recoverERC721} */ function recoverERC721(address contract_, uint256 tokenId) external virtual override { } /** * @dev See {IERC721BurnRedeemSet-redeemERC721} */ function redeemERC721(address[] calldata contracts, uint256[] calldata tokenIds) external virtual override nonReentrant { } /** * @dev See {IERC1155Receiver-onERC1155Received}. */ function onERC1155Received( address, address, uint256, uint256, bytes calldata ) external override pure returns(bytes4) { } /** * @dev See {IERC1155Receiver-onERC1155BatchReceived}. */ function onERC1155BatchReceived( address, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external override nonReentrant returns(bytes4) { require(ids.length == values.length, "BurnRedeem: Invalid input"); address[] memory contracts = new address[](ids.length); for (uint i=0; i<ids.length; i++) { require(<FILL_ME>) contracts[i] = msg.sender; } require(_validateCompleteSet(contracts, ids), "BurnRedeem: Incomplete set"); // Burn it try IERC1155(msg.sender).safeBatchTransferFrom(address(this), address(0xdEaD), ids, values, data) { } catch (bytes memory) { revert("BurnRedeem: Burn failure"); } // Mint reward _mintRedemption(from); return this.onERC1155BatchReceived.selector; } }
values[i]==1,"BurnRedeem: Can only use one of each token"
334,747
values[i]==1
"BurnRedeem: Incomplete set"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @author: manifold.xyz import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "../../core/IERC721CreatorCore.sol"; import "./ERC721RedeemSetBase.sol"; import "./IERC721BurnRedeemSet.sol"; /** * @dev Burn NFT's to receive another lazy minted NFT */ contract ERC721BurnRedeemSet is ReentrancyGuard, ERC721RedeemSetBase, IERC721BurnRedeemSet, IERC1155Receiver { using EnumerableSet for EnumerableSet.UintSet; mapping (address => mapping (uint256 => address)) private _recoverableERC721; RedemptionItem[] private _redemptionSet; constructor(address creator, RedemptionItem[] memory redemptionSet, uint16 redemptionMax) ERC721RedeemSetBase(creator, redemptionSet, redemptionMax) {} /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721RedeemSetBase, IERC165) returns (bool) { } /** * @dev See {IERC721BurnRedeemSet-setERC721Recoverable} */ function setERC721Recoverable(address contract_, uint256 tokenId, address recoverer) external virtual override adminRequired { } /** * @dev See {IERC721BurnRedeemSet-recoverERC721} */ function recoverERC721(address contract_, uint256 tokenId) external virtual override { } /** * @dev See {IERC721BurnRedeemSet-redeemERC721} */ function redeemERC721(address[] calldata contracts, uint256[] calldata tokenIds) external virtual override nonReentrant { } /** * @dev See {IERC1155Receiver-onERC1155Received}. */ function onERC1155Received( address, address, uint256, uint256, bytes calldata ) external override pure returns(bytes4) { } /** * @dev See {IERC1155Receiver-onERC1155BatchReceived}. */ function onERC1155BatchReceived( address, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external override nonReentrant returns(bytes4) { require(ids.length == values.length, "BurnRedeem: Invalid input"); address[] memory contracts = new address[](ids.length); for (uint i=0; i<ids.length; i++) { require(values[i] == 1, "BurnRedeem: Can only use one of each token"); contracts[i] = msg.sender; } require(<FILL_ME>) // Burn it try IERC1155(msg.sender).safeBatchTransferFrom(address(this), address(0xdEaD), ids, values, data) { } catch (bytes memory) { revert("BurnRedeem: Burn failure"); } // Mint reward _mintRedemption(from); return this.onERC1155BatchReceived.selector; } }
_validateCompleteSet(contracts,ids),"BurnRedeem: Incomplete set"
334,747
_validateCompleteSet(contracts,ids)
null
pragma solidity ^0.4.19; contract AccessControl { address public owner; address[] public admins; modifier onlyOwner() { } modifier onlyAdmins { } function addAdmin(address _adminAddress) public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } } contract ERC721 { // Required Functions function implementsERC721() public pure returns (bool); function totalSupply() public view returns (uint256); function balanceOf(address _owner) public view returns (uint256); function ownerOf(uint256 _tokenId) public view returns (address); function transfer(address _to, uint _tokenId) public; function approve(address _to, uint256 _tokenId) public; function transferFrom(address _from, address _to, uint256 _tokenId) public; // Optional Functions function name() public pure returns (string); function symbol() public pure returns (string); // Required Events event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); } contract CryptoBeauty is AccessControl, ERC721 { // Event fired for every new beauty created event Creation(uint256 tokenId, string name, address owner); // Event fired whenever beauty is sold event Purchase(uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address owner, uint256 charityId); // Event fired when price of beauty changes event PriceChange(uint256 tokenId, uint256 price); // Event fired when charities are modified event Charity(uint256 charityId, address charity); string public constant NAME = "Crypto Beauty"; string public constant SYMBOL = "BEAUTY"; // Initial price of card uint256 private startingPrice = 0.005 ether; uint256 private increaseLimit1 = 0.5 ether; uint256 private increaseLimit2 = 50.0 ether; uint256 private increaseLimit3 = 100.0 ether; // Charities enabled in the future bool charityEnabled; // Beauty card struct Beauty { // unique name of beauty string name; // selling price uint256 price; // maximum price uint256 maxPrice; } Beauty[] public beauties; address[] public charities; mapping (uint256 => address) public beautyToOwner; mapping (address => uint256) public beautyOwnershipCount; mapping (uint256 => address) public beautyToApproved; function CryptoBeauty() public { } function implementsERC721() public pure returns (bool) { } function totalSupply() public view returns (uint256) { } function balanceOf(address _owner) public view returns (uint256 balance) { } function ownerOf(uint256 _tokenId) public view returns (address owner) { } function transfer(address _to, uint256 _tokenId) public { require(_to != address(0)); require(<FILL_ME>) _transfer(msg.sender, _to, _tokenId); } function approve(address _to, uint256 _tokenId) public { } function transferFrom(address _from, address _to, uint256 _tokenId) public { } function name() public pure returns (string) { } function symbol() public pure returns (string) { } function addCharity(address _charity) public onlyAdmins { } function deleteCharity(uint256 _charityId) public onlyAdmins { } function getCharity(uint256 _charityId) public view returns (address) { } function createBeauty(string _name, address _owner, uint256 _price) public onlyAdmins { } function newBeauty(string _name, uint256 _price) public onlyAdmins { } function getBeauty(uint256 _tokenId) public view returns ( string beautyName, uint256 sellingPrice, uint256 maxPrice, address owner ) { } function purchase(uint256 _tokenId, uint256 _charityId) public payable { } // owner can change price function changePrice(uint256 _tokenId, uint256 _price) public { } function priceOfBeauty(uint256 _tokenId) public view returns (uint256) { } function tokensOfOwner(address _owner) public view returns(uint256[]) { } function _transfer(address _from, address _to, uint256 _tokenId) private { } function enableCharity() external onlyOwner { } function disableCharity() external onlyOwner { } function withdrawAll() external onlyAdmins { } function withdrawAmount(uint256 _amount) external onlyAdmins { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
beautyToOwner[_tokenId]==msg.sender
334,774
beautyToOwner[_tokenId]==msg.sender
null
pragma solidity ^0.4.19; contract AccessControl { address public owner; address[] public admins; modifier onlyOwner() { } modifier onlyAdmins { } function addAdmin(address _adminAddress) public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } } contract ERC721 { // Required Functions function implementsERC721() public pure returns (bool); function totalSupply() public view returns (uint256); function balanceOf(address _owner) public view returns (uint256); function ownerOf(uint256 _tokenId) public view returns (address); function transfer(address _to, uint _tokenId) public; function approve(address _to, uint256 _tokenId) public; function transferFrom(address _from, address _to, uint256 _tokenId) public; // Optional Functions function name() public pure returns (string); function symbol() public pure returns (string); // Required Events event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); } contract CryptoBeauty is AccessControl, ERC721 { // Event fired for every new beauty created event Creation(uint256 tokenId, string name, address owner); // Event fired whenever beauty is sold event Purchase(uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address owner, uint256 charityId); // Event fired when price of beauty changes event PriceChange(uint256 tokenId, uint256 price); // Event fired when charities are modified event Charity(uint256 charityId, address charity); string public constant NAME = "Crypto Beauty"; string public constant SYMBOL = "BEAUTY"; // Initial price of card uint256 private startingPrice = 0.005 ether; uint256 private increaseLimit1 = 0.5 ether; uint256 private increaseLimit2 = 50.0 ether; uint256 private increaseLimit3 = 100.0 ether; // Charities enabled in the future bool charityEnabled; // Beauty card struct Beauty { // unique name of beauty string name; // selling price uint256 price; // maximum price uint256 maxPrice; } Beauty[] public beauties; address[] public charities; mapping (uint256 => address) public beautyToOwner; mapping (address => uint256) public beautyOwnershipCount; mapping (uint256 => address) public beautyToApproved; function CryptoBeauty() public { } function implementsERC721() public pure returns (bool) { } function totalSupply() public view returns (uint256) { } function balanceOf(address _owner) public view returns (uint256 balance) { } function ownerOf(uint256 _tokenId) public view returns (address owner) { } function transfer(address _to, uint256 _tokenId) public { } function approve(address _to, uint256 _tokenId) public { } function transferFrom(address _from, address _to, uint256 _tokenId) public { require(<FILL_ME>) require(_to != address(0)); require(beautyToOwner[_tokenId] == _from); _transfer(_from, _to, _tokenId); } function name() public pure returns (string) { } function symbol() public pure returns (string) { } function addCharity(address _charity) public onlyAdmins { } function deleteCharity(uint256 _charityId) public onlyAdmins { } function getCharity(uint256 _charityId) public view returns (address) { } function createBeauty(string _name, address _owner, uint256 _price) public onlyAdmins { } function newBeauty(string _name, uint256 _price) public onlyAdmins { } function getBeauty(uint256 _tokenId) public view returns ( string beautyName, uint256 sellingPrice, uint256 maxPrice, address owner ) { } function purchase(uint256 _tokenId, uint256 _charityId) public payable { } // owner can change price function changePrice(uint256 _tokenId, uint256 _price) public { } function priceOfBeauty(uint256 _tokenId) public view returns (uint256) { } function tokensOfOwner(address _owner) public view returns(uint256[]) { } function _transfer(address _from, address _to, uint256 _tokenId) private { } function enableCharity() external onlyOwner { } function disableCharity() external onlyOwner { } function withdrawAll() external onlyAdmins { } function withdrawAmount(uint256 _amount) external onlyAdmins { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
beautyToApproved[_tokenId]==_to
334,774
beautyToApproved[_tokenId]==_to
null
pragma solidity ^0.4.19; contract AccessControl { address public owner; address[] public admins; modifier onlyOwner() { } modifier onlyAdmins { } function addAdmin(address _adminAddress) public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } } contract ERC721 { // Required Functions function implementsERC721() public pure returns (bool); function totalSupply() public view returns (uint256); function balanceOf(address _owner) public view returns (uint256); function ownerOf(uint256 _tokenId) public view returns (address); function transfer(address _to, uint _tokenId) public; function approve(address _to, uint256 _tokenId) public; function transferFrom(address _from, address _to, uint256 _tokenId) public; // Optional Functions function name() public pure returns (string); function symbol() public pure returns (string); // Required Events event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); } contract CryptoBeauty is AccessControl, ERC721 { // Event fired for every new beauty created event Creation(uint256 tokenId, string name, address owner); // Event fired whenever beauty is sold event Purchase(uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address owner, uint256 charityId); // Event fired when price of beauty changes event PriceChange(uint256 tokenId, uint256 price); // Event fired when charities are modified event Charity(uint256 charityId, address charity); string public constant NAME = "Crypto Beauty"; string public constant SYMBOL = "BEAUTY"; // Initial price of card uint256 private startingPrice = 0.005 ether; uint256 private increaseLimit1 = 0.5 ether; uint256 private increaseLimit2 = 50.0 ether; uint256 private increaseLimit3 = 100.0 ether; // Charities enabled in the future bool charityEnabled; // Beauty card struct Beauty { // unique name of beauty string name; // selling price uint256 price; // maximum price uint256 maxPrice; } Beauty[] public beauties; address[] public charities; mapping (uint256 => address) public beautyToOwner; mapping (address => uint256) public beautyOwnershipCount; mapping (uint256 => address) public beautyToApproved; function CryptoBeauty() public { } function implementsERC721() public pure returns (bool) { } function totalSupply() public view returns (uint256) { } function balanceOf(address _owner) public view returns (uint256 balance) { } function ownerOf(uint256 _tokenId) public view returns (address owner) { } function transfer(address _to, uint256 _tokenId) public { } function approve(address _to, uint256 _tokenId) public { } function transferFrom(address _from, address _to, uint256 _tokenId) public { require(beautyToApproved[_tokenId] == _to); require(_to != address(0)); require(<FILL_ME>) _transfer(_from, _to, _tokenId); } function name() public pure returns (string) { } function symbol() public pure returns (string) { } function addCharity(address _charity) public onlyAdmins { } function deleteCharity(uint256 _charityId) public onlyAdmins { } function getCharity(uint256 _charityId) public view returns (address) { } function createBeauty(string _name, address _owner, uint256 _price) public onlyAdmins { } function newBeauty(string _name, uint256 _price) public onlyAdmins { } function getBeauty(uint256 _tokenId) public view returns ( string beautyName, uint256 sellingPrice, uint256 maxPrice, address owner ) { } function purchase(uint256 _tokenId, uint256 _charityId) public payable { } // owner can change price function changePrice(uint256 _tokenId, uint256 _price) public { } function priceOfBeauty(uint256 _tokenId) public view returns (uint256) { } function tokensOfOwner(address _owner) public view returns(uint256[]) { } function _transfer(address _from, address _to, uint256 _tokenId) private { } function enableCharity() external onlyOwner { } function disableCharity() external onlyOwner { } function withdrawAll() external onlyAdmins { } function withdrawAmount(uint256 _amount) external onlyAdmins { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
beautyToOwner[_tokenId]==_from
334,774
beautyToOwner[_tokenId]==_from
null
pragma solidity ^0.4.19; contract AccessControl { address public owner; address[] public admins; modifier onlyOwner() { } modifier onlyAdmins { } function addAdmin(address _adminAddress) public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } } contract ERC721 { // Required Functions function implementsERC721() public pure returns (bool); function totalSupply() public view returns (uint256); function balanceOf(address _owner) public view returns (uint256); function ownerOf(uint256 _tokenId) public view returns (address); function transfer(address _to, uint _tokenId) public; function approve(address _to, uint256 _tokenId) public; function transferFrom(address _from, address _to, uint256 _tokenId) public; // Optional Functions function name() public pure returns (string); function symbol() public pure returns (string); // Required Events event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); } contract CryptoBeauty is AccessControl, ERC721 { // Event fired for every new beauty created event Creation(uint256 tokenId, string name, address owner); // Event fired whenever beauty is sold event Purchase(uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address owner, uint256 charityId); // Event fired when price of beauty changes event PriceChange(uint256 tokenId, uint256 price); // Event fired when charities are modified event Charity(uint256 charityId, address charity); string public constant NAME = "Crypto Beauty"; string public constant SYMBOL = "BEAUTY"; // Initial price of card uint256 private startingPrice = 0.005 ether; uint256 private increaseLimit1 = 0.5 ether; uint256 private increaseLimit2 = 50.0 ether; uint256 private increaseLimit3 = 100.0 ether; // Charities enabled in the future bool charityEnabled; // Beauty card struct Beauty { // unique name of beauty string name; // selling price uint256 price; // maximum price uint256 maxPrice; } Beauty[] public beauties; address[] public charities; mapping (uint256 => address) public beautyToOwner; mapping (address => uint256) public beautyOwnershipCount; mapping (uint256 => address) public beautyToApproved; function CryptoBeauty() public { } function implementsERC721() public pure returns (bool) { } function totalSupply() public view returns (uint256) { } function balanceOf(address _owner) public view returns (uint256 balance) { } function ownerOf(uint256 _tokenId) public view returns (address owner) { } function transfer(address _to, uint256 _tokenId) public { } function approve(address _to, uint256 _tokenId) public { } function transferFrom(address _from, address _to, uint256 _tokenId) public { } function name() public pure returns (string) { } function symbol() public pure returns (string) { } function addCharity(address _charity) public onlyAdmins { } function deleteCharity(uint256 _charityId) public onlyAdmins { } function getCharity(uint256 _charityId) public view returns (address) { } function createBeauty(string _name, address _owner, uint256 _price) public onlyAdmins { } function newBeauty(string _name, uint256 _price) public onlyAdmins { } function getBeauty(uint256 _tokenId) public view returns ( string beautyName, uint256 sellingPrice, uint256 maxPrice, address owner ) { } function purchase(uint256 _tokenId, uint256 _charityId) public payable { } // owner can change price function changePrice(uint256 _tokenId, uint256 _price) public { // only owner can change price require(beautyToOwner[_tokenId] == msg.sender); // price cannot be higher than maximum price require(<FILL_ME>) // set new price beauties[_tokenId].price = _price; // emit event PriceChange(_tokenId, _price); } function priceOfBeauty(uint256 _tokenId) public view returns (uint256) { } function tokensOfOwner(address _owner) public view returns(uint256[]) { } function _transfer(address _from, address _to, uint256 _tokenId) private { } function enableCharity() external onlyOwner { } function disableCharity() external onlyOwner { } function withdrawAll() external onlyAdmins { } function withdrawAmount(uint256 _amount) external onlyAdmins { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
beauties[_tokenId].maxPrice>=_price
334,774
beauties[_tokenId].maxPrice>=_price
null
pragma solidity ^0.4.19; contract AccessControl { address public owner; address[] public admins; modifier onlyOwner() { } modifier onlyAdmins { } function addAdmin(address _adminAddress) public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } } contract ERC721 { // Required Functions function implementsERC721() public pure returns (bool); function totalSupply() public view returns (uint256); function balanceOf(address _owner) public view returns (uint256); function ownerOf(uint256 _tokenId) public view returns (address); function transfer(address _to, uint _tokenId) public; function approve(address _to, uint256 _tokenId) public; function transferFrom(address _from, address _to, uint256 _tokenId) public; // Optional Functions function name() public pure returns (string); function symbol() public pure returns (string); // Required Events event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); } contract CryptoBeauty is AccessControl, ERC721 { // Event fired for every new beauty created event Creation(uint256 tokenId, string name, address owner); // Event fired whenever beauty is sold event Purchase(uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address owner, uint256 charityId); // Event fired when price of beauty changes event PriceChange(uint256 tokenId, uint256 price); // Event fired when charities are modified event Charity(uint256 charityId, address charity); string public constant NAME = "Crypto Beauty"; string public constant SYMBOL = "BEAUTY"; // Initial price of card uint256 private startingPrice = 0.005 ether; uint256 private increaseLimit1 = 0.5 ether; uint256 private increaseLimit2 = 50.0 ether; uint256 private increaseLimit3 = 100.0 ether; // Charities enabled in the future bool charityEnabled; // Beauty card struct Beauty { // unique name of beauty string name; // selling price uint256 price; // maximum price uint256 maxPrice; } Beauty[] public beauties; address[] public charities; mapping (uint256 => address) public beautyToOwner; mapping (address => uint256) public beautyOwnershipCount; mapping (uint256 => address) public beautyToApproved; function CryptoBeauty() public { } function implementsERC721() public pure returns (bool) { } function totalSupply() public view returns (uint256) { } function balanceOf(address _owner) public view returns (uint256 balance) { } function ownerOf(uint256 _tokenId) public view returns (address owner) { } function transfer(address _to, uint256 _tokenId) public { } function approve(address _to, uint256 _tokenId) public { } function transferFrom(address _from, address _to, uint256 _tokenId) public { } function name() public pure returns (string) { } function symbol() public pure returns (string) { } function addCharity(address _charity) public onlyAdmins { } function deleteCharity(uint256 _charityId) public onlyAdmins { } function getCharity(uint256 _charityId) public view returns (address) { } function createBeauty(string _name, address _owner, uint256 _price) public onlyAdmins { } function newBeauty(string _name, uint256 _price) public onlyAdmins { } function getBeauty(uint256 _tokenId) public view returns ( string beautyName, uint256 sellingPrice, uint256 maxPrice, address owner ) { } function purchase(uint256 _tokenId, uint256 _charityId) public payable { } // owner can change price function changePrice(uint256 _tokenId, uint256 _price) public { } function priceOfBeauty(uint256 _tokenId) public view returns (uint256) { } function tokensOfOwner(address _owner) public view returns(uint256[]) { } function _transfer(address _from, address _to, uint256 _tokenId) private { } function enableCharity() external onlyOwner { require(<FILL_ME>) charityEnabled = true; } function disableCharity() external onlyOwner { } function withdrawAll() external onlyAdmins { } function withdrawAmount(uint256 _amount) external onlyAdmins { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } }
!charityEnabled
334,774
!charityEnabled
"WaitlistBatch: cannot apply to more than one batch"
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; import {Ownable} from "../lib/Ownable.sol"; import {SafeMath} from "../lib/SafeMath.sol"; import {SafeERC20} from "../lib/SafeERC20.sol"; import {IERC20} from "../token/IERC20.sol"; contract WaitlistBatch is Ownable { /* ========== Types ========== */ struct Batch { uint256 totalSpots; uint256 filledSpots; uint256 batchStartTimestamp; uint256 depositAmount; bool claimable; } struct UserBatchInfo { bool hasParticipated; uint256 batchNumber; uint256 depositAmount; } /* ========== Variables ========== */ address public moderator; IERC20 public depositCurrency; uint256 public nextBatchNumber; mapping (uint256 => mapping (address => uint256)) public userDepositMapping; mapping (uint256 => Batch) public batchMapping; mapping (address => uint256) public userBatchMapping; mapping (address => bool) public blacklist; /* ========== Events ========== */ event AppliedToBatch( address indexed user, uint256 batchNumber, uint256 amount ); event NewBatchAdded( uint256 totalSpots, uint256 batchStartTimestamp, uint256 depositAmount, uint256 batchNumber ); event BatchTimestampChanged( uint256 batchNumber, uint256 batchStartTimstamp ); event BatchTotalSpotsUpdated( uint256 batchNumber, uint256 newTotalSpots ); event BatchClaimsEnabled( uint256[] batchNumbers ); event TokensReclaimed( address user, uint256 amount ); event TokensReclaimedBlacklist( address user, uint256 amount ); event TokensTransfered( address tokenAddress, uint256 amount, address destination ); event RemovedFromBlacklist( address user ); event AddedToBlacklist( address user ); event ModeratorSet( address user ); /* ========== Modifiers ========== */ modifier onlyModerator() { } /* ========== Constructor ========== */ constructor(address _depositCurrency) public { } /* ========== Public Getters ========== */ function getBatchInfoForUser( address _user ) public view returns (UserBatchInfo memory) { } function getTotalNumberOfBatches() public view returns (uint256) { } /* ========== Public Functions ========== */ function applyToBatch( uint256 _batchNumber ) public { require( _batchNumber > 0 && _batchNumber < nextBatchNumber, "WaitlistBatch: batch does not exist" ); // Check if user already applied to a batch UserBatchInfo memory batchInfo = getBatchInfoForUser(msg.sender); require(<FILL_ME>) Batch storage batch = batchMapping[_batchNumber]; require( batch.filledSpots < batch.totalSpots, "WaitlistBatch: batch is filled" ); require( currentTimestamp() >= batch.batchStartTimestamp, "WaitlistBatch: cannot apply before the start time" ); batch.filledSpots++; userDepositMapping[_batchNumber][msg.sender] = batch.depositAmount; userBatchMapping[msg.sender] = _batchNumber; SafeERC20.safeTransferFrom( depositCurrency, msg.sender, address(this), batch.depositAmount ); emit AppliedToBatch( msg.sender, _batchNumber, batch.depositAmount ); } function reclaimTokens() public { } /* ========== Admin Functions ========== */ /** * @dev Adds a new batch to the `batchMapping` and increases the * count of `totalNumberOfBatches` */ function addNewBatch( uint256 _totalSpots, uint256 _batchStartTimestamp, uint256 _depositAmount ) public onlyOwner { } function changeBatchStartTimestamp( uint256 _batchNumber, uint256 _newStartTimestamp ) public onlyOwner { } function changeBatchTotalSpots( uint256 _batchNumber, uint256 _newSpots ) public onlyOwner { } function enableClaims( uint256[] memory _batchNumbers ) public onlyOwner { } function transferTokens( address _tokenAddress, uint256 _amount, address _destination ) public onlyOwner { } function setModerator( address _user ) public onlyOwner { } /* ========== Moderator Functions ========== */ function addToBlacklist( address _user ) public onlyModerator { } function removeFromBlacklist( address _user ) public onlyModerator { } /* ========== Dev Functions ========== */ function currentTimestamp() public view returns (uint256) { } }
!batchInfo.hasParticipated,"WaitlistBatch: cannot apply to more than one batch"
334,831
!batchInfo.hasParticipated
"WaitlistBatch: cannot apply before the start time"
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; import {Ownable} from "../lib/Ownable.sol"; import {SafeMath} from "../lib/SafeMath.sol"; import {SafeERC20} from "../lib/SafeERC20.sol"; import {IERC20} from "../token/IERC20.sol"; contract WaitlistBatch is Ownable { /* ========== Types ========== */ struct Batch { uint256 totalSpots; uint256 filledSpots; uint256 batchStartTimestamp; uint256 depositAmount; bool claimable; } struct UserBatchInfo { bool hasParticipated; uint256 batchNumber; uint256 depositAmount; } /* ========== Variables ========== */ address public moderator; IERC20 public depositCurrency; uint256 public nextBatchNumber; mapping (uint256 => mapping (address => uint256)) public userDepositMapping; mapping (uint256 => Batch) public batchMapping; mapping (address => uint256) public userBatchMapping; mapping (address => bool) public blacklist; /* ========== Events ========== */ event AppliedToBatch( address indexed user, uint256 batchNumber, uint256 amount ); event NewBatchAdded( uint256 totalSpots, uint256 batchStartTimestamp, uint256 depositAmount, uint256 batchNumber ); event BatchTimestampChanged( uint256 batchNumber, uint256 batchStartTimstamp ); event BatchTotalSpotsUpdated( uint256 batchNumber, uint256 newTotalSpots ); event BatchClaimsEnabled( uint256[] batchNumbers ); event TokensReclaimed( address user, uint256 amount ); event TokensReclaimedBlacklist( address user, uint256 amount ); event TokensTransfered( address tokenAddress, uint256 amount, address destination ); event RemovedFromBlacklist( address user ); event AddedToBlacklist( address user ); event ModeratorSet( address user ); /* ========== Modifiers ========== */ modifier onlyModerator() { } /* ========== Constructor ========== */ constructor(address _depositCurrency) public { } /* ========== Public Getters ========== */ function getBatchInfoForUser( address _user ) public view returns (UserBatchInfo memory) { } function getTotalNumberOfBatches() public view returns (uint256) { } /* ========== Public Functions ========== */ function applyToBatch( uint256 _batchNumber ) public { require( _batchNumber > 0 && _batchNumber < nextBatchNumber, "WaitlistBatch: batch does not exist" ); // Check if user already applied to a batch UserBatchInfo memory batchInfo = getBatchInfoForUser(msg.sender); require( !batchInfo.hasParticipated, "WaitlistBatch: cannot apply to more than one batch" ); Batch storage batch = batchMapping[_batchNumber]; require( batch.filledSpots < batch.totalSpots, "WaitlistBatch: batch is filled" ); require(<FILL_ME>) batch.filledSpots++; userDepositMapping[_batchNumber][msg.sender] = batch.depositAmount; userBatchMapping[msg.sender] = _batchNumber; SafeERC20.safeTransferFrom( depositCurrency, msg.sender, address(this), batch.depositAmount ); emit AppliedToBatch( msg.sender, _batchNumber, batch.depositAmount ); } function reclaimTokens() public { } /* ========== Admin Functions ========== */ /** * @dev Adds a new batch to the `batchMapping` and increases the * count of `totalNumberOfBatches` */ function addNewBatch( uint256 _totalSpots, uint256 _batchStartTimestamp, uint256 _depositAmount ) public onlyOwner { } function changeBatchStartTimestamp( uint256 _batchNumber, uint256 _newStartTimestamp ) public onlyOwner { } function changeBatchTotalSpots( uint256 _batchNumber, uint256 _newSpots ) public onlyOwner { } function enableClaims( uint256[] memory _batchNumbers ) public onlyOwner { } function transferTokens( address _tokenAddress, uint256 _amount, address _destination ) public onlyOwner { } function setModerator( address _user ) public onlyOwner { } /* ========== Moderator Functions ========== */ function addToBlacklist( address _user ) public onlyModerator { } function removeFromBlacklist( address _user ) public onlyModerator { } /* ========== Dev Functions ========== */ function currentTimestamp() public view returns (uint256) { } }
currentTimestamp()>=batch.batchStartTimestamp,"WaitlistBatch: cannot apply before the start time"
334,831
currentTimestamp()>=batch.batchStartTimestamp
"WaitlistBatch: user did not participate in a batch"
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; import {Ownable} from "../lib/Ownable.sol"; import {SafeMath} from "../lib/SafeMath.sol"; import {SafeERC20} from "../lib/SafeERC20.sol"; import {IERC20} from "../token/IERC20.sol"; contract WaitlistBatch is Ownable { /* ========== Types ========== */ struct Batch { uint256 totalSpots; uint256 filledSpots; uint256 batchStartTimestamp; uint256 depositAmount; bool claimable; } struct UserBatchInfo { bool hasParticipated; uint256 batchNumber; uint256 depositAmount; } /* ========== Variables ========== */ address public moderator; IERC20 public depositCurrency; uint256 public nextBatchNumber; mapping (uint256 => mapping (address => uint256)) public userDepositMapping; mapping (uint256 => Batch) public batchMapping; mapping (address => uint256) public userBatchMapping; mapping (address => bool) public blacklist; /* ========== Events ========== */ event AppliedToBatch( address indexed user, uint256 batchNumber, uint256 amount ); event NewBatchAdded( uint256 totalSpots, uint256 batchStartTimestamp, uint256 depositAmount, uint256 batchNumber ); event BatchTimestampChanged( uint256 batchNumber, uint256 batchStartTimstamp ); event BatchTotalSpotsUpdated( uint256 batchNumber, uint256 newTotalSpots ); event BatchClaimsEnabled( uint256[] batchNumbers ); event TokensReclaimed( address user, uint256 amount ); event TokensReclaimedBlacklist( address user, uint256 amount ); event TokensTransfered( address tokenAddress, uint256 amount, address destination ); event RemovedFromBlacklist( address user ); event AddedToBlacklist( address user ); event ModeratorSet( address user ); /* ========== Modifiers ========== */ modifier onlyModerator() { } /* ========== Constructor ========== */ constructor(address _depositCurrency) public { } /* ========== Public Getters ========== */ function getBatchInfoForUser( address _user ) public view returns (UserBatchInfo memory) { } function getTotalNumberOfBatches() public view returns (uint256) { } /* ========== Public Functions ========== */ function applyToBatch( uint256 _batchNumber ) public { } function reclaimTokens() public { UserBatchInfo memory batchInfo = getBatchInfoForUser(msg.sender); require(<FILL_ME>) require( batchInfo.depositAmount > 0, "WaitlistBatch: there are no tokens to reclaim" ); Batch memory batch = batchMapping[batchInfo.batchNumber]; require( batch.claimable, "WaitlistBatch: the tokens are not yet claimable" ); userDepositMapping[batchInfo.batchNumber][msg.sender] -= batchInfo.depositAmount; SafeERC20.safeTransfer( depositCurrency, msg.sender, batchInfo.depositAmount ); if (blacklist[msg.sender] == true) { emit TokensReclaimedBlacklist( msg.sender, batchInfo.depositAmount ); } else { emit TokensReclaimed( msg.sender, batchInfo.depositAmount ); } } /* ========== Admin Functions ========== */ /** * @dev Adds a new batch to the `batchMapping` and increases the * count of `totalNumberOfBatches` */ function addNewBatch( uint256 _totalSpots, uint256 _batchStartTimestamp, uint256 _depositAmount ) public onlyOwner { } function changeBatchStartTimestamp( uint256 _batchNumber, uint256 _newStartTimestamp ) public onlyOwner { } function changeBatchTotalSpots( uint256 _batchNumber, uint256 _newSpots ) public onlyOwner { } function enableClaims( uint256[] memory _batchNumbers ) public onlyOwner { } function transferTokens( address _tokenAddress, uint256 _amount, address _destination ) public onlyOwner { } function setModerator( address _user ) public onlyOwner { } /* ========== Moderator Functions ========== */ function addToBlacklist( address _user ) public onlyModerator { } function removeFromBlacklist( address _user ) public onlyModerator { } /* ========== Dev Functions ========== */ function currentTimestamp() public view returns (uint256) { } }
batchInfo.hasParticipated,"WaitlistBatch: user did not participate in a batch"
334,831
batchInfo.hasParticipated
"WaitlistBatch: the tokens are not yet claimable"
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; import {Ownable} from "../lib/Ownable.sol"; import {SafeMath} from "../lib/SafeMath.sol"; import {SafeERC20} from "../lib/SafeERC20.sol"; import {IERC20} from "../token/IERC20.sol"; contract WaitlistBatch is Ownable { /* ========== Types ========== */ struct Batch { uint256 totalSpots; uint256 filledSpots; uint256 batchStartTimestamp; uint256 depositAmount; bool claimable; } struct UserBatchInfo { bool hasParticipated; uint256 batchNumber; uint256 depositAmount; } /* ========== Variables ========== */ address public moderator; IERC20 public depositCurrency; uint256 public nextBatchNumber; mapping (uint256 => mapping (address => uint256)) public userDepositMapping; mapping (uint256 => Batch) public batchMapping; mapping (address => uint256) public userBatchMapping; mapping (address => bool) public blacklist; /* ========== Events ========== */ event AppliedToBatch( address indexed user, uint256 batchNumber, uint256 amount ); event NewBatchAdded( uint256 totalSpots, uint256 batchStartTimestamp, uint256 depositAmount, uint256 batchNumber ); event BatchTimestampChanged( uint256 batchNumber, uint256 batchStartTimstamp ); event BatchTotalSpotsUpdated( uint256 batchNumber, uint256 newTotalSpots ); event BatchClaimsEnabled( uint256[] batchNumbers ); event TokensReclaimed( address user, uint256 amount ); event TokensReclaimedBlacklist( address user, uint256 amount ); event TokensTransfered( address tokenAddress, uint256 amount, address destination ); event RemovedFromBlacklist( address user ); event AddedToBlacklist( address user ); event ModeratorSet( address user ); /* ========== Modifiers ========== */ modifier onlyModerator() { } /* ========== Constructor ========== */ constructor(address _depositCurrency) public { } /* ========== Public Getters ========== */ function getBatchInfoForUser( address _user ) public view returns (UserBatchInfo memory) { } function getTotalNumberOfBatches() public view returns (uint256) { } /* ========== Public Functions ========== */ function applyToBatch( uint256 _batchNumber ) public { } function reclaimTokens() public { UserBatchInfo memory batchInfo = getBatchInfoForUser(msg.sender); require( batchInfo.hasParticipated, "WaitlistBatch: user did not participate in a batch" ); require( batchInfo.depositAmount > 0, "WaitlistBatch: there are no tokens to reclaim" ); Batch memory batch = batchMapping[batchInfo.batchNumber]; require(<FILL_ME>) userDepositMapping[batchInfo.batchNumber][msg.sender] -= batchInfo.depositAmount; SafeERC20.safeTransfer( depositCurrency, msg.sender, batchInfo.depositAmount ); if (blacklist[msg.sender] == true) { emit TokensReclaimedBlacklist( msg.sender, batchInfo.depositAmount ); } else { emit TokensReclaimed( msg.sender, batchInfo.depositAmount ); } } /* ========== Admin Functions ========== */ /** * @dev Adds a new batch to the `batchMapping` and increases the * count of `totalNumberOfBatches` */ function addNewBatch( uint256 _totalSpots, uint256 _batchStartTimestamp, uint256 _depositAmount ) public onlyOwner { } function changeBatchStartTimestamp( uint256 _batchNumber, uint256 _newStartTimestamp ) public onlyOwner { } function changeBatchTotalSpots( uint256 _batchNumber, uint256 _newSpots ) public onlyOwner { } function enableClaims( uint256[] memory _batchNumbers ) public onlyOwner { } function transferTokens( address _tokenAddress, uint256 _amount, address _destination ) public onlyOwner { } function setModerator( address _user ) public onlyOwner { } /* ========== Moderator Functions ========== */ function addToBlacklist( address _user ) public onlyModerator { } function removeFromBlacklist( address _user ) public onlyModerator { } /* ========== Dev Functions ========== */ function currentTimestamp() public view returns (uint256) { } }
batch.claimable,"WaitlistBatch: the tokens are not yet claimable"
334,831
batch.claimable
"WaitlistBatch: the batch start date already passed"
// SPDX-License-Identifier: MIT pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; import {Ownable} from "../lib/Ownable.sol"; import {SafeMath} from "../lib/SafeMath.sol"; import {SafeERC20} from "../lib/SafeERC20.sol"; import {IERC20} from "../token/IERC20.sol"; contract WaitlistBatch is Ownable { /* ========== Types ========== */ struct Batch { uint256 totalSpots; uint256 filledSpots; uint256 batchStartTimestamp; uint256 depositAmount; bool claimable; } struct UserBatchInfo { bool hasParticipated; uint256 batchNumber; uint256 depositAmount; } /* ========== Variables ========== */ address public moderator; IERC20 public depositCurrency; uint256 public nextBatchNumber; mapping (uint256 => mapping (address => uint256)) public userDepositMapping; mapping (uint256 => Batch) public batchMapping; mapping (address => uint256) public userBatchMapping; mapping (address => bool) public blacklist; /* ========== Events ========== */ event AppliedToBatch( address indexed user, uint256 batchNumber, uint256 amount ); event NewBatchAdded( uint256 totalSpots, uint256 batchStartTimestamp, uint256 depositAmount, uint256 batchNumber ); event BatchTimestampChanged( uint256 batchNumber, uint256 batchStartTimstamp ); event BatchTotalSpotsUpdated( uint256 batchNumber, uint256 newTotalSpots ); event BatchClaimsEnabled( uint256[] batchNumbers ); event TokensReclaimed( address user, uint256 amount ); event TokensReclaimedBlacklist( address user, uint256 amount ); event TokensTransfered( address tokenAddress, uint256 amount, address destination ); event RemovedFromBlacklist( address user ); event AddedToBlacklist( address user ); event ModeratorSet( address user ); /* ========== Modifiers ========== */ modifier onlyModerator() { } /* ========== Constructor ========== */ constructor(address _depositCurrency) public { } /* ========== Public Getters ========== */ function getBatchInfoForUser( address _user ) public view returns (UserBatchInfo memory) { } function getTotalNumberOfBatches() public view returns (uint256) { } /* ========== Public Functions ========== */ function applyToBatch( uint256 _batchNumber ) public { } function reclaimTokens() public { } /* ========== Admin Functions ========== */ /** * @dev Adds a new batch to the `batchMapping` and increases the * count of `totalNumberOfBatches` */ function addNewBatch( uint256 _totalSpots, uint256 _batchStartTimestamp, uint256 _depositAmount ) public onlyOwner { } function changeBatchStartTimestamp( uint256 _batchNumber, uint256 _newStartTimestamp ) public onlyOwner { } function changeBatchTotalSpots( uint256 _batchNumber, uint256 _newSpots ) public onlyOwner { require( _batchNumber > 0 && _batchNumber < nextBatchNumber, "WaitlistBatch: the batch does not exist" ); Batch storage batch = batchMapping[_batchNumber]; require(<FILL_ME>) require( batch.totalSpots < _newSpots, "WaitlistBatch: cannot change total spots to a smaller or equal number" ); batch.totalSpots = _newSpots; emit BatchTotalSpotsUpdated( _batchNumber, _newSpots ); } function enableClaims( uint256[] memory _batchNumbers ) public onlyOwner { } function transferTokens( address _tokenAddress, uint256 _amount, address _destination ) public onlyOwner { } function setModerator( address _user ) public onlyOwner { } /* ========== Moderator Functions ========== */ function addToBlacklist( address _user ) public onlyModerator { } function removeFromBlacklist( address _user ) public onlyModerator { } /* ========== Dev Functions ========== */ function currentTimestamp() public view returns (uint256) { } }
currentTimestamp()<batch.batchStartTimestamp,"WaitlistBatch: the batch start date already passed"
334,831
currentTimestamp()<batch.batchStartTimestamp
"Spender: can not activate timelock yet or has been activated"
pragma solidity ^0.6.5; /** * @dev Spender contract */ contract Spender { using SafeMath for uint256; // Constants do not have storage slot. address private constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address private constant ZERO_ADDRESS = address(0); uint256 constant private TIME_LOCK_DURATION = 1 days; // Below are the variables which consume storage slots. address public operator; address public allowanceTarget; mapping(address => bool) private authorized; mapping(address => bool) private tokenBlacklist; uint256 public numPendingAuthorized; mapping(uint256 => address) public pendingAuthorized; uint256 public timelockExpirationTime; uint256 public contractDeployedTime; bool public timelockActivated; /************************************************************ * Access control and ownership management * *************************************************************/ modifier onlyOperator() { } modifier onlyAuthorized() { } function transferOwnership(address _newOperator) external onlyOperator { } /************************************************************ * Timelock management * *************************************************************/ /// @dev Everyone can activate timelock after the contract has been deployed for more than 1 day. function activateTimelock() external { bool canActivate = block.timestamp.sub(contractDeployedTime) > 1 days; require(<FILL_ME>) timelockActivated = true; } /************************************************************ * Constructor and init functions * *************************************************************/ constructor(address _operator) public { } function setAllowanceTarget(address _allowanceTarget) external onlyOperator { } /************************************************************ * AllowanceTarget interaction functions * *************************************************************/ function setNewSpender(address _newSpender) external onlyOperator { } function teardownAllowanceTarget() external onlyOperator { } /************************************************************ * Whitelist and blacklist functions * *************************************************************/ function isBlacklisted(address _tokenAddr) external view returns (bool) { } function blacklist(address[] calldata _tokenAddrs, bool[] calldata _isBlacklisted) external onlyOperator { } function isAuthorized(address _caller) external view returns (bool) { } function authorize(address[] calldata _pendingAuthorized) external onlyOperator { } function completeAuthorize() external { } function deauthorize(address[] calldata _deauthorized) external onlyOperator { } /************************************************************ * External functions * *************************************************************/ /// @dev Spend tokens on user's behalf. Only an authority can call this. /// @param _user The user to spend token from. /// @param _tokenAddr The address of the token. /// @param _amount Amount to spend. function spendFromUser(address _user, address _tokenAddr, uint256 _amount) external onlyAuthorized { } }
canActivate&&!timelockActivated,"Spender: can not activate timelock yet or has been activated"
334,852
canActivate&&!timelockActivated
"Spender: can not authorize zero address"
pragma solidity ^0.6.5; /** * @dev Spender contract */ contract Spender { using SafeMath for uint256; // Constants do not have storage slot. address private constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address private constant ZERO_ADDRESS = address(0); uint256 constant private TIME_LOCK_DURATION = 1 days; // Below are the variables which consume storage slots. address public operator; address public allowanceTarget; mapping(address => bool) private authorized; mapping(address => bool) private tokenBlacklist; uint256 public numPendingAuthorized; mapping(uint256 => address) public pendingAuthorized; uint256 public timelockExpirationTime; uint256 public contractDeployedTime; bool public timelockActivated; /************************************************************ * Access control and ownership management * *************************************************************/ modifier onlyOperator() { } modifier onlyAuthorized() { } function transferOwnership(address _newOperator) external onlyOperator { } /************************************************************ * Timelock management * *************************************************************/ /// @dev Everyone can activate timelock after the contract has been deployed for more than 1 day. function activateTimelock() external { } /************************************************************ * Constructor and init functions * *************************************************************/ constructor(address _operator) public { } function setAllowanceTarget(address _allowanceTarget) external onlyOperator { } /************************************************************ * AllowanceTarget interaction functions * *************************************************************/ function setNewSpender(address _newSpender) external onlyOperator { } function teardownAllowanceTarget() external onlyOperator { } /************************************************************ * Whitelist and blacklist functions * *************************************************************/ function isBlacklisted(address _tokenAddr) external view returns (bool) { } function blacklist(address[] calldata _tokenAddrs, bool[] calldata _isBlacklisted) external onlyOperator { } function isAuthorized(address _caller) external view returns (bool) { } function authorize(address[] calldata _pendingAuthorized) external onlyOperator { require(_pendingAuthorized.length > 0, "Spender: authorize list is empty"); require(numPendingAuthorized == 0 && timelockExpirationTime == 0, "Spender: an authorize current in progress"); if (timelockActivated) { numPendingAuthorized = _pendingAuthorized.length; for (uint256 i = 0; i < _pendingAuthorized.length; i++) { require(<FILL_ME>) pendingAuthorized[i] = _pendingAuthorized[i]; } timelockExpirationTime = now + TIME_LOCK_DURATION; } else { for (uint256 i = 0; i < _pendingAuthorized.length; i++) { require(_pendingAuthorized[i] != address(0), "Spender: can not authorize zero address"); authorized[_pendingAuthorized[i]] = true; } } } function completeAuthorize() external { } function deauthorize(address[] calldata _deauthorized) external onlyOperator { } /************************************************************ * External functions * *************************************************************/ /// @dev Spend tokens on user's behalf. Only an authority can call this. /// @param _user The user to spend token from. /// @param _tokenAddr The address of the token. /// @param _amount Amount to spend. function spendFromUser(address _user, address _tokenAddr, uint256 _amount) external onlyAuthorized { } }
_pendingAuthorized[i]!=address(0),"Spender: can not authorize zero address"
334,852
_pendingAuthorized[i]!=address(0)
"Spender: token is blacklisted"
pragma solidity ^0.6.5; /** * @dev Spender contract */ contract Spender { using SafeMath for uint256; // Constants do not have storage slot. address private constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address private constant ZERO_ADDRESS = address(0); uint256 constant private TIME_LOCK_DURATION = 1 days; // Below are the variables which consume storage slots. address public operator; address public allowanceTarget; mapping(address => bool) private authorized; mapping(address => bool) private tokenBlacklist; uint256 public numPendingAuthorized; mapping(uint256 => address) public pendingAuthorized; uint256 public timelockExpirationTime; uint256 public contractDeployedTime; bool public timelockActivated; /************************************************************ * Access control and ownership management * *************************************************************/ modifier onlyOperator() { } modifier onlyAuthorized() { } function transferOwnership(address _newOperator) external onlyOperator { } /************************************************************ * Timelock management * *************************************************************/ /// @dev Everyone can activate timelock after the contract has been deployed for more than 1 day. function activateTimelock() external { } /************************************************************ * Constructor and init functions * *************************************************************/ constructor(address _operator) public { } function setAllowanceTarget(address _allowanceTarget) external onlyOperator { } /************************************************************ * AllowanceTarget interaction functions * *************************************************************/ function setNewSpender(address _newSpender) external onlyOperator { } function teardownAllowanceTarget() external onlyOperator { } /************************************************************ * Whitelist and blacklist functions * *************************************************************/ function isBlacklisted(address _tokenAddr) external view returns (bool) { } function blacklist(address[] calldata _tokenAddrs, bool[] calldata _isBlacklisted) external onlyOperator { } function isAuthorized(address _caller) external view returns (bool) { } function authorize(address[] calldata _pendingAuthorized) external onlyOperator { } function completeAuthorize() external { } function deauthorize(address[] calldata _deauthorized) external onlyOperator { } /************************************************************ * External functions * *************************************************************/ /// @dev Spend tokens on user's behalf. Only an authority can call this. /// @param _user The user to spend token from. /// @param _tokenAddr The address of the token. /// @param _amount Amount to spend. function spendFromUser(address _user, address _tokenAddr, uint256 _amount) external onlyAuthorized { require(<FILL_ME>) if (_tokenAddr != ETH_ADDRESS && _tokenAddr != ZERO_ADDRESS) { uint256 balanceBefore = IERC20(_tokenAddr).balanceOf(msg.sender); (bool callSucceed, ) = address(allowanceTarget).call( abi.encodeWithSelector( IAllowanceTarget.executeCall.selector, _tokenAddr, abi.encodeWithSelector( IERC20.transferFrom.selector, _user, msg.sender, _amount ) ) ); require(callSucceed, "Spender: ERC20 transferFrom failed"); // Check balance uint256 balanceAfter = IERC20(_tokenAddr).balanceOf(msg.sender); require(balanceAfter.sub(balanceBefore) == _amount, "Spender: ERC20 transferFrom result mismatch"); } } }
!tokenBlacklist[_tokenAddr],"Spender: token is blacklisted"
334,852
!tokenBlacklist[_tokenAddr]
"Spender: ERC20 transferFrom result mismatch"
pragma solidity ^0.6.5; /** * @dev Spender contract */ contract Spender { using SafeMath for uint256; // Constants do not have storage slot. address private constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address private constant ZERO_ADDRESS = address(0); uint256 constant private TIME_LOCK_DURATION = 1 days; // Below are the variables which consume storage slots. address public operator; address public allowanceTarget; mapping(address => bool) private authorized; mapping(address => bool) private tokenBlacklist; uint256 public numPendingAuthorized; mapping(uint256 => address) public pendingAuthorized; uint256 public timelockExpirationTime; uint256 public contractDeployedTime; bool public timelockActivated; /************************************************************ * Access control and ownership management * *************************************************************/ modifier onlyOperator() { } modifier onlyAuthorized() { } function transferOwnership(address _newOperator) external onlyOperator { } /************************************************************ * Timelock management * *************************************************************/ /// @dev Everyone can activate timelock after the contract has been deployed for more than 1 day. function activateTimelock() external { } /************************************************************ * Constructor and init functions * *************************************************************/ constructor(address _operator) public { } function setAllowanceTarget(address _allowanceTarget) external onlyOperator { } /************************************************************ * AllowanceTarget interaction functions * *************************************************************/ function setNewSpender(address _newSpender) external onlyOperator { } function teardownAllowanceTarget() external onlyOperator { } /************************************************************ * Whitelist and blacklist functions * *************************************************************/ function isBlacklisted(address _tokenAddr) external view returns (bool) { } function blacklist(address[] calldata _tokenAddrs, bool[] calldata _isBlacklisted) external onlyOperator { } function isAuthorized(address _caller) external view returns (bool) { } function authorize(address[] calldata _pendingAuthorized) external onlyOperator { } function completeAuthorize() external { } function deauthorize(address[] calldata _deauthorized) external onlyOperator { } /************************************************************ * External functions * *************************************************************/ /// @dev Spend tokens on user's behalf. Only an authority can call this. /// @param _user The user to spend token from. /// @param _tokenAddr The address of the token. /// @param _amount Amount to spend. function spendFromUser(address _user, address _tokenAddr, uint256 _amount) external onlyAuthorized { require(! tokenBlacklist[_tokenAddr], "Spender: token is blacklisted"); if (_tokenAddr != ETH_ADDRESS && _tokenAddr != ZERO_ADDRESS) { uint256 balanceBefore = IERC20(_tokenAddr).balanceOf(msg.sender); (bool callSucceed, ) = address(allowanceTarget).call( abi.encodeWithSelector( IAllowanceTarget.executeCall.selector, _tokenAddr, abi.encodeWithSelector( IERC20.transferFrom.selector, _user, msg.sender, _amount ) ) ); require(callSucceed, "Spender: ERC20 transferFrom failed"); // Check balance uint256 balanceAfter = IERC20(_tokenAddr).balanceOf(msg.sender); require(<FILL_ME>) } } }
balanceAfter.sub(balanceBefore)==_amount,"Spender: ERC20 transferFrom result mismatch"
334,852
balanceAfter.sub(balanceBefore)==_amount
"didn't contribute to PartyBid"
pragma solidity ^0.6.0; interface IPartyBid { function totalContributed(address) external view returns (uint256); } contract PartyDrop is ERC721Burnable, Ownable { uint256 lastMintedId; string public imageURI; string public description; IPartyBid public party; mapping(address => bool) public minted; bool public locked; constructor( string memory nftName, string memory nftSymbol, string memory _description, string memory _imageURI, address _partyAddress ) public ERC721(nftName, nftSymbol) { } function claim() public { require(<FILL_ME>) require(minted[msg.sender] == false, "NFT already minted"); minted[msg.sender] = true; uint256 newTokenId = lastMintedId + 1; lastMintedId = newTokenId; _safeMint(msg.sender, newTokenId); } function tokenURI(uint256 tokenId) public view override returns (string memory) { } function adminChangeImageURI(string memory _imageURI) public onlyOwner { } function adminChangeDescription(string memory _description) public onlyOwner { } function lock() public onlyOwner { } function toString(uint256 value) internal pure returns (string memory) { } }
party.totalContributed(msg.sender)>0,"didn't contribute to PartyBid"
334,923
party.totalContributed(msg.sender)>0
"NFT already minted"
pragma solidity ^0.6.0; interface IPartyBid { function totalContributed(address) external view returns (uint256); } contract PartyDrop is ERC721Burnable, Ownable { uint256 lastMintedId; string public imageURI; string public description; IPartyBid public party; mapping(address => bool) public minted; bool public locked; constructor( string memory nftName, string memory nftSymbol, string memory _description, string memory _imageURI, address _partyAddress ) public ERC721(nftName, nftSymbol) { } function claim() public { require( party.totalContributed(msg.sender) > 0, "didn't contribute to PartyBid" ); require(<FILL_ME>) minted[msg.sender] = true; uint256 newTokenId = lastMintedId + 1; lastMintedId = newTokenId; _safeMint(msg.sender, newTokenId); } function tokenURI(uint256 tokenId) public view override returns (string memory) { } function adminChangeImageURI(string memory _imageURI) public onlyOwner { } function adminChangeDescription(string memory _description) public onlyOwner { } function lock() public onlyOwner { } function toString(uint256 value) internal pure returns (string memory) { } }
minted[msg.sender]==false,"NFT already minted"
334,923
minted[msg.sender]==false
'CBL: Not authorzed to withdraw'
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/interfaces/IERC20.sol'; import '@openzeppelin/contracts/interfaces/IERC165.sol'; import '@openzeppelin/contracts/interfaces/IERC2981.sol'; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol'; contract CryptoBabyLions is Ownable, ERC721, IERC2981 { using Strings for uint256; struct WhitelistInfo { bytes32 merkleRoot; uint256 quantity; uint256 price; } uint16 internal royalty = 500; // base 10000, 5% uint16 public constant BASE = 10000; uint16 public constant MAX_TOKENS = 3333; uint16 public constant MAX_MINT = 3; uint256 public constant MINT_PRICE = 0.05 ether; uint256 public startBlock = type(uint256).max - 1; string private baseURI; string private centralizedURI; string private contractMetadata; address public withdrawAccount; uint256 public totalSupply; uint256 public totalPreMinted; uint8 public whitelistPlansCounter; mapping(uint8 => WhitelistInfo) public whitelistPlans; mapping(address => mapping(uint8 => uint256)) public mintedCount; modifier onlyWhitdrawable() { require(<FILL_ME>) _; } constructor( string memory _contractMetadata, string memory ipfsURI, string memory _centralizedURI ) ERC721('Crypto Baby Lions', 'CBL') { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, IERC165) returns (bool) { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } function contractURI() public view returns (string memory) { } function royaltyInfo(uint256, uint256 _salePrice) external view override returns (address receiver, uint256 royaltyAmount) { } function whitelistMint( uint256 quantity, uint8 whitelistIndex, bytes32[] calldata proof ) public payable { } function mint(uint256 quantity) public payable { } function addWhitelist( bytes32 merkleRoot, uint256 quantity, uint256 price ) public onlyOwner { } function setContractMetadata(string memory _contractMetadata) public onlyOwner { } function setStartBlock(uint256 _block) public onlyOwner { } function setRoyalty(uint16 _royalty) public onlyOwner { } function setWithdrawAccount(address account) public onlyOwner { } function withdraw(uint256 _amount) public onlyWhitdrawable { } function withdrawTokens(address _tokenContract, uint256 _amount) public onlyWhitdrawable { } function _baseURI() internal view override returns (string memory) { } function _exists(uint256 tokenId) internal view override returns (bool) { } event ContractWithdraw(address indexed withdrawAddress, uint256 amount); event WhitelistAdded(uint256 index, bytes32 merkleRoot, uint256 quantity, uint256 price); event StartTimeUpdated(uint256 blockNumber); }
_msgSender()==withdrawAccount,'CBL: Not authorzed to withdraw'
334,949
_msgSender()==withdrawAccount
'CBL: That many tokens are not available'
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/interfaces/IERC20.sol'; import '@openzeppelin/contracts/interfaces/IERC165.sol'; import '@openzeppelin/contracts/interfaces/IERC2981.sol'; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol'; contract CryptoBabyLions is Ownable, ERC721, IERC2981 { using Strings for uint256; struct WhitelistInfo { bytes32 merkleRoot; uint256 quantity; uint256 price; } uint16 internal royalty = 500; // base 10000, 5% uint16 public constant BASE = 10000; uint16 public constant MAX_TOKENS = 3333; uint16 public constant MAX_MINT = 3; uint256 public constant MINT_PRICE = 0.05 ether; uint256 public startBlock = type(uint256).max - 1; string private baseURI; string private centralizedURI; string private contractMetadata; address public withdrawAccount; uint256 public totalSupply; uint256 public totalPreMinted; uint8 public whitelistPlansCounter; mapping(uint8 => WhitelistInfo) public whitelistPlans; mapping(address => mapping(uint8 => uint256)) public mintedCount; modifier onlyWhitdrawable() { } constructor( string memory _contractMetadata, string memory ipfsURI, string memory _centralizedURI ) ERC721('Crypto Baby Lions', 'CBL') { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, IERC165) returns (bool) { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } function contractURI() public view returns (string memory) { } function royaltyInfo(uint256, uint256 _salePrice) external view override returns (address receiver, uint256 royaltyAmount) { } function whitelistMint( uint256 quantity, uint8 whitelistIndex, bytes32[] calldata proof ) public payable { require(<FILL_ME>) address msgSender = _msgSender(); uint256 accountNewMintCount = mintedCount[msgSender][whitelistIndex] + quantity; WhitelistInfo memory whitelistInfo = whitelistPlans[whitelistIndex]; require(accountNewMintCount <= whitelistInfo.quantity, 'CBL: That many tokens are not available this account'); bytes32 leaf = keccak256(abi.encodePacked(msgSender)); require(MerkleProof.verify(proof, whitelistInfo.merkleRoot, leaf), 'CBL: Invalid proof'); uint256 totalPrice = quantity * whitelistInfo.price; require(msg.value >= totalPrice, 'CBL: Not enough ethers'); if (msg.value > totalPrice) { payable(msgSender).transfer(msg.value - totalPrice); } mintedCount[msgSender][whitelistIndex] = accountNewMintCount; for (uint256 i = 0; i < quantity; i++) { _safeMint(msgSender, totalSupply); totalSupply++; } } function mint(uint256 quantity) public payable { } function addWhitelist( bytes32 merkleRoot, uint256 quantity, uint256 price ) public onlyOwner { } function setContractMetadata(string memory _contractMetadata) public onlyOwner { } function setStartBlock(uint256 _block) public onlyOwner { } function setRoyalty(uint16 _royalty) public onlyOwner { } function setWithdrawAccount(address account) public onlyOwner { } function withdraw(uint256 _amount) public onlyWhitdrawable { } function withdrawTokens(address _tokenContract, uint256 _amount) public onlyWhitdrawable { } function _baseURI() internal view override returns (string memory) { } function _exists(uint256 tokenId) internal view override returns (bool) { } event ContractWithdraw(address indexed withdrawAddress, uint256 amount); event WhitelistAdded(uint256 index, bytes32 merkleRoot, uint256 quantity, uint256 price); event StartTimeUpdated(uint256 blockNumber); }
totalSupply+quantity<=MAX_TOKENS,'CBL: That many tokens are not available'
334,949
totalSupply+quantity<=MAX_TOKENS
'CBL: Invalid proof'
// SPDX-License-Identifier: MIT pragma solidity 0.8.9; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/interfaces/IERC20.sol'; import '@openzeppelin/contracts/interfaces/IERC165.sol'; import '@openzeppelin/contracts/interfaces/IERC2981.sol'; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import '@openzeppelin/contracts/utils/cryptography/MerkleProof.sol'; contract CryptoBabyLions is Ownable, ERC721, IERC2981 { using Strings for uint256; struct WhitelistInfo { bytes32 merkleRoot; uint256 quantity; uint256 price; } uint16 internal royalty = 500; // base 10000, 5% uint16 public constant BASE = 10000; uint16 public constant MAX_TOKENS = 3333; uint16 public constant MAX_MINT = 3; uint256 public constant MINT_PRICE = 0.05 ether; uint256 public startBlock = type(uint256).max - 1; string private baseURI; string private centralizedURI; string private contractMetadata; address public withdrawAccount; uint256 public totalSupply; uint256 public totalPreMinted; uint8 public whitelistPlansCounter; mapping(uint8 => WhitelistInfo) public whitelistPlans; mapping(address => mapping(uint8 => uint256)) public mintedCount; modifier onlyWhitdrawable() { } constructor( string memory _contractMetadata, string memory ipfsURI, string memory _centralizedURI ) ERC721('Crypto Baby Lions', 'CBL') { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, IERC165) returns (bool) { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } function contractURI() public view returns (string memory) { } function royaltyInfo(uint256, uint256 _salePrice) external view override returns (address receiver, uint256 royaltyAmount) { } function whitelistMint( uint256 quantity, uint8 whitelistIndex, bytes32[] calldata proof ) public payable { require(totalSupply + quantity <= MAX_TOKENS, 'CBL: That many tokens are not available'); address msgSender = _msgSender(); uint256 accountNewMintCount = mintedCount[msgSender][whitelistIndex] + quantity; WhitelistInfo memory whitelistInfo = whitelistPlans[whitelistIndex]; require(accountNewMintCount <= whitelistInfo.quantity, 'CBL: That many tokens are not available this account'); bytes32 leaf = keccak256(abi.encodePacked(msgSender)); require(<FILL_ME>) uint256 totalPrice = quantity * whitelistInfo.price; require(msg.value >= totalPrice, 'CBL: Not enough ethers'); if (msg.value > totalPrice) { payable(msgSender).transfer(msg.value - totalPrice); } mintedCount[msgSender][whitelistIndex] = accountNewMintCount; for (uint256 i = 0; i < quantity; i++) { _safeMint(msgSender, totalSupply); totalSupply++; } } function mint(uint256 quantity) public payable { } function addWhitelist( bytes32 merkleRoot, uint256 quantity, uint256 price ) public onlyOwner { } function setContractMetadata(string memory _contractMetadata) public onlyOwner { } function setStartBlock(uint256 _block) public onlyOwner { } function setRoyalty(uint16 _royalty) public onlyOwner { } function setWithdrawAccount(address account) public onlyOwner { } function withdraw(uint256 _amount) public onlyWhitdrawable { } function withdrawTokens(address _tokenContract, uint256 _amount) public onlyWhitdrawable { } function _baseURI() internal view override returns (string memory) { } function _exists(uint256 tokenId) internal view override returns (bool) { } event ContractWithdraw(address indexed withdrawAddress, uint256 amount); event WhitelistAdded(uint256 index, bytes32 merkleRoot, uint256 quantity, uint256 price); event StartTimeUpdated(uint256 blockNumber); }
MerkleProof.verify(proof,whitelistInfo.merkleRoot,leaf),'CBL: Invalid proof'
334,949
MerkleProof.verify(proof,whitelistInfo.merkleRoot,leaf)
null
pragma solidity ^0.4.24; contract AutomatedExchange{ function buyTokens() public payable; function calculateTokenSell(uint256 tokens) public view returns(uint256); function calculateTokenBuy(uint256 eth,uint256 contractBalance) public view returns(uint256); function balanceOf(address tokenOwner) public view returns (uint balance); } contract VerifyToken { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); bool public activated; event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes data) public; } contract VRFBet is ApproveAndCallFallBack{ using SafeMath for uint; struct Bet{ uint blockPlaced; address bettor; uint betAmount; } mapping(address => bytes) public victoryMessages; mapping(uint => Bet) public betQueue; uint public MAX_SIMULTANEOUS_BETS=20; uint public index=0;//index for processing bets uint public indexBetPlace=0;//index for placing bets address vrfAddress= 0x5BD574410F3A2dA202bABBa1609330Db02aD64C2;//0xe0832c4f024D2427bBC6BD0C4931096d2ab5CCaF; //0x5BD574410F3A2dA202bABBa1609330Db02aD64C2; VerifyToken vrfcontract=VerifyToken(vrfAddress); AutomatedExchange exchangecontract=AutomatedExchange(0x48bF5e13A1ee8Bd4385C182904B3ABf73E042675); event Payout(address indexed to, uint tokens); event BetFinalized(address indexed bettor,uint tokensWagered,uint tokensAgainst,uint tokensWon,bytes victoryMessage); //Send tokens with ApproveAndCallFallBack, place a bet function receiveApproval(address from, uint256 tokens, address token, bytes data) public{ } function placeBetEth(bytes victoryMessage) public payable{ require(<FILL_ME>)//ensures you don't get a situation where there are too many existing bets to process, locking VRF in the contract uint tokensBefore=vrfcontract.balanceOf(this); exchangecontract.buyTokens.value(msg.value)(); _placeBet(vrfcontract.balanceOf(this).sub(tokensBefore),msg.sender,victoryMessage); } function payout(address to,uint numTokens) private{ } function _placeBet(uint numTokens,address from,bytes victoryMessage) private{ } function resolvePriorBets() public{ } function cancelBet() public{ } /* requires an odd number of bets and your bet is the last one */ function canCancelBet() public view returns(bool){ } function isEven(uint num) public view returns(bool){ } function maxRandom(uint blockn, address entropy) internal returns (uint256 randomNumber) { } function random(uint256 upper, uint256 blockn, address entropy) internal returns (uint256 randomNumber) { } /* only for frontend viewing purposes */ function getBetState(address bettor) public view returns(uint){ } } // ---------------------------------------------------------------------------- // Safe maths // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { } function sub(uint a, uint b) internal pure returns (uint c) { } function mul(uint a, uint b) internal pure returns (uint c) { } function div(uint a, uint b) internal pure returns (uint c) { } }
indexBetPlace-index<MAX_SIMULTANEOUS_BETS
335,036
indexBetPlace-index<MAX_SIMULTANEOUS_BETS
null
pragma solidity ^0.4.24; contract AutomatedExchange{ function buyTokens() public payable; function calculateTokenSell(uint256 tokens) public view returns(uint256); function calculateTokenBuy(uint256 eth,uint256 contractBalance) public view returns(uint256); function balanceOf(address tokenOwner) public view returns (uint balance); } contract VerifyToken { function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); bool public activated; event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes data) public; } contract VRFBet is ApproveAndCallFallBack{ using SafeMath for uint; struct Bet{ uint blockPlaced; address bettor; uint betAmount; } mapping(address => bytes) public victoryMessages; mapping(uint => Bet) public betQueue; uint public MAX_SIMULTANEOUS_BETS=20; uint public index=0;//index for processing bets uint public indexBetPlace=0;//index for placing bets address vrfAddress= 0x5BD574410F3A2dA202bABBa1609330Db02aD64C2;//0xe0832c4f024D2427bBC6BD0C4931096d2ab5CCaF; //0x5BD574410F3A2dA202bABBa1609330Db02aD64C2; VerifyToken vrfcontract=VerifyToken(vrfAddress); AutomatedExchange exchangecontract=AutomatedExchange(0x48bF5e13A1ee8Bd4385C182904B3ABf73E042675); event Payout(address indexed to, uint tokens); event BetFinalized(address indexed bettor,uint tokensWagered,uint tokensAgainst,uint tokensWon,bytes victoryMessage); //Send tokens with ApproveAndCallFallBack, place a bet function receiveApproval(address from, uint256 tokens, address token, bytes data) public{ } function placeBetEth(bytes victoryMessage) public payable{ } function payout(address to,uint numTokens) private{ } function _placeBet(uint numTokens,address from,bytes victoryMessage) private{ } function resolvePriorBets() public{ } function cancelBet() public{ resolvePriorBets(); require(<FILL_ME>) index+=1;//skip the last remaining bet } /* requires an odd number of bets and your bet is the last one */ function canCancelBet() public view returns(bool){ } function isEven(uint num) public view returns(bool){ } function maxRandom(uint blockn, address entropy) internal returns (uint256 randomNumber) { } function random(uint256 upper, uint256 blockn, address entropy) internal returns (uint256 randomNumber) { } /* only for frontend viewing purposes */ function getBetState(address bettor) public view returns(uint){ } } // ---------------------------------------------------------------------------- // Safe maths // ---------------------------------------------------------------------------- library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { } function sub(uint a, uint b) internal pure returns (uint c) { } function mul(uint a, uint b) internal pure returns (uint c) { } function div(uint a, uint b) internal pure returns (uint c) { } }
indexBetPlace-index==1&&betQueue[index].bettor==msg.sender
335,036
indexBetPlace-index==1&&betQueue[index].bettor==msg.sender
null
pragma solidity ^0.4.2; contract owned { address public owner; function owned() { } modifier onlyOwner { } function transferOwnership(address newOwner) onlyOwner { } } contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); } library MathFunction { // standard uint256 functions function plus(uint256 x, uint256 y) constant internal returns (uint256 z) { } function minus(uint256 x, uint256 y) constant internal returns (uint256 z) { } function multiply(uint256 x, uint256 y) constant internal returns (uint256 z) { } function divide(uint256 x, uint256 y) constant internal returns (uint256 z) { } // uint256 function function hplus(uint256 x, uint256 y) constant internal returns (uint256 z) { } function hminus(uint256 x, uint256 y) constant internal returns (uint256 z) { } function hmultiply(uint256 x, uint256 y) constant internal returns (uint256 z) { } function hdivide(uint256 x, uint256 y) constant internal returns (uint256 z) { } // BIG math uint256 constant BIG = 10 ** 18; function wplus(uint256 x, uint256 y) constant internal returns (uint256) { } function wminus(uint256 x, uint256 y) constant internal returns (uint256) { } function wmultiply(uint256 x, uint256 y) constant internal returns (uint256 z) { } function wdivide(uint256 x, uint256 y) constant internal returns (uint256 z) { } function cast(uint256 x) constant internal returns (uint256 z) { } } contract ERC20 { function totalSupply() constant returns (uint _totalSupply); function balanceOf(address _owner) constant returns (uint balance); function transfer(address _to, uint _value) returns (bool success); function transferFrom(address _from, address _to, uint _value) returns (bool success); function approve(address _spender, uint _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint remaining); event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } contract token is owned, ERC20 { using MathFunction for uint256; // Public variables string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; mapping (address => uint256) public contrubutedAmount; mapping (address => uint256) public balanceOf; // This creates an array with all balances mapping (address => mapping (address => uint256)) public allowance; // Creates an array with allowed amount of tokens for sender modifier onlyContributer { } // Initializes contract with name, symbol, decimal and total supply function token() { } function balanceOf(address _owner) constant returns (uint256 balance) { } function totalSupply() constant returns (uint256 _totalSupply) { } function transfer(address _to, uint256 _value) returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough require(<FILL_ME>) // Check for overflows balanceOf[msg.sender] = balanceOf[msg.sender].minus(_value); // Subtract from the sender balanceOf[_to] = balanceOf[_to].plus(_value); // Add the same to the recipient Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place return true; } // A contract attempts to get the coins function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } // Allow another contract to spend some tokens in your behalf function approve(address _spender, uint256 _value) returns (bool success) { } // Approve and then communicate the approved contract in a single tx function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { } // Function to check the amount of tokens that an owner allowed to a spender function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } } contract ICOToken is token { // Public variables string public firstLevelPrice = "Token 0.0100 ETH per Token"; string public secondLevelPrice = "Token 0.0125 ETH per Token"; string public thirdLevelPrice = "Token 0.0166 ETH per Token"; string public CapLevelPrice = "Token 0.0250 ETH per Token"; uint256 public _firstLevelEth; uint256 public _secondLevelEth; uint256 public _thirdLevelEth; uint256 public _capLevelEth; uint256 public buyPrice; uint256 public fundingGoal; uint256 public amountRaisedEth; uint256 public deadline; uint256 public maximumBuyBackPriceInCents; uint256 public maximumBuyBackAmountInCents; uint256 public maximumBuyBackAmountInWEI; address public beneficiary; mapping (address => uint256) public KilledTokens; // This creates an array with all killed tokens // Private variables uint256 _currentLevelEth; uint256 _currentLevelPrice; uint256 _nextLevelEth; uint256 _nextLevelPrice; uint256 _firstLevelPrice; uint256 _secondLevelPrice; uint256 _thirdLevelPrice; uint256 _capLevelPrice; uint256 _currentSupply; uint256 remainig; uint256 amount; uint256 TokensAmount; bool fundingGoalReached; bool crowdsaleClosed; event GoalReached(address _beneficiary, uint amountRaised); modifier afterDeadline() { } // Initializes contract function ICOToken() token() { } // Changes the level price when the current one is reached // Makes the current to be next // And next to be the following one function levelChanger() internal { } // Check if the tokens amount is bigger than total supply function safeCheck (uint256 _TokensAmount) internal { } // Calculates the tokens amount function tokensAmount() internal returns (uint256 _tokensAmount) { } function manualBuyPrice (uint256 _NewPrice) onlyOwner { } // The function without name is the default function that is called whenever anyone sends funds to a contract function buyTokens () payable { } function () payable { } // Checks if the goal or time limit has been reached and ends the campaign function CloseCrowdSale(uint256 _maximumBuyBackAmountInCents) internal { } } contract GAP is ICOToken { // Public variables string public maximumBuyBack = "Token 0.05 ETH per Token"; // Max price in ETH for buy back uint256 public KilledTillNow; uint256 public sellPrice; uint256 public mustToSellCourses; uint public depositsTillNow; uint public actualPriceInCents; address public Killer; event FundTransfer(address backer, uint amount, bool isContribution); function GAP() ICOToken() { } // The contributers can check the actual price in wei before selling function checkActualPrice() returns (uint256 _sellPrice) { } // End the crowdsale and start buying back // Only owner can execute this function function BuyBackStart(uint256 actualSellPriceInWei, uint256 _mustToSellCourses, uint256 maxBuyBackPriceCents) onlyOwner { } function deposit (uint _deposits, uint256 actualSellPriceInWei, uint _actualPriceInCents) onlyOwner payable { } function sell(uint256 amount) onlyContributer returns (uint256 revenue) { } function ownerWithdrawal(uint256 amountInWei, address _to) onlyOwner { } function safeWithdrawal() afterDeadline { } }
balanceOf[_to]<=balanceOf[_to].plus(_value)
335,038
balanceOf[_to]<=balanceOf[_to].plus(_value)
null
pragma solidity ^0.4.2; contract owned { address public owner; function owned() { } modifier onlyOwner { } function transferOwnership(address newOwner) onlyOwner { } } contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); } library MathFunction { // standard uint256 functions function plus(uint256 x, uint256 y) constant internal returns (uint256 z) { } function minus(uint256 x, uint256 y) constant internal returns (uint256 z) { } function multiply(uint256 x, uint256 y) constant internal returns (uint256 z) { } function divide(uint256 x, uint256 y) constant internal returns (uint256 z) { } // uint256 function function hplus(uint256 x, uint256 y) constant internal returns (uint256 z) { } function hminus(uint256 x, uint256 y) constant internal returns (uint256 z) { } function hmultiply(uint256 x, uint256 y) constant internal returns (uint256 z) { } function hdivide(uint256 x, uint256 y) constant internal returns (uint256 z) { } // BIG math uint256 constant BIG = 10 ** 18; function wplus(uint256 x, uint256 y) constant internal returns (uint256) { } function wminus(uint256 x, uint256 y) constant internal returns (uint256) { } function wmultiply(uint256 x, uint256 y) constant internal returns (uint256 z) { } function wdivide(uint256 x, uint256 y) constant internal returns (uint256 z) { } function cast(uint256 x) constant internal returns (uint256 z) { } } contract ERC20 { function totalSupply() constant returns (uint _totalSupply); function balanceOf(address _owner) constant returns (uint balance); function transfer(address _to, uint _value) returns (bool success); function transferFrom(address _from, address _to, uint _value) returns (bool success); function approve(address _spender, uint _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint remaining); event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } contract token is owned, ERC20 { using MathFunction for uint256; // Public variables string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; mapping (address => uint256) public contrubutedAmount; mapping (address => uint256) public balanceOf; // This creates an array with all balances mapping (address => mapping (address => uint256)) public allowance; // Creates an array with allowed amount of tokens for sender modifier onlyContributer { } // Initializes contract with name, symbol, decimal and total supply function token() { } function balanceOf(address _owner) constant returns (uint256 balance) { } function totalSupply() constant returns (uint256 _totalSupply) { } function transfer(address _to, uint256 _value) returns (bool success) { } // A contract attempts to get the coins function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } // Allow another contract to spend some tokens in your behalf function approve(address _spender, uint256 _value) returns (bool success) { } // Approve and then communicate the approved contract in a single tx function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { } // Function to check the amount of tokens that an owner allowed to a spender function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } } contract ICOToken is token { // Public variables string public firstLevelPrice = "Token 0.0100 ETH per Token"; string public secondLevelPrice = "Token 0.0125 ETH per Token"; string public thirdLevelPrice = "Token 0.0166 ETH per Token"; string public CapLevelPrice = "Token 0.0250 ETH per Token"; uint256 public _firstLevelEth; uint256 public _secondLevelEth; uint256 public _thirdLevelEth; uint256 public _capLevelEth; uint256 public buyPrice; uint256 public fundingGoal; uint256 public amountRaisedEth; uint256 public deadline; uint256 public maximumBuyBackPriceInCents; uint256 public maximumBuyBackAmountInCents; uint256 public maximumBuyBackAmountInWEI; address public beneficiary; mapping (address => uint256) public KilledTokens; // This creates an array with all killed tokens // Private variables uint256 _currentLevelEth; uint256 _currentLevelPrice; uint256 _nextLevelEth; uint256 _nextLevelPrice; uint256 _firstLevelPrice; uint256 _secondLevelPrice; uint256 _thirdLevelPrice; uint256 _capLevelPrice; uint256 _currentSupply; uint256 remainig; uint256 amount; uint256 TokensAmount; bool fundingGoalReached; bool crowdsaleClosed; event GoalReached(address _beneficiary, uint amountRaised); modifier afterDeadline() { } // Initializes contract function ICOToken() token() { } // Changes the level price when the current one is reached // Makes the current to be next // And next to be the following one function levelChanger() internal { } // Check if the tokens amount is bigger than total supply function safeCheck (uint256 _TokensAmount) internal { } // Calculates the tokens amount function tokensAmount() internal returns (uint256 _tokensAmount) { } function manualBuyPrice (uint256 _NewPrice) onlyOwner { } // The function without name is the default function that is called whenever anyone sends funds to a contract function buyTokens () payable { } function () payable { } // Checks if the goal or time limit has been reached and ends the campaign function CloseCrowdSale(uint256 _maximumBuyBackAmountInCents) internal { } } contract GAP is ICOToken { // Public variables string public maximumBuyBack = "Token 0.05 ETH per Token"; // Max price in ETH for buy back uint256 public KilledTillNow; uint256 public sellPrice; uint256 public mustToSellCourses; uint public depositsTillNow; uint public actualPriceInCents; address public Killer; event FundTransfer(address backer, uint amount, bool isContribution); function GAP() ICOToken() { } // The contributers can check the actual price in wei before selling function checkActualPrice() returns (uint256 _sellPrice) { } // End the crowdsale and start buying back // Only owner can execute this function function BuyBackStart(uint256 actualSellPriceInWei, uint256 _mustToSellCourses, uint256 maxBuyBackPriceCents) onlyOwner { } function deposit (uint _deposits, uint256 actualSellPriceInWei, uint _actualPriceInCents) onlyOwner payable { } function sell(uint256 amount) onlyContributer returns (uint256 revenue) { } function ownerWithdrawal(uint256 amountInWei, address _to) onlyOwner { } function safeWithdrawal() afterDeadline { if (!fundingGoalReached) { uint256 tokensAmount = balanceOf[msg.sender]; uint256 amountForReturn = contrubutedAmount[msg.sender]; balanceOf[msg.sender] = 0; KilledTillNow = KilledTillNow.plus(tokensAmount); KilledTokens[msg.sender] = KilledTokens[msg.sender].plus(tokensAmount); require(tokensAmount > 0); contrubutedAmount[msg.sender] = contrubutedAmount[msg.sender].minus(amountForReturn); msg.sender.transfer(amountForReturn); } if(fundingGoalReached && beneficiary == msg.sender) { require(<FILL_ME>) beneficiary.transfer(amountRaisedEth); } } }
fundingGoalReached&&beneficiary==msg.sender
335,038
fundingGoalReached&&beneficiary==msg.sender
"Cannot change presale state while public sale is live"
pragma solidity ^0.8.0; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping (uint256 => address) private _owners; // Mapping owner address to token count mapping (address => uint256) private _balances; // Mapping from token ID to approved address mapping (uint256 => address) private _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 Base URI for computing {tokenURI}. Empty by default, can be overriden * in child contracts. */ function _baseURI() internal view virtual 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` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - 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, uint256 tokenId) 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, uint256 tokenId, 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: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { } /** * @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 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) { } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { } } pragma solidity ^0.8.0; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external 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); } pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { } } pragma solidity ^0.8.0; contract FivePenguins is ERC721, ReentrancyGuard { address public immutable owner; uint256 public constant MAX_SUPPLY = 3125; uint256 public price = 1 ether / 20; bool public presaleEnabled; bool public saleEnabled; mapping (address => bool) public admins; bool private adminsLocked; mapping (address => bool) public whitelist; mapping (address => bool) public freeMintClaimed; uint256 public totalSupply; string private uri; constructor(string memory name, string memory symbol, string memory _uri) ERC721(name, symbol) { } function baseURI() public view returns (string memory) { } function _baseURI() internal view override returns (string memory) { } function canClaimFreeMint(address claimer) public view returns (bool) { } function soldOut() public view returns (bool) { } function mint(uint256 amountToBuy) public payable nonReentrant { } function withdraw() public { } function setPresaleEnabled(bool to) public { require(msg.sender == owner || admins[msg.sender], "Only owner or admin can change presale state"); require(<FILL_ME>) require(totalSupply != MAX_SUPPLY, "Cannot change presale state after selling out"); presaleEnabled = to; } function setSaleEnabled(bool to) public { } function setPrice(uint256 to) public { } function addToWhitelist(address[] calldata addresses) public { } function removeFromWhitelist(address[] calldata addresses) public { } function addAdmins(address[] calldata addresses) public { } function removeAdmins(address[] calldata addresses) public { } function setAdminsLock(bool to) public { } function tokenOwners(uint256 startAt, uint256 limit) public view returns (address[] memory, uint256) { } }
!saleEnabled,"Cannot change presale state while public sale is live"
335,042
!saleEnabled
"Cannot change administrators while locked"
pragma solidity ^0.8.0; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping (uint256 => address) private _owners; // Mapping owner address to token count mapping (address => uint256) private _balances; // Mapping from token ID to approved address mapping (uint256 => address) private _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 Base URI for computing {tokenURI}. Empty by default, can be overriden * in child contracts. */ function _baseURI() internal view virtual 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` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - 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, uint256 tokenId) 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, uint256 tokenId, 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: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { } /** * @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 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) { } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { } } pragma solidity ^0.8.0; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external 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); } pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { } } pragma solidity ^0.8.0; contract FivePenguins is ERC721, ReentrancyGuard { address public immutable owner; uint256 public constant MAX_SUPPLY = 3125; uint256 public price = 1 ether / 20; bool public presaleEnabled; bool public saleEnabled; mapping (address => bool) public admins; bool private adminsLocked; mapping (address => bool) public whitelist; mapping (address => bool) public freeMintClaimed; uint256 public totalSupply; string private uri; constructor(string memory name, string memory symbol, string memory _uri) ERC721(name, symbol) { } function baseURI() public view returns (string memory) { } function _baseURI() internal view override returns (string memory) { } function canClaimFreeMint(address claimer) public view returns (bool) { } function soldOut() public view returns (bool) { } function mint(uint256 amountToBuy) public payable nonReentrant { } function withdraw() public { } function setPresaleEnabled(bool to) public { } function setSaleEnabled(bool to) public { } function setPrice(uint256 to) public { } function addToWhitelist(address[] calldata addresses) public { } function removeFromWhitelist(address[] calldata addresses) public { } function addAdmins(address[] calldata addresses) public { require(msg.sender == owner, "Only owner can add administrators"); require(<FILL_ME>) for (uint i = 0; i < addresses.length; i++) { admins[addresses[i]] = true; } } function removeAdmins(address[] calldata addresses) public { } function setAdminsLock(bool to) public { } function tokenOwners(uint256 startAt, uint256 limit) public view returns (address[] memory, uint256) { } }
!adminsLocked,"Cannot change administrators while locked"
335,042
!adminsLocked
"Account should be present"
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@rarible/royalties/contracts/impl/RoyaltiesV2Impl.sol"; import "@rarible/royalties-upgradeable/contracts/RoyaltiesV2Upgradeable.sol"; import "@rarible/lazy-mint/contracts/erc-721/IERC721LazyMint.sol"; import "./Mint721Validator.sol"; abstract contract ERC721Lazy is IERC721LazyMint, ERC721Upgradeable, Mint721Validator, RoyaltiesV2Upgradeable, RoyaltiesV2Impl { using SafeMathUpgradeable for uint; bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd; bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63; // tokenId => creators mapping(uint256 => LibPart.Part[]) private creators; function __ERC721Lazy_init_unchained() internal initializer { } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) { } function transferFromOrMint( LibERC721LazyMint.Mint721Data memory data, address from, address to ) override external { } function mintAndTransfer(LibERC721LazyMint.Mint721Data memory data, address to) public override virtual { } function _saveCreators(uint tokenId, LibPart.Part[] memory _creators) internal { LibPart.Part[] storage creatorsOfToken = creators[tokenId]; uint total = 0; for (uint i = 0; i < _creators.length; i++) { require(<FILL_ME>) require(_creators[i].value != 0, "Creator share should be positive"); creatorsOfToken.push(_creators[i]); total = total.add(_creators[i].value); } require(total == 10000, "total amount of creators share should be 10000"); emit Creators(tokenId, _creators); } function updateAccount(uint256 _id, address _from, address _to) external { } function getCreators(uint256 _id) external view returns (LibPart.Part[] memory) { } uint256[50] private __gap; }
_creators[i].account!=address(0x0),"Account should be present"
335,079
_creators[i].account!=address(0x0)
"Creator share should be positive"
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@rarible/royalties/contracts/impl/RoyaltiesV2Impl.sol"; import "@rarible/royalties-upgradeable/contracts/RoyaltiesV2Upgradeable.sol"; import "@rarible/lazy-mint/contracts/erc-721/IERC721LazyMint.sol"; import "./Mint721Validator.sol"; abstract contract ERC721Lazy is IERC721LazyMint, ERC721Upgradeable, Mint721Validator, RoyaltiesV2Upgradeable, RoyaltiesV2Impl { using SafeMathUpgradeable for uint; bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd; bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63; // tokenId => creators mapping(uint256 => LibPart.Part[]) private creators; function __ERC721Lazy_init_unchained() internal initializer { } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) { } function transferFromOrMint( LibERC721LazyMint.Mint721Data memory data, address from, address to ) override external { } function mintAndTransfer(LibERC721LazyMint.Mint721Data memory data, address to) public override virtual { } function _saveCreators(uint tokenId, LibPart.Part[] memory _creators) internal { LibPart.Part[] storage creatorsOfToken = creators[tokenId]; uint total = 0; for (uint i = 0; i < _creators.length; i++) { require(_creators[i].account != address(0x0), "Account should be present"); require(<FILL_ME>) creatorsOfToken.push(_creators[i]); total = total.add(_creators[i].value); } require(total == 10000, "total amount of creators share should be 10000"); emit Creators(tokenId, _creators); } function updateAccount(uint256 _id, address _from, address _to) external { } function getCreators(uint256 _id) external view returns (LibPart.Part[] memory) { } uint256[50] private __gap; }
_creators[i].value!=0,"Creator share should be positive"
335,079
_creators[i].value!=0
"not allowed"
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma abicoder v2; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@rarible/royalties/contracts/impl/RoyaltiesV2Impl.sol"; import "@rarible/royalties-upgradeable/contracts/RoyaltiesV2Upgradeable.sol"; import "@rarible/lazy-mint/contracts/erc-721/IERC721LazyMint.sol"; import "./Mint721Validator.sol"; abstract contract ERC721Lazy is IERC721LazyMint, ERC721Upgradeable, Mint721Validator, RoyaltiesV2Upgradeable, RoyaltiesV2Impl { using SafeMathUpgradeable for uint; bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd; bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63; // tokenId => creators mapping(uint256 => LibPart.Part[]) private creators; function __ERC721Lazy_init_unchained() internal initializer { } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) { } function transferFromOrMint( LibERC721LazyMint.Mint721Data memory data, address from, address to ) override external { } function mintAndTransfer(LibERC721LazyMint.Mint721Data memory data, address to) public override virtual { } function _saveCreators(uint tokenId, LibPart.Part[] memory _creators) internal { } function updateAccount(uint256 _id, address _from, address _to) external { require(<FILL_ME>) super._updateAccount(_id, _from, _to); } function getCreators(uint256 _id) external view returns (LibPart.Part[] memory) { } uint256[50] private __gap; }
_msgSender()==_from,"not allowed"
335,079
_msgSender()==_from
"Max supply exceeded"
pragma solidity ^0.8.7; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; contract CrookedPalmTrees is ERC721Enumerable, Ownable { using SafeMath for uint; using Strings for uint; using Address for address; uint public price; uint public cutDownFee; uint public killSharksFee; uint public buildUpFee; uint public immutable maxSupply; bool public mintingEnabled = true; bool public cutDown; bool public buildUp; bool public killSharks; uint public buyLimit; string private _baseURIPrefix; address payable immutable cash; constructor ( string memory _name, string memory _symbol, uint _maxSupply, uint _price, uint _buyLimit, string memory _uri, address payable _cash ) ERC721(_name, _symbol) { } function _baseURI() internal view override returns (string memory) { } function setBaseURI(string memory newUri) external onlyOwner { } function setPrice(uint256 newPrice) external onlyOwner { } function setBuyLimit(uint256 newBuyLimit) external onlyOwner { } function toggleMinting() external onlyOwner { } function mintNFTs(uint256 quantity) external payable { require(<FILL_ME>) if (_msgSender() != owner()) { require(mintingEnabled, "Minting has not been enabled"); require(quantity <= buyLimit, "Buy limit exceeded"); require(price.mul(quantity) == msg.value, "Incorrect ETH value"); } require(quantity > 0, "Invalid quantity"); for (uint i = 0; i < quantity; i++) { _safeMint(_msgSender(), totalSupply().add(1)); } } function toggleCutDown() external onlyOwner { } function toggleBuildUp() external onlyOwner { } function toggleKillSharks() external onlyOwner { } function cutDownYourPalmTree(uint _tokenId) external payable { } event PalmCut( uint indexed _id ); function buildUpIsland(uint _tokenId) external payable { } event PalmBuildUp( uint indexed _id ); function removeSharks(uint _tokenId) external payable { } event SharksKilled( uint indexed _id ); function withdraw() external onlyOwner { } }
totalSupply().add(quantity)<=maxSupply,"Max supply exceeded"
335,217
totalSupply().add(quantity)<=maxSupply
"Incorrect ETH value"
pragma solidity ^0.8.7; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.sol"; contract CrookedPalmTrees is ERC721Enumerable, Ownable { using SafeMath for uint; using Strings for uint; using Address for address; uint public price; uint public cutDownFee; uint public killSharksFee; uint public buildUpFee; uint public immutable maxSupply; bool public mintingEnabled = true; bool public cutDown; bool public buildUp; bool public killSharks; uint public buyLimit; string private _baseURIPrefix; address payable immutable cash; constructor ( string memory _name, string memory _symbol, uint _maxSupply, uint _price, uint _buyLimit, string memory _uri, address payable _cash ) ERC721(_name, _symbol) { } function _baseURI() internal view override returns (string memory) { } function setBaseURI(string memory newUri) external onlyOwner { } function setPrice(uint256 newPrice) external onlyOwner { } function setBuyLimit(uint256 newBuyLimit) external onlyOwner { } function toggleMinting() external onlyOwner { } function mintNFTs(uint256 quantity) external payable { require(totalSupply().add(quantity) <= maxSupply, "Max supply exceeded"); if (_msgSender() != owner()) { require(mintingEnabled, "Minting has not been enabled"); require(quantity <= buyLimit, "Buy limit exceeded"); require(<FILL_ME>) } require(quantity > 0, "Invalid quantity"); for (uint i = 0; i < quantity; i++) { _safeMint(_msgSender(), totalSupply().add(1)); } } function toggleCutDown() external onlyOwner { } function toggleBuildUp() external onlyOwner { } function toggleKillSharks() external onlyOwner { } function cutDownYourPalmTree(uint _tokenId) external payable { } event PalmCut( uint indexed _id ); function buildUpIsland(uint _tokenId) external payable { } event PalmBuildUp( uint indexed _id ); function removeSharks(uint _tokenId) external payable { } event SharksKilled( uint indexed _id ); function withdraw() external onlyOwner { } }
price.mul(quantity)==msg.value,"Incorrect ETH value"
335,217
price.mul(quantity)==msg.value
"You're exceeding maximum tokens"
pragma solidity 0.8.11; contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } abstract contract Toadz { function balanceOf(address ownew) view public virtual returns (uint); } abstract contract Groupies { function balanceOf(address ownew) view public virtual returns (uint); } contract PeacefulToadz is ERC721, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; //constants uint public holdersaleCost = 0.066 ether; uint public presaleCost = 0.066 ether; uint public publicsaleCost = 0.066 ether; uint public maxSupply = 8888; uint private holderMaxMintAmount = 3; uint private publicMaxMintAmount = 25; uint private reservedOwnerMint=100; //variable s bool public paused = false; bool public baseURILocked = false; bool public publicsale = false; bool public holdersale = false; bool public presale = false; address public proxyRegistryAddress; bytes32 private merkleRoot; string public contractURL; string public baseURI; string public baseExtension = ".json"; address public token1address; address public token2address; address public coldwallet; //Arrays mapping(address => uint) publicSaleMinted; mapping(address => uint) holderSaleRemaining; mapping(address => bool) holderSaleUsed; mapping(address => uint) whitelistRemaining; mapping(address => bool) whitelistUsed; //Actions event BaseTokenURIChanged(string baseURI); event ContractURIChanged(string contractURL); constructor(string memory _name, string memory _symbol,string memory _initBaseURI,string memory _initcontractURI,address _initProxyAddress,bytes32 _merkleRoot,address _token1address, address _token2address,address _coldwallet) ERC721(_name, _symbol) { } // internal function mint_function(uint _mintAmount) internal { require(!paused,"Contract is paused"); uint current = _tokenIdCounter.current(); require(<FILL_ME>) for (uint i = 1; i <= _mintAmount; i++) { mintInternal(); } } function mintInternal() internal { } // public function totalSupply() public view returns (uint) { } function holderSaleMint(uint _mintAmount) external payable{ } function preSaleMint(uint _mintAmount, uint _MaxMintAmount,bool _earlyInvest, bytes32[] memory proof) external payable { } function publicSaleMint(uint _mintAmount) external payable { } function tokenURI(uint tokenId) public view virtual override returns (string memory) { } function contractURI() public view returns (string memory) { } //ADMIN FUNCTIONS function lockContract() public onlyOwner(){ } function ownershiptransfer(address _newOwner) public onlyOwner(){ } function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner() { } function setBaseURI(string memory _newBaseURI) public onlyOwner() { } function setBaseExtension(string memory _newBaseExtension) public onlyOwner() { } function setcontractURI(string memory _newcontractURI) public onlyOwner() { } function toogleSection(uint section) public onlyOwner() { } function changePrice(uint section, uint price) public onlyOwner() { } function setAddress(uint section, address _address) public onlyOwner() { } function withdraw() public payable { } function tokensOfOwner(address _owner, uint startId, uint endId) external view returns(uint[] memory ) { } // Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings. function isApprovedForAll(address owner, address operator) override public view returns (bool) { } }
current+_mintAmount<=maxSupply,"You're exceeding maximum tokens"
335,379
current+_mintAmount<=maxSupply