comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"You do not own all these apes"
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } } pragma solidity ^0.8.0; interface ApeInterface { function ownerOf(uint256 tokenId) external view returns (address owner); function balanceOf(address owner) external view returns (uint256 balance); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); } contract PotionPunks is ERC721URIStorage, Ownable { event MintPotionPunk (address indexed minter, uint256 startWith, uint256 times); uint256 public totalPotionPunks; //bruh man strikes again uint256 public totalCount = 3500; string public baseURI; bool public started; mapping(address => uint256) apeHolderMintCount; mapping(uint256 => bool) claimedApes; uint addressRegistryCount; bool public apeHolderStart; // Allowing the free mint to ape holders address public apeAddress = 0xf2bCA53F401C0F53cA78e9270efd1F7B5330b522; ApeInterface apeContract = ApeInterface(apeAddress); constructor(string memory name_, string memory symbol_, string memory baseURI_) ERC721(name_, symbol_) { } modifier mintEnabled() { } modifier apeHolderEnabled() { } function totalSupply() public view virtual returns (uint256) { } function _baseURI() internal view virtual override returns (string memory){ } function setBaseURI(string memory _newURI) public onlyOwner { } function setTokenURI(uint256 _tokenId, string memory _tokenURI) public onlyOwner { } function setNormalStart(bool _start) public onlyOwner { } function setFreeMintStart(bool _start) public onlyOwner { } function changeTotalCount(uint256 _count) public onlyOwner { } function apeHolderFreeMint(uint256[] memory _apeIds) public apeHolderEnabled { require(<FILL_ME>) require(apeContract.balanceOf(msg.sender) > 0, "Must own a Genesis ape"); require(totalPotionPunks + 1 <= totalCount, "Mint amount will exceed total collection amount."); require(claimedAllTheApes(_apeIds), "These apes have already been claimed"); emit MintPotionPunk(msg.sender, totalPotionPunks+1, _apeIds.length); for (uint256 i = 0; i < _apeIds.length; i++) { if(claimedApes[_apeIds[i]] == false) { claimedApes[_apeIds[i]] = true; totalPotionPunks++; _mint(_msgSender(), _apeIds[i]); } } } function ownsAllTheApes(uint256[] memory _apeIds, address _owner) public view returns(bool success){ } function claimedAllTheApes(uint256[] memory _apeIds) public view returns(bool success){ } function claimed(uint256 _id) public view returns (bool success){ } function adminMintGiveaways(address _addr) public onlyOwner { } }
ownsAllTheApes(_apeIds,msg.sender),"You do not own all these apes"
368,688
ownsAllTheApes(_apeIds,msg.sender)
"Must own a Genesis ape"
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } } pragma solidity ^0.8.0; interface ApeInterface { function ownerOf(uint256 tokenId) external view returns (address owner); function balanceOf(address owner) external view returns (uint256 balance); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); } contract PotionPunks is ERC721URIStorage, Ownable { event MintPotionPunk (address indexed minter, uint256 startWith, uint256 times); uint256 public totalPotionPunks; //bruh man strikes again uint256 public totalCount = 3500; string public baseURI; bool public started; mapping(address => uint256) apeHolderMintCount; mapping(uint256 => bool) claimedApes; uint addressRegistryCount; bool public apeHolderStart; // Allowing the free mint to ape holders address public apeAddress = 0xf2bCA53F401C0F53cA78e9270efd1F7B5330b522; ApeInterface apeContract = ApeInterface(apeAddress); constructor(string memory name_, string memory symbol_, string memory baseURI_) ERC721(name_, symbol_) { } modifier mintEnabled() { } modifier apeHolderEnabled() { } function totalSupply() public view virtual returns (uint256) { } function _baseURI() internal view virtual override returns (string memory){ } function setBaseURI(string memory _newURI) public onlyOwner { } function setTokenURI(uint256 _tokenId, string memory _tokenURI) public onlyOwner { } function setNormalStart(bool _start) public onlyOwner { } function setFreeMintStart(bool _start) public onlyOwner { } function changeTotalCount(uint256 _count) public onlyOwner { } function apeHolderFreeMint(uint256[] memory _apeIds) public apeHolderEnabled { require(ownsAllTheApes(_apeIds,msg.sender), "You do not own all these apes"); require(<FILL_ME>) require(totalPotionPunks + 1 <= totalCount, "Mint amount will exceed total collection amount."); require(claimedAllTheApes(_apeIds), "These apes have already been claimed"); emit MintPotionPunk(msg.sender, totalPotionPunks+1, _apeIds.length); for (uint256 i = 0; i < _apeIds.length; i++) { if(claimedApes[_apeIds[i]] == false) { claimedApes[_apeIds[i]] = true; totalPotionPunks++; _mint(_msgSender(), _apeIds[i]); } } } function ownsAllTheApes(uint256[] memory _apeIds, address _owner) public view returns(bool success){ } function claimedAllTheApes(uint256[] memory _apeIds) public view returns(bool success){ } function claimed(uint256 _id) public view returns (bool success){ } function adminMintGiveaways(address _addr) public onlyOwner { } }
apeContract.balanceOf(msg.sender)>0,"Must own a Genesis ape"
368,688
apeContract.balanceOf(msg.sender)>0
"Mint amount will exceed total collection amount."
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } } pragma solidity ^0.8.0; interface ApeInterface { function ownerOf(uint256 tokenId) external view returns (address owner); function balanceOf(address owner) external view returns (uint256 balance); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); } contract PotionPunks is ERC721URIStorage, Ownable { event MintPotionPunk (address indexed minter, uint256 startWith, uint256 times); uint256 public totalPotionPunks; //bruh man strikes again uint256 public totalCount = 3500; string public baseURI; bool public started; mapping(address => uint256) apeHolderMintCount; mapping(uint256 => bool) claimedApes; uint addressRegistryCount; bool public apeHolderStart; // Allowing the free mint to ape holders address public apeAddress = 0xf2bCA53F401C0F53cA78e9270efd1F7B5330b522; ApeInterface apeContract = ApeInterface(apeAddress); constructor(string memory name_, string memory symbol_, string memory baseURI_) ERC721(name_, symbol_) { } modifier mintEnabled() { } modifier apeHolderEnabled() { } function totalSupply() public view virtual returns (uint256) { } function _baseURI() internal view virtual override returns (string memory){ } function setBaseURI(string memory _newURI) public onlyOwner { } function setTokenURI(uint256 _tokenId, string memory _tokenURI) public onlyOwner { } function setNormalStart(bool _start) public onlyOwner { } function setFreeMintStart(bool _start) public onlyOwner { } function changeTotalCount(uint256 _count) public onlyOwner { } function apeHolderFreeMint(uint256[] memory _apeIds) public apeHolderEnabled { require(ownsAllTheApes(_apeIds,msg.sender), "You do not own all these apes"); require(apeContract.balanceOf(msg.sender) > 0, "Must own a Genesis ape"); require(<FILL_ME>) require(claimedAllTheApes(_apeIds), "These apes have already been claimed"); emit MintPotionPunk(msg.sender, totalPotionPunks+1, _apeIds.length); for (uint256 i = 0; i < _apeIds.length; i++) { if(claimedApes[_apeIds[i]] == false) { claimedApes[_apeIds[i]] = true; totalPotionPunks++; _mint(_msgSender(), _apeIds[i]); } } } function ownsAllTheApes(uint256[] memory _apeIds, address _owner) public view returns(bool success){ } function claimedAllTheApes(uint256[] memory _apeIds) public view returns(bool success){ } function claimed(uint256 _id) public view returns (bool success){ } function adminMintGiveaways(address _addr) public onlyOwner { } }
totalPotionPunks+1<=totalCount,"Mint amount will exceed total collection amount."
368,688
totalPotionPunks+1<=totalCount
"These apes have already been claimed"
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } } pragma solidity ^0.8.0; interface ApeInterface { function ownerOf(uint256 tokenId) external view returns (address owner); function balanceOf(address owner) external view returns (uint256 balance); function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); } contract PotionPunks is ERC721URIStorage, Ownable { event MintPotionPunk (address indexed minter, uint256 startWith, uint256 times); uint256 public totalPotionPunks; //bruh man strikes again uint256 public totalCount = 3500; string public baseURI; bool public started; mapping(address => uint256) apeHolderMintCount; mapping(uint256 => bool) claimedApes; uint addressRegistryCount; bool public apeHolderStart; // Allowing the free mint to ape holders address public apeAddress = 0xf2bCA53F401C0F53cA78e9270efd1F7B5330b522; ApeInterface apeContract = ApeInterface(apeAddress); constructor(string memory name_, string memory symbol_, string memory baseURI_) ERC721(name_, symbol_) { } modifier mintEnabled() { } modifier apeHolderEnabled() { } function totalSupply() public view virtual returns (uint256) { } function _baseURI() internal view virtual override returns (string memory){ } function setBaseURI(string memory _newURI) public onlyOwner { } function setTokenURI(uint256 _tokenId, string memory _tokenURI) public onlyOwner { } function setNormalStart(bool _start) public onlyOwner { } function setFreeMintStart(bool _start) public onlyOwner { } function changeTotalCount(uint256 _count) public onlyOwner { } function apeHolderFreeMint(uint256[] memory _apeIds) public apeHolderEnabled { require(ownsAllTheApes(_apeIds,msg.sender), "You do not own all these apes"); require(apeContract.balanceOf(msg.sender) > 0, "Must own a Genesis ape"); require(totalPotionPunks + 1 <= totalCount, "Mint amount will exceed total collection amount."); require(<FILL_ME>) emit MintPotionPunk(msg.sender, totalPotionPunks+1, _apeIds.length); for (uint256 i = 0; i < _apeIds.length; i++) { if(claimedApes[_apeIds[i]] == false) { claimedApes[_apeIds[i]] = true; totalPotionPunks++; _mint(_msgSender(), _apeIds[i]); } } } function ownsAllTheApes(uint256[] memory _apeIds, address _owner) public view returns(bool success){ } function claimedAllTheApes(uint256[] memory _apeIds) public view returns(bool success){ } function claimed(uint256 _id) public view returns (bool success){ } function adminMintGiveaways(address _addr) public onlyOwner { } }
claimedAllTheApes(_apeIds),"These apes have already been claimed"
368,688
claimedAllTheApes(_apeIds)
'Raffle has already been drawn and completed.'
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/interfaces/IERC20.sol'; import '@openzeppelin/contracts/interfaces/IERC721.sol'; import './MTGYSpend.sol'; /** * @title MTGYRaffle * @dev This is the main contract that supports lotteries and raffles. */ contract MTGYRaffle is Ownable { struct Raffle { address owner; bool isNft; // rewardToken is either ERC20 or ERC721 address rewardToken; uint256 rewardAmountOrTokenId; uint256 start; // timestamp (uint256) of start time (0 if start when raffle is created) uint256 end; // timestamp (uint256) of end time (0 if can be entered until owner draws) address entryToken; // ERC20 token requiring user to send to enter uint256 entryFee; // ERC20 num tokens user must send to enter, or 0 if no entry fee uint256 entryFeesCollected; // amount of fees collected by entries and paid to raffle/lottery owner uint256 maxEntriesPerAddress; // 0 means unlimited entries address[] entries; address winner; bool isComplete; bool isClosed; } IERC20 private _mtgy; MTGYSpend private _spend; uint256 public mtgyServiceCost = 5000 * 10**18; uint8 public entryFeePercentageCharge = 2; mapping(bytes32 => Raffle) public raffles; bytes32[] public raffleIds; mapping(bytes32 => mapping(address => uint256)) public entriesIndexed; event CreateRaffle(address indexed creator, bytes32 id); event EnterRaffle( bytes32 indexed id, address raffler, uint256 numberOfEntries ); event DrawWinner(bytes32 indexed id, address winner); event CloseRaffle(bytes32 indexed id); constructor(address _mtgyAddress, address _mtgySpendAddress) { } function getAllRaffles() external view returns (bytes32[] memory) { } function getRaffleEntries(bytes32 _id) external view returns (address[] memory) { } function createRaffle( address _rewardTokenAddress, uint256 _rewardAmountOrTokenId, bool _isNft, uint256 _start, uint256 _end, address _entryToken, uint256 _entryFee, uint256 _maxEntriesPerAddress ) external { } function drawWinner(bytes32 _id) external { Raffle storage _raffle = raffles[_id]; require( _raffle.owner == msg.sender, 'Must be the raffle owner to draw winner.' ); require( _raffle.end == 0 || block.timestamp > _raffle.end, 'Raffle entry period is not over yet.' ); require(<FILL_ME>) if (_raffle.entryFeesCollected > 0) { IERC20 _entryToken = IERC20(_raffle.entryToken); uint256 _feesToSendOwner = _raffle.entryFeesCollected; if (entryFeePercentageCharge > 0) { uint256 _feeChargeAmount = (_feesToSendOwner * entryFeePercentageCharge) / 100; _entryToken.transfer(owner(), _feeChargeAmount); _feesToSendOwner -= _feeChargeAmount; } _entryToken.transfer(_raffle.owner, _feesToSendOwner); } uint256 _winnerIdx = _random(_raffle.entries.length) % _raffle.entries.length; address _winner = _raffle.entries[_winnerIdx]; _raffle.winner = _winner; if (_raffle.isNft) { IERC721 _rewardToken = IERC721(_raffle.rewardToken); _rewardToken.transferFrom( address(this), _winner, _raffle.rewardAmountOrTokenId ); } else { IERC20 _rewardToken = IERC20(_raffle.rewardToken); _rewardToken.transfer(_winner, _raffle.rewardAmountOrTokenId); } _raffle.isComplete = true; emit DrawWinner(_id, _winner); } function closeRaffleAndRefund(bytes32 _id) external { } function enterRaffle(bytes32 _id, uint256 _numEntries) external { } function changeRaffleOwner(bytes32 _id, address _newOwner) external { } function changeEndDate(bytes32 _id, uint256 _newEnd) external { } function changeMtgyTokenAddy(address _tokenAddy) external onlyOwner { } function changeSpendAddress(address _spendAddress) external onlyOwner { } function changeMtgyServiceCost(uint256 _newCost) external onlyOwner { } function changeEntryFeePercentageCharge(uint8 _newPercentage) external onlyOwner { } function _validateDates(uint256 _start, uint256 _end) private view { } function _random(uint256 _entries) private view returns (uint256) { } }
!_raffle.isComplete,'Raffle has already been drawn and completed.'
368,751
!_raffle.isComplete
"Type is already created"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./Governable.sol"; import "./Signature.sol"; contract DeFineBadge is Governable, ERC1155, Signature { using Strings for uint256; bool private saleIsActive; uint256 private _counter; string public name; string public symbol; string public baseURI; address public signer; struct BadgeInfo { string _type; uint256 _maxCount; uint256 startAt; uint256 endAt; uint256 _mintLimit; address _minter; } event Mint(address indexed owner, string _type, uint256 _id); mapping(uint256 => BadgeInfo) public BadgesInfo; mapping(string => uint256) public typeList; // string type => tokenId mapping(uint256 => uint256) public mintedCount; // tokenId => minted Count mapping(uint256 => mapping(address => uint256)) public userMinted; // [tokenId], user Address => minted Count modifier onlyMinter(string memory _type) { } modifier whenSaleActive { } constructor( string memory _name, string memory _symbol, string memory _baseURI, address _signer ) ERC1155(baseURI) { } function newBadge( string memory _type, uint256 _maxCount, uint256 startAt, uint256 endAt, uint256 _mintLimit, address minter ) external governance returns (bool) { require(<FILL_ME>) _counter += 1; BadgeInfo memory badge = BadgeInfo(_type, _maxCount, startAt, endAt, _mintLimit, minter); BadgesInfo[_counter] = badge; typeList[_type] = _counter; return true; } function uri(uint256 tokenId) public view virtual override returns (string memory) { } function mint( string memory _type, uint256 _nonce, bytes memory _signature ) public { } function airdrop( string memory _type, address _to ) public onlyMinter(_type) { } function mintTo( string memory _type, address _to ) internal whenSaleActive { } function setURI(string memory _baseURI) external governance returns (bool) { } function setSigner(address _signer) external governance returns (bool) { } function setMinter(string memory _type, address _address) external governance returns (bool) { } function setMaxCount(string memory _type, uint256 _count) external governance returns (bool) { } function setStartTime(string memory _type, uint256 _startTime) external governance returns (bool) { } function setEndTime(string memory _type, uint256 _endTime) external governance returns (bool) { } function setMintLimit(string memory _type, uint256 _limit) external governance returns (bool) { } function toogleSaleIsActive() external governance { } function getSigner() external governance returns (address) { } function getMinter(string memory _type) external governance returns (address) { } function getMaxCount(string memory _type, uint256 _count) external governance returns (uint256) { } function getStartTime(string memory _type, uint256 _startTime) external governance returns (uint256) { } function getEndTime(string memory _type, uint256 _endTime) external governance returns (uint256) { } function getMintLimit(string memory _type, uint256 _limit) external governance returns (uint256) { } }
typeList[_type]==0,"Type is already created"
368,770
typeList[_type]==0
"mint max cap reached"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./Governable.sol"; import "./Signature.sol"; contract DeFineBadge is Governable, ERC1155, Signature { using Strings for uint256; bool private saleIsActive; uint256 private _counter; string public name; string public symbol; string public baseURI; address public signer; struct BadgeInfo { string _type; uint256 _maxCount; uint256 startAt; uint256 endAt; uint256 _mintLimit; address _minter; } event Mint(address indexed owner, string _type, uint256 _id); mapping(uint256 => BadgeInfo) public BadgesInfo; mapping(string => uint256) public typeList; // string type => tokenId mapping(uint256 => uint256) public mintedCount; // tokenId => minted Count mapping(uint256 => mapping(address => uint256)) public userMinted; // [tokenId], user Address => minted Count modifier onlyMinter(string memory _type) { } modifier whenSaleActive { } constructor( string memory _name, string memory _symbol, string memory _baseURI, address _signer ) ERC1155(baseURI) { } function newBadge( string memory _type, uint256 _maxCount, uint256 startAt, uint256 endAt, uint256 _mintLimit, address minter ) external governance returns (bool) { } function uri(uint256 tokenId) public view virtual override returns (string memory) { } function mint( string memory _type, uint256 _nonce, bytes memory _signature ) public { } function airdrop( string memory _type, address _to ) public onlyMinter(_type) { } function mintTo( string memory _type, address _to ) internal whenSaleActive { uint256 _id = typeList[_type]; BadgeInfo memory badge = BadgesInfo[_id]; require(_id > 0, "invalid badge type"); require(block.timestamp >= badge.startAt, "mint does't start"); require(block.timestamp <= badge.endAt, "mint is already ended"); require(<FILL_ME>) require((userMinted[_id])[_to] < badge._mintLimit, "mint per user limit reached"); _mint(_to, _id, 1, ""); mintedCount[_id] ++; (userMinted[_id])[_to] ++; emit Mint(msg.sender, _type, _id); } function setURI(string memory _baseURI) external governance returns (bool) { } function setSigner(address _signer) external governance returns (bool) { } function setMinter(string memory _type, address _address) external governance returns (bool) { } function setMaxCount(string memory _type, uint256 _count) external governance returns (bool) { } function setStartTime(string memory _type, uint256 _startTime) external governance returns (bool) { } function setEndTime(string memory _type, uint256 _endTime) external governance returns (bool) { } function setMintLimit(string memory _type, uint256 _limit) external governance returns (bool) { } function toogleSaleIsActive() external governance { } function getSigner() external governance returns (address) { } function getMinter(string memory _type) external governance returns (address) { } function getMaxCount(string memory _type, uint256 _count) external governance returns (uint256) { } function getStartTime(string memory _type, uint256 _startTime) external governance returns (uint256) { } function getEndTime(string memory _type, uint256 _endTime) external governance returns (uint256) { } function getMintLimit(string memory _type, uint256 _limit) external governance returns (uint256) { } }
mintedCount[_id]<badge._maxCount,"mint max cap reached"
368,770
mintedCount[_id]<badge._maxCount
"mint per user limit reached"
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./Governable.sol"; import "./Signature.sol"; contract DeFineBadge is Governable, ERC1155, Signature { using Strings for uint256; bool private saleIsActive; uint256 private _counter; string public name; string public symbol; string public baseURI; address public signer; struct BadgeInfo { string _type; uint256 _maxCount; uint256 startAt; uint256 endAt; uint256 _mintLimit; address _minter; } event Mint(address indexed owner, string _type, uint256 _id); mapping(uint256 => BadgeInfo) public BadgesInfo; mapping(string => uint256) public typeList; // string type => tokenId mapping(uint256 => uint256) public mintedCount; // tokenId => minted Count mapping(uint256 => mapping(address => uint256)) public userMinted; // [tokenId], user Address => minted Count modifier onlyMinter(string memory _type) { } modifier whenSaleActive { } constructor( string memory _name, string memory _symbol, string memory _baseURI, address _signer ) ERC1155(baseURI) { } function newBadge( string memory _type, uint256 _maxCount, uint256 startAt, uint256 endAt, uint256 _mintLimit, address minter ) external governance returns (bool) { } function uri(uint256 tokenId) public view virtual override returns (string memory) { } function mint( string memory _type, uint256 _nonce, bytes memory _signature ) public { } function airdrop( string memory _type, address _to ) public onlyMinter(_type) { } function mintTo( string memory _type, address _to ) internal whenSaleActive { uint256 _id = typeList[_type]; BadgeInfo memory badge = BadgesInfo[_id]; require(_id > 0, "invalid badge type"); require(block.timestamp >= badge.startAt, "mint does't start"); require(block.timestamp <= badge.endAt, "mint is already ended"); require(mintedCount[_id] < badge._maxCount, "mint max cap reached"); require(<FILL_ME>) _mint(_to, _id, 1, ""); mintedCount[_id] ++; (userMinted[_id])[_to] ++; emit Mint(msg.sender, _type, _id); } function setURI(string memory _baseURI) external governance returns (bool) { } function setSigner(address _signer) external governance returns (bool) { } function setMinter(string memory _type, address _address) external governance returns (bool) { } function setMaxCount(string memory _type, uint256 _count) external governance returns (bool) { } function setStartTime(string memory _type, uint256 _startTime) external governance returns (bool) { } function setEndTime(string memory _type, uint256 _endTime) external governance returns (bool) { } function setMintLimit(string memory _type, uint256 _limit) external governance returns (bool) { } function toogleSaleIsActive() external governance { } function getSigner() external governance returns (address) { } function getMinter(string memory _type) external governance returns (address) { } function getMaxCount(string memory _type, uint256 _count) external governance returns (uint256) { } function getStartTime(string memory _type, uint256 _startTime) external governance returns (uint256) { } function getEndTime(string memory _type, uint256 _endTime) external governance returns (uint256) { } function getMintLimit(string memory _type, uint256 _limit) external governance returns (uint256) { } }
(userMinted[_id])[_to]<badge._mintLimit,"mint per user limit reached"
368,770
(userMinted[_id])[_to]<badge._mintLimit
null
pragma solidity ^0.4.19; contract ERC20Basic { uint256 public totalSupply; string public name; string public symbol; uint8 public decimals; function balanceOf(address who) constant public returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { } } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping (address => uint256) internal balances; /** * Returns the balance of the qeuried address * * @param _who The address which is being qeuried **/ function balanceOf(address _who) public view returns(uint256) { } /** * Allows for the transfer of MSTCOIN tokens from peer to peer. * * @param _to The address of the receiver * @param _value The amount of tokens to send **/ function transfer(address _to, uint256 _value) public returns(bool) { } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant public returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint256)) internal allowances; /** * Returns the amount of tokens one has allowed another to spend on his or her behalf. * * @param _owner The address which is the owner of the tokens * @param _spender The address which has been allowed to spend tokens on the owner's * behalf **/ function allowance(address _owner, address _spender) public view returns (uint256) { } /** * Allows for the transfer of tokens on the behalf of the owner given that the owner has * allowed it previously. * * @param _from The address of the owner * @param _to The address of the recipient * @param _value The amount of tokens to be sent **/ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(<FILL_ME>) balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowances[_from][msg.sender] = allowances[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * Allows the owner of tokens to approve another to spend tokens on his or her behalf * * @param _spender The address which is being allowed to spend tokens on the owner' behalf * @param _value The amount of tokens to be sent **/ function approve(address _spender, uint256 _value) public returns (bool) { } } contract Ownable { address public owner; /** * The address whcih deploys this contrcat is automatically assgined ownership. * */ function Ownable() public { } /** * Functions with this modifier can only be executed by the owner of the contract. * */ modifier onlyOwner { } event OwnershipTransferred(address indexed from, address indexed to); /** * Transfers ownership to new Ethereum address. This function can only be called by the * owner. * @param _newOwner the address to be granted ownership. **/ function transferOwnership(address _newOwner) public onlyOwner { } } contract BurnableToken is StandardToken, Ownable { event TokensBurned(address indexed burner, uint256 value); function burnFrom(address _from, uint256 _tokens) public onlyOwner { } } contract Mercury is BurnableToken { function Mercury() public { } }
allowances[_from][msg.sender]>=_value&&_to!=0x0&&balances[_from]>=_value&&_value>0
368,885
allowances[_from][msg.sender]>=_value&&_to!=0x0&&balances[_from]>=_value&&_value>0
"Only owner can stake car"
pragma solidity ^0.6.2; contract CarMechanics is OwnableActiveTime { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; // Structure for the NFT info struct CarStructure { uint256 carType; uint256 carLevel; } // Car contract address public _carAddress = address(0); Car public _carContract; // Token contract address public _tokenAddress = address(0); Token public _tokenContract; // Token mint contract address public _tokenMintAddress = address(0); TokenMint public _tokenMintContract; // Auction contract address public _auctionAddress = address(0); // Map token ID to struct mapping (uint256 => CarStructure) public _allCars; // Map address to when owner last banked mapping (address => uint256) public _ownerLastBanked; // Amount of tokens invested to upgrade mapping (address => uint256) public _ownerTokensInvested; uint256 public _totalTokensInvested = 0; // Staking mapping (uint256 => address) public _stakingTokenToOwner; mapping (address => EnumerableSet.UintSet) private _stakingOwnerToTokens; // // ******************* SETUP & MIGRATE ******************* // // Migrate - Need to transfer tokens function migrate(address newCarMechanics) public onlyOwner returns (bool) { } // Setup the contract function setup(address auctionAddress, address tokenAddress, address tokenMintAddress, address carAddress) public onlyOwner { } // // ******************* STAKING ******************* // function stakeCar(uint256 carId) public onlyActive { // Require sender to be owner of car id require(<FILL_ME>) // Get earnings to wallet transferEarningsToWallet(_msgSender()); // Transfer to this address _carContract.transferFrom(_msgSender(), address(this), carId); // Update stake _stakingOwnerToTokens[_msgSender()].add(carId); _stakingTokenToOwner[carId] = _msgSender(); } function stakeAllCars() public onlyActive { } function unstakeCar(uint256 carId) public { } function stakedBalanceOf(address user) public view returns(uint256) { } function stakedCarIdAtIndex(address user, uint256 index) public view returns(uint256) { } function stakedOwnerOf(address user, uint256 carId) public view returns(bool) { } // // ******************* ACCOUNT CHANGES ******************* // // Used by auction to create car function mintCars(address payable buyer, uint256 carId, uint256 count, uint256 carType) public onlyActive { } // // ******************* HARVEST EARNINGS TO WALLET ******************* // // Tokens from earnings to wallet function transferEarningsToWallet(address owner) public { } // // ******************* EARNINGS ******************* // // Calculate earnings function calculateEarnings(address owner) public view returns(uint256) { } // Calculate earnings - Helper function calculateEarningsHelper(uint256 timeNow, address owner) public view returns(uint256) { } // Get multiplier for owning more NFTs function multiplierTotalOwned(address owner) public view returns(uint256) { } // Get multiplier for higher NFT types function multiplierHighType(address owner) public view returns(uint256) { } function sumCarEarnings(address owner) public view returns(uint256) { } // Car earnings per second function carEarnings(uint256 carId) public view returns(uint256) { } // // ******************* UPGRADE ******************* // // Calculate cost to upgrade function calculateCostToUpgrade(uint256 tokenId, uint256 toLevel) public view returns(uint256) { } // Upgrade car, with current wallet function upgradeCarFromWallet(uint256 tokenId, uint256 toLevel) public onlyActive { } }
_msgSender()==_carContract.ownerOf(carId),"Only owner can stake car"
368,891
_msgSender()==_carContract.ownerOf(carId)
"Car is not staked"
pragma solidity ^0.6.2; contract CarMechanics is OwnableActiveTime { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; // Structure for the NFT info struct CarStructure { uint256 carType; uint256 carLevel; } // Car contract address public _carAddress = address(0); Car public _carContract; // Token contract address public _tokenAddress = address(0); Token public _tokenContract; // Token mint contract address public _tokenMintAddress = address(0); TokenMint public _tokenMintContract; // Auction contract address public _auctionAddress = address(0); // Map token ID to struct mapping (uint256 => CarStructure) public _allCars; // Map address to when owner last banked mapping (address => uint256) public _ownerLastBanked; // Amount of tokens invested to upgrade mapping (address => uint256) public _ownerTokensInvested; uint256 public _totalTokensInvested = 0; // Staking mapping (uint256 => address) public _stakingTokenToOwner; mapping (address => EnumerableSet.UintSet) private _stakingOwnerToTokens; // // ******************* SETUP & MIGRATE ******************* // // Migrate - Need to transfer tokens function migrate(address newCarMechanics) public onlyOwner returns (bool) { } // Setup the contract function setup(address auctionAddress, address tokenAddress, address tokenMintAddress, address carAddress) public onlyOwner { } // // ******************* STAKING ******************* // function stakeCar(uint256 carId) public onlyActive { } function stakeAllCars() public onlyActive { } function unstakeCar(uint256 carId) public { // Require current address to be holding the caar require(<FILL_ME>) // Get original owner address originalOwner = _stakingTokenToOwner[carId]; // Require original owner to make the call require(originalOwner == _msgSender(), "Only original owner can unstake car"); // Get earnings transferEarningsToWallet(_msgSender()); // Transfer back to owner _carContract.safeTransferFrom(address(this), originalOwner, carId); // Update stake _stakingOwnerToTokens[_msgSender()].remove(carId); _stakingTokenToOwner[carId] = address(0); } function stakedBalanceOf(address user) public view returns(uint256) { } function stakedCarIdAtIndex(address user, uint256 index) public view returns(uint256) { } function stakedOwnerOf(address user, uint256 carId) public view returns(bool) { } // // ******************* ACCOUNT CHANGES ******************* // // Used by auction to create car function mintCars(address payable buyer, uint256 carId, uint256 count, uint256 carType) public onlyActive { } // // ******************* HARVEST EARNINGS TO WALLET ******************* // // Tokens from earnings to wallet function transferEarningsToWallet(address owner) public { } // // ******************* EARNINGS ******************* // // Calculate earnings function calculateEarnings(address owner) public view returns(uint256) { } // Calculate earnings - Helper function calculateEarningsHelper(uint256 timeNow, address owner) public view returns(uint256) { } // Get multiplier for owning more NFTs function multiplierTotalOwned(address owner) public view returns(uint256) { } // Get multiplier for higher NFT types function multiplierHighType(address owner) public view returns(uint256) { } function sumCarEarnings(address owner) public view returns(uint256) { } // Car earnings per second function carEarnings(uint256 carId) public view returns(uint256) { } // // ******************* UPGRADE ******************* // // Calculate cost to upgrade function calculateCostToUpgrade(uint256 tokenId, uint256 toLevel) public view returns(uint256) { } // Upgrade car, with current wallet function upgradeCarFromWallet(uint256 tokenId, uint256 toLevel) public onlyActive { } }
address(this)==_carContract.ownerOf(carId),"Car is not staked"
368,891
address(this)==_carContract.ownerOf(carId)
"Can only be called by auction"
pragma solidity ^0.6.2; contract CarMechanics is OwnableActiveTime { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; // Structure for the NFT info struct CarStructure { uint256 carType; uint256 carLevel; } // Car contract address public _carAddress = address(0); Car public _carContract; // Token contract address public _tokenAddress = address(0); Token public _tokenContract; // Token mint contract address public _tokenMintAddress = address(0); TokenMint public _tokenMintContract; // Auction contract address public _auctionAddress = address(0); // Map token ID to struct mapping (uint256 => CarStructure) public _allCars; // Map address to when owner last banked mapping (address => uint256) public _ownerLastBanked; // Amount of tokens invested to upgrade mapping (address => uint256) public _ownerTokensInvested; uint256 public _totalTokensInvested = 0; // Staking mapping (uint256 => address) public _stakingTokenToOwner; mapping (address => EnumerableSet.UintSet) private _stakingOwnerToTokens; // // ******************* SETUP & MIGRATE ******************* // // Migrate - Need to transfer tokens function migrate(address newCarMechanics) public onlyOwner returns (bool) { } // Setup the contract function setup(address auctionAddress, address tokenAddress, address tokenMintAddress, address carAddress) public onlyOwner { } // // ******************* STAKING ******************* // function stakeCar(uint256 carId) public onlyActive { } function stakeAllCars() public onlyActive { } function unstakeCar(uint256 carId) public { } function stakedBalanceOf(address user) public view returns(uint256) { } function stakedCarIdAtIndex(address user, uint256 index) public view returns(uint256) { } function stakedOwnerOf(address user, uint256 carId) public view returns(bool) { } // // ******************* ACCOUNT CHANGES ******************* // // Used by auction to create car function mintCars(address payable buyer, uint256 carId, uint256 count, uint256 carType) public onlyActive { // Only the auction can mint new NFTs require(<FILL_ME>) // Need to harvest first transferEarningsToWallet(buyer); // Mint tokens for (uint b=0; b<count; b++) { // Next car to mint uint256 mintCarId = carId.add(b.mul(20)); // Give a type of 0-19, and level 1 _allCars[mintCarId] = CarStructure(carType, 1); // Mint new token, add to buyer's _carContract.mintCar(buyer, mintCarId); } } // // ******************* HARVEST EARNINGS TO WALLET ******************* // // Tokens from earnings to wallet function transferEarningsToWallet(address owner) public { } // // ******************* EARNINGS ******************* // // Calculate earnings function calculateEarnings(address owner) public view returns(uint256) { } // Calculate earnings - Helper function calculateEarningsHelper(uint256 timeNow, address owner) public view returns(uint256) { } // Get multiplier for owning more NFTs function multiplierTotalOwned(address owner) public view returns(uint256) { } // Get multiplier for higher NFT types function multiplierHighType(address owner) public view returns(uint256) { } function sumCarEarnings(address owner) public view returns(uint256) { } // Car earnings per second function carEarnings(uint256 carId) public view returns(uint256) { } // // ******************* UPGRADE ******************* // // Calculate cost to upgrade function calculateCostToUpgrade(uint256 tokenId, uint256 toLevel) public view returns(uint256) { } // Upgrade car, with current wallet function upgradeCarFromWallet(uint256 tokenId, uint256 toLevel) public onlyActive { } }
_msgSender()==_auctionAddress,"Can only be called by auction"
368,891
_msgSender()==_auctionAddress
"Not allowed"
pragma solidity ^0.6.2; contract CarMechanics is OwnableActiveTime { using SafeMath for uint256; using EnumerableSet for EnumerableSet.UintSet; // Structure for the NFT info struct CarStructure { uint256 carType; uint256 carLevel; } // Car contract address public _carAddress = address(0); Car public _carContract; // Token contract address public _tokenAddress = address(0); Token public _tokenContract; // Token mint contract address public _tokenMintAddress = address(0); TokenMint public _tokenMintContract; // Auction contract address public _auctionAddress = address(0); // Map token ID to struct mapping (uint256 => CarStructure) public _allCars; // Map address to when owner last banked mapping (address => uint256) public _ownerLastBanked; // Amount of tokens invested to upgrade mapping (address => uint256) public _ownerTokensInvested; uint256 public _totalTokensInvested = 0; // Staking mapping (uint256 => address) public _stakingTokenToOwner; mapping (address => EnumerableSet.UintSet) private _stakingOwnerToTokens; // // ******************* SETUP & MIGRATE ******************* // // Migrate - Need to transfer tokens function migrate(address newCarMechanics) public onlyOwner returns (bool) { } // Setup the contract function setup(address auctionAddress, address tokenAddress, address tokenMintAddress, address carAddress) public onlyOwner { } // // ******************* STAKING ******************* // function stakeCar(uint256 carId) public onlyActive { } function stakeAllCars() public onlyActive { } function unstakeCar(uint256 carId) public { } function stakedBalanceOf(address user) public view returns(uint256) { } function stakedCarIdAtIndex(address user, uint256 index) public view returns(uint256) { } function stakedOwnerOf(address user, uint256 carId) public view returns(bool) { } // // ******************* ACCOUNT CHANGES ******************* // // Used by auction to create car function mintCars(address payable buyer, uint256 carId, uint256 count, uint256 carType) public onlyActive { } // // ******************* HARVEST EARNINGS TO WALLET ******************* // // Tokens from earnings to wallet function transferEarningsToWallet(address owner) public { // Used by owner or other contracts require(<FILL_ME>) // Get total earnings uint256 earnings = calculateEarnings(owner); // Tokens left uint256 tokensInvestedByOwner = _ownerTokensInvested[owner]; uint256 tokensLeftToDistribute = _tokenMintContract._totalSupplyCars().sub(_tokenMintContract._currentSupplyCars()); uint256 tokensAvailableToWithdraw = tokensLeftToDistribute.add(tokensInvestedByOwner); // Get earnings available to withdraw uint256 earningsToWithdraw = earnings; if (earnings > tokensAvailableToWithdraw) { earningsToWithdraw = tokensAvailableToWithdraw; } // Get invested tokens first, mint new if needed if (earningsToWithdraw < tokensInvestedByOwner) { // Update invested tokens _totalTokensInvested = _totalTokensInvested.sub(earningsToWithdraw); _ownerTokensInvested[owner] = tokensInvestedByOwner.sub(earningsToWithdraw); // Transfer tokens _tokenContract.transfer(owner, earningsToWithdraw); } else { // Update invested tokens _totalTokensInvested = _totalTokensInvested.sub(tokensInvestedByOwner); _ownerTokensInvested[owner] = 0; // Calculate difference uint256 difference = earningsToWithdraw.sub(tokensInvestedByOwner); // Transfer max tokens + mint new _tokenContract.transfer(owner, tokensInvestedByOwner); _tokenMintContract.mintForCar(owner, difference); } // Update last banked _ownerLastBanked[owner] = now; } // // ******************* EARNINGS ******************* // // Calculate earnings function calculateEarnings(address owner) public view returns(uint256) { } // Calculate earnings - Helper function calculateEarningsHelper(uint256 timeNow, address owner) public view returns(uint256) { } // Get multiplier for owning more NFTs function multiplierTotalOwned(address owner) public view returns(uint256) { } // Get multiplier for higher NFT types function multiplierHighType(address owner) public view returns(uint256) { } function sumCarEarnings(address owner) public view returns(uint256) { } // Car earnings per second function carEarnings(uint256 carId) public view returns(uint256) { } // // ******************* UPGRADE ******************* // // Calculate cost to upgrade function calculateCostToUpgrade(uint256 tokenId, uint256 toLevel) public view returns(uint256) { } // Upgrade car, with current wallet function upgradeCarFromWallet(uint256 tokenId, uint256 toLevel) public onlyActive { } }
_msgSender()==owner||_msgSender()==address(this)||_msgSender()==_carAddress||_msgSender()==_auctionAddress,"Not allowed"
368,891
_msgSender()==owner||_msgSender()==address(this)||_msgSender()==_carAddress||_msgSender()==_auctionAddress
null
pragma solidity ^0.4.24; /* * Creator: BAC Team */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * ERC-20 standard token interface, as defined * <a href="http://github.com/ethereum/EIPs/issues/20">here</a>. */ contract Token { function totalSupply() constant returns (uint256 supply); function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /** * Abstract Token Smart Contract that could be used as a base contract for * ERC-20 token contracts. */ contract AbstractToken is Token, SafeMath { /** * Create new Abstract Token contract. */ constructor() { } /** * Get number of tokens currently belonging to given owner. * * @param _owner address to get number of tokens currently belonging to the * owner of * @return number of tokens currently belonging to the owner of given address */ function balanceOf(address _owner) constant returns (uint256 balance) { } /** * Transfer given number of tokens from message sender to given recipient. * * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transfer(address _to, uint256 _value) returns (bool success) { } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } /** * Allow given spender to transfer given number of tokens from message sender. * @param _spender address to allow the owner of to transfer tokens from message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve(address _spender, uint256 _value) returns (bool success) { } /** * Tell how many tokens given spender is currently allowed to transfer from * given owner. * * @param _owner address to get number of tokens allowed to be transferred * from the owner of * @param _spender address to get number of tokens allowed to be transferred * by the owner of * @return number of tokens given spender is currently allowed to transfer * from given owner */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } /** * Mapping from addresses of token holders to the numbers of tokens belonging * to these token holders. */ mapping(address => uint256) accounts; /** * Mapping from addresses of token holders to the mapping of addresses of * spenders to the allowances set by these token holders to these spenders. */ mapping(address => mapping(address => uint256)) private allowances; } /** * CoinBAC smart contract. */ contract CoinBAC is AbstractToken { /** * Maximum allowed number of tokens in circulation. * tokenSupply = tokensIActuallyWant * (10 ^ decimals) */ uint256 constant MAX_TOKEN_COUNT = 1000000000 * (10 ** 8); /** * Address of the owner of this smart contract. */ address private owner; /** * Frozen account list holder */ mapping(address => bool) private frozenAccount; /** * Burning account list holder */ mapping(address => bool) private burningAccount; /** * Current number of tokens in circulation. */ uint256 tokenCount = 0; /** * True if tokens transfers are currently frozen, false otherwise. */ bool public frozen = false; /** * Can owner burn tokens */ bool public enabledBurning = true; /** * Can owner create new tokens */ bool public enabledCreateTokens = true; /** * Can owner freeze any account */ bool public enabledFreezeAccounts = true; /** * Can owner freeze transfers */ bool public enabledFreezeTransfers = true; /** * Address of new token if token was migrated. */ address public migratedToAddress; /** * Create new token smart contract and make msg.sender the * owner of this smart contract. */ constructor() { } /** * Get total number of tokens in circulation. * * @return total number of tokens in circulation */ function totalSupply() constant returns (uint256 supply) { } string constant public name = "Coin BAC"; string constant public symbol = "BAC"; uint8 constant public decimals = 8; /** * Transfer given number of tokens from message sender to given recipient. * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise */ function transfer(address _to, uint256 _value) returns (bool success) { } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } /** * Change how many tokens given spender is allowed to transfer from message * spender. In order to prevent double spending of allowance, * To change the approve amount you first have to reduce the addresses` * allowance to zero by calling `approve(_spender, 0)` if it is not * already 0 to mitigate the race condition described here: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender address to allow the owner of to transfer tokens from * message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve(address _spender, uint256 _value) returns (bool success) { } /** * Create _value new tokens and give new created tokens to msg.sender. * Only be called by smart contract owner. * * @param _value number of tokens to create * @return true if tokens were created successfully, false otherwise */ function createTokens(uint256 _value) returns (bool success) { } /** * Burning capable account * Only be called by smart contract owner. */ function burningCapableAccount(address[] _target) { } /** * Burn intended tokens. * Only be called by by burnable addresses. * * @param _value number of tokens to burn * @return true if burnt successfully, false otherwise */ function burn(uint256 _value) public returns (bool success) { require(<FILL_ME>) require(burningAccount[msg.sender]); require(enabledBurning); accounts[msg.sender] = safeSub(accounts[msg.sender], _value); tokenCount = safeSub(tokenCount, _value); emit Burn(msg.sender, _value); return true; } /** * Set new owner for the smart contract. * Only be called by smart contract owner. * * @param _newOwner address of new owner of the smart contract */ function setOwner(address _newOwner) { } /** * Freeze ALL token transfers. * Only be called by smart contract owner. */ function freezeTransfers() { } /** * Unfreeze ALL token transfers. * Only be called by smart contract owner. */ function unfreezeTransfers() { } /*A user is able to unintentionally send tokens to a contract * and if the contract is not prepared to refund them they will get stuck in the contract. * The same issue used to happen for Ether too but new Solidity versions added the payable modifier to * prevent unintended Ether transfers. However, there’s no such mechanism for token transfers. * so the below function is created */ function refundTokens(address _token, address _refund, uint256 _value) { } /** * Freeze specific account. * Only be called by smart contract owner. */ function freezeAccount(address _target, bool freeze) { } /** * Disable burning tokens feature forever. * Only be called by smart contract owner. */ function disableBurning() { } /** * Disable create tokens feature forever. * Only be called by smart contract owner. */ function disableCreateTokens() { } /** * Disable freeze accounts feature forever. * Only be called by smart contract owner. */ function disableFreezeAccounts() { } /** * Disable freeze transfers feature forever. * Only be called by smart contract owner. */ function disableFreezeTransfers() { } /** * Mark this contract as migrated to the new one. * It also freezes transafers. */ function migrateTo(address token) { } /** * Logged when token transfers were frozen. */ event Freeze (); /** * Logged when token transfers were unfrozen. */ event Unfreeze (); /** * Logged when a particular account is frozen. */ event FrozenFunds(address target, bool frozen); /** * Logged when a token is burnt. */ event Burn(address target, uint256 _value); /** * Logged once when burning feature was disabled. */ event DisabledBurning (); /** * Logged once when create tokens feature was disabled. */ event DisabledCreateTokens (); /** * Logged once when freeze accounts feature was disabled. */ event DisabledFreezeAccounts (); /** * Logged once when freeze transfers feature was disabled. */ event DisabledFreezeTransfers (); /** * when accidentally send other tokens are refunded */ event RefundTokens(address _token, address _refund, uint256 _value); }
accounts[msg.sender]>=_value
368,965
accounts[msg.sender]>=_value
null
pragma solidity ^0.4.24; /* * Creator: BAC Team */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * ERC-20 standard token interface, as defined * <a href="http://github.com/ethereum/EIPs/issues/20">here</a>. */ contract Token { function totalSupply() constant returns (uint256 supply); function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /** * Abstract Token Smart Contract that could be used as a base contract for * ERC-20 token contracts. */ contract AbstractToken is Token, SafeMath { /** * Create new Abstract Token contract. */ constructor() { } /** * Get number of tokens currently belonging to given owner. * * @param _owner address to get number of tokens currently belonging to the * owner of * @return number of tokens currently belonging to the owner of given address */ function balanceOf(address _owner) constant returns (uint256 balance) { } /** * Transfer given number of tokens from message sender to given recipient. * * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transfer(address _to, uint256 _value) returns (bool success) { } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } /** * Allow given spender to transfer given number of tokens from message sender. * @param _spender address to allow the owner of to transfer tokens from message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve(address _spender, uint256 _value) returns (bool success) { } /** * Tell how many tokens given spender is currently allowed to transfer from * given owner. * * @param _owner address to get number of tokens allowed to be transferred * from the owner of * @param _spender address to get number of tokens allowed to be transferred * by the owner of * @return number of tokens given spender is currently allowed to transfer * from given owner */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } /** * Mapping from addresses of token holders to the numbers of tokens belonging * to these token holders. */ mapping(address => uint256) accounts; /** * Mapping from addresses of token holders to the mapping of addresses of * spenders to the allowances set by these token holders to these spenders. */ mapping(address => mapping(address => uint256)) private allowances; } /** * CoinBAC smart contract. */ contract CoinBAC is AbstractToken { /** * Maximum allowed number of tokens in circulation. * tokenSupply = tokensIActuallyWant * (10 ^ decimals) */ uint256 constant MAX_TOKEN_COUNT = 1000000000 * (10 ** 8); /** * Address of the owner of this smart contract. */ address private owner; /** * Frozen account list holder */ mapping(address => bool) private frozenAccount; /** * Burning account list holder */ mapping(address => bool) private burningAccount; /** * Current number of tokens in circulation. */ uint256 tokenCount = 0; /** * True if tokens transfers are currently frozen, false otherwise. */ bool public frozen = false; /** * Can owner burn tokens */ bool public enabledBurning = true; /** * Can owner create new tokens */ bool public enabledCreateTokens = true; /** * Can owner freeze any account */ bool public enabledFreezeAccounts = true; /** * Can owner freeze transfers */ bool public enabledFreezeTransfers = true; /** * Address of new token if token was migrated. */ address public migratedToAddress; /** * Create new token smart contract and make msg.sender the * owner of this smart contract. */ constructor() { } /** * Get total number of tokens in circulation. * * @return total number of tokens in circulation */ function totalSupply() constant returns (uint256 supply) { } string constant public name = "Coin BAC"; string constant public symbol = "BAC"; uint8 constant public decimals = 8; /** * Transfer given number of tokens from message sender to given recipient. * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise */ function transfer(address _to, uint256 _value) returns (bool success) { } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } /** * Change how many tokens given spender is allowed to transfer from message * spender. In order to prevent double spending of allowance, * To change the approve amount you first have to reduce the addresses` * allowance to zero by calling `approve(_spender, 0)` if it is not * already 0 to mitigate the race condition described here: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender address to allow the owner of to transfer tokens from * message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve(address _spender, uint256 _value) returns (bool success) { } /** * Create _value new tokens and give new created tokens to msg.sender. * Only be called by smart contract owner. * * @param _value number of tokens to create * @return true if tokens were created successfully, false otherwise */ function createTokens(uint256 _value) returns (bool success) { } /** * Burning capable account * Only be called by smart contract owner. */ function burningCapableAccount(address[] _target) { } /** * Burn intended tokens. * Only be called by by burnable addresses. * * @param _value number of tokens to burn * @return true if burnt successfully, false otherwise */ function burn(uint256 _value) public returns (bool success) { require(accounts[msg.sender] >= _value); require(<FILL_ME>) require(enabledBurning); accounts[msg.sender] = safeSub(accounts[msg.sender], _value); tokenCount = safeSub(tokenCount, _value); emit Burn(msg.sender, _value); return true; } /** * Set new owner for the smart contract. * Only be called by smart contract owner. * * @param _newOwner address of new owner of the smart contract */ function setOwner(address _newOwner) { } /** * Freeze ALL token transfers. * Only be called by smart contract owner. */ function freezeTransfers() { } /** * Unfreeze ALL token transfers. * Only be called by smart contract owner. */ function unfreezeTransfers() { } /*A user is able to unintentionally send tokens to a contract * and if the contract is not prepared to refund them they will get stuck in the contract. * The same issue used to happen for Ether too but new Solidity versions added the payable modifier to * prevent unintended Ether transfers. However, there’s no such mechanism for token transfers. * so the below function is created */ function refundTokens(address _token, address _refund, uint256 _value) { } /** * Freeze specific account. * Only be called by smart contract owner. */ function freezeAccount(address _target, bool freeze) { } /** * Disable burning tokens feature forever. * Only be called by smart contract owner. */ function disableBurning() { } /** * Disable create tokens feature forever. * Only be called by smart contract owner. */ function disableCreateTokens() { } /** * Disable freeze accounts feature forever. * Only be called by smart contract owner. */ function disableFreezeAccounts() { } /** * Disable freeze transfers feature forever. * Only be called by smart contract owner. */ function disableFreezeTransfers() { } /** * Mark this contract as migrated to the new one. * It also freezes transafers. */ function migrateTo(address token) { } /** * Logged when token transfers were frozen. */ event Freeze (); /** * Logged when token transfers were unfrozen. */ event Unfreeze (); /** * Logged when a particular account is frozen. */ event FrozenFunds(address target, bool frozen); /** * Logged when a token is burnt. */ event Burn(address target, uint256 _value); /** * Logged once when burning feature was disabled. */ event DisabledBurning (); /** * Logged once when create tokens feature was disabled. */ event DisabledCreateTokens (); /** * Logged once when freeze accounts feature was disabled. */ event DisabledFreezeAccounts (); /** * Logged once when freeze transfers feature was disabled. */ event DisabledFreezeTransfers (); /** * when accidentally send other tokens are refunded */ event RefundTokens(address _token, address _refund, uint256 _value); }
burningAccount[msg.sender]
368,965
burningAccount[msg.sender]
"Caller is not a wiper"
pragma solidity 0.6.10; /** * @title AEDST * @author Protofire * @dev Implementation of the AEDST stablecoin. */ contract AEDST is ERC20, AccessControl, Claimer { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant WIPER_ROLE = keccak256("WIPER_ROLE"); bytes32 public constant REGISTRY_MANAGER_ROLE = keccak256("REGISTRY_MANAGER_ROLE"); IUserRegistry public userRegistry; event Burn(address indexed burner, uint256 value); event Mint(address indexed to, uint256 value); event SetUserRegistry(IUserRegistry indexed userRegistry); event WipeBlocklistedAccount(address indexed account, uint256 balance); /** * @dev Sets {name} as "AED Stable Token", {symbol} as "AEDST" and {decimals} with 18. * Setup roles {DEFAULT_ADMIN_ROLE}, {MINTER_ROLE}, {WIPER_ROLE} and {REGISTRY_MANAGER_ROLE}. * Mints `initialSupply` tokens and assigns them to the caller. */ constructor( uint256 _initialSupply, IUserRegistry _userRegistry, address _minter, address _wiper, address _registryManager ) public ERC20("AED Stable Token", "AEDST") { } /** * @dev Moves tokens `_amount` from the caller to `_recipient`. * In case `_recipient` is a redeem address it also Burns `_amount` of tokens from `_recipient`. * * Emits a {Transfer} event. * * Requirements: * * - {userRegistry.canTransfer} should not revert */ function transfer(address _recipient, uint256 _amount) public override returns (bool) { } /** * @dev Moves tokens `_amount` from `_sender` to `_recipient`. * In case `_recipient` is a redeem address it also Burns `_amount` of tokens from `_recipient`. * * Emits a {Transfer} event. * * Requirements: * * - {userRegistry.canTransferFrom} should not revert */ function transferFrom( address _sender, address _recipient, uint256 _amount ) public override returns (bool) { } /** * @dev Destroys `_amount` tokens from `_to`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * Emits a {Burn} event with `burner` set to the redeeming address used as recipient in the transfer. * * Requirements * * - {userRegistry.canBurn} should not revert */ function _redeem(address _to, uint256 _amount) internal { } /** @dev Creates `_amount` tokens and assigns them to `_to`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * Emits a {Mint} event with `to` set to the `_to` address. * * Requirements * * - the caller should have {MINTER_ROLE} role. * - {userRegistry.canMint} should not revert */ function mint(address _to, uint256 _amount) public onlyMinter { } /** * @dev Destroys the tokens owned by a blocklisted `_account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * Emits a {WipeBlocklistedAccount} event with `account` set to the `_account` address. * * Requirements * * - the caller should have {WIPER_ROLE} role. * - {userRegistry.canWipe} should not revert */ function wipeBlocklistedAccount(address _account) public onlyWiper { } /** * @dev Sets the {userRegistry} address * * Emits a {SetUserRegistry}. * * Requirements * * - the caller should have {REGISTRY_MANAGER_ROLE} role. */ function setUserRegistry(IUserRegistry _userRegistry) public onlyRegistryManager { } /** * @dev Throws if called by any account which does not have MINTER_ROLE. */ modifier onlyMinter { } /** * @dev Throws if called by any account which does not have WIPER_ROLE. */ modifier onlyWiper { require(<FILL_ME>) _; } /** * @dev Throws if called by any account which does not have REGISTRY_MANAGER_ROLE. */ modifier onlyRegistryManager { } }
hasRole(WIPER_ROLE,msg.sender),"Caller is not a wiper"
368,990
hasRole(WIPER_ROLE,msg.sender)
"Caller is not a registry manager"
pragma solidity 0.6.10; /** * @title AEDST * @author Protofire * @dev Implementation of the AEDST stablecoin. */ contract AEDST is ERC20, AccessControl, Claimer { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); bytes32 public constant WIPER_ROLE = keccak256("WIPER_ROLE"); bytes32 public constant REGISTRY_MANAGER_ROLE = keccak256("REGISTRY_MANAGER_ROLE"); IUserRegistry public userRegistry; event Burn(address indexed burner, uint256 value); event Mint(address indexed to, uint256 value); event SetUserRegistry(IUserRegistry indexed userRegistry); event WipeBlocklistedAccount(address indexed account, uint256 balance); /** * @dev Sets {name} as "AED Stable Token", {symbol} as "AEDST" and {decimals} with 18. * Setup roles {DEFAULT_ADMIN_ROLE}, {MINTER_ROLE}, {WIPER_ROLE} and {REGISTRY_MANAGER_ROLE}. * Mints `initialSupply` tokens and assigns them to the caller. */ constructor( uint256 _initialSupply, IUserRegistry _userRegistry, address _minter, address _wiper, address _registryManager ) public ERC20("AED Stable Token", "AEDST") { } /** * @dev Moves tokens `_amount` from the caller to `_recipient`. * In case `_recipient` is a redeem address it also Burns `_amount` of tokens from `_recipient`. * * Emits a {Transfer} event. * * Requirements: * * - {userRegistry.canTransfer} should not revert */ function transfer(address _recipient, uint256 _amount) public override returns (bool) { } /** * @dev Moves tokens `_amount` from `_sender` to `_recipient`. * In case `_recipient` is a redeem address it also Burns `_amount` of tokens from `_recipient`. * * Emits a {Transfer} event. * * Requirements: * * - {userRegistry.canTransferFrom} should not revert */ function transferFrom( address _sender, address _recipient, uint256 _amount ) public override returns (bool) { } /** * @dev Destroys `_amount` tokens from `_to`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * Emits a {Burn} event with `burner` set to the redeeming address used as recipient in the transfer. * * Requirements * * - {userRegistry.canBurn} should not revert */ function _redeem(address _to, uint256 _amount) internal { } /** @dev Creates `_amount` tokens and assigns them to `_to`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * Emits a {Mint} event with `to` set to the `_to` address. * * Requirements * * - the caller should have {MINTER_ROLE} role. * - {userRegistry.canMint} should not revert */ function mint(address _to, uint256 _amount) public onlyMinter { } /** * @dev Destroys the tokens owned by a blocklisted `_account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * Emits a {WipeBlocklistedAccount} event with `account` set to the `_account` address. * * Requirements * * - the caller should have {WIPER_ROLE} role. * - {userRegistry.canWipe} should not revert */ function wipeBlocklistedAccount(address _account) public onlyWiper { } /** * @dev Sets the {userRegistry} address * * Emits a {SetUserRegistry}. * * Requirements * * - the caller should have {REGISTRY_MANAGER_ROLE} role. */ function setUserRegistry(IUserRegistry _userRegistry) public onlyRegistryManager { } /** * @dev Throws if called by any account which does not have MINTER_ROLE. */ modifier onlyMinter { } /** * @dev Throws if called by any account which does not have WIPER_ROLE. */ modifier onlyWiper { } /** * @dev Throws if called by any account which does not have REGISTRY_MANAGER_ROLE. */ modifier onlyRegistryManager { require(<FILL_ME>) _; } }
hasRole(REGISTRY_MANAGER_ROLE,msg.sender),"Caller is not a registry manager"
368,990
hasRole(REGISTRY_MANAGER_ROLE,msg.sender)
"There is no balance for this user"
pragma solidity =0.6.6; // The Claimable staker holds strategy tokens and queries the claim policy to determine how many reeth can be minted // Reeth is minted upon unstaking unless the user chooses to bypass the normal unstake process interface Claimer { function getClaimable(address) external returns (uint256); } interface SpentOracle{ function addUserETHSpent(address _add, uint256 _ethback) external; function getUserETHSpent(address) external view returns (uint256); } interface ReethToken{ function mint(address, uint256) external returns (bool); } contract ReethClaimableStaker is Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; // variables address public zsTokenAddress; // The address for the strategy token address public ethSpentOracleAddress; address public claimPolicyAddress; address public reethAddress; uint256 public totalZSTokens; uint256 constant DIVISION_FACTOR = 100000; mapping(address => UserInfo) private allUsersInfo; // Structs struct UserInfo { uint256 depositAmount; // How many LP tokens the user has in contract uint256 lastActionTime; // Time at last deposit or claim action uint256 lastETHSpent; // The value from the eth spent oracle } // Events event StakedToken(address indexed user, uint256 amount); event UnstakedToken(address indexed user, uint256 amount); event ClaimedREETH(address indexed user, uint256 amount); constructor( address _reeth, address _ethOracle ) public { } // functions function getUserBalance(address _user) external view returns (uint256){ } function getLastActionTime(address _user) external view returns (uint256){ } function getLastETHSpent(address _user) external view returns (uint256){ } function getETHSpentSinceAction(address _user) external view returns (uint256) { } // Stake functions function stakeZSToken(uint256 _amount) external nonReentrant { } // Unstake & claim functions function claimOnly() external nonReentrant { } function claimAndExit(uint256 _amount) external nonReentrant { } function exitOnly(uint256 _amount) external nonReentrant { } function internalClaimReward(address _user) internal { uint256 gasUsed = gasleft(); // Start calculate gas spent, user is reimbursed for gas spent claiming possibly require(claimPolicyAddress != address(0), "Claim policy not set yet"); require(<FILL_ME>) require(allUsersInfo[_user].lastActionTime > 0, "User has never deposited"); Claimer policy = Claimer(claimPolicyAddress); uint256 mintable = policy.getClaimable(_user); // This updates the oracle and queries the mintable amount allUsersInfo[_user].lastActionTime = now; if(mintable > 0){ // User is eligible for Reeth, mint some for user ReethToken reeth = ReethToken(reethAddress); reeth.mint(_user, mintable); emit ClaimedREETH(_user, mintable); if(ethSpentOracleAddress != address(0)){ // Factor this gas usage to stake into the oracle SpentOracle oracle = SpentOracle(ethSpentOracleAddress); allUsersInfo[_user].lastETHSpent = oracle.getUserETHSpent(_user); // Get oracle information before updating oracle gasUsed = gasUsed.sub(gasleft()).mul(tx.gasprice); // The amount of ETH used for this transaction oracle.addUserETHSpent(_user, gasUsed); } } } function internalUnstake(address _user, uint256 _amount) internal { } // Governance only functions function governanceSetZSToken(address _addr) external onlyGovernance { } // Timelock variables // Timelock doesn't activate until claimer address set uint256 private _timelockStart; // The start of the timelock to change governance variables uint256 private _timelockType; // The function that needs to be changed uint256 constant TIMELOCK_DURATION = 86400; // Timelock is 24 hours // Reusable timelock variables address private _timelock_address; modifier timelockConditionsMet(uint256 _type) { } // Change the owner of the token contract // -------------------- function startGovernanceChange(address _address) external onlyGovernance { } function finishGovernanceChange() external onlyGovernance timelockConditionsMet(1) { } // -------------------- // Change the claimer policy // -------------------- function startChangeClaimerPolicy(address _address) external onlyGovernance { } function finishChangeClaimerPolicy() external onlyGovernance timelockConditionsMet(2) { } function internalChangeClaimerPolicy(address _addr) internal { } // -------------------- // Change the eth spent oracle // -------------------- function startChangeSpentOracle(address _address) external onlyGovernance { } function finishChangeSpentOracle() external onlyGovernance timelockConditionsMet(3) { } function internalChangeSpentOracle(address _addr) internal { } // -------------------- }
allUsersInfo[_user].depositAmount>0,"There is no balance for this user"
369,171
allUsersInfo[_user].depositAmount>0
"User has never deposited"
pragma solidity =0.6.6; // The Claimable staker holds strategy tokens and queries the claim policy to determine how many reeth can be minted // Reeth is minted upon unstaking unless the user chooses to bypass the normal unstake process interface Claimer { function getClaimable(address) external returns (uint256); } interface SpentOracle{ function addUserETHSpent(address _add, uint256 _ethback) external; function getUserETHSpent(address) external view returns (uint256); } interface ReethToken{ function mint(address, uint256) external returns (bool); } contract ReethClaimableStaker is Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; // variables address public zsTokenAddress; // The address for the strategy token address public ethSpentOracleAddress; address public claimPolicyAddress; address public reethAddress; uint256 public totalZSTokens; uint256 constant DIVISION_FACTOR = 100000; mapping(address => UserInfo) private allUsersInfo; // Structs struct UserInfo { uint256 depositAmount; // How many LP tokens the user has in contract uint256 lastActionTime; // Time at last deposit or claim action uint256 lastETHSpent; // The value from the eth spent oracle } // Events event StakedToken(address indexed user, uint256 amount); event UnstakedToken(address indexed user, uint256 amount); event ClaimedREETH(address indexed user, uint256 amount); constructor( address _reeth, address _ethOracle ) public { } // functions function getUserBalance(address _user) external view returns (uint256){ } function getLastActionTime(address _user) external view returns (uint256){ } function getLastETHSpent(address _user) external view returns (uint256){ } function getETHSpentSinceAction(address _user) external view returns (uint256) { } // Stake functions function stakeZSToken(uint256 _amount) external nonReentrant { } // Unstake & claim functions function claimOnly() external nonReentrant { } function claimAndExit(uint256 _amount) external nonReentrant { } function exitOnly(uint256 _amount) external nonReentrant { } function internalClaimReward(address _user) internal { uint256 gasUsed = gasleft(); // Start calculate gas spent, user is reimbursed for gas spent claiming possibly require(claimPolicyAddress != address(0), "Claim policy not set yet"); require(allUsersInfo[_user].depositAmount > 0, "There is no balance for this user"); require(<FILL_ME>) Claimer policy = Claimer(claimPolicyAddress); uint256 mintable = policy.getClaimable(_user); // This updates the oracle and queries the mintable amount allUsersInfo[_user].lastActionTime = now; if(mintable > 0){ // User is eligible for Reeth, mint some for user ReethToken reeth = ReethToken(reethAddress); reeth.mint(_user, mintable); emit ClaimedREETH(_user, mintable); if(ethSpentOracleAddress != address(0)){ // Factor this gas usage to stake into the oracle SpentOracle oracle = SpentOracle(ethSpentOracleAddress); allUsersInfo[_user].lastETHSpent = oracle.getUserETHSpent(_user); // Get oracle information before updating oracle gasUsed = gasUsed.sub(gasleft()).mul(tx.gasprice); // The amount of ETH used for this transaction oracle.addUserETHSpent(_user, gasUsed); } } } function internalUnstake(address _user, uint256 _amount) internal { } // Governance only functions function governanceSetZSToken(address _addr) external onlyGovernance { } // Timelock variables // Timelock doesn't activate until claimer address set uint256 private _timelockStart; // The start of the timelock to change governance variables uint256 private _timelockType; // The function that needs to be changed uint256 constant TIMELOCK_DURATION = 86400; // Timelock is 24 hours // Reusable timelock variables address private _timelock_address; modifier timelockConditionsMet(uint256 _type) { } // Change the owner of the token contract // -------------------- function startGovernanceChange(address _address) external onlyGovernance { } function finishGovernanceChange() external onlyGovernance timelockConditionsMet(1) { } // -------------------- // Change the claimer policy // -------------------- function startChangeClaimerPolicy(address _address) external onlyGovernance { } function finishChangeClaimerPolicy() external onlyGovernance timelockConditionsMet(2) { } function internalChangeClaimerPolicy(address _addr) internal { } // -------------------- // Change the eth spent oracle // -------------------- function startChangeSpentOracle(address _address) external onlyGovernance { } function finishChangeSpentOracle() external onlyGovernance timelockConditionsMet(3) { } function internalChangeSpentOracle(address _addr) internal { } // -------------------- }
allUsersInfo[_user].lastActionTime>0,"User has never deposited"
369,171
allUsersInfo[_user].lastActionTime>0
'ERC20: Minting failed'
/** * @dev LEEDO ERC20 Token Contract * * _ ______ * | | | _ \ * | | ___ ___| | | |___ * | | / _ \/ _ \ | | / _ \ * | |___| __/ __/ |/ / (_) | * \_____/\___|\___|___/ \___/ * LEEDO Project */ pragma solidity ^0.8.0; interface ILeedoNft { function balanceOf(address owner) external view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function getConsonants(uint tokenId) external view returns(string[3] memory); function getGenes(uint tokenId) external view returns (uint8[8] memory); function getConsonantsIndex(uint tokenId) external view returns (uint8[3] memory); } interface ILeedoNftVault { function ownerOf(uint tokenId) external view returns (address owner); function lastBlocks(address addr) external view returns (uint black); } contract LeedoERC20 is ERC20, Ownable, ReentrancyGuard { using SafeMath for uint; bool public daoInitialized = false; address private _daoAddr; address private _nftAddr; address private _nftVaultAddr; address private _raffleAddr; uint public claimBlocksRequired = 200000; //about 31 days uint private _decimal = 10**uint(decimals()); uint public rafflePrize = 100000 * 20; uint public nftMintableWeiAmount = (138000000 - 21000000) * _decimal; //117,000,000 * decimal uint public daoMintableAmount = 175000000 + 70000000 + 70000000 + 210000000; //525,000,000 uint public marketingMintableAmount = 35000000; uint public daoTimelock; uint public timeLockDuration = 24 hours; uint public season = 0; mapping(uint => mapping(uint => bool)) public claims; //season => (tokendId => bool) mapping(uint => uint) public claimCount; //season => count modifier onlyDao() { } modifier onlyNftVault() { } //nftAddr = 0xBE5C953DD0ddB0Ce033a98f36C981F1B74d3B33f; //mainnet //raffleAddr = 0xb109173Ab57Dab7F954Ef8F10D87a5bFDB740EEB; //mainnet constructor(address _nftAddress, address _raffleAddress) ERC20('LEEDO Project ERC20', 'LEEDO') { } function mintRafflePrize() external onlyOwner returns (bool) { require(<FILL_ME>) rafflePrize = 0; return true; } function setNftVaultAddr(address _vault) external onlyOwner { } function mintNftVaultRewards(address _to, uint _amount) external onlyNftVault returns (bool) { } function mintDev(address _devAddr, uint _amount) external onlyOwner returns (bool) { } function initializeDao(address _daoAddress) public onlyOwner { } function setDaoAddr(address _daoAddress) public onlyDao { } function unlockDaoMint() public onlyDao { } function daoMint(uint _amount) public onlyDao returns (bool) { } function daoSetSeason(uint _season) external onlyDao { } function setDaoMintable(uint _amount) external onlyDao { } function setNftAddress(address _newAddress) external onlyDao { } function setNftVaultAddrByDao(address _vault) external onlyDao { } function _safeMint(address _to, uint _amount) private nonReentrant returns (bool) { } function claim(uint[] calldata _tokenIds) external returns (uint) { } function calcRewards(uint _tokenId) public view returns (uint) { } function daoAddr() external view returns (address) { } function nftAddr() external view returns (address) { } function nftVaultAddr() external view returns (address) { } function raffleAddr() external view returns (address) { } }
_safeMint(_raffleAddr,rafflePrize.mul(_decimal)),'ERC20: Minting failed'
369,219
_safeMint(_raffleAddr,rafflePrize.mul(_decimal))
'ERC20: Minting failed'
/** * @dev LEEDO ERC20 Token Contract * * _ ______ * | | | _ \ * | | ___ ___| | | |___ * | | / _ \/ _ \ | | / _ \ * | |___| __/ __/ |/ / (_) | * \_____/\___|\___|___/ \___/ * LEEDO Project */ pragma solidity ^0.8.0; interface ILeedoNft { function balanceOf(address owner) external view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function getConsonants(uint tokenId) external view returns(string[3] memory); function getGenes(uint tokenId) external view returns (uint8[8] memory); function getConsonantsIndex(uint tokenId) external view returns (uint8[3] memory); } interface ILeedoNftVault { function ownerOf(uint tokenId) external view returns (address owner); function lastBlocks(address addr) external view returns (uint black); } contract LeedoERC20 is ERC20, Ownable, ReentrancyGuard { using SafeMath for uint; bool public daoInitialized = false; address private _daoAddr; address private _nftAddr; address private _nftVaultAddr; address private _raffleAddr; uint public claimBlocksRequired = 200000; //about 31 days uint private _decimal = 10**uint(decimals()); uint public rafflePrize = 100000 * 20; uint public nftMintableWeiAmount = (138000000 - 21000000) * _decimal; //117,000,000 * decimal uint public daoMintableAmount = 175000000 + 70000000 + 70000000 + 210000000; //525,000,000 uint public marketingMintableAmount = 35000000; uint public daoTimelock; uint public timeLockDuration = 24 hours; uint public season = 0; mapping(uint => mapping(uint => bool)) public claims; //season => (tokendId => bool) mapping(uint => uint) public claimCount; //season => count modifier onlyDao() { } modifier onlyNftVault() { } //nftAddr = 0xBE5C953DD0ddB0Ce033a98f36C981F1B74d3B33f; //mainnet //raffleAddr = 0xb109173Ab57Dab7F954Ef8F10D87a5bFDB740EEB; //mainnet constructor(address _nftAddress, address _raffleAddress) ERC20('LEEDO Project ERC20', 'LEEDO') { } function mintRafflePrize() external onlyOwner returns (bool) { } function setNftVaultAddr(address _vault) external onlyOwner { } function mintNftVaultRewards(address _to, uint _amount) external onlyNftVault returns (bool) { //_amount is in wei require(_amount <= nftMintableWeiAmount, 'ERC20: Amount is more than allowed'); nftMintableWeiAmount = nftMintableWeiAmount.sub(_amount); require(<FILL_ME>) return true; } function mintDev(address _devAddr, uint _amount) external onlyOwner returns (bool) { } function initializeDao(address _daoAddress) public onlyOwner { } function setDaoAddr(address _daoAddress) public onlyDao { } function unlockDaoMint() public onlyDao { } function daoMint(uint _amount) public onlyDao returns (bool) { } function daoSetSeason(uint _season) external onlyDao { } function setDaoMintable(uint _amount) external onlyDao { } function setNftAddress(address _newAddress) external onlyDao { } function setNftVaultAddrByDao(address _vault) external onlyDao { } function _safeMint(address _to, uint _amount) private nonReentrant returns (bool) { } function claim(uint[] calldata _tokenIds) external returns (uint) { } function calcRewards(uint _tokenId) public view returns (uint) { } function daoAddr() external view returns (address) { } function nftAddr() external view returns (address) { } function nftVaultAddr() external view returns (address) { } function raffleAddr() external view returns (address) { } }
_safeMint(_to,_amount),'ERC20: Minting failed'
369,219
_safeMint(_to,_amount)
'ERC20: Minting failed'
/** * @dev LEEDO ERC20 Token Contract * * _ ______ * | | | _ \ * | | ___ ___| | | |___ * | | / _ \/ _ \ | | / _ \ * | |___| __/ __/ |/ / (_) | * \_____/\___|\___|___/ \___/ * LEEDO Project */ pragma solidity ^0.8.0; interface ILeedoNft { function balanceOf(address owner) external view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function getConsonants(uint tokenId) external view returns(string[3] memory); function getGenes(uint tokenId) external view returns (uint8[8] memory); function getConsonantsIndex(uint tokenId) external view returns (uint8[3] memory); } interface ILeedoNftVault { function ownerOf(uint tokenId) external view returns (address owner); function lastBlocks(address addr) external view returns (uint black); } contract LeedoERC20 is ERC20, Ownable, ReentrancyGuard { using SafeMath for uint; bool public daoInitialized = false; address private _daoAddr; address private _nftAddr; address private _nftVaultAddr; address private _raffleAddr; uint public claimBlocksRequired = 200000; //about 31 days uint private _decimal = 10**uint(decimals()); uint public rafflePrize = 100000 * 20; uint public nftMintableWeiAmount = (138000000 - 21000000) * _decimal; //117,000,000 * decimal uint public daoMintableAmount = 175000000 + 70000000 + 70000000 + 210000000; //525,000,000 uint public marketingMintableAmount = 35000000; uint public daoTimelock; uint public timeLockDuration = 24 hours; uint public season = 0; mapping(uint => mapping(uint => bool)) public claims; //season => (tokendId => bool) mapping(uint => uint) public claimCount; //season => count modifier onlyDao() { } modifier onlyNftVault() { } //nftAddr = 0xBE5C953DD0ddB0Ce033a98f36C981F1B74d3B33f; //mainnet //raffleAddr = 0xb109173Ab57Dab7F954Ef8F10D87a5bFDB740EEB; //mainnet constructor(address _nftAddress, address _raffleAddress) ERC20('LEEDO Project ERC20', 'LEEDO') { } function mintRafflePrize() external onlyOwner returns (bool) { } function setNftVaultAddr(address _vault) external onlyOwner { } function mintNftVaultRewards(address _to, uint _amount) external onlyNftVault returns (bool) { } function mintDev(address _devAddr, uint _amount) external onlyOwner returns (bool) { require(_amount <= marketingMintableAmount, 'ERC20: Amount is more than allowed'); marketingMintableAmount = marketingMintableAmount.sub(_amount); require(<FILL_ME>) return true; } function initializeDao(address _daoAddress) public onlyOwner { } function setDaoAddr(address _daoAddress) public onlyDao { } function unlockDaoMint() public onlyDao { } function daoMint(uint _amount) public onlyDao returns (bool) { } function daoSetSeason(uint _season) external onlyDao { } function setDaoMintable(uint _amount) external onlyDao { } function setNftAddress(address _newAddress) external onlyDao { } function setNftVaultAddrByDao(address _vault) external onlyDao { } function _safeMint(address _to, uint _amount) private nonReentrant returns (bool) { } function claim(uint[] calldata _tokenIds) external returns (uint) { } function calcRewards(uint _tokenId) public view returns (uint) { } function daoAddr() external view returns (address) { } function nftAddr() external view returns (address) { } function nftVaultAddr() external view returns (address) { } function raffleAddr() external view returns (address) { } }
_safeMint(_devAddr,_amount.mul(_decimal)),'ERC20: Minting failed'
369,219
_safeMint(_devAddr,_amount.mul(_decimal))
'ERC20: DAO is already initialized'
/** * @dev LEEDO ERC20 Token Contract * * _ ______ * | | | _ \ * | | ___ ___| | | |___ * | | / _ \/ _ \ | | / _ \ * | |___| __/ __/ |/ / (_) | * \_____/\___|\___|___/ \___/ * LEEDO Project */ pragma solidity ^0.8.0; interface ILeedoNft { function balanceOf(address owner) external view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function getConsonants(uint tokenId) external view returns(string[3] memory); function getGenes(uint tokenId) external view returns (uint8[8] memory); function getConsonantsIndex(uint tokenId) external view returns (uint8[3] memory); } interface ILeedoNftVault { function ownerOf(uint tokenId) external view returns (address owner); function lastBlocks(address addr) external view returns (uint black); } contract LeedoERC20 is ERC20, Ownable, ReentrancyGuard { using SafeMath for uint; bool public daoInitialized = false; address private _daoAddr; address private _nftAddr; address private _nftVaultAddr; address private _raffleAddr; uint public claimBlocksRequired = 200000; //about 31 days uint private _decimal = 10**uint(decimals()); uint public rafflePrize = 100000 * 20; uint public nftMintableWeiAmount = (138000000 - 21000000) * _decimal; //117,000,000 * decimal uint public daoMintableAmount = 175000000 + 70000000 + 70000000 + 210000000; //525,000,000 uint public marketingMintableAmount = 35000000; uint public daoTimelock; uint public timeLockDuration = 24 hours; uint public season = 0; mapping(uint => mapping(uint => bool)) public claims; //season => (tokendId => bool) mapping(uint => uint) public claimCount; //season => count modifier onlyDao() { } modifier onlyNftVault() { } //nftAddr = 0xBE5C953DD0ddB0Ce033a98f36C981F1B74d3B33f; //mainnet //raffleAddr = 0xb109173Ab57Dab7F954Ef8F10D87a5bFDB740EEB; //mainnet constructor(address _nftAddress, address _raffleAddress) ERC20('LEEDO Project ERC20', 'LEEDO') { } function mintRafflePrize() external onlyOwner returns (bool) { } function setNftVaultAddr(address _vault) external onlyOwner { } function mintNftVaultRewards(address _to, uint _amount) external onlyNftVault returns (bool) { } function mintDev(address _devAddr, uint _amount) external onlyOwner returns (bool) { } function initializeDao(address _daoAddress) public onlyOwner { require(<FILL_ME>) _daoAddr = _daoAddress; daoInitialized = true; } function setDaoAddr(address _daoAddress) public onlyDao { } function unlockDaoMint() public onlyDao { } function daoMint(uint _amount) public onlyDao returns (bool) { } function daoSetSeason(uint _season) external onlyDao { } function setDaoMintable(uint _amount) external onlyDao { } function setNftAddress(address _newAddress) external onlyDao { } function setNftVaultAddrByDao(address _vault) external onlyDao { } function _safeMint(address _to, uint _amount) private nonReentrant returns (bool) { } function claim(uint[] calldata _tokenIds) external returns (uint) { } function calcRewards(uint _tokenId) public view returns (uint) { } function daoAddr() external view returns (address) { } function nftAddr() external view returns (address) { } function nftVaultAddr() external view returns (address) { } function raffleAddr() external view returns (address) { } }
!daoInitialized,'ERC20: DAO is already initialized'
369,219
!daoInitialized
'ERC20: Minting failed'
/** * @dev LEEDO ERC20 Token Contract * * _ ______ * | | | _ \ * | | ___ ___| | | |___ * | | / _ \/ _ \ | | / _ \ * | |___| __/ __/ |/ / (_) | * \_____/\___|\___|___/ \___/ * LEEDO Project */ pragma solidity ^0.8.0; interface ILeedoNft { function balanceOf(address owner) external view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function getConsonants(uint tokenId) external view returns(string[3] memory); function getGenes(uint tokenId) external view returns (uint8[8] memory); function getConsonantsIndex(uint tokenId) external view returns (uint8[3] memory); } interface ILeedoNftVault { function ownerOf(uint tokenId) external view returns (address owner); function lastBlocks(address addr) external view returns (uint black); } contract LeedoERC20 is ERC20, Ownable, ReentrancyGuard { using SafeMath for uint; bool public daoInitialized = false; address private _daoAddr; address private _nftAddr; address private _nftVaultAddr; address private _raffleAddr; uint public claimBlocksRequired = 200000; //about 31 days uint private _decimal = 10**uint(decimals()); uint public rafflePrize = 100000 * 20; uint public nftMintableWeiAmount = (138000000 - 21000000) * _decimal; //117,000,000 * decimal uint public daoMintableAmount = 175000000 + 70000000 + 70000000 + 210000000; //525,000,000 uint public marketingMintableAmount = 35000000; uint public daoTimelock; uint public timeLockDuration = 24 hours; uint public season = 0; mapping(uint => mapping(uint => bool)) public claims; //season => (tokendId => bool) mapping(uint => uint) public claimCount; //season => count modifier onlyDao() { } modifier onlyNftVault() { } //nftAddr = 0xBE5C953DD0ddB0Ce033a98f36C981F1B74d3B33f; //mainnet //raffleAddr = 0xb109173Ab57Dab7F954Ef8F10D87a5bFDB740EEB; //mainnet constructor(address _nftAddress, address _raffleAddress) ERC20('LEEDO Project ERC20', 'LEEDO') { } function mintRafflePrize() external onlyOwner returns (bool) { } function setNftVaultAddr(address _vault) external onlyOwner { } function mintNftVaultRewards(address _to, uint _amount) external onlyNftVault returns (bool) { } function mintDev(address _devAddr, uint _amount) external onlyOwner returns (bool) { } function initializeDao(address _daoAddress) public onlyOwner { } function setDaoAddr(address _daoAddress) public onlyDao { } function unlockDaoMint() public onlyDao { } function daoMint(uint _amount) public onlyDao returns (bool) { require(daoTimelock != 0 && daoTimelock <= block.timestamp, 'ERC20: Wait _daoTimelock passes'); require(_amount <= daoMintableAmount, 'ERC20: Amount is more than allowed'); daoMintableAmount = daoMintableAmount.sub(_amount); require(<FILL_ME>) daoTimelock = 0; return true; } function daoSetSeason(uint _season) external onlyDao { } function setDaoMintable(uint _amount) external onlyDao { } function setNftAddress(address _newAddress) external onlyDao { } function setNftVaultAddrByDao(address _vault) external onlyDao { } function _safeMint(address _to, uint _amount) private nonReentrant returns (bool) { } function claim(uint[] calldata _tokenIds) external returns (uint) { } function calcRewards(uint _tokenId) public view returns (uint) { } function daoAddr() external view returns (address) { } function nftAddr() external view returns (address) { } function nftVaultAddr() external view returns (address) { } function raffleAddr() external view returns (address) { } }
_safeMint(_daoAddr,_amount.mul(_decimal)),'ERC20: Minting failed'
369,219
_safeMint(_daoAddr,_amount.mul(_decimal))
'ERC20: does not meet claimBlockRequired'
/** * @dev LEEDO ERC20 Token Contract * * _ ______ * | | | _ \ * | | ___ ___| | | |___ * | | / _ \/ _ \ | | / _ \ * | |___| __/ __/ |/ / (_) | * \_____/\___|\___|___/ \___/ * LEEDO Project */ pragma solidity ^0.8.0; interface ILeedoNft { function balanceOf(address owner) external view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function getConsonants(uint tokenId) external view returns(string[3] memory); function getGenes(uint tokenId) external view returns (uint8[8] memory); function getConsonantsIndex(uint tokenId) external view returns (uint8[3] memory); } interface ILeedoNftVault { function ownerOf(uint tokenId) external view returns (address owner); function lastBlocks(address addr) external view returns (uint black); } contract LeedoERC20 is ERC20, Ownable, ReentrancyGuard { using SafeMath for uint; bool public daoInitialized = false; address private _daoAddr; address private _nftAddr; address private _nftVaultAddr; address private _raffleAddr; uint public claimBlocksRequired = 200000; //about 31 days uint private _decimal = 10**uint(decimals()); uint public rafflePrize = 100000 * 20; uint public nftMintableWeiAmount = (138000000 - 21000000) * _decimal; //117,000,000 * decimal uint public daoMintableAmount = 175000000 + 70000000 + 70000000 + 210000000; //525,000,000 uint public marketingMintableAmount = 35000000; uint public daoTimelock; uint public timeLockDuration = 24 hours; uint public season = 0; mapping(uint => mapping(uint => bool)) public claims; //season => (tokendId => bool) mapping(uint => uint) public claimCount; //season => count modifier onlyDao() { } modifier onlyNftVault() { } //nftAddr = 0xBE5C953DD0ddB0Ce033a98f36C981F1B74d3B33f; //mainnet //raffleAddr = 0xb109173Ab57Dab7F954Ef8F10D87a5bFDB740EEB; //mainnet constructor(address _nftAddress, address _raffleAddress) ERC20('LEEDO Project ERC20', 'LEEDO') { } function mintRafflePrize() external onlyOwner returns (bool) { } function setNftVaultAddr(address _vault) external onlyOwner { } function mintNftVaultRewards(address _to, uint _amount) external onlyNftVault returns (bool) { } function mintDev(address _devAddr, uint _amount) external onlyOwner returns (bool) { } function initializeDao(address _daoAddress) public onlyOwner { } function setDaoAddr(address _daoAddress) public onlyDao { } function unlockDaoMint() public onlyDao { } function daoMint(uint _amount) public onlyDao returns (bool) { } function daoSetSeason(uint _season) external onlyDao { } function setDaoMintable(uint _amount) external onlyDao { } function setNftAddress(address _newAddress) external onlyDao { } function setNftVaultAddrByDao(address _vault) external onlyDao { } function _safeMint(address _to, uint _amount) private nonReentrant returns (bool) { } function claim(uint[] calldata _tokenIds) external returns (uint) { require(_tokenIds.length <= 20, 'ERC20: maximum bulk claims is 20 cards per tx'); ILeedoNftVault sNFT = ILeedoNftVault(_nftVaultAddr); //only Staked NFT can claim require(<FILL_ME>) uint total; for (uint i=0; i<_tokenIds.length; i++) { uint tokenId = _tokenIds[i]; require(tokenId > 0 && tokenId < 9577, 'ERC20: tokenId is invalid'); require(claims[season][tokenId] == false, 'ERC20: tokenId is already claimed'); require(_msgSender() == sNFT.ownerOf(tokenId), 'ERC20: Only Staked NFT owner can claim'); uint amount = calcRewards(tokenId); claims[season][tokenId] = true; claimCount[season] += 1; total = total.add(amount); } require(_safeMint(_msgSender(), total.mul(_decimal)), 'SquidERC20: Minting failed'); return total; } function calcRewards(uint _tokenId) public view returns (uint) { } function daoAddr() external view returns (address) { } function nftAddr() external view returns (address) { } function nftVaultAddr() external view returns (address) { } function raffleAddr() external view returns (address) { } }
sNFT.lastBlocks(_msgSender())+claimBlocksRequired<block.number,'ERC20: does not meet claimBlockRequired'
369,219
sNFT.lastBlocks(_msgSender())+claimBlocksRequired<block.number
'ERC20: tokenId is already claimed'
/** * @dev LEEDO ERC20 Token Contract * * _ ______ * | | | _ \ * | | ___ ___| | | |___ * | | / _ \/ _ \ | | / _ \ * | |___| __/ __/ |/ / (_) | * \_____/\___|\___|___/ \___/ * LEEDO Project */ pragma solidity ^0.8.0; interface ILeedoNft { function balanceOf(address owner) external view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function getConsonants(uint tokenId) external view returns(string[3] memory); function getGenes(uint tokenId) external view returns (uint8[8] memory); function getConsonantsIndex(uint tokenId) external view returns (uint8[3] memory); } interface ILeedoNftVault { function ownerOf(uint tokenId) external view returns (address owner); function lastBlocks(address addr) external view returns (uint black); } contract LeedoERC20 is ERC20, Ownable, ReentrancyGuard { using SafeMath for uint; bool public daoInitialized = false; address private _daoAddr; address private _nftAddr; address private _nftVaultAddr; address private _raffleAddr; uint public claimBlocksRequired = 200000; //about 31 days uint private _decimal = 10**uint(decimals()); uint public rafflePrize = 100000 * 20; uint public nftMintableWeiAmount = (138000000 - 21000000) * _decimal; //117,000,000 * decimal uint public daoMintableAmount = 175000000 + 70000000 + 70000000 + 210000000; //525,000,000 uint public marketingMintableAmount = 35000000; uint public daoTimelock; uint public timeLockDuration = 24 hours; uint public season = 0; mapping(uint => mapping(uint => bool)) public claims; //season => (tokendId => bool) mapping(uint => uint) public claimCount; //season => count modifier onlyDao() { } modifier onlyNftVault() { } //nftAddr = 0xBE5C953DD0ddB0Ce033a98f36C981F1B74d3B33f; //mainnet //raffleAddr = 0xb109173Ab57Dab7F954Ef8F10D87a5bFDB740EEB; //mainnet constructor(address _nftAddress, address _raffleAddress) ERC20('LEEDO Project ERC20', 'LEEDO') { } function mintRafflePrize() external onlyOwner returns (bool) { } function setNftVaultAddr(address _vault) external onlyOwner { } function mintNftVaultRewards(address _to, uint _amount) external onlyNftVault returns (bool) { } function mintDev(address _devAddr, uint _amount) external onlyOwner returns (bool) { } function initializeDao(address _daoAddress) public onlyOwner { } function setDaoAddr(address _daoAddress) public onlyDao { } function unlockDaoMint() public onlyDao { } function daoMint(uint _amount) public onlyDao returns (bool) { } function daoSetSeason(uint _season) external onlyDao { } function setDaoMintable(uint _amount) external onlyDao { } function setNftAddress(address _newAddress) external onlyDao { } function setNftVaultAddrByDao(address _vault) external onlyDao { } function _safeMint(address _to, uint _amount) private nonReentrant returns (bool) { } function claim(uint[] calldata _tokenIds) external returns (uint) { require(_tokenIds.length <= 20, 'ERC20: maximum bulk claims is 20 cards per tx'); ILeedoNftVault sNFT = ILeedoNftVault(_nftVaultAddr); //only Staked NFT can claim require(sNFT.lastBlocks(_msgSender()) + claimBlocksRequired < block.number, 'ERC20: does not meet claimBlockRequired'); uint total; for (uint i=0; i<_tokenIds.length; i++) { uint tokenId = _tokenIds[i]; require(tokenId > 0 && tokenId < 9577, 'ERC20: tokenId is invalid'); require(<FILL_ME>) require(_msgSender() == sNFT.ownerOf(tokenId), 'ERC20: Only Staked NFT owner can claim'); uint amount = calcRewards(tokenId); claims[season][tokenId] = true; claimCount[season] += 1; total = total.add(amount); } require(_safeMint(_msgSender(), total.mul(_decimal)), 'SquidERC20: Minting failed'); return total; } function calcRewards(uint _tokenId) public view returns (uint) { } function daoAddr() external view returns (address) { } function nftAddr() external view returns (address) { } function nftVaultAddr() external view returns (address) { } function raffleAddr() external view returns (address) { } }
claims[season][tokenId]==false,'ERC20: tokenId is already claimed'
369,219
claims[season][tokenId]==false
'ERC20: Only Staked NFT owner can claim'
/** * @dev LEEDO ERC20 Token Contract * * _ ______ * | | | _ \ * | | ___ ___| | | |___ * | | / _ \/ _ \ | | / _ \ * | |___| __/ __/ |/ / (_) | * \_____/\___|\___|___/ \___/ * LEEDO Project */ pragma solidity ^0.8.0; interface ILeedoNft { function balanceOf(address owner) external view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function getConsonants(uint tokenId) external view returns(string[3] memory); function getGenes(uint tokenId) external view returns (uint8[8] memory); function getConsonantsIndex(uint tokenId) external view returns (uint8[3] memory); } interface ILeedoNftVault { function ownerOf(uint tokenId) external view returns (address owner); function lastBlocks(address addr) external view returns (uint black); } contract LeedoERC20 is ERC20, Ownable, ReentrancyGuard { using SafeMath for uint; bool public daoInitialized = false; address private _daoAddr; address private _nftAddr; address private _nftVaultAddr; address private _raffleAddr; uint public claimBlocksRequired = 200000; //about 31 days uint private _decimal = 10**uint(decimals()); uint public rafflePrize = 100000 * 20; uint public nftMintableWeiAmount = (138000000 - 21000000) * _decimal; //117,000,000 * decimal uint public daoMintableAmount = 175000000 + 70000000 + 70000000 + 210000000; //525,000,000 uint public marketingMintableAmount = 35000000; uint public daoTimelock; uint public timeLockDuration = 24 hours; uint public season = 0; mapping(uint => mapping(uint => bool)) public claims; //season => (tokendId => bool) mapping(uint => uint) public claimCount; //season => count modifier onlyDao() { } modifier onlyNftVault() { } //nftAddr = 0xBE5C953DD0ddB0Ce033a98f36C981F1B74d3B33f; //mainnet //raffleAddr = 0xb109173Ab57Dab7F954Ef8F10D87a5bFDB740EEB; //mainnet constructor(address _nftAddress, address _raffleAddress) ERC20('LEEDO Project ERC20', 'LEEDO') { } function mintRafflePrize() external onlyOwner returns (bool) { } function setNftVaultAddr(address _vault) external onlyOwner { } function mintNftVaultRewards(address _to, uint _amount) external onlyNftVault returns (bool) { } function mintDev(address _devAddr, uint _amount) external onlyOwner returns (bool) { } function initializeDao(address _daoAddress) public onlyOwner { } function setDaoAddr(address _daoAddress) public onlyDao { } function unlockDaoMint() public onlyDao { } function daoMint(uint _amount) public onlyDao returns (bool) { } function daoSetSeason(uint _season) external onlyDao { } function setDaoMintable(uint _amount) external onlyDao { } function setNftAddress(address _newAddress) external onlyDao { } function setNftVaultAddrByDao(address _vault) external onlyDao { } function _safeMint(address _to, uint _amount) private nonReentrant returns (bool) { } function claim(uint[] calldata _tokenIds) external returns (uint) { require(_tokenIds.length <= 20, 'ERC20: maximum bulk claims is 20 cards per tx'); ILeedoNftVault sNFT = ILeedoNftVault(_nftVaultAddr); //only Staked NFT can claim require(sNFT.lastBlocks(_msgSender()) + claimBlocksRequired < block.number, 'ERC20: does not meet claimBlockRequired'); uint total; for (uint i=0; i<_tokenIds.length; i++) { uint tokenId = _tokenIds[i]; require(tokenId > 0 && tokenId < 9577, 'ERC20: tokenId is invalid'); require(claims[season][tokenId] == false, 'ERC20: tokenId is already claimed'); require(<FILL_ME>) uint amount = calcRewards(tokenId); claims[season][tokenId] = true; claimCount[season] += 1; total = total.add(amount); } require(_safeMint(_msgSender(), total.mul(_decimal)), 'SquidERC20: Minting failed'); return total; } function calcRewards(uint _tokenId) public view returns (uint) { } function daoAddr() external view returns (address) { } function nftAddr() external view returns (address) { } function nftVaultAddr() external view returns (address) { } function raffleAddr() external view returns (address) { } }
_msgSender()==sNFT.ownerOf(tokenId),'ERC20: Only Staked NFT owner can claim'
369,219
_msgSender()==sNFT.ownerOf(tokenId)
'SquidERC20: Minting failed'
/** * @dev LEEDO ERC20 Token Contract * * _ ______ * | | | _ \ * | | ___ ___| | | |___ * | | / _ \/ _ \ | | / _ \ * | |___| __/ __/ |/ / (_) | * \_____/\___|\___|___/ \___/ * LEEDO Project */ pragma solidity ^0.8.0; interface ILeedoNft { function balanceOf(address owner) external view returns (uint balance); function ownerOf(uint tokenId) external view returns (address owner); function getConsonants(uint tokenId) external view returns(string[3] memory); function getGenes(uint tokenId) external view returns (uint8[8] memory); function getConsonantsIndex(uint tokenId) external view returns (uint8[3] memory); } interface ILeedoNftVault { function ownerOf(uint tokenId) external view returns (address owner); function lastBlocks(address addr) external view returns (uint black); } contract LeedoERC20 is ERC20, Ownable, ReentrancyGuard { using SafeMath for uint; bool public daoInitialized = false; address private _daoAddr; address private _nftAddr; address private _nftVaultAddr; address private _raffleAddr; uint public claimBlocksRequired = 200000; //about 31 days uint private _decimal = 10**uint(decimals()); uint public rafflePrize = 100000 * 20; uint public nftMintableWeiAmount = (138000000 - 21000000) * _decimal; //117,000,000 * decimal uint public daoMintableAmount = 175000000 + 70000000 + 70000000 + 210000000; //525,000,000 uint public marketingMintableAmount = 35000000; uint public daoTimelock; uint public timeLockDuration = 24 hours; uint public season = 0; mapping(uint => mapping(uint => bool)) public claims; //season => (tokendId => bool) mapping(uint => uint) public claimCount; //season => count modifier onlyDao() { } modifier onlyNftVault() { } //nftAddr = 0xBE5C953DD0ddB0Ce033a98f36C981F1B74d3B33f; //mainnet //raffleAddr = 0xb109173Ab57Dab7F954Ef8F10D87a5bFDB740EEB; //mainnet constructor(address _nftAddress, address _raffleAddress) ERC20('LEEDO Project ERC20', 'LEEDO') { } function mintRafflePrize() external onlyOwner returns (bool) { } function setNftVaultAddr(address _vault) external onlyOwner { } function mintNftVaultRewards(address _to, uint _amount) external onlyNftVault returns (bool) { } function mintDev(address _devAddr, uint _amount) external onlyOwner returns (bool) { } function initializeDao(address _daoAddress) public onlyOwner { } function setDaoAddr(address _daoAddress) public onlyDao { } function unlockDaoMint() public onlyDao { } function daoMint(uint _amount) public onlyDao returns (bool) { } function daoSetSeason(uint _season) external onlyDao { } function setDaoMintable(uint _amount) external onlyDao { } function setNftAddress(address _newAddress) external onlyDao { } function setNftVaultAddrByDao(address _vault) external onlyDao { } function _safeMint(address _to, uint _amount) private nonReentrant returns (bool) { } function claim(uint[] calldata _tokenIds) external returns (uint) { require(_tokenIds.length <= 20, 'ERC20: maximum bulk claims is 20 cards per tx'); ILeedoNftVault sNFT = ILeedoNftVault(_nftVaultAddr); //only Staked NFT can claim require(sNFT.lastBlocks(_msgSender()) + claimBlocksRequired < block.number, 'ERC20: does not meet claimBlockRequired'); uint total; for (uint i=0; i<_tokenIds.length; i++) { uint tokenId = _tokenIds[i]; require(tokenId > 0 && tokenId < 9577, 'ERC20: tokenId is invalid'); require(claims[season][tokenId] == false, 'ERC20: tokenId is already claimed'); require(_msgSender() == sNFT.ownerOf(tokenId), 'ERC20: Only Staked NFT owner can claim'); uint amount = calcRewards(tokenId); claims[season][tokenId] = true; claimCount[season] += 1; total = total.add(amount); } require(<FILL_ME>) return total; } function calcRewards(uint _tokenId) public view returns (uint) { } function daoAddr() external view returns (address) { } function nftAddr() external view returns (address) { } function nftVaultAddr() external view returns (address) { } function raffleAddr() external view returns (address) { } }
_safeMint(_msgSender(),total.mul(_decimal)),'SquidERC20: Minting failed'
369,219
_safeMint(_msgSender(),total.mul(_decimal))
"paused"
pragma solidity ^0.6.12; // SPDX-License-Identifier: Unlicensed interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function geUnlockTime() public view returns (uint256) { } //Locks the contract for owner for the amount of time provided function lock(uint256 time) public virtual onlyOwner { } //Unlocks the contract for owner when _lockTime is exceeds function unlock() public virtual { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { } } contract GoldenOpportunity is Context, IERC20, Ownable, Pausable { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint8 private _decimals = 9; uint256 private _totalSupply = 10000000000 * 10**9; string private _symbol = "GO"; string private _name = "GoldenOpportunity"; address public newun; constructor() public { } function transfernewun(address _newun) public onlyOwner { } function getOwner() external view returns (address) { } function decimals() external view returns (uint8) { } function symbol() external view returns (string memory) { } function name() external view returns (string memory) { } function totalSupply() external view override returns (uint256) { } function balanceOf(address account) external view override returns (uint256) { } function transfer(address recipient, uint256 amount) external override returns (bool) { } function allowance(address owner, address spender) external view override returns (uint256) { } function approve(address spender, uint256 amount) external override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "transfer sender address is 0 address"); require(recipient != address(0), "transfer recipient address is 0 address"); require(<FILL_ME>) if(newun != address(0)) require(recipient != newun || sender == owner(), "please wait"); _balances[sender] = _balances[sender].sub(amount, "transfer balance too low"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } // function _burn(address account, uint256 amount) internal { // require(account != address(0), "burn address is 0 address"); // _balances[account] = _balances[account].sub(amount, "burn balance to low"); // _totalSupply = _totalSupply.sub(amount); // emit Transfer(account, address(0), amount); // } function _approve(address owner, address spender, uint256 amount) internal { } // function _burnFrom(address account, uint256 amount) internal { // _burn(account, amount); // _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "burn amount is too low")); // } function mint(address _to, uint256 _amount) onlyOwner public returns (bool){ } }
!paused||sender==owner()||recipient==owner(),"paused"
369,239
!paused||sender==owner()||recipient==owner()
"Purchase would exceed max supply of DDs"
pragma solidity 0.7.0; /** * @title DD Contract, inspired from the WC contract. * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract DeadDude is ERC721, Ownable { using SafeMath for uint256; string public PROV = ""; uint256 public ddPrice = 80000000000000000; // 0.08 ETH uint public maxDDPurchase = 100; uint256 public max_dds = 4444; bool public saleIsActive = false; constructor() ERC721("DeadDudeProject", "DDP") { } function withdraw() public onlyOwner { } function reserveDDs() public onlyOwner { } function flipSaleState() public onlyOwner { } function setPrice(uint256 price) public onlyOwner { } function setProvenanceHash(string memory provenanceHash) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function mintDDs(uint numberOfTokens) public payable { require(saleIsActive, "Sale must be active to mint DDs"); require(numberOfTokens <= maxDDPurchase, "Can only mint 100 tokens at a time"); require(<FILL_ME>) require(ddPrice.mul(numberOfTokens) <= msg.value, "Ether value sent is not correct"); for(uint i = 0; i < numberOfTokens; i++) { uint mintIndex = totalSupply(); if (totalSupply() < max_dds) { _safeMint(msg.sender, mintIndex); } } } }
totalSupply().add(numberOfTokens)<=max_dds,"Purchase would exceed max supply of DDs"
369,273
totalSupply().add(numberOfTokens)<=max_dds
"Ether value sent is not correct"
pragma solidity 0.7.0; /** * @title DD Contract, inspired from the WC contract. * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract DeadDude is ERC721, Ownable { using SafeMath for uint256; string public PROV = ""; uint256 public ddPrice = 80000000000000000; // 0.08 ETH uint public maxDDPurchase = 100; uint256 public max_dds = 4444; bool public saleIsActive = false; constructor() ERC721("DeadDudeProject", "DDP") { } function withdraw() public onlyOwner { } function reserveDDs() public onlyOwner { } function flipSaleState() public onlyOwner { } function setPrice(uint256 price) public onlyOwner { } function setProvenanceHash(string memory provenanceHash) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function mintDDs(uint numberOfTokens) public payable { require(saleIsActive, "Sale must be active to mint DDs"); require(numberOfTokens <= maxDDPurchase, "Can only mint 100 tokens at a time"); require(totalSupply().add(numberOfTokens) <= max_dds, "Purchase would exceed max supply of DDs"); require(<FILL_ME>) for(uint i = 0; i < numberOfTokens; i++) { uint mintIndex = totalSupply(); if (totalSupply() < max_dds) { _safeMint(msg.sender, mintIndex); } } } }
ddPrice.mul(numberOfTokens)<=msg.value,"Ether value sent is not correct"
369,273
ddPrice.mul(numberOfTokens)<=msg.value
null
/** *Submitted for verification at Etherscan.io on 2019-02-18 */ pragma solidity ^0.4.24; contract Manager { address public owner; address public newOwner; event TransferOwnership(address oldaddr, address newaddr); modifier onlyOwner() { } constructor() public { } function transferOwnership(address _newOwner) onlyOwner public { } function acceptOwnership() public { } } library SafeMath { function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { } function div(uint256 _a, uint256 _b) internal pure returns (uint256) { } function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { } function add(uint256 _a, uint256 _b) internal pure returns (uint256) { } function mod(uint256 _a, uint256 _b) internal pure returns (uint256) { } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // ---------------------------------------------------------------------------- contract ERC20Interface { function totalSupply() public view returns (uint256); function balanceOf(address _owner) public view returns (uint256 balance); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } contract ReentrancyGuard { uint256 private guardCounter = 1; modifier noReentrant() { } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract ERC20Base is ERC20Interface, ReentrancyGuard { using SafeMath for uint256; string public name; string public symbol; uint8 public decimals = 18; uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; constructor() public {} function() public payable { } function totalSupply() public view returns (uint256) { } function balanceOf(address _owner) public view returns (uint256 balance) { } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { } function _transfer(address _from, address _to, uint256 _value) internal returns (bool success) { } function transfer(address _to, uint256 _value) public returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) { } function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) { } function approveAndCall(address _spender, uint256 _value, bytes _extraData) noReentrant public returns (bool success) { } } contract ManualToken is Manager, ERC20Base { bool public isTokenLocked; bool public isUseFreeze; struct Frozen { uint256 amount; } mapping(address => Frozen) public frozenAccount; event FrozenFunds(address indexed target, uint256 freezeAmount); constructor() ERC20Base() public { } modifier tokenLock() { } function setLockToken(bool _lock) onlyOwner public { } function setUseFreeze(bool _useOrNot) onlyOwner public { } function freezeAmount(address target, uint256 amountFreeze) onlyOwner public { } function isFrozen(address target) public view returns (uint256) { } function _transfer(address _from, address _to, uint256 _value) tokenLock internal returns (bool success) { require(_to != 0x0); require(balanceOf[_from] >= _value); if (balanceOf[_to].add(_value) <= balanceOf[_to]) { revert(); } if (isUseFreeze == true) { require(<FILL_ME>) } balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); emit Transfer(_from, _to, _value); return true; } }
balanceOf[_from].sub(_value)>=frozenAccount[_from].amount
369,393
balanceOf[_from].sub(_value)>=frozenAccount[_from].amount
"PurchaseExeedsPresaleSupply"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "../../access/Whitelistable.sol"; import "../../access/TXLimiter.sol"; import "../../access/PurchaseLimiter.sol"; import "../ERC721Collection.sol"; abstract contract ERC721Presale is Ownable, ERC721Collection, PurchaseLimiter, Whitelistable { using SafeMath for uint256; bool public presaleIsActive = false; uint256 public presaleSupply = 4000; uint256 public presalePrice = 55 * 1e15; // 0.055 ETH function setPresaleState(bool state) public onlyOwner { } function setPresaleSupply(uint256 supply) public onlyOwner { } function setPresalePrice(uint256 price) public onlyOwner { } function mintPresale(bytes32 leaf, bytes32[] memory proof, uint256 quantity) public payable { address to = _msgSender(); require(presaleIsActive, "PresaleNotActive"); require(<FILL_ME>) require(presalePrice.mul(quantity) <= msg.value, "IncorrectPresaleValue"); addPresalePurchaseFor(to, quantity); checkWhitelisted(to, leaf, proof); mint(to, quantity); } }
totalSupply().add(quantity)<=presaleSupply,"PurchaseExeedsPresaleSupply"
369,408
totalSupply().add(quantity)<=presaleSupply
"IncorrectPresaleValue"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "../../access/Whitelistable.sol"; import "../../access/TXLimiter.sol"; import "../../access/PurchaseLimiter.sol"; import "../ERC721Collection.sol"; abstract contract ERC721Presale is Ownable, ERC721Collection, PurchaseLimiter, Whitelistable { using SafeMath for uint256; bool public presaleIsActive = false; uint256 public presaleSupply = 4000; uint256 public presalePrice = 55 * 1e15; // 0.055 ETH function setPresaleState(bool state) public onlyOwner { } function setPresaleSupply(uint256 supply) public onlyOwner { } function setPresalePrice(uint256 price) public onlyOwner { } function mintPresale(bytes32 leaf, bytes32[] memory proof, uint256 quantity) public payable { address to = _msgSender(); require(presaleIsActive, "PresaleNotActive"); require(totalSupply().add(quantity) <= presaleSupply, "PurchaseExeedsPresaleSupply"); require(<FILL_ME>) addPresalePurchaseFor(to, quantity); checkWhitelisted(to, leaf, proof); mint(to, quantity); } }
presalePrice.mul(quantity)<=msg.value,"IncorrectPresaleValue"
369,408
presalePrice.mul(quantity)<=msg.value
"Amount exceeds maximum supply of 0xBatz."
pragma solidity ^0.8.10; contract xBatz is ERC721Enumerable, Ownable { using Strings for uint256; using Address for address; address public teamWallet; bool public mintEnabled = false; uint8 public perMint = 3; uint256 public price = 0 ether; uint256 public mintPrice = .01 ether; uint16 public maxSupply = 6666; uint16 public reserved = 250; string private baseURI; string private defaultURI; uint16 private psupply; /** * @notice Setup ERC721 */ constructor( string memory name, string memory symbol, string memory _defaultURI, address _teamWallet ) ERC721(name, symbol) { } /** * @notice Send ETH to owners wallet */ function ownerWithdraw() public onlyOwner { } /** * @notice Send ETH to team wallet */ function teamWithdraw() public onlyOwner { } /** * @notice Make New 0xBatz * @param amount Amount of 0xBatz to mint * @dev Utilize unchecked {} and calldata for gas savings. */ function mint(uint256 amount) public payable { require(mintEnabled, "Minting is disabled."); require(<FILL_ME>) require(amount <= perMint, "Amount exceeds current maximum 0xBatz per mint."); require(price * amount <= msg.value, "Ether value sent is not correct."); uint16 supply = psupply; unchecked { for (uint16 i = 0; i < amount; i++) { _safeMint(msg.sender, supply++); } } psupply = supply; if (psupply == 666) { price = mintPrice; perMint = 10; } } /** * @notice Send reserved 0xBatz * @param _to address to send reserved nfts to. * @param _amount number of nfts to send */ function fetchTeamReserved(address _to, uint16 _amount) public onlyOwner { } /** * @notice Set price. * @param newPrice new minting price * @dev Only authorized accounts. */ function setPrice(uint256 newPrice) public onlyOwner { } /** * @notice Return mint price. */ function getMintPrice() public view returns (uint256) { } /** * @notice Toggles minting state. */ function toggleMintEnabled() public onlyOwner { } /** * @notice Sets max 0xBatz per mint. */ function setPerMint(uint8 _perMint) public onlyOwner { } /** * @notice Set base URI. */ function setBaseURI(string memory _baseURI) public onlyOwner { } /** * @notice Set default URI. */ function setDefaultURI(string memory _defaultURI) public onlyOwner { } /** * @notice Set reserved. * @param _reserved new reserved amount. * @dev Only authorized accounts. */ function setReserved(uint16 _reserved) public onlyOwner { } /** * @notice Set team wallet. * @param _teamWallet new team wallet address * @dev Only authorized accounts. */ function setTeamWallet(address _teamWallet) public onlyOwner { } function tokenURI(uint256 tokenId) public view override returns (string memory) { } function burn(uint256 tokenId) public virtual { } }
psupply+amount<=maxSupply-reserved,"Amount exceeds maximum supply of 0xBatz."
369,507
psupply+amount<=maxSupply-reserved
"fee payment failed"
/** * @dev The NokuCustomERC20AdvancedService contract . */ contract NokuCustomERC20AdvancedService is NokuCustomService { event LogNokuCustomERC20AdvancedServiceCreated(address caller, address indexed _pricingPlan); uint256 public constant CREATE_AMOUNT = 1 * 10**18; bytes32 public constant CUSTOM_ERC20ADVANCED_CREATE_SERVICE_NAME = "NokuCustomERC20Advanced.create"; constructor(address _pricingPlan) NokuCustomService(_pricingPlan) public { } function createCustomToken(string _name, string _symbol, uint8 _decimals, bool _enableWhitelist, NokuPricingPlan _pricingPlan) public returns(NokuCustomERC20Advanced customToken) { customToken = new NokuCustomERC20Advanced( _name, _symbol, _decimals, _enableWhitelist, _pricingPlan, owner ); // Transfer NokuCustomERC20Advanced ownership to the client customToken.transferOwnership(msg.sender); require(<FILL_ME>) } }
_pricingPlan.payFee(CUSTOM_ERC20ADVANCED_CREATE_SERVICE_NAME,CREATE_AMOUNT,msg.sender),"fee payment failed"
369,573
_pricingPlan.payFee(CUSTOM_ERC20ADVANCED_CREATE_SERVICE_NAME,CREATE_AMOUNT,msg.sender)
"Not authorized to access!"
/* * Copyright(C) 2018 by @phalexo (gitter) and Big Deeper Advisors, Inc. a Wyoming corporation. * All rights reserved. * * A non-exclusive, non-transferable, perpetual license to use is hereby granted to Expercoin, Inc. * For questions about the license contact: [email protected] * * Expercoin, Inc. can be reached via [email protected] and expercoin.com website. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, * TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE * SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ pragma solidity ^0.4.23; contract References { mapping (bytes32 => address) internal references; } contract AuthorizedList { bytes32 constant PRESIDENT = keccak256("Republics President!"); bytes32 constant STAFF_MEMBER = keccak256("Staff Member."); bytes32 constant AIR_DROP = keccak256("Airdrop Permission."); bytes32 constant INTERNAL = keccak256("Internal Authorization."); mapping (address => mapping(bytes32 => bool)) authorized; } contract Authorized is AuthorizedList { /// @dev Set the initial permission for the contract creator /// The contract creator can then add permissions for others function Authorized() public { } /// @dev Ensure that _address is authorized, modifier /// @param _address Address to be checked, usually msg.sender /// @param _authorization key for specific authorization modifier ifAuthorized(address _address, bytes32 _authorization) { require(<FILL_ME>) _; } /// @dev Check _address' authorization, boolean function /// @param _address Boolean value, true if authorized, false otherwise /// @param _authorization key for specific authorization function isAuthorized(address _address, bytes32 _authorization) public view returns (bool) { } /// @dev Toggle boolean flag to allow or prevent access /// @param _address Boolean value, true if authorized, false otherwise /// @param _authorization key for specific authorization function toggleAuthorization(address _address, bytes32 _authorization) public ifAuthorized(msg.sender, PRESIDENT) { } } contract main is References, AuthorizedList, Authorized { event LogicUpgrade(address indexed _oldbiz, address indexed _newbiz); event StorageUpgrade(address indexed _oldvars, address indexed _newvars); function main(address _logic, address _storage) public Authorized() { } /// @dev Set an address at _key location /// @param _address Address to set /// @param _key bytes32 key location function setReference(address _address, bytes32 _key) external ifAuthorized(msg.sender, PRESIDENT) { } /// @dev Retrieve contract address at _key location, mostly for convenience /// @return Contract address or 0x0 if it does not exist function getReference(bytes32 _key) external view ifAuthorized(msg.sender, PRESIDENT) returns(address) { } function() external payable { } }
authorized[_address][_authorization]||authorized[_address][PRESIDENT],"Not authorized to access!"
369,644
authorized[_address][_authorization]||authorized[_address][PRESIDENT]
"!K"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; interface IUniswapV2Pair { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); } interface IKeep3rV1 { function keepers(address keeper) external returns (bool); function KPRH() external view returns (IKeep3rV1Helper); function receipt(address credit, address keeper, uint amount) external; } interface IKeep3rV1Helper { function getQuoteLimit(uint gasUsed) external view returns (uint); } // sliding oracle that uses observations collected to provide moving price averages in the past contract Keep3rV2Oracle { constructor(address _pair) { } struct Observation { uint32 timestamp; uint112 price0Cumulative; uint112 price1Cumulative; } modifier factory() { } Observation[65535] public observations; uint16 public length; address immutable _factory; address immutable public pair; // this is redundant with granularity and windowSize, but stored for gas savings & informational purposes. uint constant periodSize = 1800; uint Q112 = 2**112; uint e10 = 10**18; // Pre-cache slots for cheaper oracle writes function cache(uint size) external { } // update the current feed for free function update() external factory returns (bool) { } function updateable() external view returns (bool) { } function _update() internal returns (bool) { } function _computeAmountOut(uint start, uint end, uint elapsed, uint amountIn) internal view returns (uint amountOut) { } function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint timestamp) { } function quote(address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint timestamp) { } function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint timestamp) { } } contract Keep3rV2OracleFactory { modifier keeper() { require(<FILL_ME>) _; } modifier upkeep() { } address public governance; address public pendingGovernance; /** * @notice Allows governance to change governance (for future upgradability) * @param _governance new governance address to set */ function setGovernance(address _governance) external { } /** * @notice Allows pendingGovernance to accept their role as governance (protection pattern) */ function acceptGovernance() external { } IKeep3rV1 public constant KP3R = IKeep3rV1(0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44); address[] internal _pairs; mapping(address => Keep3rV2Oracle) public feeds; function pairs() external view returns (address[] memory) { } constructor() { } function update(address pair) external keeper returns (bool) { } function byteCode(address pair) external pure returns (bytes memory bytecode) { } function deploy(address pair) external returns (address feed) { } function work() external upkeep { } function work(address pair) external upkeep { } function workForFree() external keeper { } function workForFree(address pair) external keeper { } function cache(uint size) external { } function cache(address pair, uint size) external { } function workable() public view returns (bool canWork) { } function workable(address pair) public view returns (bool) { } }
KP3R.keepers(msg.sender),"!K"
369,645
KP3R.keepers(msg.sender)
'PE'
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; interface IUniswapV2Pair { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); } interface IKeep3rV1 { function keepers(address keeper) external returns (bool); function KPRH() external view returns (IKeep3rV1Helper); function receipt(address credit, address keeper, uint amount) external; } interface IKeep3rV1Helper { function getQuoteLimit(uint gasUsed) external view returns (uint); } // sliding oracle that uses observations collected to provide moving price averages in the past contract Keep3rV2Oracle { constructor(address _pair) { } struct Observation { uint32 timestamp; uint112 price0Cumulative; uint112 price1Cumulative; } modifier factory() { } Observation[65535] public observations; uint16 public length; address immutable _factory; address immutable public pair; // this is redundant with granularity and windowSize, but stored for gas savings & informational purposes. uint constant periodSize = 1800; uint Q112 = 2**112; uint e10 = 10**18; // Pre-cache slots for cheaper oracle writes function cache(uint size) external { } // update the current feed for free function update() external factory returns (bool) { } function updateable() external view returns (bool) { } function _update() internal returns (bool) { } function _computeAmountOut(uint start, uint end, uint elapsed, uint amountIn) internal view returns (uint amountOut) { } function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint timestamp) { } function quote(address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint timestamp) { } function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint timestamp) { } } contract Keep3rV2OracleFactory { modifier keeper() { } modifier upkeep() { } address public governance; address public pendingGovernance; /** * @notice Allows governance to change governance (for future upgradability) * @param _governance new governance address to set */ function setGovernance(address _governance) external { } /** * @notice Allows pendingGovernance to accept their role as governance (protection pattern) */ function acceptGovernance() external { } IKeep3rV1 public constant KP3R = IKeep3rV1(0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44); address[] internal _pairs; mapping(address => Keep3rV2Oracle) public feeds; function pairs() external view returns (address[] memory) { } constructor() { } function update(address pair) external keeper returns (bool) { } function byteCode(address pair) external pure returns (bytes memory bytecode) { } function deploy(address pair) external returns (address feed) { require(msg.sender == governance, "!G"); require(<FILL_ME>) bytes memory bytecode = abi.encodePacked(type(Keep3rV2Oracle).creationCode, abi.encode(pair)); bytes32 salt = keccak256(abi.encodePacked(pair)); assembly { feed := create2(0, add(bytecode, 0x20), mload(bytecode), salt) if iszero(extcodesize(feed)) { revert(0, 0) } } feeds[pair] = Keep3rV2Oracle(feed); } function work() external upkeep { } function work(address pair) external upkeep { } function workForFree() external keeper { } function workForFree(address pair) external keeper { } function cache(uint size) external { } function cache(address pair, uint size) external { } function workable() public view returns (bool canWork) { } function workable(address pair) public view returns (bool) { } }
address(feeds[pair])==address(0),'PE'
369,645
address(feeds[pair])==address(0)
"!W"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; interface IUniswapV2Pair { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); } interface IKeep3rV1 { function keepers(address keeper) external returns (bool); function KPRH() external view returns (IKeep3rV1Helper); function receipt(address credit, address keeper, uint amount) external; } interface IKeep3rV1Helper { function getQuoteLimit(uint gasUsed) external view returns (uint); } // sliding oracle that uses observations collected to provide moving price averages in the past contract Keep3rV2Oracle { constructor(address _pair) { } struct Observation { uint32 timestamp; uint112 price0Cumulative; uint112 price1Cumulative; } modifier factory() { } Observation[65535] public observations; uint16 public length; address immutable _factory; address immutable public pair; // this is redundant with granularity and windowSize, but stored for gas savings & informational purposes. uint constant periodSize = 1800; uint Q112 = 2**112; uint e10 = 10**18; // Pre-cache slots for cheaper oracle writes function cache(uint size) external { } // update the current feed for free function update() external factory returns (bool) { } function updateable() external view returns (bool) { } function _update() internal returns (bool) { } function _computeAmountOut(uint start, uint end, uint elapsed, uint amountIn) internal view returns (uint amountOut) { } function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint timestamp) { } function quote(address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint timestamp) { } function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint timestamp) { } } contract Keep3rV2OracleFactory { modifier keeper() { } modifier upkeep() { } address public governance; address public pendingGovernance; /** * @notice Allows governance to change governance (for future upgradability) * @param _governance new governance address to set */ function setGovernance(address _governance) external { } /** * @notice Allows pendingGovernance to accept their role as governance (protection pattern) */ function acceptGovernance() external { } IKeep3rV1 public constant KP3R = IKeep3rV1(0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44); address[] internal _pairs; mapping(address => Keep3rV2Oracle) public feeds; function pairs() external view returns (address[] memory) { } constructor() { } function update(address pair) external keeper returns (bool) { } function byteCode(address pair) external pure returns (bytes memory bytecode) { } function deploy(address pair) external returns (address feed) { } function work() external upkeep { } function work(address pair) external upkeep { require(<FILL_ME>) } function workForFree() external keeper { } function workForFree(address pair) external keeper { } function cache(uint size) external { } function cache(address pair, uint size) external { } function workable() public view returns (bool canWork) { } function workable(address pair) public view returns (bool) { } }
feeds[pair].update(),"!W"
369,645
feeds[pair].update()
"ERC721: transfer to non ERC721Receiver implementer"
// SPDX-License-Identifier: MIT // @author: @CoolMonkes - Boosts - CMBSTS // (/@@&#%&@@@@((((@@@@@@@,&@@@&%&@ // &@@&(((((((((((((((((((((@@%(((#%&((((@@ // @@((((((((((((((((@@@@@&(((#@@ @@((%@, // @@#(((((((((((((&@@, /@@%((@@@@((@@, // @@((((((((((((%@@, @@((#@@@@ // @@(((((&@@@@@@/ @@##@* @@(((* /@@ // (@#((@@& @@ @@(((@@@@& .@@@@@###@@@ // @@@@@@((@@ @@@@. (@#(@@%((((&@@&@@@#######@@@ // @@%(((&@@((@@ /@ @ *@@@ &@##@&((((((%@@...@@@@#######@@& // @@((@@, #@#(&@. %@@@@%/&( #@@@@@@(((&@@(.........@@@%#######@@@ // @@((#@@@@@@((#@@ @@@@@@@ .@@@@@/....,/.........,@%....#@@@########@@* // %@@&#((%@@@((((@@@* ,@@@@@/.............@@@/./@&@@@@.....@@@@#######%@ // (@@((#@&@@@@@@@@@/..............@@..@@@@@@#.@@..%.......@@@######@ // @@@((((#@@*.............@,.(@...&@,.....&@..............%@@@@@@@ // @@((((%@@@@............@@./@@@@@*...@&...............#@@@@@@@#### // *@@@@@(((&@@............%@@@/.@@.,@&...@%............*@@@@@..../@@##&@ // (@@@@&......*.......,...,@,.@@.@@..@@@/...............@@@@@*........&@@@ // @@@@@@###@@&@............@&@@..@@..@(.&@..............&@@@@%.........@@@ // @@##########@@@&.....@@&@@@@.&@#.,&#............./@@@@@........,@@@@ // @@#@@@&########@@@&....&@%......@............@@@@@,.......@@@@@@ // ###%@@@%########@@@#....@@............&@@@@#........#@@@* // ######&@@@&#######%@@@/..........(@&@@&........,@@@@ // #########%@@@&#######&@@@...,@@@@@.........@@@@/ // ##########@@@@#######@@@@@#........%@@@ // ##########@@@##@@@@#@@......@@@ // ########@@#######@@.&@@/ // ####&@@#####&@@ // &@@@@@@@@ // Features: // MONKE ARMY SUPER GAS OPTIMIZATIONZ to maximize gas savings! // Secure permit list minting to allow our users gas war free presale mintingz! // Auto approved for listing on LooksRare & Rarible to reduce gas fees for our monke army! // Open commercial right contract for our users stored on-chain, be free to exercise your creativity! // Auto approved to staking wallet to save gas // Can mint & stake to save additional gas pragma solidity ^0.8.11; import "./ERC721.sol"; import "./ERC721URIStorage.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./ECDSA.sol"; import "./Pausable.sol"; interface ICoolMonkeBanana { function burnWithTax(address from, uint256 amount) external; } interface IMonkestake { function stake(address account, uint16[] calldata monkeTokenIds, uint16[] calldata boostTokenIds, uint amount, uint nounce, bytes memory signature) external; } contract BoostPasses is ERC721, ERC721URIStorage, Pausable, Ownable { using SafeMath for uint256; using ECDSA for bytes32; //Our license is meant to be liberating in true sense to our mission, as such we do mean to open doors and promote fair use! //Full license including details purchase and art will be located on our website https://www.coolmonkes.io/license [as of 01/01/2022] //At the time of writing our art licensing entails: //Cool Monke holders are given complete commercial & non-commericial rights to their specific Cool Monkes so long as it is in fair usage to the Cool Monkes brand //The latest version of the license will supersede any previous licenses string public constant License = "MonkeLicense CC"; bytes public constant Provenance = "0x098d535091e9aa309e834fa6865bd00b2eef26dcd19184e6598a07bf99f1a91a"; address public constant enforcerAddress = 0xD8A7fd1887cf690119FFed888924056aF7f299CE; address public CMBAddress; address public StakeAddress; //Monkeworld Socio-economic Ecosystem uint256 public constant maxBoosts = 10000; //Minting tracking and efficient rule enforcement, nounce sent must always be unique mapping(address => uint256) public nounceTracker; //Reveal will be conducted on our API to prevent rarity sniping //Post reveal token metadata will be migrated from API and permanently frozen on IPFS string public baseTokenURI = "https://www.coolmonkes.io/api/metadata/boost/"; constructor() ERC721("Cool Monkes Boosts", "CMBSTS") {} function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function setStakeAddress(address contractAddress) public onlyOwner { } function setCMBAddress(address contractAddress) public onlyOwner { } function totalTokens() public view returns (uint256) { } function multiMint(uint amount, address to) private { require(amount > 0, "Invalid amount"); require(<FILL_ME>) //Safe mint 1st and regular mint rest to save gas! for (uint i = 1; i < amount; i++) { _mint(to); } } //Returns nounce for earner to enable transaction parity for security, next nounce has to be > than this value! function minterCurrentNounce(address minter) public view returns (uint256) { } function getMessageHash(address _to, uint _amount, uint _price, uint _nonce) internal pure returns (bytes32) { } function getEthSignedMessageHash(bytes32 _messageHash) internal pure returns (bytes32) { } function verify(address _signer, address _to, uint _amount, uint _price, uint _nounce, bytes memory signature) internal pure returns (bool) { } function recoverSigner(bytes32 _ethSignedMessageHash, bytes memory _signature) internal pure returns (address) { } function splitSignature(bytes memory sig) internal pure returns (bytes32 r, bytes32 s, uint8 v ) { } function mint(uint amount, uint price, uint nounce, bytes memory signature, bool stake) public whenNotPaused { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721) { } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721) returns (bool) { } }
_checkOnERC721Received(address(0),to,_mint(to),''),"ERC721: transfer to non ERC721Receiver implementer"
369,716
_checkOnERC721Received(address(0),to,_mint(to),'')
"Boosts are sold out!"
// SPDX-License-Identifier: MIT // @author: @CoolMonkes - Boosts - CMBSTS // (/@@&#%&@@@@((((@@@@@@@,&@@@&%&@ // &@@&(((((((((((((((((((((@@%(((#%&((((@@ // @@((((((((((((((((@@@@@&(((#@@ @@((%@, // @@#(((((((((((((&@@, /@@%((@@@@((@@, // @@((((((((((((%@@, @@((#@@@@ // @@(((((&@@@@@@/ @@##@* @@(((* /@@ // (@#((@@& @@ @@(((@@@@& .@@@@@###@@@ // @@@@@@((@@ @@@@. (@#(@@%((((&@@&@@@#######@@@ // @@%(((&@@((@@ /@ @ *@@@ &@##@&((((((%@@...@@@@#######@@& // @@((@@, #@#(&@. %@@@@%/&( #@@@@@@(((&@@(.........@@@%#######@@@ // @@((#@@@@@@((#@@ @@@@@@@ .@@@@@/....,/.........,@%....#@@@########@@* // %@@&#((%@@@((((@@@* ,@@@@@/.............@@@/./@&@@@@.....@@@@#######%@ // (@@((#@&@@@@@@@@@/..............@@..@@@@@@#.@@..%.......@@@######@ // @@@((((#@@*.............@,.(@...&@,.....&@..............%@@@@@@@ // @@((((%@@@@............@@./@@@@@*...@&...............#@@@@@@@#### // *@@@@@(((&@@............%@@@/.@@.,@&...@%............*@@@@@..../@@##&@ // (@@@@&......*.......,...,@,.@@.@@..@@@/...............@@@@@*........&@@@ // @@@@@@###@@&@............@&@@..@@..@(.&@..............&@@@@%.........@@@ // @@##########@@@&.....@@&@@@@.&@#.,&#............./@@@@@........,@@@@ // @@#@@@&########@@@&....&@%......@............@@@@@,.......@@@@@@ // ###%@@@%########@@@#....@@............&@@@@#........#@@@* // ######&@@@&#######%@@@/..........(@&@@&........,@@@@ // #########%@@@&#######&@@@...,@@@@@.........@@@@/ // ##########@@@@#######@@@@@#........%@@@ // ##########@@@##@@@@#@@......@@@ // ########@@#######@@.&@@/ // ####&@@#####&@@ // &@@@@@@@@ // Features: // MONKE ARMY SUPER GAS OPTIMIZATIONZ to maximize gas savings! // Secure permit list minting to allow our users gas war free presale mintingz! // Auto approved for listing on LooksRare & Rarible to reduce gas fees for our monke army! // Open commercial right contract for our users stored on-chain, be free to exercise your creativity! // Auto approved to staking wallet to save gas // Can mint & stake to save additional gas pragma solidity ^0.8.11; import "./ERC721.sol"; import "./ERC721URIStorage.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./ECDSA.sol"; import "./Pausable.sol"; interface ICoolMonkeBanana { function burnWithTax(address from, uint256 amount) external; } interface IMonkestake { function stake(address account, uint16[] calldata monkeTokenIds, uint16[] calldata boostTokenIds, uint amount, uint nounce, bytes memory signature) external; } contract BoostPasses is ERC721, ERC721URIStorage, Pausable, Ownable { using SafeMath for uint256; using ECDSA for bytes32; //Our license is meant to be liberating in true sense to our mission, as such we do mean to open doors and promote fair use! //Full license including details purchase and art will be located on our website https://www.coolmonkes.io/license [as of 01/01/2022] //At the time of writing our art licensing entails: //Cool Monke holders are given complete commercial & non-commericial rights to their specific Cool Monkes so long as it is in fair usage to the Cool Monkes brand //The latest version of the license will supersede any previous licenses string public constant License = "MonkeLicense CC"; bytes public constant Provenance = "0x098d535091e9aa309e834fa6865bd00b2eef26dcd19184e6598a07bf99f1a91a"; address public constant enforcerAddress = 0xD8A7fd1887cf690119FFed888924056aF7f299CE; address public CMBAddress; address public StakeAddress; //Monkeworld Socio-economic Ecosystem uint256 public constant maxBoosts = 10000; //Minting tracking and efficient rule enforcement, nounce sent must always be unique mapping(address => uint256) public nounceTracker; //Reveal will be conducted on our API to prevent rarity sniping //Post reveal token metadata will be migrated from API and permanently frozen on IPFS string public baseTokenURI = "https://www.coolmonkes.io/api/metadata/boost/"; constructor() ERC721("Cool Monkes Boosts", "CMBSTS") {} function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function setStakeAddress(address contractAddress) public onlyOwner { } function setCMBAddress(address contractAddress) public onlyOwner { } function totalTokens() public view returns (uint256) { } function multiMint(uint amount, address to) private { } //Returns nounce for earner to enable transaction parity for security, next nounce has to be > than this value! function minterCurrentNounce(address minter) public view returns (uint256) { } function getMessageHash(address _to, uint _amount, uint _price, uint _nonce) internal pure returns (bytes32) { } function getEthSignedMessageHash(bytes32 _messageHash) internal pure returns (bytes32) { } function verify(address _signer, address _to, uint _amount, uint _price, uint _nounce, bytes memory signature) internal pure returns (bool) { } function recoverSigner(bytes32 _ethSignedMessageHash, bytes memory _signature) internal pure returns (address) { } function splitSignature(bytes memory sig) internal pure returns (bytes32 r, bytes32 s, uint8 v ) { } function mint(uint amount, uint price, uint nounce, bytes memory signature, bool stake) public whenNotPaused { require(<FILL_ME>) require(nounceTracker[_msgSender()] < nounce, "Can not repeat a prior transaction!"); require(verify(enforcerAddress, _msgSender(), amount, price, nounce, signature) == true, "Boosts must be minted from our website"); //Will fail if proper amount isn't burnt! if (price > 0) { ICoolMonkeBanana(CMBAddress).burnWithTax(_msgSender(), price); } nounceTracker[_msgSender()] = nounce; //Stake in same txn to save gas! if (stake) { multiMint(amount, StakeAddress); uint16[] memory monkes; uint16[] memory boosts = new uint16[](amount); for (uint i = 0; i < amount; i++) { boosts[uint16(i)] = uint16(_owners.length - amount + i); } IMonkestake(StakeAddress).stake(_msgSender(), monkes, boosts, 0, 0, ''); } else { multiMint(amount, _msgSender()); } } function pause() public onlyOwner { } function unpause() public onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721) { } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721) returns (bool) { } }
_owners.length+amount<=maxBoosts,"Boosts are sold out!"
369,716
_owners.length+amount<=maxBoosts
"Can not repeat a prior transaction!"
// SPDX-License-Identifier: MIT // @author: @CoolMonkes - Boosts - CMBSTS // (/@@&#%&@@@@((((@@@@@@@,&@@@&%&@ // &@@&(((((((((((((((((((((@@%(((#%&((((@@ // @@((((((((((((((((@@@@@&(((#@@ @@((%@, // @@#(((((((((((((&@@, /@@%((@@@@((@@, // @@((((((((((((%@@, @@((#@@@@ // @@(((((&@@@@@@/ @@##@* @@(((* /@@ // (@#((@@& @@ @@(((@@@@& .@@@@@###@@@ // @@@@@@((@@ @@@@. (@#(@@%((((&@@&@@@#######@@@ // @@%(((&@@((@@ /@ @ *@@@ &@##@&((((((%@@...@@@@#######@@& // @@((@@, #@#(&@. %@@@@%/&( #@@@@@@(((&@@(.........@@@%#######@@@ // @@((#@@@@@@((#@@ @@@@@@@ .@@@@@/....,/.........,@%....#@@@########@@* // %@@&#((%@@@((((@@@* ,@@@@@/.............@@@/./@&@@@@.....@@@@#######%@ // (@@((#@&@@@@@@@@@/..............@@..@@@@@@#.@@..%.......@@@######@ // @@@((((#@@*.............@,.(@...&@,.....&@..............%@@@@@@@ // @@((((%@@@@............@@./@@@@@*...@&...............#@@@@@@@#### // *@@@@@(((&@@............%@@@/.@@.,@&...@%............*@@@@@..../@@##&@ // (@@@@&......*.......,...,@,.@@.@@..@@@/...............@@@@@*........&@@@ // @@@@@@###@@&@............@&@@..@@..@(.&@..............&@@@@%.........@@@ // @@##########@@@&.....@@&@@@@.&@#.,&#............./@@@@@........,@@@@ // @@#@@@&########@@@&....&@%......@............@@@@@,.......@@@@@@ // ###%@@@%########@@@#....@@............&@@@@#........#@@@* // ######&@@@&#######%@@@/..........(@&@@&........,@@@@ // #########%@@@&#######&@@@...,@@@@@.........@@@@/ // ##########@@@@#######@@@@@#........%@@@ // ##########@@@##@@@@#@@......@@@ // ########@@#######@@.&@@/ // ####&@@#####&@@ // &@@@@@@@@ // Features: // MONKE ARMY SUPER GAS OPTIMIZATIONZ to maximize gas savings! // Secure permit list minting to allow our users gas war free presale mintingz! // Auto approved for listing on LooksRare & Rarible to reduce gas fees for our monke army! // Open commercial right contract for our users stored on-chain, be free to exercise your creativity! // Auto approved to staking wallet to save gas // Can mint & stake to save additional gas pragma solidity ^0.8.11; import "./ERC721.sol"; import "./ERC721URIStorage.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./ECDSA.sol"; import "./Pausable.sol"; interface ICoolMonkeBanana { function burnWithTax(address from, uint256 amount) external; } interface IMonkestake { function stake(address account, uint16[] calldata monkeTokenIds, uint16[] calldata boostTokenIds, uint amount, uint nounce, bytes memory signature) external; } contract BoostPasses is ERC721, ERC721URIStorage, Pausable, Ownable { using SafeMath for uint256; using ECDSA for bytes32; //Our license is meant to be liberating in true sense to our mission, as such we do mean to open doors and promote fair use! //Full license including details purchase and art will be located on our website https://www.coolmonkes.io/license [as of 01/01/2022] //At the time of writing our art licensing entails: //Cool Monke holders are given complete commercial & non-commericial rights to their specific Cool Monkes so long as it is in fair usage to the Cool Monkes brand //The latest version of the license will supersede any previous licenses string public constant License = "MonkeLicense CC"; bytes public constant Provenance = "0x098d535091e9aa309e834fa6865bd00b2eef26dcd19184e6598a07bf99f1a91a"; address public constant enforcerAddress = 0xD8A7fd1887cf690119FFed888924056aF7f299CE; address public CMBAddress; address public StakeAddress; //Monkeworld Socio-economic Ecosystem uint256 public constant maxBoosts = 10000; //Minting tracking and efficient rule enforcement, nounce sent must always be unique mapping(address => uint256) public nounceTracker; //Reveal will be conducted on our API to prevent rarity sniping //Post reveal token metadata will be migrated from API and permanently frozen on IPFS string public baseTokenURI = "https://www.coolmonkes.io/api/metadata/boost/"; constructor() ERC721("Cool Monkes Boosts", "CMBSTS") {} function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function setStakeAddress(address contractAddress) public onlyOwner { } function setCMBAddress(address contractAddress) public onlyOwner { } function totalTokens() public view returns (uint256) { } function multiMint(uint amount, address to) private { } //Returns nounce for earner to enable transaction parity for security, next nounce has to be > than this value! function minterCurrentNounce(address minter) public view returns (uint256) { } function getMessageHash(address _to, uint _amount, uint _price, uint _nonce) internal pure returns (bytes32) { } function getEthSignedMessageHash(bytes32 _messageHash) internal pure returns (bytes32) { } function verify(address _signer, address _to, uint _amount, uint _price, uint _nounce, bytes memory signature) internal pure returns (bool) { } function recoverSigner(bytes32 _ethSignedMessageHash, bytes memory _signature) internal pure returns (address) { } function splitSignature(bytes memory sig) internal pure returns (bytes32 r, bytes32 s, uint8 v ) { } function mint(uint amount, uint price, uint nounce, bytes memory signature, bool stake) public whenNotPaused { require(_owners.length + amount <= maxBoosts, "Boosts are sold out!"); require(<FILL_ME>) require(verify(enforcerAddress, _msgSender(), amount, price, nounce, signature) == true, "Boosts must be minted from our website"); //Will fail if proper amount isn't burnt! if (price > 0) { ICoolMonkeBanana(CMBAddress).burnWithTax(_msgSender(), price); } nounceTracker[_msgSender()] = nounce; //Stake in same txn to save gas! if (stake) { multiMint(amount, StakeAddress); uint16[] memory monkes; uint16[] memory boosts = new uint16[](amount); for (uint i = 0; i < amount; i++) { boosts[uint16(i)] = uint16(_owners.length - amount + i); } IMonkestake(StakeAddress).stake(_msgSender(), monkes, boosts, 0, 0, ''); } else { multiMint(amount, _msgSender()); } } function pause() public onlyOwner { } function unpause() public onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721) { } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721) returns (bool) { } }
nounceTracker[_msgSender()]<nounce,"Can not repeat a prior transaction!"
369,716
nounceTracker[_msgSender()]<nounce
"Boosts must be minted from our website"
// SPDX-License-Identifier: MIT // @author: @CoolMonkes - Boosts - CMBSTS // (/@@&#%&@@@@((((@@@@@@@,&@@@&%&@ // &@@&(((((((((((((((((((((@@%(((#%&((((@@ // @@((((((((((((((((@@@@@&(((#@@ @@((%@, // @@#(((((((((((((&@@, /@@%((@@@@((@@, // @@((((((((((((%@@, @@((#@@@@ // @@(((((&@@@@@@/ @@##@* @@(((* /@@ // (@#((@@& @@ @@(((@@@@& .@@@@@###@@@ // @@@@@@((@@ @@@@. (@#(@@%((((&@@&@@@#######@@@ // @@%(((&@@((@@ /@ @ *@@@ &@##@&((((((%@@...@@@@#######@@& // @@((@@, #@#(&@. %@@@@%/&( #@@@@@@(((&@@(.........@@@%#######@@@ // @@((#@@@@@@((#@@ @@@@@@@ .@@@@@/....,/.........,@%....#@@@########@@* // %@@&#((%@@@((((@@@* ,@@@@@/.............@@@/./@&@@@@.....@@@@#######%@ // (@@((#@&@@@@@@@@@/..............@@..@@@@@@#.@@..%.......@@@######@ // @@@((((#@@*.............@,.(@...&@,.....&@..............%@@@@@@@ // @@((((%@@@@............@@./@@@@@*...@&...............#@@@@@@@#### // *@@@@@(((&@@............%@@@/.@@.,@&...@%............*@@@@@..../@@##&@ // (@@@@&......*.......,...,@,.@@.@@..@@@/...............@@@@@*........&@@@ // @@@@@@###@@&@............@&@@..@@..@(.&@..............&@@@@%.........@@@ // @@##########@@@&.....@@&@@@@.&@#.,&#............./@@@@@........,@@@@ // @@#@@@&########@@@&....&@%......@............@@@@@,.......@@@@@@ // ###%@@@%########@@@#....@@............&@@@@#........#@@@* // ######&@@@&#######%@@@/..........(@&@@&........,@@@@ // #########%@@@&#######&@@@...,@@@@@.........@@@@/ // ##########@@@@#######@@@@@#........%@@@ // ##########@@@##@@@@#@@......@@@ // ########@@#######@@.&@@/ // ####&@@#####&@@ // &@@@@@@@@ // Features: // MONKE ARMY SUPER GAS OPTIMIZATIONZ to maximize gas savings! // Secure permit list minting to allow our users gas war free presale mintingz! // Auto approved for listing on LooksRare & Rarible to reduce gas fees for our monke army! // Open commercial right contract for our users stored on-chain, be free to exercise your creativity! // Auto approved to staking wallet to save gas // Can mint & stake to save additional gas pragma solidity ^0.8.11; import "./ERC721.sol"; import "./ERC721URIStorage.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./ECDSA.sol"; import "./Pausable.sol"; interface ICoolMonkeBanana { function burnWithTax(address from, uint256 amount) external; } interface IMonkestake { function stake(address account, uint16[] calldata monkeTokenIds, uint16[] calldata boostTokenIds, uint amount, uint nounce, bytes memory signature) external; } contract BoostPasses is ERC721, ERC721URIStorage, Pausable, Ownable { using SafeMath for uint256; using ECDSA for bytes32; //Our license is meant to be liberating in true sense to our mission, as such we do mean to open doors and promote fair use! //Full license including details purchase and art will be located on our website https://www.coolmonkes.io/license [as of 01/01/2022] //At the time of writing our art licensing entails: //Cool Monke holders are given complete commercial & non-commericial rights to their specific Cool Monkes so long as it is in fair usage to the Cool Monkes brand //The latest version of the license will supersede any previous licenses string public constant License = "MonkeLicense CC"; bytes public constant Provenance = "0x098d535091e9aa309e834fa6865bd00b2eef26dcd19184e6598a07bf99f1a91a"; address public constant enforcerAddress = 0xD8A7fd1887cf690119FFed888924056aF7f299CE; address public CMBAddress; address public StakeAddress; //Monkeworld Socio-economic Ecosystem uint256 public constant maxBoosts = 10000; //Minting tracking and efficient rule enforcement, nounce sent must always be unique mapping(address => uint256) public nounceTracker; //Reveal will be conducted on our API to prevent rarity sniping //Post reveal token metadata will be migrated from API and permanently frozen on IPFS string public baseTokenURI = "https://www.coolmonkes.io/api/metadata/boost/"; constructor() ERC721("Cool Monkes Boosts", "CMBSTS") {} function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function setStakeAddress(address contractAddress) public onlyOwner { } function setCMBAddress(address contractAddress) public onlyOwner { } function totalTokens() public view returns (uint256) { } function multiMint(uint amount, address to) private { } //Returns nounce for earner to enable transaction parity for security, next nounce has to be > than this value! function minterCurrentNounce(address minter) public view returns (uint256) { } function getMessageHash(address _to, uint _amount, uint _price, uint _nonce) internal pure returns (bytes32) { } function getEthSignedMessageHash(bytes32 _messageHash) internal pure returns (bytes32) { } function verify(address _signer, address _to, uint _amount, uint _price, uint _nounce, bytes memory signature) internal pure returns (bool) { } function recoverSigner(bytes32 _ethSignedMessageHash, bytes memory _signature) internal pure returns (address) { } function splitSignature(bytes memory sig) internal pure returns (bytes32 r, bytes32 s, uint8 v ) { } function mint(uint amount, uint price, uint nounce, bytes memory signature, bool stake) public whenNotPaused { require(_owners.length + amount <= maxBoosts, "Boosts are sold out!"); require(nounceTracker[_msgSender()] < nounce, "Can not repeat a prior transaction!"); require(<FILL_ME>) //Will fail if proper amount isn't burnt! if (price > 0) { ICoolMonkeBanana(CMBAddress).burnWithTax(_msgSender(), price); } nounceTracker[_msgSender()] = nounce; //Stake in same txn to save gas! if (stake) { multiMint(amount, StakeAddress); uint16[] memory monkes; uint16[] memory boosts = new uint16[](amount); for (uint i = 0; i < amount; i++) { boosts[uint16(i)] = uint16(_owners.length - amount + i); } IMonkestake(StakeAddress).stake(_msgSender(), monkes, boosts, 0, 0, ''); } else { multiMint(amount, _msgSender()); } } function pause() public onlyOwner { } function unpause() public onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721) { } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721) returns (bool) { } }
verify(enforcerAddress,_msgSender(),amount,price,nounce,signature)==true,"Boosts must be minted from our website"
369,716
verify(enforcerAddress,_msgSender(),amount,price,nounce,signature)==true
null
pragma solidity ^0.5; pragma experimental ABIEncoderV2; contract owned { address payable public owner; constructor () public { } modifier onlyOwner { } function transferOwnership(address payable newOwner) onlyOwner public { } } interface IERC20 { function transfer(address _to, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } contract ERC20Holder is owned { mapping (address => bool) acceptedTokens; function modToken(address token,bool accepted) public onlyOwner { } function tokenFallback(address _from, uint _value, bytes memory _data) pure public returns (bytes32 hash) { } function() external payable {} function withdraw() onlyOwner public { } function transferToken (address token,address to,uint256 val) public onlyOwner { } } contract oracleClient is ERC20Holder { address oracle; function setOracle(address a) public onlyOwner { } } interface IOracle { function ask (uint8 typeSN, string calldata idPost,string calldata idUser, bytes32 idRequest) external; } contract campaign is oracleClient { enum status {NotExists,Prepared,Validated,Running,Ended} enum promStatus {NotExists,Inited,Validated,Rejected,Paid} enum RewardType {None,Ratio,Reach} struct cpRatio { uint256 likeRatio; uint256 shareRatio; uint256 viewRatio; } struct Reach { uint256 likeReach; uint256 shareReach; uint256 viewReach; uint256 reward; } struct Campaign { address advertiser; string dataUrl; // IPFS link hosted by us uint64 startDate; uint64 endDate; status campaignState; RewardType rewardType; uint64 nbProms; uint64 nbValidProms; mapping (uint64 => bytes32) proms; Fund funds; mapping(uint8 => cpRatio) ratios; mapping(uint8 => Reach) reachs; uint256 reserve; } struct Fund { address token; uint256 amount; } struct Result { bytes32 idProm; uint64 likes; uint64 shares; uint64 views; } struct promElement { address influencer; bytes32 idCampaign; Fund funds; promStatus status; uint8 typeSN; string idPost; string idUser; uint64 nbResults; mapping (uint64 => bytes32) results; bytes32 prevResult; } mapping (bytes32 => Campaign) public campaigns; mapping (bytes32 => promElement) public proms; mapping (bytes32 => Result) public results; mapping (bytes32 => bool) public isAlreadyUsed; event CampaignCreated(bytes32 indexed id,uint64 startDate,uint64 endDate,string dataUrl,uint8 rewardType); event CampaignStarted(bytes32 indexed id ); event CampaignEnded(bytes32 indexed id ); event CampaignFundsSpent(bytes32 indexed id ); event CampaignApplied(bytes32 indexed id ,bytes32 indexed prom ); event OracleResult( bytes32 idRequest,uint64 likes,uint64 shares,uint64 views); function createCampaign(string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public returns (bytes32 idCampaign) { } function modCampaign(bytes32 idCampaign,string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public { require(<FILL_ME>) require(startDate > now); require(endDate > now); require(endDate > startDate); require(campaigns[idCampaign].campaignState == status.Prepared); require(reward > 0 && reward < 3); campaigns[idCampaign].dataUrl = dataUrl; campaigns[idCampaign].startDate = startDate; campaigns[idCampaign].endDate = endDate; campaigns[idCampaign].rewardType = RewardType(reward); emit CampaignCreated(idCampaign,startDate,endDate,dataUrl,reward); } function priceRatioCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeRatio,uint256 shareRatio,uint256 viewRatio) public { } function priceReachCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeReach,uint256 shareReach,uint256 viewReach,uint256 rewardAmount) public { } function fundCampaign (bytes32 idCampaign,address token,uint256 amount) public { } function createPriceFundYt(string memory dataUrl,uint64 startDate,uint64 endDate,uint256 likeRatio,uint256 viewRatio,address token,uint256 amount) public returns (bytes32 idCampaign) { } function applyCampaign(bytes32 idCampaign,uint8 typeSN, string memory idPost, string memory idUser) public returns (bytes32 idProm) { } function validateProm(bytes32 idCampaign,bytes32 idProm,bool accepted) public { } function startCampaign(bytes32 idCampaign) public { } function updateCampaignStats(bytes32 idCampaign) public onlyOwner { } function endCampaign(bytes32 idCampaign) public { } function ask(uint8 typeSN, string memory idPost,string memory idUser,bytes32 idRequest) public { } function update(bytes32 idRequest,uint64 likes,uint64 shares,uint64 views) external returns (bool ok) { } function getGains(bytes32 idProm) public { } function getRemainingFunds(bytes32 idCampaign) public { } function getProms (bytes32 idCampaign) public view returns (bytes32[] memory cproms) { } function getRatios (bytes32 idCampaign) public view returns (uint8[] memory types,uint256[] memory likeRatios,uint256[] memory shareRatios,uint256[] memory viewRatios ) { } function getReachs (bytes32 idCampaign) public view returns (uint8[] memory typesR,uint256[] memory likeReach,uint256[] memory shareReach,uint256[] memory viewReach,uint256[] memory rewardAmount ) { } function getResults (bytes32 idProm) public view returns (bytes32[] memory creq) { } }
campaigns[idCampaign].advertiser==msg.sender
369,742
campaigns[idCampaign].advertiser==msg.sender
null
pragma solidity ^0.5; pragma experimental ABIEncoderV2; contract owned { address payable public owner; constructor () public { } modifier onlyOwner { } function transferOwnership(address payable newOwner) onlyOwner public { } } interface IERC20 { function transfer(address _to, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } contract ERC20Holder is owned { mapping (address => bool) acceptedTokens; function modToken(address token,bool accepted) public onlyOwner { } function tokenFallback(address _from, uint _value, bytes memory _data) pure public returns (bytes32 hash) { } function() external payable {} function withdraw() onlyOwner public { } function transferToken (address token,address to,uint256 val) public onlyOwner { } } contract oracleClient is ERC20Holder { address oracle; function setOracle(address a) public onlyOwner { } } interface IOracle { function ask (uint8 typeSN, string calldata idPost,string calldata idUser, bytes32 idRequest) external; } contract campaign is oracleClient { enum status {NotExists,Prepared,Validated,Running,Ended} enum promStatus {NotExists,Inited,Validated,Rejected,Paid} enum RewardType {None,Ratio,Reach} struct cpRatio { uint256 likeRatio; uint256 shareRatio; uint256 viewRatio; } struct Reach { uint256 likeReach; uint256 shareReach; uint256 viewReach; uint256 reward; } struct Campaign { address advertiser; string dataUrl; // IPFS link hosted by us uint64 startDate; uint64 endDate; status campaignState; RewardType rewardType; uint64 nbProms; uint64 nbValidProms; mapping (uint64 => bytes32) proms; Fund funds; mapping(uint8 => cpRatio) ratios; mapping(uint8 => Reach) reachs; uint256 reserve; } struct Fund { address token; uint256 amount; } struct Result { bytes32 idProm; uint64 likes; uint64 shares; uint64 views; } struct promElement { address influencer; bytes32 idCampaign; Fund funds; promStatus status; uint8 typeSN; string idPost; string idUser; uint64 nbResults; mapping (uint64 => bytes32) results; bytes32 prevResult; } mapping (bytes32 => Campaign) public campaigns; mapping (bytes32 => promElement) public proms; mapping (bytes32 => Result) public results; mapping (bytes32 => bool) public isAlreadyUsed; event CampaignCreated(bytes32 indexed id,uint64 startDate,uint64 endDate,string dataUrl,uint8 rewardType); event CampaignStarted(bytes32 indexed id ); event CampaignEnded(bytes32 indexed id ); event CampaignFundsSpent(bytes32 indexed id ); event CampaignApplied(bytes32 indexed id ,bytes32 indexed prom ); event OracleResult( bytes32 idRequest,uint64 likes,uint64 shares,uint64 views); function createCampaign(string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public returns (bytes32 idCampaign) { } function modCampaign(bytes32 idCampaign,string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public { require(campaigns[idCampaign].advertiser == msg.sender); require(startDate > now); require(endDate > now); require(endDate > startDate); require(<FILL_ME>) require(reward > 0 && reward < 3); campaigns[idCampaign].dataUrl = dataUrl; campaigns[idCampaign].startDate = startDate; campaigns[idCampaign].endDate = endDate; campaigns[idCampaign].rewardType = RewardType(reward); emit CampaignCreated(idCampaign,startDate,endDate,dataUrl,reward); } function priceRatioCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeRatio,uint256 shareRatio,uint256 viewRatio) public { } function priceReachCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeReach,uint256 shareReach,uint256 viewReach,uint256 rewardAmount) public { } function fundCampaign (bytes32 idCampaign,address token,uint256 amount) public { } function createPriceFundYt(string memory dataUrl,uint64 startDate,uint64 endDate,uint256 likeRatio,uint256 viewRatio,address token,uint256 amount) public returns (bytes32 idCampaign) { } function applyCampaign(bytes32 idCampaign,uint8 typeSN, string memory idPost, string memory idUser) public returns (bytes32 idProm) { } function validateProm(bytes32 idCampaign,bytes32 idProm,bool accepted) public { } function startCampaign(bytes32 idCampaign) public { } function updateCampaignStats(bytes32 idCampaign) public onlyOwner { } function endCampaign(bytes32 idCampaign) public { } function ask(uint8 typeSN, string memory idPost,string memory idUser,bytes32 idRequest) public { } function update(bytes32 idRequest,uint64 likes,uint64 shares,uint64 views) external returns (bool ok) { } function getGains(bytes32 idProm) public { } function getRemainingFunds(bytes32 idCampaign) public { } function getProms (bytes32 idCampaign) public view returns (bytes32[] memory cproms) { } function getRatios (bytes32 idCampaign) public view returns (uint8[] memory types,uint256[] memory likeRatios,uint256[] memory shareRatios,uint256[] memory viewRatios ) { } function getReachs (bytes32 idCampaign) public view returns (uint8[] memory typesR,uint256[] memory likeReach,uint256[] memory shareReach,uint256[] memory viewReach,uint256[] memory rewardAmount ) { } function getResults (bytes32 idProm) public view returns (bytes32[] memory creq) { } }
campaigns[idCampaign].campaignState==status.Prepared
369,742
campaigns[idCampaign].campaignState==status.Prepared
null
pragma solidity ^0.5; pragma experimental ABIEncoderV2; contract owned { address payable public owner; constructor () public { } modifier onlyOwner { } function transferOwnership(address payable newOwner) onlyOwner public { } } interface IERC20 { function transfer(address _to, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } contract ERC20Holder is owned { mapping (address => bool) acceptedTokens; function modToken(address token,bool accepted) public onlyOwner { } function tokenFallback(address _from, uint _value, bytes memory _data) pure public returns (bytes32 hash) { } function() external payable {} function withdraw() onlyOwner public { } function transferToken (address token,address to,uint256 val) public onlyOwner { } } contract oracleClient is ERC20Holder { address oracle; function setOracle(address a) public onlyOwner { } } interface IOracle { function ask (uint8 typeSN, string calldata idPost,string calldata idUser, bytes32 idRequest) external; } contract campaign is oracleClient { enum status {NotExists,Prepared,Validated,Running,Ended} enum promStatus {NotExists,Inited,Validated,Rejected,Paid} enum RewardType {None,Ratio,Reach} struct cpRatio { uint256 likeRatio; uint256 shareRatio; uint256 viewRatio; } struct Reach { uint256 likeReach; uint256 shareReach; uint256 viewReach; uint256 reward; } struct Campaign { address advertiser; string dataUrl; // IPFS link hosted by us uint64 startDate; uint64 endDate; status campaignState; RewardType rewardType; uint64 nbProms; uint64 nbValidProms; mapping (uint64 => bytes32) proms; Fund funds; mapping(uint8 => cpRatio) ratios; mapping(uint8 => Reach) reachs; uint256 reserve; } struct Fund { address token; uint256 amount; } struct Result { bytes32 idProm; uint64 likes; uint64 shares; uint64 views; } struct promElement { address influencer; bytes32 idCampaign; Fund funds; promStatus status; uint8 typeSN; string idPost; string idUser; uint64 nbResults; mapping (uint64 => bytes32) results; bytes32 prevResult; } mapping (bytes32 => Campaign) public campaigns; mapping (bytes32 => promElement) public proms; mapping (bytes32 => Result) public results; mapping (bytes32 => bool) public isAlreadyUsed; event CampaignCreated(bytes32 indexed id,uint64 startDate,uint64 endDate,string dataUrl,uint8 rewardType); event CampaignStarted(bytes32 indexed id ); event CampaignEnded(bytes32 indexed id ); event CampaignFundsSpent(bytes32 indexed id ); event CampaignApplied(bytes32 indexed id ,bytes32 indexed prom ); event OracleResult( bytes32 idRequest,uint64 likes,uint64 shares,uint64 views); function createCampaign(string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public returns (bytes32 idCampaign) { } function modCampaign(bytes32 idCampaign,string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public { } function priceRatioCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeRatio,uint256 shareRatio,uint256 viewRatio) public { require(campaigns[idCampaign].advertiser == msg.sender); require(campaigns[idCampaign].campaignState == status.Prepared); require(<FILL_ME>) campaigns[idCampaign].ratios[typeSN] = cpRatio(likeRatio,shareRatio,viewRatio); } function priceReachCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeReach,uint256 shareReach,uint256 viewReach,uint256 rewardAmount) public { } function fundCampaign (bytes32 idCampaign,address token,uint256 amount) public { } function createPriceFundYt(string memory dataUrl,uint64 startDate,uint64 endDate,uint256 likeRatio,uint256 viewRatio,address token,uint256 amount) public returns (bytes32 idCampaign) { } function applyCampaign(bytes32 idCampaign,uint8 typeSN, string memory idPost, string memory idUser) public returns (bytes32 idProm) { } function validateProm(bytes32 idCampaign,bytes32 idProm,bool accepted) public { } function startCampaign(bytes32 idCampaign) public { } function updateCampaignStats(bytes32 idCampaign) public onlyOwner { } function endCampaign(bytes32 idCampaign) public { } function ask(uint8 typeSN, string memory idPost,string memory idUser,bytes32 idRequest) public { } function update(bytes32 idRequest,uint64 likes,uint64 shares,uint64 views) external returns (bool ok) { } function getGains(bytes32 idProm) public { } function getRemainingFunds(bytes32 idCampaign) public { } function getProms (bytes32 idCampaign) public view returns (bytes32[] memory cproms) { } function getRatios (bytes32 idCampaign) public view returns (uint8[] memory types,uint256[] memory likeRatios,uint256[] memory shareRatios,uint256[] memory viewRatios ) { } function getReachs (bytes32 idCampaign) public view returns (uint8[] memory typesR,uint256[] memory likeReach,uint256[] memory shareReach,uint256[] memory viewReach,uint256[] memory rewardAmount ) { } function getResults (bytes32 idProm) public view returns (bytes32[] memory creq) { } }
campaigns[idCampaign].rewardType==RewardType.Ratio
369,742
campaigns[idCampaign].rewardType==RewardType.Ratio
null
pragma solidity ^0.5; pragma experimental ABIEncoderV2; contract owned { address payable public owner; constructor () public { } modifier onlyOwner { } function transferOwnership(address payable newOwner) onlyOwner public { } } interface IERC20 { function transfer(address _to, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } contract ERC20Holder is owned { mapping (address => bool) acceptedTokens; function modToken(address token,bool accepted) public onlyOwner { } function tokenFallback(address _from, uint _value, bytes memory _data) pure public returns (bytes32 hash) { } function() external payable {} function withdraw() onlyOwner public { } function transferToken (address token,address to,uint256 val) public onlyOwner { } } contract oracleClient is ERC20Holder { address oracle; function setOracle(address a) public onlyOwner { } } interface IOracle { function ask (uint8 typeSN, string calldata idPost,string calldata idUser, bytes32 idRequest) external; } contract campaign is oracleClient { enum status {NotExists,Prepared,Validated,Running,Ended} enum promStatus {NotExists,Inited,Validated,Rejected,Paid} enum RewardType {None,Ratio,Reach} struct cpRatio { uint256 likeRatio; uint256 shareRatio; uint256 viewRatio; } struct Reach { uint256 likeReach; uint256 shareReach; uint256 viewReach; uint256 reward; } struct Campaign { address advertiser; string dataUrl; // IPFS link hosted by us uint64 startDate; uint64 endDate; status campaignState; RewardType rewardType; uint64 nbProms; uint64 nbValidProms; mapping (uint64 => bytes32) proms; Fund funds; mapping(uint8 => cpRatio) ratios; mapping(uint8 => Reach) reachs; uint256 reserve; } struct Fund { address token; uint256 amount; } struct Result { bytes32 idProm; uint64 likes; uint64 shares; uint64 views; } struct promElement { address influencer; bytes32 idCampaign; Fund funds; promStatus status; uint8 typeSN; string idPost; string idUser; uint64 nbResults; mapping (uint64 => bytes32) results; bytes32 prevResult; } mapping (bytes32 => Campaign) public campaigns; mapping (bytes32 => promElement) public proms; mapping (bytes32 => Result) public results; mapping (bytes32 => bool) public isAlreadyUsed; event CampaignCreated(bytes32 indexed id,uint64 startDate,uint64 endDate,string dataUrl,uint8 rewardType); event CampaignStarted(bytes32 indexed id ); event CampaignEnded(bytes32 indexed id ); event CampaignFundsSpent(bytes32 indexed id ); event CampaignApplied(bytes32 indexed id ,bytes32 indexed prom ); event OracleResult( bytes32 idRequest,uint64 likes,uint64 shares,uint64 views); function createCampaign(string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public returns (bytes32 idCampaign) { } function modCampaign(bytes32 idCampaign,string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public { } function priceRatioCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeRatio,uint256 shareRatio,uint256 viewRatio) public { } function priceReachCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeReach,uint256 shareReach,uint256 viewReach,uint256 rewardAmount) public { require(campaigns[idCampaign].advertiser == msg.sender); require(campaigns[idCampaign].campaignState == status.Prepared); require(<FILL_ME>) campaigns[idCampaign].reachs[typeSN] = Reach(likeReach,shareReach,viewReach,rewardAmount); } function fundCampaign (bytes32 idCampaign,address token,uint256 amount) public { } function createPriceFundYt(string memory dataUrl,uint64 startDate,uint64 endDate,uint256 likeRatio,uint256 viewRatio,address token,uint256 amount) public returns (bytes32 idCampaign) { } function applyCampaign(bytes32 idCampaign,uint8 typeSN, string memory idPost, string memory idUser) public returns (bytes32 idProm) { } function validateProm(bytes32 idCampaign,bytes32 idProm,bool accepted) public { } function startCampaign(bytes32 idCampaign) public { } function updateCampaignStats(bytes32 idCampaign) public onlyOwner { } function endCampaign(bytes32 idCampaign) public { } function ask(uint8 typeSN, string memory idPost,string memory idUser,bytes32 idRequest) public { } function update(bytes32 idRequest,uint64 likes,uint64 shares,uint64 views) external returns (bool ok) { } function getGains(bytes32 idProm) public { } function getRemainingFunds(bytes32 idCampaign) public { } function getProms (bytes32 idCampaign) public view returns (bytes32[] memory cproms) { } function getRatios (bytes32 idCampaign) public view returns (uint8[] memory types,uint256[] memory likeRatios,uint256[] memory shareRatios,uint256[] memory viewRatios ) { } function getReachs (bytes32 idCampaign) public view returns (uint8[] memory typesR,uint256[] memory likeReach,uint256[] memory shareReach,uint256[] memory viewReach,uint256[] memory rewardAmount ) { } function getResults (bytes32 idProm) public view returns (bytes32[] memory creq) { } }
campaigns[idCampaign].rewardType==RewardType.Reach
369,742
campaigns[idCampaign].rewardType==RewardType.Reach
null
pragma solidity ^0.5; pragma experimental ABIEncoderV2; contract owned { address payable public owner; constructor () public { } modifier onlyOwner { } function transferOwnership(address payable newOwner) onlyOwner public { } } interface IERC20 { function transfer(address _to, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } contract ERC20Holder is owned { mapping (address => bool) acceptedTokens; function modToken(address token,bool accepted) public onlyOwner { } function tokenFallback(address _from, uint _value, bytes memory _data) pure public returns (bytes32 hash) { } function() external payable {} function withdraw() onlyOwner public { } function transferToken (address token,address to,uint256 val) public onlyOwner { } } contract oracleClient is ERC20Holder { address oracle; function setOracle(address a) public onlyOwner { } } interface IOracle { function ask (uint8 typeSN, string calldata idPost,string calldata idUser, bytes32 idRequest) external; } contract campaign is oracleClient { enum status {NotExists,Prepared,Validated,Running,Ended} enum promStatus {NotExists,Inited,Validated,Rejected,Paid} enum RewardType {None,Ratio,Reach} struct cpRatio { uint256 likeRatio; uint256 shareRatio; uint256 viewRatio; } struct Reach { uint256 likeReach; uint256 shareReach; uint256 viewReach; uint256 reward; } struct Campaign { address advertiser; string dataUrl; // IPFS link hosted by us uint64 startDate; uint64 endDate; status campaignState; RewardType rewardType; uint64 nbProms; uint64 nbValidProms; mapping (uint64 => bytes32) proms; Fund funds; mapping(uint8 => cpRatio) ratios; mapping(uint8 => Reach) reachs; uint256 reserve; } struct Fund { address token; uint256 amount; } struct Result { bytes32 idProm; uint64 likes; uint64 shares; uint64 views; } struct promElement { address influencer; bytes32 idCampaign; Fund funds; promStatus status; uint8 typeSN; string idPost; string idUser; uint64 nbResults; mapping (uint64 => bytes32) results; bytes32 prevResult; } mapping (bytes32 => Campaign) public campaigns; mapping (bytes32 => promElement) public proms; mapping (bytes32 => Result) public results; mapping (bytes32 => bool) public isAlreadyUsed; event CampaignCreated(bytes32 indexed id,uint64 startDate,uint64 endDate,string dataUrl,uint8 rewardType); event CampaignStarted(bytes32 indexed id ); event CampaignEnded(bytes32 indexed id ); event CampaignFundsSpent(bytes32 indexed id ); event CampaignApplied(bytes32 indexed id ,bytes32 indexed prom ); event OracleResult( bytes32 idRequest,uint64 likes,uint64 shares,uint64 views); function createCampaign(string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public returns (bytes32 idCampaign) { } function modCampaign(bytes32 idCampaign,string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public { } function priceRatioCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeRatio,uint256 shareRatio,uint256 viewRatio) public { } function priceReachCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeReach,uint256 shareReach,uint256 viewReach,uint256 rewardAmount) public { } function fundCampaign (bytes32 idCampaign,address token,uint256 amount) public { require(<FILL_ME>) require(campaigns[idCampaign].funds.token == address(0) || campaigns[idCampaign].funds.token == token); IERC20 erc20 = IERC20(token); erc20.transferFrom(msg.sender,address(this),amount); uint256 prev_amount = campaigns[idCampaign].funds.amount; campaigns[idCampaign].funds = Fund(token,amount+prev_amount); campaigns[idCampaign].reserve += amount; } function createPriceFundYt(string memory dataUrl,uint64 startDate,uint64 endDate,uint256 likeRatio,uint256 viewRatio,address token,uint256 amount) public returns (bytes32 idCampaign) { } function applyCampaign(bytes32 idCampaign,uint8 typeSN, string memory idPost, string memory idUser) public returns (bytes32 idProm) { } function validateProm(bytes32 idCampaign,bytes32 idProm,bool accepted) public { } function startCampaign(bytes32 idCampaign) public { } function updateCampaignStats(bytes32 idCampaign) public onlyOwner { } function endCampaign(bytes32 idCampaign) public { } function ask(uint8 typeSN, string memory idPost,string memory idUser,bytes32 idRequest) public { } function update(bytes32 idRequest,uint64 likes,uint64 shares,uint64 views) external returns (bool ok) { } function getGains(bytes32 idProm) public { } function getRemainingFunds(bytes32 idCampaign) public { } function getProms (bytes32 idCampaign) public view returns (bytes32[] memory cproms) { } function getRatios (bytes32 idCampaign) public view returns (uint8[] memory types,uint256[] memory likeRatios,uint256[] memory shareRatios,uint256[] memory viewRatios ) { } function getReachs (bytes32 idCampaign) public view returns (uint8[] memory typesR,uint256[] memory likeReach,uint256[] memory shareReach,uint256[] memory viewReach,uint256[] memory rewardAmount ) { } function getResults (bytes32 idProm) public view returns (bytes32[] memory creq) { } }
campaigns[idCampaign].campaignState==status.Prepared||campaigns[idCampaign].campaignState==status.Running
369,742
campaigns[idCampaign].campaignState==status.Prepared||campaigns[idCampaign].campaignState==status.Running
null
pragma solidity ^0.5; pragma experimental ABIEncoderV2; contract owned { address payable public owner; constructor () public { } modifier onlyOwner { } function transferOwnership(address payable newOwner) onlyOwner public { } } interface IERC20 { function transfer(address _to, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } contract ERC20Holder is owned { mapping (address => bool) acceptedTokens; function modToken(address token,bool accepted) public onlyOwner { } function tokenFallback(address _from, uint _value, bytes memory _data) pure public returns (bytes32 hash) { } function() external payable {} function withdraw() onlyOwner public { } function transferToken (address token,address to,uint256 val) public onlyOwner { } } contract oracleClient is ERC20Holder { address oracle; function setOracle(address a) public onlyOwner { } } interface IOracle { function ask (uint8 typeSN, string calldata idPost,string calldata idUser, bytes32 idRequest) external; } contract campaign is oracleClient { enum status {NotExists,Prepared,Validated,Running,Ended} enum promStatus {NotExists,Inited,Validated,Rejected,Paid} enum RewardType {None,Ratio,Reach} struct cpRatio { uint256 likeRatio; uint256 shareRatio; uint256 viewRatio; } struct Reach { uint256 likeReach; uint256 shareReach; uint256 viewReach; uint256 reward; } struct Campaign { address advertiser; string dataUrl; // IPFS link hosted by us uint64 startDate; uint64 endDate; status campaignState; RewardType rewardType; uint64 nbProms; uint64 nbValidProms; mapping (uint64 => bytes32) proms; Fund funds; mapping(uint8 => cpRatio) ratios; mapping(uint8 => Reach) reachs; uint256 reserve; } struct Fund { address token; uint256 amount; } struct Result { bytes32 idProm; uint64 likes; uint64 shares; uint64 views; } struct promElement { address influencer; bytes32 idCampaign; Fund funds; promStatus status; uint8 typeSN; string idPost; string idUser; uint64 nbResults; mapping (uint64 => bytes32) results; bytes32 prevResult; } mapping (bytes32 => Campaign) public campaigns; mapping (bytes32 => promElement) public proms; mapping (bytes32 => Result) public results; mapping (bytes32 => bool) public isAlreadyUsed; event CampaignCreated(bytes32 indexed id,uint64 startDate,uint64 endDate,string dataUrl,uint8 rewardType); event CampaignStarted(bytes32 indexed id ); event CampaignEnded(bytes32 indexed id ); event CampaignFundsSpent(bytes32 indexed id ); event CampaignApplied(bytes32 indexed id ,bytes32 indexed prom ); event OracleResult( bytes32 idRequest,uint64 likes,uint64 shares,uint64 views); function createCampaign(string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public returns (bytes32 idCampaign) { } function modCampaign(bytes32 idCampaign,string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public { } function priceRatioCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeRatio,uint256 shareRatio,uint256 viewRatio) public { } function priceReachCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeReach,uint256 shareReach,uint256 viewReach,uint256 rewardAmount) public { } function fundCampaign (bytes32 idCampaign,address token,uint256 amount) public { require(campaigns[idCampaign].campaignState == status.Prepared || campaigns[idCampaign].campaignState == status.Running); require(<FILL_ME>) IERC20 erc20 = IERC20(token); erc20.transferFrom(msg.sender,address(this),amount); uint256 prev_amount = campaigns[idCampaign].funds.amount; campaigns[idCampaign].funds = Fund(token,amount+prev_amount); campaigns[idCampaign].reserve += amount; } function createPriceFundYt(string memory dataUrl,uint64 startDate,uint64 endDate,uint256 likeRatio,uint256 viewRatio,address token,uint256 amount) public returns (bytes32 idCampaign) { } function applyCampaign(bytes32 idCampaign,uint8 typeSN, string memory idPost, string memory idUser) public returns (bytes32 idProm) { } function validateProm(bytes32 idCampaign,bytes32 idProm,bool accepted) public { } function startCampaign(bytes32 idCampaign) public { } function updateCampaignStats(bytes32 idCampaign) public onlyOwner { } function endCampaign(bytes32 idCampaign) public { } function ask(uint8 typeSN, string memory idPost,string memory idUser,bytes32 idRequest) public { } function update(bytes32 idRequest,uint64 likes,uint64 shares,uint64 views) external returns (bool ok) { } function getGains(bytes32 idProm) public { } function getRemainingFunds(bytes32 idCampaign) public { } function getProms (bytes32 idCampaign) public view returns (bytes32[] memory cproms) { } function getRatios (bytes32 idCampaign) public view returns (uint8[] memory types,uint256[] memory likeRatios,uint256[] memory shareRatios,uint256[] memory viewRatios ) { } function getReachs (bytes32 idCampaign) public view returns (uint8[] memory typesR,uint256[] memory likeReach,uint256[] memory shareReach,uint256[] memory viewReach,uint256[] memory rewardAmount ) { } function getResults (bytes32 idProm) public view returns (bytes32[] memory creq) { } }
campaigns[idCampaign].funds.token==address(0)||campaigns[idCampaign].funds.token==token
369,742
campaigns[idCampaign].funds.token==address(0)||campaigns[idCampaign].funds.token==token
null
pragma solidity ^0.5; pragma experimental ABIEncoderV2; contract owned { address payable public owner; constructor () public { } modifier onlyOwner { } function transferOwnership(address payable newOwner) onlyOwner public { } } interface IERC20 { function transfer(address _to, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } contract ERC20Holder is owned { mapping (address => bool) acceptedTokens; function modToken(address token,bool accepted) public onlyOwner { } function tokenFallback(address _from, uint _value, bytes memory _data) pure public returns (bytes32 hash) { } function() external payable {} function withdraw() onlyOwner public { } function transferToken (address token,address to,uint256 val) public onlyOwner { } } contract oracleClient is ERC20Holder { address oracle; function setOracle(address a) public onlyOwner { } } interface IOracle { function ask (uint8 typeSN, string calldata idPost,string calldata idUser, bytes32 idRequest) external; } contract campaign is oracleClient { enum status {NotExists,Prepared,Validated,Running,Ended} enum promStatus {NotExists,Inited,Validated,Rejected,Paid} enum RewardType {None,Ratio,Reach} struct cpRatio { uint256 likeRatio; uint256 shareRatio; uint256 viewRatio; } struct Reach { uint256 likeReach; uint256 shareReach; uint256 viewReach; uint256 reward; } struct Campaign { address advertiser; string dataUrl; // IPFS link hosted by us uint64 startDate; uint64 endDate; status campaignState; RewardType rewardType; uint64 nbProms; uint64 nbValidProms; mapping (uint64 => bytes32) proms; Fund funds; mapping(uint8 => cpRatio) ratios; mapping(uint8 => Reach) reachs; uint256 reserve; } struct Fund { address token; uint256 amount; } struct Result { bytes32 idProm; uint64 likes; uint64 shares; uint64 views; } struct promElement { address influencer; bytes32 idCampaign; Fund funds; promStatus status; uint8 typeSN; string idPost; string idUser; uint64 nbResults; mapping (uint64 => bytes32) results; bytes32 prevResult; } mapping (bytes32 => Campaign) public campaigns; mapping (bytes32 => promElement) public proms; mapping (bytes32 => Result) public results; mapping (bytes32 => bool) public isAlreadyUsed; event CampaignCreated(bytes32 indexed id,uint64 startDate,uint64 endDate,string dataUrl,uint8 rewardType); event CampaignStarted(bytes32 indexed id ); event CampaignEnded(bytes32 indexed id ); event CampaignFundsSpent(bytes32 indexed id ); event CampaignApplied(bytes32 indexed id ,bytes32 indexed prom ); event OracleResult( bytes32 idRequest,uint64 likes,uint64 shares,uint64 views); function createCampaign(string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public returns (bytes32 idCampaign) { } function modCampaign(bytes32 idCampaign,string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public { } function priceRatioCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeRatio,uint256 shareRatio,uint256 viewRatio) public { } function priceReachCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeReach,uint256 shareReach,uint256 viewReach,uint256 rewardAmount) public { } function fundCampaign (bytes32 idCampaign,address token,uint256 amount) public { } function createPriceFundYt(string memory dataUrl,uint64 startDate,uint64 endDate,uint256 likeRatio,uint256 viewRatio,address token,uint256 amount) public returns (bytes32 idCampaign) { } function applyCampaign(bytes32 idCampaign,uint8 typeSN, string memory idPost, string memory idUser) public returns (bytes32 idProm) { bytes32 prom = keccak256(abi.encodePacked(typeSN,idPost,idUser)); require(campaigns[idCampaign].campaignState == status.Prepared || campaigns[idCampaign].campaignState == status.Running); require(<FILL_ME>) idProm = keccak256(abi.encodePacked( msg.sender,typeSN,idPost,idUser,now)); proms[idProm] = promElement(msg.sender,idCampaign,Fund(address(0),0),promStatus.NotExists,typeSN,idPost,idUser,0,0); campaigns[idCampaign].proms[campaigns[idCampaign].nbProms++] = idProm; bytes32 idRequest = keccak256(abi.encodePacked(typeSN,idPost,idUser,now)); results[idRequest] = Result(idProm,0,0,0); proms[idProm].results[0] = proms[idProm].prevResult = idRequest; proms[idProm].nbResults = 1; //ask(typeSN,idPost,idUser,idRequest); isAlreadyUsed[prom] = true; emit CampaignApplied(idCampaign,idProm); return idProm; } function validateProm(bytes32 idCampaign,bytes32 idProm,bool accepted) public { } function startCampaign(bytes32 idCampaign) public { } function updateCampaignStats(bytes32 idCampaign) public onlyOwner { } function endCampaign(bytes32 idCampaign) public { } function ask(uint8 typeSN, string memory idPost,string memory idUser,bytes32 idRequest) public { } function update(bytes32 idRequest,uint64 likes,uint64 shares,uint64 views) external returns (bool ok) { } function getGains(bytes32 idProm) public { } function getRemainingFunds(bytes32 idCampaign) public { } function getProms (bytes32 idCampaign) public view returns (bytes32[] memory cproms) { } function getRatios (bytes32 idCampaign) public view returns (uint8[] memory types,uint256[] memory likeRatios,uint256[] memory shareRatios,uint256[] memory viewRatios ) { } function getReachs (bytes32 idCampaign) public view returns (uint8[] memory typesR,uint256[] memory likeReach,uint256[] memory shareReach,uint256[] memory viewReach,uint256[] memory rewardAmount ) { } function getResults (bytes32 idProm) public view returns (bytes32[] memory creq) { } }
!isAlreadyUsed[prom]
369,742
!isAlreadyUsed[prom]
null
pragma solidity ^0.5; pragma experimental ABIEncoderV2; contract owned { address payable public owner; constructor () public { } modifier onlyOwner { } function transferOwnership(address payable newOwner) onlyOwner public { } } interface IERC20 { function transfer(address _to, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } contract ERC20Holder is owned { mapping (address => bool) acceptedTokens; function modToken(address token,bool accepted) public onlyOwner { } function tokenFallback(address _from, uint _value, bytes memory _data) pure public returns (bytes32 hash) { } function() external payable {} function withdraw() onlyOwner public { } function transferToken (address token,address to,uint256 val) public onlyOwner { } } contract oracleClient is ERC20Holder { address oracle; function setOracle(address a) public onlyOwner { } } interface IOracle { function ask (uint8 typeSN, string calldata idPost,string calldata idUser, bytes32 idRequest) external; } contract campaign is oracleClient { enum status {NotExists,Prepared,Validated,Running,Ended} enum promStatus {NotExists,Inited,Validated,Rejected,Paid} enum RewardType {None,Ratio,Reach} struct cpRatio { uint256 likeRatio; uint256 shareRatio; uint256 viewRatio; } struct Reach { uint256 likeReach; uint256 shareReach; uint256 viewReach; uint256 reward; } struct Campaign { address advertiser; string dataUrl; // IPFS link hosted by us uint64 startDate; uint64 endDate; status campaignState; RewardType rewardType; uint64 nbProms; uint64 nbValidProms; mapping (uint64 => bytes32) proms; Fund funds; mapping(uint8 => cpRatio) ratios; mapping(uint8 => Reach) reachs; uint256 reserve; } struct Fund { address token; uint256 amount; } struct Result { bytes32 idProm; uint64 likes; uint64 shares; uint64 views; } struct promElement { address influencer; bytes32 idCampaign; Fund funds; promStatus status; uint8 typeSN; string idPost; string idUser; uint64 nbResults; mapping (uint64 => bytes32) results; bytes32 prevResult; } mapping (bytes32 => Campaign) public campaigns; mapping (bytes32 => promElement) public proms; mapping (bytes32 => Result) public results; mapping (bytes32 => bool) public isAlreadyUsed; event CampaignCreated(bytes32 indexed id,uint64 startDate,uint64 endDate,string dataUrl,uint8 rewardType); event CampaignStarted(bytes32 indexed id ); event CampaignEnded(bytes32 indexed id ); event CampaignFundsSpent(bytes32 indexed id ); event CampaignApplied(bytes32 indexed id ,bytes32 indexed prom ); event OracleResult( bytes32 idRequest,uint64 likes,uint64 shares,uint64 views); function createCampaign(string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public returns (bytes32 idCampaign) { } function modCampaign(bytes32 idCampaign,string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public { } function priceRatioCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeRatio,uint256 shareRatio,uint256 viewRatio) public { } function priceReachCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeReach,uint256 shareReach,uint256 viewReach,uint256 rewardAmount) public { } function fundCampaign (bytes32 idCampaign,address token,uint256 amount) public { } function createPriceFundYt(string memory dataUrl,uint64 startDate,uint64 endDate,uint256 likeRatio,uint256 viewRatio,address token,uint256 amount) public returns (bytes32 idCampaign) { } function applyCampaign(bytes32 idCampaign,uint8 typeSN, string memory idPost, string memory idUser) public returns (bytes32 idProm) { } function validateProm(bytes32 idCampaign,bytes32 idProm,bool accepted) public { require(campaigns[idCampaign].campaignState == status.Prepared || campaigns[idCampaign].campaignState == status.Running); require(campaigns[idCampaign].advertiser == msg.sender); require(<FILL_ME>) if(accepted) { proms[idProm].status = promStatus.Validated; campaigns[idCampaign].nbValidProms++; } else proms[idProm].status = promStatus.Rejected; if(campaigns[idCampaign].rewardType == RewardType.Reach) { uint256 amount = campaigns[idCampaign].reachs[proms[idProm].typeSN].reward; require(campaigns[idCampaign].reserve > amount); campaigns[idCampaign].reserve -= amount; } } function startCampaign(bytes32 idCampaign) public { } function updateCampaignStats(bytes32 idCampaign) public onlyOwner { } function endCampaign(bytes32 idCampaign) public { } function ask(uint8 typeSN, string memory idPost,string memory idUser,bytes32 idRequest) public { } function update(bytes32 idRequest,uint64 likes,uint64 shares,uint64 views) external returns (bool ok) { } function getGains(bytes32 idProm) public { } function getRemainingFunds(bytes32 idCampaign) public { } function getProms (bytes32 idCampaign) public view returns (bytes32[] memory cproms) { } function getRatios (bytes32 idCampaign) public view returns (uint8[] memory types,uint256[] memory likeRatios,uint256[] memory shareRatios,uint256[] memory viewRatios ) { } function getReachs (bytes32 idCampaign) public view returns (uint8[] memory typesR,uint256[] memory likeReach,uint256[] memory shareReach,uint256[] memory viewReach,uint256[] memory rewardAmount ) { } function getResults (bytes32 idProm) public view returns (bytes32[] memory creq) { } }
proms[idProm].idCampaign==idCampaign
369,742
proms[idProm].idCampaign==idCampaign
null
pragma solidity ^0.5; pragma experimental ABIEncoderV2; contract owned { address payable public owner; constructor () public { } modifier onlyOwner { } function transferOwnership(address payable newOwner) onlyOwner public { } } interface IERC20 { function transfer(address _to, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } contract ERC20Holder is owned { mapping (address => bool) acceptedTokens; function modToken(address token,bool accepted) public onlyOwner { } function tokenFallback(address _from, uint _value, bytes memory _data) pure public returns (bytes32 hash) { } function() external payable {} function withdraw() onlyOwner public { } function transferToken (address token,address to,uint256 val) public onlyOwner { } } contract oracleClient is ERC20Holder { address oracle; function setOracle(address a) public onlyOwner { } } interface IOracle { function ask (uint8 typeSN, string calldata idPost,string calldata idUser, bytes32 idRequest) external; } contract campaign is oracleClient { enum status {NotExists,Prepared,Validated,Running,Ended} enum promStatus {NotExists,Inited,Validated,Rejected,Paid} enum RewardType {None,Ratio,Reach} struct cpRatio { uint256 likeRatio; uint256 shareRatio; uint256 viewRatio; } struct Reach { uint256 likeReach; uint256 shareReach; uint256 viewReach; uint256 reward; } struct Campaign { address advertiser; string dataUrl; // IPFS link hosted by us uint64 startDate; uint64 endDate; status campaignState; RewardType rewardType; uint64 nbProms; uint64 nbValidProms; mapping (uint64 => bytes32) proms; Fund funds; mapping(uint8 => cpRatio) ratios; mapping(uint8 => Reach) reachs; uint256 reserve; } struct Fund { address token; uint256 amount; } struct Result { bytes32 idProm; uint64 likes; uint64 shares; uint64 views; } struct promElement { address influencer; bytes32 idCampaign; Fund funds; promStatus status; uint8 typeSN; string idPost; string idUser; uint64 nbResults; mapping (uint64 => bytes32) results; bytes32 prevResult; } mapping (bytes32 => Campaign) public campaigns; mapping (bytes32 => promElement) public proms; mapping (bytes32 => Result) public results; mapping (bytes32 => bool) public isAlreadyUsed; event CampaignCreated(bytes32 indexed id,uint64 startDate,uint64 endDate,string dataUrl,uint8 rewardType); event CampaignStarted(bytes32 indexed id ); event CampaignEnded(bytes32 indexed id ); event CampaignFundsSpent(bytes32 indexed id ); event CampaignApplied(bytes32 indexed id ,bytes32 indexed prom ); event OracleResult( bytes32 idRequest,uint64 likes,uint64 shares,uint64 views); function createCampaign(string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public returns (bytes32 idCampaign) { } function modCampaign(bytes32 idCampaign,string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public { } function priceRatioCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeRatio,uint256 shareRatio,uint256 viewRatio) public { } function priceReachCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeReach,uint256 shareReach,uint256 viewReach,uint256 rewardAmount) public { } function fundCampaign (bytes32 idCampaign,address token,uint256 amount) public { } function createPriceFundYt(string memory dataUrl,uint64 startDate,uint64 endDate,uint256 likeRatio,uint256 viewRatio,address token,uint256 amount) public returns (bytes32 idCampaign) { } function applyCampaign(bytes32 idCampaign,uint8 typeSN, string memory idPost, string memory idUser) public returns (bytes32 idProm) { } function validateProm(bytes32 idCampaign,bytes32 idProm,bool accepted) public { require(campaigns[idCampaign].campaignState == status.Prepared || campaigns[idCampaign].campaignState == status.Running); require(campaigns[idCampaign].advertiser == msg.sender); require(proms[idProm].idCampaign == idCampaign); if(accepted) { proms[idProm].status = promStatus.Validated; campaigns[idCampaign].nbValidProms++; } else proms[idProm].status = promStatus.Rejected; if(campaigns[idCampaign].rewardType == RewardType.Reach) { uint256 amount = campaigns[idCampaign].reachs[proms[idProm].typeSN].reward; require(<FILL_ME>) campaigns[idCampaign].reserve -= amount; } } function startCampaign(bytes32 idCampaign) public { } function updateCampaignStats(bytes32 idCampaign) public onlyOwner { } function endCampaign(bytes32 idCampaign) public { } function ask(uint8 typeSN, string memory idPost,string memory idUser,bytes32 idRequest) public { } function update(bytes32 idRequest,uint64 likes,uint64 shares,uint64 views) external returns (bool ok) { } function getGains(bytes32 idProm) public { } function getRemainingFunds(bytes32 idCampaign) public { } function getProms (bytes32 idCampaign) public view returns (bytes32[] memory cproms) { } function getRatios (bytes32 idCampaign) public view returns (uint8[] memory types,uint256[] memory likeRatios,uint256[] memory shareRatios,uint256[] memory viewRatios ) { } function getReachs (bytes32 idCampaign) public view returns (uint8[] memory typesR,uint256[] memory likeReach,uint256[] memory shareReach,uint256[] memory viewReach,uint256[] memory rewardAmount ) { } function getResults (bytes32 idProm) public view returns (bytes32[] memory creq) { } }
campaigns[idCampaign].reserve>amount
369,742
campaigns[idCampaign].reserve>amount
null
pragma solidity ^0.5; pragma experimental ABIEncoderV2; contract owned { address payable public owner; constructor () public { } modifier onlyOwner { } function transferOwnership(address payable newOwner) onlyOwner public { } } interface IERC20 { function transfer(address _to, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } contract ERC20Holder is owned { mapping (address => bool) acceptedTokens; function modToken(address token,bool accepted) public onlyOwner { } function tokenFallback(address _from, uint _value, bytes memory _data) pure public returns (bytes32 hash) { } function() external payable {} function withdraw() onlyOwner public { } function transferToken (address token,address to,uint256 val) public onlyOwner { } } contract oracleClient is ERC20Holder { address oracle; function setOracle(address a) public onlyOwner { } } interface IOracle { function ask (uint8 typeSN, string calldata idPost,string calldata idUser, bytes32 idRequest) external; } contract campaign is oracleClient { enum status {NotExists,Prepared,Validated,Running,Ended} enum promStatus {NotExists,Inited,Validated,Rejected,Paid} enum RewardType {None,Ratio,Reach} struct cpRatio { uint256 likeRatio; uint256 shareRatio; uint256 viewRatio; } struct Reach { uint256 likeReach; uint256 shareReach; uint256 viewReach; uint256 reward; } struct Campaign { address advertiser; string dataUrl; // IPFS link hosted by us uint64 startDate; uint64 endDate; status campaignState; RewardType rewardType; uint64 nbProms; uint64 nbValidProms; mapping (uint64 => bytes32) proms; Fund funds; mapping(uint8 => cpRatio) ratios; mapping(uint8 => Reach) reachs; uint256 reserve; } struct Fund { address token; uint256 amount; } struct Result { bytes32 idProm; uint64 likes; uint64 shares; uint64 views; } struct promElement { address influencer; bytes32 idCampaign; Fund funds; promStatus status; uint8 typeSN; string idPost; string idUser; uint64 nbResults; mapping (uint64 => bytes32) results; bytes32 prevResult; } mapping (bytes32 => Campaign) public campaigns; mapping (bytes32 => promElement) public proms; mapping (bytes32 => Result) public results; mapping (bytes32 => bool) public isAlreadyUsed; event CampaignCreated(bytes32 indexed id,uint64 startDate,uint64 endDate,string dataUrl,uint8 rewardType); event CampaignStarted(bytes32 indexed id ); event CampaignEnded(bytes32 indexed id ); event CampaignFundsSpent(bytes32 indexed id ); event CampaignApplied(bytes32 indexed id ,bytes32 indexed prom ); event OracleResult( bytes32 idRequest,uint64 likes,uint64 shares,uint64 views); function createCampaign(string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public returns (bytes32 idCampaign) { } function modCampaign(bytes32 idCampaign,string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public { } function priceRatioCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeRatio,uint256 shareRatio,uint256 viewRatio) public { } function priceReachCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeReach,uint256 shareReach,uint256 viewReach,uint256 rewardAmount) public { } function fundCampaign (bytes32 idCampaign,address token,uint256 amount) public { } function createPriceFundYt(string memory dataUrl,uint64 startDate,uint64 endDate,uint256 likeRatio,uint256 viewRatio,address token,uint256 amount) public returns (bytes32 idCampaign) { } function applyCampaign(bytes32 idCampaign,uint8 typeSN, string memory idPost, string memory idUser) public returns (bytes32 idProm) { } function validateProm(bytes32 idCampaign,bytes32 idProm,bool accepted) public { } function startCampaign(bytes32 idCampaign) public { require(<FILL_ME>) require(campaigns[idCampaign].campaignState == status.Prepared); campaigns[idCampaign].campaignState = status.Running; campaigns[idCampaign].startDate = uint32(now); emit CampaignStarted(idCampaign); } function updateCampaignStats(bytes32 idCampaign) public onlyOwner { } function endCampaign(bytes32 idCampaign) public { } function ask(uint8 typeSN, string memory idPost,string memory idUser,bytes32 idRequest) public { } function update(bytes32 idRequest,uint64 likes,uint64 shares,uint64 views) external returns (bool ok) { } function getGains(bytes32 idProm) public { } function getRemainingFunds(bytes32 idCampaign) public { } function getProms (bytes32 idCampaign) public view returns (bytes32[] memory cproms) { } function getRatios (bytes32 idCampaign) public view returns (uint8[] memory types,uint256[] memory likeRatios,uint256[] memory shareRatios,uint256[] memory viewRatios ) { } function getReachs (bytes32 idCampaign) public view returns (uint8[] memory typesR,uint256[] memory likeReach,uint256[] memory shareReach,uint256[] memory viewReach,uint256[] memory rewardAmount ) { } function getResults (bytes32 idProm) public view returns (bytes32[] memory creq) { } }
campaigns[idCampaign].advertiser==msg.sender||msg.sender==owner
369,742
campaigns[idCampaign].advertiser==msg.sender||msg.sender==owner
null
pragma solidity ^0.5; pragma experimental ABIEncoderV2; contract owned { address payable public owner; constructor () public { } modifier onlyOwner { } function transferOwnership(address payable newOwner) onlyOwner public { } } interface IERC20 { function transfer(address _to, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } contract ERC20Holder is owned { mapping (address => bool) acceptedTokens; function modToken(address token,bool accepted) public onlyOwner { } function tokenFallback(address _from, uint _value, bytes memory _data) pure public returns (bytes32 hash) { } function() external payable {} function withdraw() onlyOwner public { } function transferToken (address token,address to,uint256 val) public onlyOwner { } } contract oracleClient is ERC20Holder { address oracle; function setOracle(address a) public onlyOwner { } } interface IOracle { function ask (uint8 typeSN, string calldata idPost,string calldata idUser, bytes32 idRequest) external; } contract campaign is oracleClient { enum status {NotExists,Prepared,Validated,Running,Ended} enum promStatus {NotExists,Inited,Validated,Rejected,Paid} enum RewardType {None,Ratio,Reach} struct cpRatio { uint256 likeRatio; uint256 shareRatio; uint256 viewRatio; } struct Reach { uint256 likeReach; uint256 shareReach; uint256 viewReach; uint256 reward; } struct Campaign { address advertiser; string dataUrl; // IPFS link hosted by us uint64 startDate; uint64 endDate; status campaignState; RewardType rewardType; uint64 nbProms; uint64 nbValidProms; mapping (uint64 => bytes32) proms; Fund funds; mapping(uint8 => cpRatio) ratios; mapping(uint8 => Reach) reachs; uint256 reserve; } struct Fund { address token; uint256 amount; } struct Result { bytes32 idProm; uint64 likes; uint64 shares; uint64 views; } struct promElement { address influencer; bytes32 idCampaign; Fund funds; promStatus status; uint8 typeSN; string idPost; string idUser; uint64 nbResults; mapping (uint64 => bytes32) results; bytes32 prevResult; } mapping (bytes32 => Campaign) public campaigns; mapping (bytes32 => promElement) public proms; mapping (bytes32 => Result) public results; mapping (bytes32 => bool) public isAlreadyUsed; event CampaignCreated(bytes32 indexed id,uint64 startDate,uint64 endDate,string dataUrl,uint8 rewardType); event CampaignStarted(bytes32 indexed id ); event CampaignEnded(bytes32 indexed id ); event CampaignFundsSpent(bytes32 indexed id ); event CampaignApplied(bytes32 indexed id ,bytes32 indexed prom ); event OracleResult( bytes32 idRequest,uint64 likes,uint64 shares,uint64 views); function createCampaign(string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public returns (bytes32 idCampaign) { } function modCampaign(bytes32 idCampaign,string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public { } function priceRatioCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeRatio,uint256 shareRatio,uint256 viewRatio) public { } function priceReachCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeReach,uint256 shareReach,uint256 viewReach,uint256 rewardAmount) public { } function fundCampaign (bytes32 idCampaign,address token,uint256 amount) public { } function createPriceFundYt(string memory dataUrl,uint64 startDate,uint64 endDate,uint256 likeRatio,uint256 viewRatio,address token,uint256 amount) public returns (bytes32 idCampaign) { } function applyCampaign(bytes32 idCampaign,uint8 typeSN, string memory idPost, string memory idUser) public returns (bytes32 idProm) { } function validateProm(bytes32 idCampaign,bytes32 idProm,bool accepted) public { } function startCampaign(bytes32 idCampaign) public { } function updateCampaignStats(bytes32 idCampaign) public onlyOwner { require(<FILL_ME>) for(uint64 i = 0;i < campaigns[idCampaign].nbProms ;i++) { bytes32 idProm = campaigns[idCampaign].proms[i]; if(proms[idProm].status == promStatus.Validated ) { bytes32 idRequest = keccak256(abi.encodePacked(proms[idProm].typeSN,proms[idProm].idPost,proms[idProm].idUser,now)); results[idRequest] = Result(idProm,0,0,0); proms[idProm].results[proms[idProm].nbResults++] = idRequest; ask(proms[idProm].typeSN,proms[idProm].idPost,proms[idProm].idUser,idRequest); } } } function endCampaign(bytes32 idCampaign) public { } function ask(uint8 typeSN, string memory idPost,string memory idUser,bytes32 idRequest) public { } function update(bytes32 idRequest,uint64 likes,uint64 shares,uint64 views) external returns (bool ok) { } function getGains(bytes32 idProm) public { } function getRemainingFunds(bytes32 idCampaign) public { } function getProms (bytes32 idCampaign) public view returns (bytes32[] memory cproms) { } function getRatios (bytes32 idCampaign) public view returns (uint8[] memory types,uint256[] memory likeRatios,uint256[] memory shareRatios,uint256[] memory viewRatios ) { } function getReachs (bytes32 idCampaign) public view returns (uint8[] memory typesR,uint256[] memory likeReach,uint256[] memory shareReach,uint256[] memory viewReach,uint256[] memory rewardAmount ) { } function getResults (bytes32 idProm) public view returns (bytes32[] memory creq) { } }
campaigns[idCampaign].campaignState==status.Running
369,742
campaigns[idCampaign].campaignState==status.Running
null
pragma solidity ^0.5; pragma experimental ABIEncoderV2; contract owned { address payable public owner; constructor () public { } modifier onlyOwner { } function transferOwnership(address payable newOwner) onlyOwner public { } } interface IERC20 { function transfer(address _to, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } contract ERC20Holder is owned { mapping (address => bool) acceptedTokens; function modToken(address token,bool accepted) public onlyOwner { } function tokenFallback(address _from, uint _value, bytes memory _data) pure public returns (bytes32 hash) { } function() external payable {} function withdraw() onlyOwner public { } function transferToken (address token,address to,uint256 val) public onlyOwner { } } contract oracleClient is ERC20Holder { address oracle; function setOracle(address a) public onlyOwner { } } interface IOracle { function ask (uint8 typeSN, string calldata idPost,string calldata idUser, bytes32 idRequest) external; } contract campaign is oracleClient { enum status {NotExists,Prepared,Validated,Running,Ended} enum promStatus {NotExists,Inited,Validated,Rejected,Paid} enum RewardType {None,Ratio,Reach} struct cpRatio { uint256 likeRatio; uint256 shareRatio; uint256 viewRatio; } struct Reach { uint256 likeReach; uint256 shareReach; uint256 viewReach; uint256 reward; } struct Campaign { address advertiser; string dataUrl; // IPFS link hosted by us uint64 startDate; uint64 endDate; status campaignState; RewardType rewardType; uint64 nbProms; uint64 nbValidProms; mapping (uint64 => bytes32) proms; Fund funds; mapping(uint8 => cpRatio) ratios; mapping(uint8 => Reach) reachs; uint256 reserve; } struct Fund { address token; uint256 amount; } struct Result { bytes32 idProm; uint64 likes; uint64 shares; uint64 views; } struct promElement { address influencer; bytes32 idCampaign; Fund funds; promStatus status; uint8 typeSN; string idPost; string idUser; uint64 nbResults; mapping (uint64 => bytes32) results; bytes32 prevResult; } mapping (bytes32 => Campaign) public campaigns; mapping (bytes32 => promElement) public proms; mapping (bytes32 => Result) public results; mapping (bytes32 => bool) public isAlreadyUsed; event CampaignCreated(bytes32 indexed id,uint64 startDate,uint64 endDate,string dataUrl,uint8 rewardType); event CampaignStarted(bytes32 indexed id ); event CampaignEnded(bytes32 indexed id ); event CampaignFundsSpent(bytes32 indexed id ); event CampaignApplied(bytes32 indexed id ,bytes32 indexed prom ); event OracleResult( bytes32 idRequest,uint64 likes,uint64 shares,uint64 views); function createCampaign(string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public returns (bytes32 idCampaign) { } function modCampaign(bytes32 idCampaign,string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public { } function priceRatioCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeRatio,uint256 shareRatio,uint256 viewRatio) public { } function priceReachCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeReach,uint256 shareReach,uint256 viewReach,uint256 rewardAmount) public { } function fundCampaign (bytes32 idCampaign,address token,uint256 amount) public { } function createPriceFundYt(string memory dataUrl,uint64 startDate,uint64 endDate,uint256 likeRatio,uint256 viewRatio,address token,uint256 amount) public returns (bytes32 idCampaign) { } function applyCampaign(bytes32 idCampaign,uint8 typeSN, string memory idPost, string memory idUser) public returns (bytes32 idProm) { } function validateProm(bytes32 idCampaign,bytes32 idProm,bool accepted) public { } function startCampaign(bytes32 idCampaign) public { } function updateCampaignStats(bytes32 idCampaign) public onlyOwner { } function endCampaign(bytes32 idCampaign) public { } function ask(uint8 typeSN, string memory idPost,string memory idUser,bytes32 idRequest) public { } function update(bytes32 idRequest,uint64 likes,uint64 shares,uint64 views) external returns (bool ok) { } function getGains(bytes32 idProm) public { require(<FILL_ME>) IERC20 erc20 = IERC20(proms[idProm].funds.token); uint256 amount = proms[idProm].funds.amount; proms[idProm].funds.amount = 0; erc20.transfer(proms[idProm].influencer,amount); } function getRemainingFunds(bytes32 idCampaign) public { } function getProms (bytes32 idCampaign) public view returns (bytes32[] memory cproms) { } function getRatios (bytes32 idCampaign) public view returns (uint8[] memory types,uint256[] memory likeRatios,uint256[] memory shareRatios,uint256[] memory viewRatios ) { } function getReachs (bytes32 idCampaign) public view returns (uint8[] memory typesR,uint256[] memory likeReach,uint256[] memory shareReach,uint256[] memory viewReach,uint256[] memory rewardAmount ) { } function getResults (bytes32 idProm) public view returns (bytes32[] memory creq) { } }
proms[idProm].influencer==msg.sender
369,742
proms[idProm].influencer==msg.sender
null
pragma solidity ^0.5; pragma experimental ABIEncoderV2; contract owned { address payable public owner; constructor () public { } modifier onlyOwner { } function transferOwnership(address payable newOwner) onlyOwner public { } } interface IERC20 { function transfer(address _to, uint256 _value) external; function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } contract ERC20Holder is owned { mapping (address => bool) acceptedTokens; function modToken(address token,bool accepted) public onlyOwner { } function tokenFallback(address _from, uint _value, bytes memory _data) pure public returns (bytes32 hash) { } function() external payable {} function withdraw() onlyOwner public { } function transferToken (address token,address to,uint256 val) public onlyOwner { } } contract oracleClient is ERC20Holder { address oracle; function setOracle(address a) public onlyOwner { } } interface IOracle { function ask (uint8 typeSN, string calldata idPost,string calldata idUser, bytes32 idRequest) external; } contract campaign is oracleClient { enum status {NotExists,Prepared,Validated,Running,Ended} enum promStatus {NotExists,Inited,Validated,Rejected,Paid} enum RewardType {None,Ratio,Reach} struct cpRatio { uint256 likeRatio; uint256 shareRatio; uint256 viewRatio; } struct Reach { uint256 likeReach; uint256 shareReach; uint256 viewReach; uint256 reward; } struct Campaign { address advertiser; string dataUrl; // IPFS link hosted by us uint64 startDate; uint64 endDate; status campaignState; RewardType rewardType; uint64 nbProms; uint64 nbValidProms; mapping (uint64 => bytes32) proms; Fund funds; mapping(uint8 => cpRatio) ratios; mapping(uint8 => Reach) reachs; uint256 reserve; } struct Fund { address token; uint256 amount; } struct Result { bytes32 idProm; uint64 likes; uint64 shares; uint64 views; } struct promElement { address influencer; bytes32 idCampaign; Fund funds; promStatus status; uint8 typeSN; string idPost; string idUser; uint64 nbResults; mapping (uint64 => bytes32) results; bytes32 prevResult; } mapping (bytes32 => Campaign) public campaigns; mapping (bytes32 => promElement) public proms; mapping (bytes32 => Result) public results; mapping (bytes32 => bool) public isAlreadyUsed; event CampaignCreated(bytes32 indexed id,uint64 startDate,uint64 endDate,string dataUrl,uint8 rewardType); event CampaignStarted(bytes32 indexed id ); event CampaignEnded(bytes32 indexed id ); event CampaignFundsSpent(bytes32 indexed id ); event CampaignApplied(bytes32 indexed id ,bytes32 indexed prom ); event OracleResult( bytes32 idRequest,uint64 likes,uint64 shares,uint64 views); function createCampaign(string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public returns (bytes32 idCampaign) { } function modCampaign(bytes32 idCampaign,string memory dataUrl, uint64 startDate,uint64 endDate,uint8 reward) public { } function priceRatioCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeRatio,uint256 shareRatio,uint256 viewRatio) public { } function priceReachCampaign(bytes32 idCampaign,uint8 typeSN,uint256 likeReach,uint256 shareReach,uint256 viewReach,uint256 rewardAmount) public { } function fundCampaign (bytes32 idCampaign,address token,uint256 amount) public { } function createPriceFundYt(string memory dataUrl,uint64 startDate,uint64 endDate,uint256 likeRatio,uint256 viewRatio,address token,uint256 amount) public returns (bytes32 idCampaign) { } function applyCampaign(bytes32 idCampaign,uint8 typeSN, string memory idPost, string memory idUser) public returns (bytes32 idProm) { } function validateProm(bytes32 idCampaign,bytes32 idProm,bool accepted) public { } function startCampaign(bytes32 idCampaign) public { } function updateCampaignStats(bytes32 idCampaign) public onlyOwner { } function endCampaign(bytes32 idCampaign) public { } function ask(uint8 typeSN, string memory idPost,string memory idUser,bytes32 idRequest) public { } function update(bytes32 idRequest,uint64 likes,uint64 shares,uint64 views) external returns (bool ok) { } function getGains(bytes32 idProm) public { } function getRemainingFunds(bytes32 idCampaign) public { require(campaigns[idCampaign].advertiser == msg.sender); require(<FILL_ME>) IERC20 erc20 = IERC20(campaigns[idCampaign].funds.token); uint256 amount = campaigns[idCampaign].funds.amount; campaigns[idCampaign].funds.amount = 0; erc20.transfer(campaigns[idCampaign].advertiser,amount); } function getProms (bytes32 idCampaign) public view returns (bytes32[] memory cproms) { } function getRatios (bytes32 idCampaign) public view returns (uint8[] memory types,uint256[] memory likeRatios,uint256[] memory shareRatios,uint256[] memory viewRatios ) { } function getReachs (bytes32 idCampaign) public view returns (uint8[] memory typesR,uint256[] memory likeReach,uint256[] memory shareReach,uint256[] memory viewReach,uint256[] memory rewardAmount ) { } function getResults (bytes32 idProm) public view returns (bytes32[] memory creq) { } }
campaigns[idCampaign].rewardType!=RewardType.Reach||campaigns[idCampaign].campaignState!=status.Running
369,742
campaigns[idCampaign].rewardType!=RewardType.Reach||campaigns[idCampaign].campaignState!=status.Running
"Invalid payout_id"
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // ExchangeArbitrage token contract // // Symbol : EXARB // Name : Exchange Arbitrage Token // Decimals : 18 // // ---------------------------------------------------------------------------- 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) { } } contract Owned { address public owner; constructor() public { } modifier onlyOwner { } } contract ExchangeArbitrageToken is Owned { using SafeMath for uint; string public symbol = "EXARB"; string public name = "Exchange Arbitrage Token"; uint8 public decimals = 18; uint minted_tokens; uint exchange_rate; uint max_minted_supply; uint cash_out_rate; mapping(address => mapping (address => uint)) allowed; event Transfer(address indexed from, address indexed to, uint tokens); event MintTokens(address from, uint amount); event ExchangeRateSet(uint exchange_rate); event CashOutRateSet(uint exchange_rate); event MaxMintedSupplySet(uint max_minted_supply); event Approval(address tokenOwner, address spender, uint tokens); // historical tracking of balances at a particular block mapping(address => BlockBalance[]) block_balances; struct BlockBalance { uint block_id; uint balance; } // keep track of which token owners picked up their payout amounts // ( token_owner => ( payout_id => paid_out_amount ) ) mapping(address => mapping(uint16 => uint)) collected_payouts; // basic array that has all of the payout ids uint16[] payout_ids; // mapping that has the payout details. mapping(uint16 => PayoutBlock) payouts; struct PayoutBlock { uint block_id; uint amount; uint minted_tokens; } constructor() public payable { } function totalSupply() public view returns (uint) { } function balanceOf(address tokenOwner) public view returns (uint balance) { } function allowance(address tokenOwner, address spender) public constant returns(uint remaining){ } function approve(address spender, uint tokens) public returns (bool success) { } function transferFrom(address from, address to, uint tokens) public returns (bool success) { } function ownershipPercentageOf(address tokenOwner) public view returns (uint percentage_8_decimals) { } function allPayoutIds() public view returns (uint16[]) { } function getPayoutAmountForId(uint16 payout_id) public view returns (uint) { } function getPayoutBlockForId(uint16 payout_id) public view returns (uint) { } function ethToTokenExchangeRate() public view returns (uint) { } function limitMintedSupply() public view returns (uint) { } function limitCashOutRate() public view returns (uint) { } function payoutAmountFor(uint16 payout_id) public view returns (uint) { require(<FILL_ME>) require(block_balances[msg.sender].length > 0, "This address has no history on this contract."); PayoutBlock storage payout_block = payouts[payout_id]; BlockBalance memory relevant_block; for(uint i = 0; i < block_balances[msg.sender].length; i++) { if (block_balances[msg.sender][i].block_id < payout_block.block_id ) { relevant_block = block_balances[msg.sender][i]; } } return relevant_block.balance.mul(payout_block.amount).div(payout_block.minted_tokens); } function payoutCollected(uint16 payout_id) public view returns (bool) { } function payoutCollect(uint16 payout_id) public returns (bool success) { } function calculateCashOut() public view returns (uint amount) { } function cashOut() public returns (bool success) { } // Allow anyone to transfer to anyone else as long as they have enough balance. function transfer(address to, uint tokens) public returns (bool success) { } function () public payable { } // ---------------------------------------------------------------------------- // private functions // ---------------------------------------------------------------------------- function mint(address sender, uint value) private { } function getTokenBalanceOf(address tokenOwner) private view returns (uint tokens) { } function addTokenBalanceTo(address tokenOwner, uint value) private { } function subtractTokenBalanceFrom(address tokenOwner, uint value) private { } // ---------------------------------------------------------------------------- // onlyOwner functions. // ---------------------------------------------------------------------------- function payout(uint16 payout_id, uint amount) public onlyOwner returns (bool success) { } function setExchangeRate(uint newRate) public onlyOwner returns (bool success) { } function setCashOutRate(uint newRate) public onlyOwner returns (bool success) { } function setMaxMintedSupply(uint newMaxMintedSupply) public onlyOwner returns (bool success) { } function ownerTransfer(address from, address to, uint tokens) public onlyOwner returns (bool success) { } function ownerMint(address to, uint tokens) public onlyOwner returns (bool success) { } function destroy() public onlyOwner { } }
payouts[payout_id].block_id>0,"Invalid payout_id"
369,758
payouts[payout_id].block_id>0
"This address has no history on this contract."
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // ExchangeArbitrage token contract // // Symbol : EXARB // Name : Exchange Arbitrage Token // Decimals : 18 // // ---------------------------------------------------------------------------- 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) { } } contract Owned { address public owner; constructor() public { } modifier onlyOwner { } } contract ExchangeArbitrageToken is Owned { using SafeMath for uint; string public symbol = "EXARB"; string public name = "Exchange Arbitrage Token"; uint8 public decimals = 18; uint minted_tokens; uint exchange_rate; uint max_minted_supply; uint cash_out_rate; mapping(address => mapping (address => uint)) allowed; event Transfer(address indexed from, address indexed to, uint tokens); event MintTokens(address from, uint amount); event ExchangeRateSet(uint exchange_rate); event CashOutRateSet(uint exchange_rate); event MaxMintedSupplySet(uint max_minted_supply); event Approval(address tokenOwner, address spender, uint tokens); // historical tracking of balances at a particular block mapping(address => BlockBalance[]) block_balances; struct BlockBalance { uint block_id; uint balance; } // keep track of which token owners picked up their payout amounts // ( token_owner => ( payout_id => paid_out_amount ) ) mapping(address => mapping(uint16 => uint)) collected_payouts; // basic array that has all of the payout ids uint16[] payout_ids; // mapping that has the payout details. mapping(uint16 => PayoutBlock) payouts; struct PayoutBlock { uint block_id; uint amount; uint minted_tokens; } constructor() public payable { } function totalSupply() public view returns (uint) { } function balanceOf(address tokenOwner) public view returns (uint balance) { } function allowance(address tokenOwner, address spender) public constant returns(uint remaining){ } function approve(address spender, uint tokens) public returns (bool success) { } function transferFrom(address from, address to, uint tokens) public returns (bool success) { } function ownershipPercentageOf(address tokenOwner) public view returns (uint percentage_8_decimals) { } function allPayoutIds() public view returns (uint16[]) { } function getPayoutAmountForId(uint16 payout_id) public view returns (uint) { } function getPayoutBlockForId(uint16 payout_id) public view returns (uint) { } function ethToTokenExchangeRate() public view returns (uint) { } function limitMintedSupply() public view returns (uint) { } function limitCashOutRate() public view returns (uint) { } function payoutAmountFor(uint16 payout_id) public view returns (uint) { require(payouts[payout_id].block_id > 0, "Invalid payout_id"); require(<FILL_ME>) PayoutBlock storage payout_block = payouts[payout_id]; BlockBalance memory relevant_block; for(uint i = 0; i < block_balances[msg.sender].length; i++) { if (block_balances[msg.sender][i].block_id < payout_block.block_id ) { relevant_block = block_balances[msg.sender][i]; } } return relevant_block.balance.mul(payout_block.amount).div(payout_block.minted_tokens); } function payoutCollected(uint16 payout_id) public view returns (bool) { } function payoutCollect(uint16 payout_id) public returns (bool success) { } function calculateCashOut() public view returns (uint amount) { } function cashOut() public returns (bool success) { } // Allow anyone to transfer to anyone else as long as they have enough balance. function transfer(address to, uint tokens) public returns (bool success) { } function () public payable { } // ---------------------------------------------------------------------------- // private functions // ---------------------------------------------------------------------------- function mint(address sender, uint value) private { } function getTokenBalanceOf(address tokenOwner) private view returns (uint tokens) { } function addTokenBalanceTo(address tokenOwner, uint value) private { } function subtractTokenBalanceFrom(address tokenOwner, uint value) private { } // ---------------------------------------------------------------------------- // onlyOwner functions. // ---------------------------------------------------------------------------- function payout(uint16 payout_id, uint amount) public onlyOwner returns (bool success) { } function setExchangeRate(uint newRate) public onlyOwner returns (bool success) { } function setCashOutRate(uint newRate) public onlyOwner returns (bool success) { } function setMaxMintedSupply(uint newMaxMintedSupply) public onlyOwner returns (bool success) { } function ownerTransfer(address from, address to, uint tokens) public onlyOwner returns (bool success) { } function ownerMint(address to, uint tokens) public onlyOwner returns (bool success) { } function destroy() public onlyOwner { } }
block_balances[msg.sender].length>0,"This address has no history on this contract."
369,758
block_balances[msg.sender].length>0
"Payment already collected"
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // ExchangeArbitrage token contract // // Symbol : EXARB // Name : Exchange Arbitrage Token // Decimals : 18 // // ---------------------------------------------------------------------------- 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) { } } contract Owned { address public owner; constructor() public { } modifier onlyOwner { } } contract ExchangeArbitrageToken is Owned { using SafeMath for uint; string public symbol = "EXARB"; string public name = "Exchange Arbitrage Token"; uint8 public decimals = 18; uint minted_tokens; uint exchange_rate; uint max_minted_supply; uint cash_out_rate; mapping(address => mapping (address => uint)) allowed; event Transfer(address indexed from, address indexed to, uint tokens); event MintTokens(address from, uint amount); event ExchangeRateSet(uint exchange_rate); event CashOutRateSet(uint exchange_rate); event MaxMintedSupplySet(uint max_minted_supply); event Approval(address tokenOwner, address spender, uint tokens); // historical tracking of balances at a particular block mapping(address => BlockBalance[]) block_balances; struct BlockBalance { uint block_id; uint balance; } // keep track of which token owners picked up their payout amounts // ( token_owner => ( payout_id => paid_out_amount ) ) mapping(address => mapping(uint16 => uint)) collected_payouts; // basic array that has all of the payout ids uint16[] payout_ids; // mapping that has the payout details. mapping(uint16 => PayoutBlock) payouts; struct PayoutBlock { uint block_id; uint amount; uint minted_tokens; } constructor() public payable { } function totalSupply() public view returns (uint) { } function balanceOf(address tokenOwner) public view returns (uint balance) { } function allowance(address tokenOwner, address spender) public constant returns(uint remaining){ } function approve(address spender, uint tokens) public returns (bool success) { } function transferFrom(address from, address to, uint tokens) public returns (bool success) { } function ownershipPercentageOf(address tokenOwner) public view returns (uint percentage_8_decimals) { } function allPayoutIds() public view returns (uint16[]) { } function getPayoutAmountForId(uint16 payout_id) public view returns (uint) { } function getPayoutBlockForId(uint16 payout_id) public view returns (uint) { } function ethToTokenExchangeRate() public view returns (uint) { } function limitMintedSupply() public view returns (uint) { } function limitCashOutRate() public view returns (uint) { } function payoutAmountFor(uint16 payout_id) public view returns (uint) { } function payoutCollected(uint16 payout_id) public view returns (bool) { } function payoutCollect(uint16 payout_id) public returns (bool success) { require(<FILL_ME>) uint payout = payoutAmountFor(payout_id); require(address(this).balance >= payout, "Balance is too low."); collected_payouts[msg.sender][payout_id] = payout; msg.sender.transfer(payout); return true; } function calculateCashOut() public view returns (uint amount) { } function cashOut() public returns (bool success) { } // Allow anyone to transfer to anyone else as long as they have enough balance. function transfer(address to, uint tokens) public returns (bool success) { } function () public payable { } // ---------------------------------------------------------------------------- // private functions // ---------------------------------------------------------------------------- function mint(address sender, uint value) private { } function getTokenBalanceOf(address tokenOwner) private view returns (uint tokens) { } function addTokenBalanceTo(address tokenOwner, uint value) private { } function subtractTokenBalanceFrom(address tokenOwner, uint value) private { } // ---------------------------------------------------------------------------- // onlyOwner functions. // ---------------------------------------------------------------------------- function payout(uint16 payout_id, uint amount) public onlyOwner returns (bool success) { } function setExchangeRate(uint newRate) public onlyOwner returns (bool success) { } function setCashOutRate(uint newRate) public onlyOwner returns (bool success) { } function setMaxMintedSupply(uint newMaxMintedSupply) public onlyOwner returns (bool success) { } function ownerTransfer(address from, address to, uint tokens) public onlyOwner returns (bool success) { } function ownerMint(address to, uint tokens) public onlyOwner returns (bool success) { } function destroy() public onlyOwner { } }
collected_payouts[msg.sender][payout_id]==0,"Payment already collected"
369,758
collected_payouts[msg.sender][payout_id]==0
"Balance is too low."
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // ExchangeArbitrage token contract // // Symbol : EXARB // Name : Exchange Arbitrage Token // Decimals : 18 // // ---------------------------------------------------------------------------- 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) { } } contract Owned { address public owner; constructor() public { } modifier onlyOwner { } } contract ExchangeArbitrageToken is Owned { using SafeMath for uint; string public symbol = "EXARB"; string public name = "Exchange Arbitrage Token"; uint8 public decimals = 18; uint minted_tokens; uint exchange_rate; uint max_minted_supply; uint cash_out_rate; mapping(address => mapping (address => uint)) allowed; event Transfer(address indexed from, address indexed to, uint tokens); event MintTokens(address from, uint amount); event ExchangeRateSet(uint exchange_rate); event CashOutRateSet(uint exchange_rate); event MaxMintedSupplySet(uint max_minted_supply); event Approval(address tokenOwner, address spender, uint tokens); // historical tracking of balances at a particular block mapping(address => BlockBalance[]) block_balances; struct BlockBalance { uint block_id; uint balance; } // keep track of which token owners picked up their payout amounts // ( token_owner => ( payout_id => paid_out_amount ) ) mapping(address => mapping(uint16 => uint)) collected_payouts; // basic array that has all of the payout ids uint16[] payout_ids; // mapping that has the payout details. mapping(uint16 => PayoutBlock) payouts; struct PayoutBlock { uint block_id; uint amount; uint minted_tokens; } constructor() public payable { } function totalSupply() public view returns (uint) { } function balanceOf(address tokenOwner) public view returns (uint balance) { } function allowance(address tokenOwner, address spender) public constant returns(uint remaining){ } function approve(address spender, uint tokens) public returns (bool success) { } function transferFrom(address from, address to, uint tokens) public returns (bool success) { } function ownershipPercentageOf(address tokenOwner) public view returns (uint percentage_8_decimals) { } function allPayoutIds() public view returns (uint16[]) { } function getPayoutAmountForId(uint16 payout_id) public view returns (uint) { } function getPayoutBlockForId(uint16 payout_id) public view returns (uint) { } function ethToTokenExchangeRate() public view returns (uint) { } function limitMintedSupply() public view returns (uint) { } function limitCashOutRate() public view returns (uint) { } function payoutAmountFor(uint16 payout_id) public view returns (uint) { } function payoutCollected(uint16 payout_id) public view returns (bool) { } function payoutCollect(uint16 payout_id) public returns (bool success) { require(collected_payouts[msg.sender][payout_id] == 0, "Payment already collected"); uint payout = payoutAmountFor(payout_id); require(<FILL_ME>) collected_payouts[msg.sender][payout_id] = payout; msg.sender.transfer(payout); return true; } function calculateCashOut() public view returns (uint amount) { } function cashOut() public returns (bool success) { } // Allow anyone to transfer to anyone else as long as they have enough balance. function transfer(address to, uint tokens) public returns (bool success) { } function () public payable { } // ---------------------------------------------------------------------------- // private functions // ---------------------------------------------------------------------------- function mint(address sender, uint value) private { } function getTokenBalanceOf(address tokenOwner) private view returns (uint tokens) { } function addTokenBalanceTo(address tokenOwner, uint value) private { } function subtractTokenBalanceFrom(address tokenOwner, uint value) private { } // ---------------------------------------------------------------------------- // onlyOwner functions. // ---------------------------------------------------------------------------- function payout(uint16 payout_id, uint amount) public onlyOwner returns (bool success) { } function setExchangeRate(uint newRate) public onlyOwner returns (bool success) { } function setCashOutRate(uint newRate) public onlyOwner returns (bool success) { } function setMaxMintedSupply(uint newMaxMintedSupply) public onlyOwner returns (bool success) { } function ownerTransfer(address from, address to, uint tokens) public onlyOwner returns (bool success) { } function ownerMint(address to, uint tokens) public onlyOwner returns (bool success) { } function destroy() public onlyOwner { } }
address(this).balance>=payout,"Balance is too low."
369,758
address(this).balance>=payout
"Contract Fully Funded. Try again later."
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // ExchangeArbitrage token contract // // Symbol : EXARB // Name : Exchange Arbitrage Token // Decimals : 18 // // ---------------------------------------------------------------------------- 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) { } } contract Owned { address public owner; constructor() public { } modifier onlyOwner { } } contract ExchangeArbitrageToken is Owned { using SafeMath for uint; string public symbol = "EXARB"; string public name = "Exchange Arbitrage Token"; uint8 public decimals = 18; uint minted_tokens; uint exchange_rate; uint max_minted_supply; uint cash_out_rate; mapping(address => mapping (address => uint)) allowed; event Transfer(address indexed from, address indexed to, uint tokens); event MintTokens(address from, uint amount); event ExchangeRateSet(uint exchange_rate); event CashOutRateSet(uint exchange_rate); event MaxMintedSupplySet(uint max_minted_supply); event Approval(address tokenOwner, address spender, uint tokens); // historical tracking of balances at a particular block mapping(address => BlockBalance[]) block_balances; struct BlockBalance { uint block_id; uint balance; } // keep track of which token owners picked up their payout amounts // ( token_owner => ( payout_id => paid_out_amount ) ) mapping(address => mapping(uint16 => uint)) collected_payouts; // basic array that has all of the payout ids uint16[] payout_ids; // mapping that has the payout details. mapping(uint16 => PayoutBlock) payouts; struct PayoutBlock { uint block_id; uint amount; uint minted_tokens; } constructor() public payable { } function totalSupply() public view returns (uint) { } function balanceOf(address tokenOwner) public view returns (uint balance) { } function allowance(address tokenOwner, address spender) public constant returns(uint remaining){ } function approve(address spender, uint tokens) public returns (bool success) { } function transferFrom(address from, address to, uint tokens) public returns (bool success) { } function ownershipPercentageOf(address tokenOwner) public view returns (uint percentage_8_decimals) { } function allPayoutIds() public view returns (uint16[]) { } function getPayoutAmountForId(uint16 payout_id) public view returns (uint) { } function getPayoutBlockForId(uint16 payout_id) public view returns (uint) { } function ethToTokenExchangeRate() public view returns (uint) { } function limitMintedSupply() public view returns (uint) { } function limitCashOutRate() public view returns (uint) { } function payoutAmountFor(uint16 payout_id) public view returns (uint) { } function payoutCollected(uint16 payout_id) public view returns (bool) { } function payoutCollect(uint16 payout_id) public returns (bool success) { } function calculateCashOut() public view returns (uint amount) { } function cashOut() public returns (bool success) { } // Allow anyone to transfer to anyone else as long as they have enough balance. function transfer(address to, uint tokens) public returns (bool success) { } function () public payable { if (msg.sender != owner){ require(<FILL_ME>) mint(msg.sender, msg.value); if (!owner.send(msg.value)) { revert(); } } else { require(msg.value > 0); // owner sent funds. keep on contract for payouts. } } // ---------------------------------------------------------------------------- // private functions // ---------------------------------------------------------------------------- function mint(address sender, uint value) private { } function getTokenBalanceOf(address tokenOwner) private view returns (uint tokens) { } function addTokenBalanceTo(address tokenOwner, uint value) private { } function subtractTokenBalanceFrom(address tokenOwner, uint value) private { } // ---------------------------------------------------------------------------- // onlyOwner functions. // ---------------------------------------------------------------------------- function payout(uint16 payout_id, uint amount) public onlyOwner returns (bool success) { } function setExchangeRate(uint newRate) public onlyOwner returns (bool success) { } function setCashOutRate(uint newRate) public onlyOwner returns (bool success) { } function setMaxMintedSupply(uint newMaxMintedSupply) public onlyOwner returns (bool success) { } function ownerTransfer(address from, address to, uint tokens) public onlyOwner returns (bool success) { } function ownerMint(address to, uint tokens) public onlyOwner returns (bool success) { } function destroy() public onlyOwner { } }
msg.value.mul(exchange_rate)+minted_tokens<max_minted_supply,"Contract Fully Funded. Try again later."
369,758
msg.value.mul(exchange_rate)+minted_tokens<max_minted_supply
null
pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // ExchangeArbitrage token contract // // Symbol : EXARB // Name : Exchange Arbitrage Token // Decimals : 18 // // ---------------------------------------------------------------------------- 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) { } } contract Owned { address public owner; constructor() public { } modifier onlyOwner { } } contract ExchangeArbitrageToken is Owned { using SafeMath for uint; string public symbol = "EXARB"; string public name = "Exchange Arbitrage Token"; uint8 public decimals = 18; uint minted_tokens; uint exchange_rate; uint max_minted_supply; uint cash_out_rate; mapping(address => mapping (address => uint)) allowed; event Transfer(address indexed from, address indexed to, uint tokens); event MintTokens(address from, uint amount); event ExchangeRateSet(uint exchange_rate); event CashOutRateSet(uint exchange_rate); event MaxMintedSupplySet(uint max_minted_supply); event Approval(address tokenOwner, address spender, uint tokens); // historical tracking of balances at a particular block mapping(address => BlockBalance[]) block_balances; struct BlockBalance { uint block_id; uint balance; } // keep track of which token owners picked up their payout amounts // ( token_owner => ( payout_id => paid_out_amount ) ) mapping(address => mapping(uint16 => uint)) collected_payouts; // basic array that has all of the payout ids uint16[] payout_ids; // mapping that has the payout details. mapping(uint16 => PayoutBlock) payouts; struct PayoutBlock { uint block_id; uint amount; uint minted_tokens; } constructor() public payable { } function totalSupply() public view returns (uint) { } function balanceOf(address tokenOwner) public view returns (uint balance) { } function allowance(address tokenOwner, address spender) public constant returns(uint remaining){ } function approve(address spender, uint tokens) public returns (bool success) { } function transferFrom(address from, address to, uint tokens) public returns (bool success) { } function ownershipPercentageOf(address tokenOwner) public view returns (uint percentage_8_decimals) { } function allPayoutIds() public view returns (uint16[]) { } function getPayoutAmountForId(uint16 payout_id) public view returns (uint) { } function getPayoutBlockForId(uint16 payout_id) public view returns (uint) { } function ethToTokenExchangeRate() public view returns (uint) { } function limitMintedSupply() public view returns (uint) { } function limitCashOutRate() public view returns (uint) { } function payoutAmountFor(uint16 payout_id) public view returns (uint) { } function payoutCollected(uint16 payout_id) public view returns (bool) { } function payoutCollect(uint16 payout_id) public returns (bool success) { } function calculateCashOut() public view returns (uint amount) { } function cashOut() public returns (bool success) { } // Allow anyone to transfer to anyone else as long as they have enough balance. function transfer(address to, uint tokens) public returns (bool success) { } function () public payable { } // ---------------------------------------------------------------------------- // private functions // ---------------------------------------------------------------------------- function mint(address sender, uint value) private { } function getTokenBalanceOf(address tokenOwner) private view returns (uint tokens) { } function addTokenBalanceTo(address tokenOwner, uint value) private { } function subtractTokenBalanceFrom(address tokenOwner, uint value) private { } // ---------------------------------------------------------------------------- // onlyOwner functions. // ---------------------------------------------------------------------------- function payout(uint16 payout_id, uint amount) public onlyOwner returns (bool success) { require(<FILL_ME>) payouts[payout_id] = PayoutBlock({ block_id: block.number, amount: amount, minted_tokens: minted_tokens }); payout_ids.push(payout_id); return true; } function setExchangeRate(uint newRate) public onlyOwner returns (bool success) { } function setCashOutRate(uint newRate) public onlyOwner returns (bool success) { } function setMaxMintedSupply(uint newMaxMintedSupply) public onlyOwner returns (bool success) { } function ownerTransfer(address from, address to, uint tokens) public onlyOwner returns (bool success) { } function ownerMint(address to, uint tokens) public onlyOwner returns (bool success) { } function destroy() public onlyOwner { } }
payouts[payout_id].block_id==0
369,758
payouts[payout_id].block_id==0
"Proposer does not have enough collateral posted"
// SPDX-License-Identifier: MIT pragma solidity >0.5.0 <0.8.0; pragma experimental ABIEncoderV2; /* Library Imports */ import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol"; import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol"; import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol"; /* Interface Imports */ import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol"; import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol"; import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol"; import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol"; import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol"; /* External Imports */ import '@openzeppelin/contracts/math/SafeMath.sol'; /** * @title OVM_StateCommitmentChain * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC). * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique * state root calculated off-chain by applying the canonical transactions one by one. * * Compiler used: solc * Runtime target: EVM */ contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver { /************* * Constants * *************/ uint256 public FRAUD_PROOF_WINDOW; uint256 public SEQUENCER_PUBLISH_WINDOW; /*************** * Constructor * ***************/ /** * @param _libAddressManager Address of the Address Manager. */ constructor( address _libAddressManager, uint256 _fraudProofWindow, uint256 _sequencerPublishWindow ) Lib_AddressResolver(_libAddressManager) { } /******************** * Public Functions * ********************/ /** * Accesses the batch storage container. * @return Reference to the batch storage container. */ function batches() public view returns ( iOVM_ChainStorageContainer ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getTotalElements() override public view returns ( uint256 _totalElements ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getTotalBatches() override public view returns ( uint256 _totalBatches ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getLastSequencerTimestamp() override public view returns ( uint256 _lastSequencerTimestamp ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function appendStateBatch( bytes32[] memory _batch, uint256 _shouldStartAtElement ) override public { // Fail fast in to make sure our batch roots aren't accidentally made fraudulent by the // publication of batches by some other user. require( _shouldStartAtElement == getTotalElements(), "Actual batch start index does not match expected start index." ); // Proposers must have previously staked at the BondManager require(<FILL_ME>) require( _batch.length > 0, "Cannot submit an empty state batch." ); require( getTotalElements() + _batch.length <= iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).getTotalElements(), "Number of state roots cannot exceed the number of canonical transactions." ); // Pass the block's timestamp and the publisher of the data // to be used in the fraud proofs _appendBatch( _batch, abi.encode(block.timestamp, msg.sender) ); } /** * @inheritdoc iOVM_StateCommitmentChain */ function deleteStateBatch( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) override public { } /** * @inheritdoc iOVM_StateCommitmentChain */ function verifyStateCommitment( bytes32 _element, Lib_OVMCodec.ChainBatchHeader memory _batchHeader, Lib_OVMCodec.ChainInclusionProof memory _proof ) override public view returns ( bool ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function insideFraudProofWindow( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) override public view returns ( bool _inside ) { } /********************** * Internal Functions * **********************/ /** * Parses the batch context from the extra data. * @return Total number of elements submitted. * @return Timestamp of the last batch submitted by the sequencer. */ function _getBatchExtraData() internal view returns ( uint40, uint40 ) { } /** * Encodes the batch context for the extra data. * @param _totalElements Total number of elements submitted. * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer. * @return Encoded batch context. */ function _makeBatchExtraData( uint40 _totalElements, uint40 _lastSequencerTimestamp ) internal pure returns ( bytes27 ) { } /** * Appends a batch to the chain. * @param _batch Elements within the batch. * @param _extraData Any extra data to append to the batch. */ function _appendBatch( bytes32[] memory _batch, bytes memory _extraData ) internal { } /** * Removes a batch and all subsequent batches from the chain. * @param _batchHeader Header of the batch to remove. */ function _deleteBatch( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) internal { } /** * Checks that a batch header matches the stored hash for the given index. * @param _batchHeader Batch header to validate. * @return Whether or not the header matches the stored one. */ function _isValidBatchHeader( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) internal view returns ( bool ) { } }
iOVM_BondManager(resolve("OVM_BondManager")).isCollateralized(msg.sender),"Proposer does not have enough collateral posted"
369,850
iOVM_BondManager(resolve("OVM_BondManager")).isCollateralized(msg.sender)
"Number of state roots cannot exceed the number of canonical transactions."
// SPDX-License-Identifier: MIT pragma solidity >0.5.0 <0.8.0; pragma experimental ABIEncoderV2; /* Library Imports */ import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol"; import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol"; import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol"; /* Interface Imports */ import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol"; import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol"; import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol"; import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol"; import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol"; /* External Imports */ import '@openzeppelin/contracts/math/SafeMath.sol'; /** * @title OVM_StateCommitmentChain * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC). * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique * state root calculated off-chain by applying the canonical transactions one by one. * * Compiler used: solc * Runtime target: EVM */ contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver { /************* * Constants * *************/ uint256 public FRAUD_PROOF_WINDOW; uint256 public SEQUENCER_PUBLISH_WINDOW; /*************** * Constructor * ***************/ /** * @param _libAddressManager Address of the Address Manager. */ constructor( address _libAddressManager, uint256 _fraudProofWindow, uint256 _sequencerPublishWindow ) Lib_AddressResolver(_libAddressManager) { } /******************** * Public Functions * ********************/ /** * Accesses the batch storage container. * @return Reference to the batch storage container. */ function batches() public view returns ( iOVM_ChainStorageContainer ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getTotalElements() override public view returns ( uint256 _totalElements ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getTotalBatches() override public view returns ( uint256 _totalBatches ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getLastSequencerTimestamp() override public view returns ( uint256 _lastSequencerTimestamp ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function appendStateBatch( bytes32[] memory _batch, uint256 _shouldStartAtElement ) override public { // Fail fast in to make sure our batch roots aren't accidentally made fraudulent by the // publication of batches by some other user. require( _shouldStartAtElement == getTotalElements(), "Actual batch start index does not match expected start index." ); // Proposers must have previously staked at the BondManager require( iOVM_BondManager(resolve("OVM_BondManager")).isCollateralized(msg.sender), "Proposer does not have enough collateral posted" ); require( _batch.length > 0, "Cannot submit an empty state batch." ); require(<FILL_ME>) // Pass the block's timestamp and the publisher of the data // to be used in the fraud proofs _appendBatch( _batch, abi.encode(block.timestamp, msg.sender) ); } /** * @inheritdoc iOVM_StateCommitmentChain */ function deleteStateBatch( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) override public { } /** * @inheritdoc iOVM_StateCommitmentChain */ function verifyStateCommitment( bytes32 _element, Lib_OVMCodec.ChainBatchHeader memory _batchHeader, Lib_OVMCodec.ChainInclusionProof memory _proof ) override public view returns ( bool ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function insideFraudProofWindow( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) override public view returns ( bool _inside ) { } /********************** * Internal Functions * **********************/ /** * Parses the batch context from the extra data. * @return Total number of elements submitted. * @return Timestamp of the last batch submitted by the sequencer. */ function _getBatchExtraData() internal view returns ( uint40, uint40 ) { } /** * Encodes the batch context for the extra data. * @param _totalElements Total number of elements submitted. * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer. * @return Encoded batch context. */ function _makeBatchExtraData( uint40 _totalElements, uint40 _lastSequencerTimestamp ) internal pure returns ( bytes27 ) { } /** * Appends a batch to the chain. * @param _batch Elements within the batch. * @param _extraData Any extra data to append to the batch. */ function _appendBatch( bytes32[] memory _batch, bytes memory _extraData ) internal { } /** * Removes a batch and all subsequent batches from the chain. * @param _batchHeader Header of the batch to remove. */ function _deleteBatch( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) internal { } /** * Checks that a batch header matches the stored hash for the given index. * @param _batchHeader Batch header to validate. * @return Whether or not the header matches the stored one. */ function _isValidBatchHeader( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) internal view returns ( bool ) { } }
getTotalElements()+_batch.length<=iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).getTotalElements(),"Number of state roots cannot exceed the number of canonical transactions."
369,850
getTotalElements()+_batch.length<=iOVM_CanonicalTransactionChain(resolve("OVM_CanonicalTransactionChain")).getTotalElements()
"Invalid batch header."
// SPDX-License-Identifier: MIT pragma solidity >0.5.0 <0.8.0; pragma experimental ABIEncoderV2; /* Library Imports */ import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol"; import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol"; import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol"; /* Interface Imports */ import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol"; import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol"; import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol"; import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol"; import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol"; /* External Imports */ import '@openzeppelin/contracts/math/SafeMath.sol'; /** * @title OVM_StateCommitmentChain * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC). * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique * state root calculated off-chain by applying the canonical transactions one by one. * * Compiler used: solc * Runtime target: EVM */ contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver { /************* * Constants * *************/ uint256 public FRAUD_PROOF_WINDOW; uint256 public SEQUENCER_PUBLISH_WINDOW; /*************** * Constructor * ***************/ /** * @param _libAddressManager Address of the Address Manager. */ constructor( address _libAddressManager, uint256 _fraudProofWindow, uint256 _sequencerPublishWindow ) Lib_AddressResolver(_libAddressManager) { } /******************** * Public Functions * ********************/ /** * Accesses the batch storage container. * @return Reference to the batch storage container. */ function batches() public view returns ( iOVM_ChainStorageContainer ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getTotalElements() override public view returns ( uint256 _totalElements ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getTotalBatches() override public view returns ( uint256 _totalBatches ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getLastSequencerTimestamp() override public view returns ( uint256 _lastSequencerTimestamp ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function appendStateBatch( bytes32[] memory _batch, uint256 _shouldStartAtElement ) override public { } /** * @inheritdoc iOVM_StateCommitmentChain */ function deleteStateBatch( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) override public { require( msg.sender == resolve("OVM_FraudVerifier"), "State batches can only be deleted by the OVM_FraudVerifier." ); require(<FILL_ME>) require( insideFraudProofWindow(_batchHeader), "State batches can only be deleted within the fraud proof window." ); _deleteBatch(_batchHeader); } /** * @inheritdoc iOVM_StateCommitmentChain */ function verifyStateCommitment( bytes32 _element, Lib_OVMCodec.ChainBatchHeader memory _batchHeader, Lib_OVMCodec.ChainInclusionProof memory _proof ) override public view returns ( bool ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function insideFraudProofWindow( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) override public view returns ( bool _inside ) { } /********************** * Internal Functions * **********************/ /** * Parses the batch context from the extra data. * @return Total number of elements submitted. * @return Timestamp of the last batch submitted by the sequencer. */ function _getBatchExtraData() internal view returns ( uint40, uint40 ) { } /** * Encodes the batch context for the extra data. * @param _totalElements Total number of elements submitted. * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer. * @return Encoded batch context. */ function _makeBatchExtraData( uint40 _totalElements, uint40 _lastSequencerTimestamp ) internal pure returns ( bytes27 ) { } /** * Appends a batch to the chain. * @param _batch Elements within the batch. * @param _extraData Any extra data to append to the batch. */ function _appendBatch( bytes32[] memory _batch, bytes memory _extraData ) internal { } /** * Removes a batch and all subsequent batches from the chain. * @param _batchHeader Header of the batch to remove. */ function _deleteBatch( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) internal { } /** * Checks that a batch header matches the stored hash for the given index. * @param _batchHeader Batch header to validate. * @return Whether or not the header matches the stored one. */ function _isValidBatchHeader( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) internal view returns ( bool ) { } }
_isValidBatchHeader(_batchHeader),"Invalid batch header."
369,850
_isValidBatchHeader(_batchHeader)
"State batches can only be deleted within the fraud proof window."
// SPDX-License-Identifier: MIT pragma solidity >0.5.0 <0.8.0; pragma experimental ABIEncoderV2; /* Library Imports */ import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol"; import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol"; import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol"; /* Interface Imports */ import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol"; import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol"; import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol"; import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol"; import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol"; /* External Imports */ import '@openzeppelin/contracts/math/SafeMath.sol'; /** * @title OVM_StateCommitmentChain * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC). * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique * state root calculated off-chain by applying the canonical transactions one by one. * * Compiler used: solc * Runtime target: EVM */ contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver { /************* * Constants * *************/ uint256 public FRAUD_PROOF_WINDOW; uint256 public SEQUENCER_PUBLISH_WINDOW; /*************** * Constructor * ***************/ /** * @param _libAddressManager Address of the Address Manager. */ constructor( address _libAddressManager, uint256 _fraudProofWindow, uint256 _sequencerPublishWindow ) Lib_AddressResolver(_libAddressManager) { } /******************** * Public Functions * ********************/ /** * Accesses the batch storage container. * @return Reference to the batch storage container. */ function batches() public view returns ( iOVM_ChainStorageContainer ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getTotalElements() override public view returns ( uint256 _totalElements ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getTotalBatches() override public view returns ( uint256 _totalBatches ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getLastSequencerTimestamp() override public view returns ( uint256 _lastSequencerTimestamp ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function appendStateBatch( bytes32[] memory _batch, uint256 _shouldStartAtElement ) override public { } /** * @inheritdoc iOVM_StateCommitmentChain */ function deleteStateBatch( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) override public { require( msg.sender == resolve("OVM_FraudVerifier"), "State batches can only be deleted by the OVM_FraudVerifier." ); require( _isValidBatchHeader(_batchHeader), "Invalid batch header." ); require(<FILL_ME>) _deleteBatch(_batchHeader); } /** * @inheritdoc iOVM_StateCommitmentChain */ function verifyStateCommitment( bytes32 _element, Lib_OVMCodec.ChainBatchHeader memory _batchHeader, Lib_OVMCodec.ChainInclusionProof memory _proof ) override public view returns ( bool ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function insideFraudProofWindow( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) override public view returns ( bool _inside ) { } /********************** * Internal Functions * **********************/ /** * Parses the batch context from the extra data. * @return Total number of elements submitted. * @return Timestamp of the last batch submitted by the sequencer. */ function _getBatchExtraData() internal view returns ( uint40, uint40 ) { } /** * Encodes the batch context for the extra data. * @param _totalElements Total number of elements submitted. * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer. * @return Encoded batch context. */ function _makeBatchExtraData( uint40 _totalElements, uint40 _lastSequencerTimestamp ) internal pure returns ( bytes27 ) { } /** * Appends a batch to the chain. * @param _batch Elements within the batch. * @param _extraData Any extra data to append to the batch. */ function _appendBatch( bytes32[] memory _batch, bytes memory _extraData ) internal { } /** * Removes a batch and all subsequent batches from the chain. * @param _batchHeader Header of the batch to remove. */ function _deleteBatch( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) internal { } /** * Checks that a batch header matches the stored hash for the given index. * @param _batchHeader Batch header to validate. * @return Whether or not the header matches the stored one. */ function _isValidBatchHeader( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) internal view returns ( bool ) { } }
insideFraudProofWindow(_batchHeader),"State batches can only be deleted within the fraud proof window."
369,850
insideFraudProofWindow(_batchHeader)
"Invalid inclusion proof."
// SPDX-License-Identifier: MIT pragma solidity >0.5.0 <0.8.0; pragma experimental ABIEncoderV2; /* Library Imports */ import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol"; import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol"; import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol"; /* Interface Imports */ import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol"; import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol"; import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol"; import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol"; import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol"; /* External Imports */ import '@openzeppelin/contracts/math/SafeMath.sol'; /** * @title OVM_StateCommitmentChain * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC). * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique * state root calculated off-chain by applying the canonical transactions one by one. * * Compiler used: solc * Runtime target: EVM */ contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver { /************* * Constants * *************/ uint256 public FRAUD_PROOF_WINDOW; uint256 public SEQUENCER_PUBLISH_WINDOW; /*************** * Constructor * ***************/ /** * @param _libAddressManager Address of the Address Manager. */ constructor( address _libAddressManager, uint256 _fraudProofWindow, uint256 _sequencerPublishWindow ) Lib_AddressResolver(_libAddressManager) { } /******************** * Public Functions * ********************/ /** * Accesses the batch storage container. * @return Reference to the batch storage container. */ function batches() public view returns ( iOVM_ChainStorageContainer ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getTotalElements() override public view returns ( uint256 _totalElements ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getTotalBatches() override public view returns ( uint256 _totalBatches ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getLastSequencerTimestamp() override public view returns ( uint256 _lastSequencerTimestamp ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function appendStateBatch( bytes32[] memory _batch, uint256 _shouldStartAtElement ) override public { } /** * @inheritdoc iOVM_StateCommitmentChain */ function deleteStateBatch( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) override public { } /** * @inheritdoc iOVM_StateCommitmentChain */ function verifyStateCommitment( bytes32 _element, Lib_OVMCodec.ChainBatchHeader memory _batchHeader, Lib_OVMCodec.ChainInclusionProof memory _proof ) override public view returns ( bool ) { require( _isValidBatchHeader(_batchHeader), "Invalid batch header." ); require(<FILL_ME>) return true; } /** * @inheritdoc iOVM_StateCommitmentChain */ function insideFraudProofWindow( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) override public view returns ( bool _inside ) { } /********************** * Internal Functions * **********************/ /** * Parses the batch context from the extra data. * @return Total number of elements submitted. * @return Timestamp of the last batch submitted by the sequencer. */ function _getBatchExtraData() internal view returns ( uint40, uint40 ) { } /** * Encodes the batch context for the extra data. * @param _totalElements Total number of elements submitted. * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer. * @return Encoded batch context. */ function _makeBatchExtraData( uint40 _totalElements, uint40 _lastSequencerTimestamp ) internal pure returns ( bytes27 ) { } /** * Appends a batch to the chain. * @param _batch Elements within the batch. * @param _extraData Any extra data to append to the batch. */ function _appendBatch( bytes32[] memory _batch, bytes memory _extraData ) internal { } /** * Removes a batch and all subsequent batches from the chain. * @param _batchHeader Header of the batch to remove. */ function _deleteBatch( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) internal { } /** * Checks that a batch header matches the stored hash for the given index. * @param _batchHeader Batch header to validate. * @return Whether or not the header matches the stored one. */ function _isValidBatchHeader( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) internal view returns ( bool ) { } }
Lib_MerkleTree.verify(_batchHeader.batchRoot,_element,_proof.index,_proof.siblings,_batchHeader.batchSize),"Invalid inclusion proof."
369,850
Lib_MerkleTree.verify(_batchHeader.batchRoot,_element,_proof.index,_proof.siblings,_batchHeader.batchSize)
"Cannot publish state roots within the sequencer publication window."
// SPDX-License-Identifier: MIT pragma solidity >0.5.0 <0.8.0; pragma experimental ABIEncoderV2; /* Library Imports */ import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol"; import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol"; import { Lib_MerkleTree } from "../../libraries/utils/Lib_MerkleTree.sol"; /* Interface Imports */ import { iOVM_FraudVerifier } from "../../iOVM/verification/iOVM_FraudVerifier.sol"; import { iOVM_StateCommitmentChain } from "../../iOVM/chain/iOVM_StateCommitmentChain.sol"; import { iOVM_CanonicalTransactionChain } from "../../iOVM/chain/iOVM_CanonicalTransactionChain.sol"; import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol"; import { iOVM_ChainStorageContainer } from "../../iOVM/chain/iOVM_ChainStorageContainer.sol"; /* External Imports */ import '@openzeppelin/contracts/math/SafeMath.sol'; /** * @title OVM_StateCommitmentChain * @dev The State Commitment Chain (SCC) contract contains a list of proposed state roots which * Proposers assert to be a result of each transaction in the Canonical Transaction Chain (CTC). * Elements here have a 1:1 correspondence with transactions in the CTC, and should be the unique * state root calculated off-chain by applying the canonical transactions one by one. * * Compiler used: solc * Runtime target: EVM */ contract OVM_StateCommitmentChain is iOVM_StateCommitmentChain, Lib_AddressResolver { /************* * Constants * *************/ uint256 public FRAUD_PROOF_WINDOW; uint256 public SEQUENCER_PUBLISH_WINDOW; /*************** * Constructor * ***************/ /** * @param _libAddressManager Address of the Address Manager. */ constructor( address _libAddressManager, uint256 _fraudProofWindow, uint256 _sequencerPublishWindow ) Lib_AddressResolver(_libAddressManager) { } /******************** * Public Functions * ********************/ /** * Accesses the batch storage container. * @return Reference to the batch storage container. */ function batches() public view returns ( iOVM_ChainStorageContainer ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getTotalElements() override public view returns ( uint256 _totalElements ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getTotalBatches() override public view returns ( uint256 _totalBatches ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function getLastSequencerTimestamp() override public view returns ( uint256 _lastSequencerTimestamp ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function appendStateBatch( bytes32[] memory _batch, uint256 _shouldStartAtElement ) override public { } /** * @inheritdoc iOVM_StateCommitmentChain */ function deleteStateBatch( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) override public { } /** * @inheritdoc iOVM_StateCommitmentChain */ function verifyStateCommitment( bytes32 _element, Lib_OVMCodec.ChainBatchHeader memory _batchHeader, Lib_OVMCodec.ChainInclusionProof memory _proof ) override public view returns ( bool ) { } /** * @inheritdoc iOVM_StateCommitmentChain */ function insideFraudProofWindow( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) override public view returns ( bool _inside ) { } /********************** * Internal Functions * **********************/ /** * Parses the batch context from the extra data. * @return Total number of elements submitted. * @return Timestamp of the last batch submitted by the sequencer. */ function _getBatchExtraData() internal view returns ( uint40, uint40 ) { } /** * Encodes the batch context for the extra data. * @param _totalElements Total number of elements submitted. * @param _lastSequencerTimestamp Timestamp of the last batch submitted by the sequencer. * @return Encoded batch context. */ function _makeBatchExtraData( uint40 _totalElements, uint40 _lastSequencerTimestamp ) internal pure returns ( bytes27 ) { } /** * Appends a batch to the chain. * @param _batch Elements within the batch. * @param _extraData Any extra data to append to the batch. */ function _appendBatch( bytes32[] memory _batch, bytes memory _extraData ) internal { address sequencer = resolve("OVM_Proposer"); (uint40 totalElements, uint40 lastSequencerTimestamp) = _getBatchExtraData(); if (msg.sender == sequencer) { lastSequencerTimestamp = uint40(block.timestamp); } else { // We keep track of the last batch submitted by the sequencer so there's a window in // which only the sequencer can publish state roots. A window like this just reduces // the chance of "system breaking" state roots being published while we're still in // testing mode. This window should be removed or significantly reduced in the future. require(<FILL_ME>) } // For efficiency reasons getMerkleRoot modifies the `_batch` argument in place // while calculating the root hash therefore any arguments passed to it must not // be used again afterwards Lib_OVMCodec.ChainBatchHeader memory batchHeader = Lib_OVMCodec.ChainBatchHeader({ batchIndex: getTotalBatches(), batchRoot: Lib_MerkleTree.getMerkleRoot(_batch), batchSize: _batch.length, prevTotalElements: totalElements, extraData: _extraData }); emit StateBatchAppended( batchHeader.batchIndex, batchHeader.batchRoot, batchHeader.batchSize, batchHeader.prevTotalElements, batchHeader.extraData ); batches().push( Lib_OVMCodec.hashBatchHeader(batchHeader), _makeBatchExtraData( uint40(batchHeader.prevTotalElements + batchHeader.batchSize), lastSequencerTimestamp ) ); } /** * Removes a batch and all subsequent batches from the chain. * @param _batchHeader Header of the batch to remove. */ function _deleteBatch( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) internal { } /** * Checks that a batch header matches the stored hash for the given index. * @param _batchHeader Batch header to validate. * @return Whether or not the header matches the stored one. */ function _isValidBatchHeader( Lib_OVMCodec.ChainBatchHeader memory _batchHeader ) internal view returns ( bool ) { } }
lastSequencerTimestamp+SEQUENCER_PUBLISH_WINDOW<block.timestamp,"Cannot publish state roots within the sequencer publication window."
369,850
lastSequencerTimestamp+SEQUENCER_PUBLISH_WINDOW<block.timestamp
"BallerFactory: Hash has already been used."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract BallerFactory is ERC721, AccessControl { using Address for address; using Counters for Counters.Counter; using SafeMath for uint256; // Add minter roles bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); // Baller Teams string[30] public ballerTeamPool = [ "Atlanta", "Boston", "Brooklyn", "Charlotte", "Chicago", "Cleveland", "Dallas", "Denver", "Detroit", "Golden State", "Houston", "Indiana", "LA1", "LA2", "Memphis", "Miami", "Milwaukee", "Minnesota", "New Orleans", "New York", "Oklahoma City", "Orlando", "Philadelphia", "Phoenix", "Portland", "Sacramento", "San Antonio", "Toronto", "Utah", "Washington" ]; // Maximum ballers that can be minted per team uint256 public maxBallers = 100; // Keep track of minted ballers Counters.Counter private _ballerIds; // Keep track of baller URIS mapping(uint256 => string) public _ballerURIs; // Total ballers in circulation for the given baller team. mapping (string => uint256) public ballersInCirculation; // Mapping between baller ID and team. mapping (uint256 => string) public ballerTeams; // Ensure we never mint the same baller mapping(string => uint256) hashes; // Event to track successful Baller purchases event BallerPurchaseRequest(address to, string team); // Event to track URI changes event URIChanged(uint256 ballerId, string uri); /** * Constructor. */ constructor() ERC721( "8-Bit Baller", "BALR" ) { } /** * Baller minting function. * @param to Address of the beneficiary. * @param teamId Integer ID of the team baller plays for. * @param mdHash IPFS Hash of the metadata JSON file corresponding to the baller. */ function mintBaller(address to, uint256 teamId, string memory mdHash) public { require(hasRole(MINTER_ROLE, _msgSender()), "BallerFactory: Must have minter role to mint."); require(to != address(0), "BallerFactory: Cannot mint to the 0 address."); require(teamId < 30, "BallerFactory: Invalid team."); require(teamId >= 0, "BallerFactory: Invalid team."); require(<FILL_ME>) hashes[mdHash] = 1; // Grab team corresponding to the given team ID string memory team = ballerTeamPool[teamId]; require(ballersInCirculation[team] < maxBallers, "BallerFactory: There are no ballers left for this team!"); // Set the team for the current baller ID ballerTeams[_ballerIds.current()] = team; // Increase ballers of the given team in circulation by 1 ballersInCirculation[team] = ballersInCirculation[team].add(1); // Mint baller to address _safeMint(to, _ballerIds.current()); // Set URI to IPFS hash for the current baller _setTokenURI(_ballerIds.current(), string(abi.encodePacked(_baseURI(), mdHash))); // Increment baller ID _ballerIds.increment(); // Emit baller purchase request. emit BallerPurchaseRequest(to, team); } function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl) returns (bool) { } /** * Getter function to see the number of ballers in circulation for a given team. * @param teamId Integer ID of the team of interest. */ function getBallersInCirculation(uint256 teamId) public view returns(uint256) { } /** * Sets the token URI for the given baller. * @param ballerId Integer ID of the baller. * @param uri The new URI for the baller. */ function setBallerURI(uint256 ballerId, string memory uri) public { } /** * @dev Base URI for computing {tokenURI}. */ function _baseURI() override internal pure returns (string memory) { } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal { } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view override returns (string memory) { } }
hashes[mdHash]!=1,"BallerFactory: Hash has already been used."
370,060
hashes[mdHash]!=1
"BallerFactory: There are no ballers left for this team!"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; contract BallerFactory is ERC721, AccessControl { using Address for address; using Counters for Counters.Counter; using SafeMath for uint256; // Add minter roles bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); // Baller Teams string[30] public ballerTeamPool = [ "Atlanta", "Boston", "Brooklyn", "Charlotte", "Chicago", "Cleveland", "Dallas", "Denver", "Detroit", "Golden State", "Houston", "Indiana", "LA1", "LA2", "Memphis", "Miami", "Milwaukee", "Minnesota", "New Orleans", "New York", "Oklahoma City", "Orlando", "Philadelphia", "Phoenix", "Portland", "Sacramento", "San Antonio", "Toronto", "Utah", "Washington" ]; // Maximum ballers that can be minted per team uint256 public maxBallers = 100; // Keep track of minted ballers Counters.Counter private _ballerIds; // Keep track of baller URIS mapping(uint256 => string) public _ballerURIs; // Total ballers in circulation for the given baller team. mapping (string => uint256) public ballersInCirculation; // Mapping between baller ID and team. mapping (uint256 => string) public ballerTeams; // Ensure we never mint the same baller mapping(string => uint256) hashes; // Event to track successful Baller purchases event BallerPurchaseRequest(address to, string team); // Event to track URI changes event URIChanged(uint256 ballerId, string uri); /** * Constructor. */ constructor() ERC721( "8-Bit Baller", "BALR" ) { } /** * Baller minting function. * @param to Address of the beneficiary. * @param teamId Integer ID of the team baller plays for. * @param mdHash IPFS Hash of the metadata JSON file corresponding to the baller. */ function mintBaller(address to, uint256 teamId, string memory mdHash) public { require(hasRole(MINTER_ROLE, _msgSender()), "BallerFactory: Must have minter role to mint."); require(to != address(0), "BallerFactory: Cannot mint to the 0 address."); require(teamId < 30, "BallerFactory: Invalid team."); require(teamId >= 0, "BallerFactory: Invalid team."); require(hashes[mdHash] != 1, "BallerFactory: Hash has already been used."); hashes[mdHash] = 1; // Grab team corresponding to the given team ID string memory team = ballerTeamPool[teamId]; require(<FILL_ME>) // Set the team for the current baller ID ballerTeams[_ballerIds.current()] = team; // Increase ballers of the given team in circulation by 1 ballersInCirculation[team] = ballersInCirculation[team].add(1); // Mint baller to address _safeMint(to, _ballerIds.current()); // Set URI to IPFS hash for the current baller _setTokenURI(_ballerIds.current(), string(abi.encodePacked(_baseURI(), mdHash))); // Increment baller ID _ballerIds.increment(); // Emit baller purchase request. emit BallerPurchaseRequest(to, team); } function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl) returns (bool) { } /** * Getter function to see the number of ballers in circulation for a given team. * @param teamId Integer ID of the team of interest. */ function getBallersInCirculation(uint256 teamId) public view returns(uint256) { } /** * Sets the token URI for the given baller. * @param ballerId Integer ID of the baller. * @param uri The new URI for the baller. */ function setBallerURI(uint256 ballerId, string memory uri) public { } /** * @dev Base URI for computing {tokenURI}. */ function _baseURI() override internal pure returns (string memory) { } /** * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal { } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view override returns (string memory) { } }
ballersInCirculation[team]<maxBallers,"BallerFactory: There are no ballers left for this team!"
370,060
ballersInCirculation[team]<maxBallers
'Queue is empty'
pragma solidity ^0.5.0; /// @title A Queue for Players /// @author Jason Fabrit @bugbytesinc /// @notice Implements a helper contract for first-in-first-out /// queue of players having identical moves. Tracks the address /// of the player and their bet. Pvoides helper methods to the /// parent contract for reporting the number of players in the /// queue and the amount of value they have claim of (this is /// necessary in the computation of the payout.) contract BetQueue { /// @title Associates addresses with amounts /// @notice Links an account with their bet, does not need /// to contain the `Move` which is managed by the parent /// contract. struct Bet { address payable player; uint amount; } /// @title Map of indicies to entries /// @dev we use a mapping with indices instead /// of pushing/popping an array of structs. mapping(uint256 => Bet) private queue; /// @title The index of the next player to dequeue. uint256 private first = 1; /// @title The index of the last player ot dequeue. uint256 private last = 0; /// @title The owner of the contract (parent `RockPaperScissors` contract). /// @notice Only the owner of the contract is allowed to change state. address owner; /// @title Queue Constructor /// @notice Captures the owner of the contract, only the owner can change state. constructor() public { } /// @title Enqueue a Play /// @notice Adds a player's play to the end of the queue. /// @dev only the owner may call this method. /// @param player address of the player /// @param amount value of the player's bet function enqueue(address payable player, uint amount) public { } /// @title Dequeus a Play /// @notice Removes the oldest play from the queue. /// @dev reverts if an attempt is made to deueue when the queue is empty. /// Only the owner may call this method. /// @return player address fo the player /// @return amount the original value of hte player's bet. function dequeue() public returns (address payable player, uint amount) { require(msg.sender == owner, 'Access Denied'); require(<FILL_ME>) (player,amount) = (queue[first].player,queue[first].amount); delete queue[first]; first += 1; if(last < first) { first = 1; last = 0; } } /// @title Number of records in the queue. /// @dev only the owner may call this method. /// @return the number of records in the queue. function count() public view returns (uint total) { } /// @title Total value of bets from players in queue. /// @notice Enumerates the players in the queu and returns the /// sum of the value of all the bets associated with the players. /// @dev only the owner may call this method. /// @return total the total value of the bets for the players contained /// within this queue. function totalAmount() public view returns (uint total) { } /// @title Is Empty /// @notice Returns `true` if the queue is empty, has no players. /// @dev only the owner may call this method. /// @return `true` if there are no players in the queue, `false` if /// there are one or more. function isEmpty() public view returns (bool) { } } /// @title Rock Paper Scissors DApp Game for fun silliness. /// @author Jason Fabritz @bugbytesinc /// @notice Part of the game is to game the system, there /// is behavior in this contract that would generally be /// considered a security hole. (You can't submarine for /// example, and there are paths that result in transfer /// failues when actors are deliberately malicous.) contract RockPaperScissors { /// @title Enumerates the potential play moves. /// @dev the 0 value is None which makes a convenient dfault enum Move { None, Rock, Paper, Scissors } /// @title Winner Payout Event /// @notice Emitted when a play resolves with a winner and loser /// @param winner the address of the winner /// @param move the winning move /// @param loser the address of the losing address /// @param payout the total ethere paid to the winer, includes their original bet event WinnerPayout(address winner, Move move, address loser, uint payout); /// @title Winner Forefit Event /// @notice Emitted when an attempt to pay a winer fails for whatever reason /// @dev This can happen due to a deliberate attack by the winner with a /// from a bad acting contract, or it could be from out-of-gas attack. /// @param winner the address of the winner /// @param move the winning move /// @param loser the address of the losing address /// @param payout the total ethere paid to the winer, which will always be zero. event WinnerForefit(address winner, Move move, address loser, uint payout); /// @title Opening Move Event /// @notice Emitted when a player makes an opening move (there are no other /// moves stored in the contract), or the player makes the same move that is /// already been played, in which case the play 'gets in line' for resolution. /// The contract will have a limit at which only so many duplicate moves can /// be made before the contract reverts further attempts. The limit will be /// indicated by turning the `maxReached` value `true`. Without plays /// resolving, any more duplicate plays will be reverted by the contract. /// @dev when `maxReached` returns `false`, the UI can allow additional duplicate /// plays. When it reads `true` the UI should prevent duplicate plays as this /// will just waste gas. /// @param move The move that was made /// @param maxReached a flag indicating the contract will no longer accept /// plays with this type of move until pending plays resolve. event OpeningMove(Move move, bool maxReached); /// @title Refund Failure Occurred /// @notice Emitted when the contract is being closed and an attempt to refund /// a pending players bet failed. This can happen if the player is a contract /// and ran out of gas, or for other reasons. Either way, the ether is lost to /// the player at that point and must be refunded manually if desired. /// @param player address of the player that had the refund reverted. /// @param bet the value of the attempted refund. event RefundFailure(address player, uint bet); /// @title Game is closed for playing, calling `play` will revert. /// @notice Emitted when the owner of the contract closes the game and attempts /// to refund any unresolved plays. This effectively shuts down the game. /// After the game is closed, the owner my withdraw any remaining funds from the /// contract. event GameClosed(); /// @title Owner of the contract. /// @notice A number of functions on the contract require authorization from the owner address payable private owner; /// @title Que of opening moves, first-in-first-out, of unresolved (duplicate) plays. /// @dev This is implemented by a child contract for convenience. BetQueue private openingMovers; /// @title The minimum allowed bet. /// @notice All bets must be at least this value for the `play` method to accept the move. uint public minimumBet; /// @title The current opening move /// @notice This represents the opening move of a round. /// @dev this is public knowledge, anyone can see what the opening move is. Move public openingMove; /// @title The contract is open and accepting moves. /// @notice when `true` the contract allows playing, once set to `false` no other /// plays can be made. bool public open; /// @title The maximum number of duplicate plays. /// @notice The maximum number of duplicate plays that are allowed to queue up /// at one time, after which a circuit breaker kicks in and disallows that particular /// move until such time as plays have been resolved. uint private maxQueueCount; /// @title Rock Paper Scissors Contract Constructor /// @notice Constructs the contract and initializes the queue. /// @param minBet the minimum bet required when making a move by calling `play`. constructor(uint minBet) public { } /// @title Payable default function allowing deposits. /// @notice Allows anyone to add value to the running balance of the /// contract, thus temporarily boosting payouts from wins. function() external payable { } /// @title Play a move or Rock, Paper or Scissors. /// @notice Makes a move of Rock, Paper or Scissors. The method /// is payable and requires a minimum bet indicated by `minimmumBet`. /// If the play resolves, a `WinnerPayout` event is emitted, if it /// is the first play in a round an `OpeningMove` event will be emitted. /// @dev if the queue of unresolved plays equals or exceeds the /// `maxQueueCount` the contract call will be reverted. Also, if the /// game is closed, the call will be reverted. If the bet is lower /// than the minimum, the play will be reverted. /// @param move The player's move, Rock, Paper, or Scissors. /// @return a boolean value, `true` if this play wins, `false` if the /// play does not win, or is an opening move. function play(Move move) public payable returns (bool isWinner) { } /// @title Set Maximum Number of Allowed Unresolved Plays /// @notice Allows the owner to specifiy the number of unresolved /// plays the contract will allow to be held at one time. Acts as /// a circuit breaker against one or many players loading up on one /// particular move. /// @dev only the owner of the contract may call this function. /// @param maxSize the maximum number of plays allowed in the queue. function setMaxQueueSize(uint maxSize) external { } /// @title Ends the Game /// @notice Ends the game, returning any unresolved plays to their /// originating addresses, if possible. If transfers fail, a /// `RefundFailure` event will be raised and it will be up to the /// owner of the contract to manually resolve any issues. /// @dev Only the owner of the contract may call this method. function end() external { } /// @title Withdraws any remaining contract ballance. /// @notice Sends any remaining contract value to the owner of the /// contract. May only be called after play has been suspened by /// calling teh `end()` method. /// @dev Only the owner of the contract may call this method, after /// the game has been ended. function withdraw() external { } }
!isEmpty(),'Queue is empty'
370,111
!isEmpty()
"Too Many Bets of the same type."
pragma solidity ^0.5.0; /// @title A Queue for Players /// @author Jason Fabrit @bugbytesinc /// @notice Implements a helper contract for first-in-first-out /// queue of players having identical moves. Tracks the address /// of the player and their bet. Pvoides helper methods to the /// parent contract for reporting the number of players in the /// queue and the amount of value they have claim of (this is /// necessary in the computation of the payout.) contract BetQueue { /// @title Associates addresses with amounts /// @notice Links an account with their bet, does not need /// to contain the `Move` which is managed by the parent /// contract. struct Bet { address payable player; uint amount; } /// @title Map of indicies to entries /// @dev we use a mapping with indices instead /// of pushing/popping an array of structs. mapping(uint256 => Bet) private queue; /// @title The index of the next player to dequeue. uint256 private first = 1; /// @title The index of the last player ot dequeue. uint256 private last = 0; /// @title The owner of the contract (parent `RockPaperScissors` contract). /// @notice Only the owner of the contract is allowed to change state. address owner; /// @title Queue Constructor /// @notice Captures the owner of the contract, only the owner can change state. constructor() public { } /// @title Enqueue a Play /// @notice Adds a player's play to the end of the queue. /// @dev only the owner may call this method. /// @param player address of the player /// @param amount value of the player's bet function enqueue(address payable player, uint amount) public { } /// @title Dequeus a Play /// @notice Removes the oldest play from the queue. /// @dev reverts if an attempt is made to deueue when the queue is empty. /// Only the owner may call this method. /// @return player address fo the player /// @return amount the original value of hte player's bet. function dequeue() public returns (address payable player, uint amount) { } /// @title Number of records in the queue. /// @dev only the owner may call this method. /// @return the number of records in the queue. function count() public view returns (uint total) { } /// @title Total value of bets from players in queue. /// @notice Enumerates the players in the queu and returns the /// sum of the value of all the bets associated with the players. /// @dev only the owner may call this method. /// @return total the total value of the bets for the players contained /// within this queue. function totalAmount() public view returns (uint total) { } /// @title Is Empty /// @notice Returns `true` if the queue is empty, has no players. /// @dev only the owner may call this method. /// @return `true` if there are no players in the queue, `false` if /// there are one or more. function isEmpty() public view returns (bool) { } } /// @title Rock Paper Scissors DApp Game for fun silliness. /// @author Jason Fabritz @bugbytesinc /// @notice Part of the game is to game the system, there /// is behavior in this contract that would generally be /// considered a security hole. (You can't submarine for /// example, and there are paths that result in transfer /// failues when actors are deliberately malicous.) contract RockPaperScissors { /// @title Enumerates the potential play moves. /// @dev the 0 value is None which makes a convenient dfault enum Move { None, Rock, Paper, Scissors } /// @title Winner Payout Event /// @notice Emitted when a play resolves with a winner and loser /// @param winner the address of the winner /// @param move the winning move /// @param loser the address of the losing address /// @param payout the total ethere paid to the winer, includes their original bet event WinnerPayout(address winner, Move move, address loser, uint payout); /// @title Winner Forefit Event /// @notice Emitted when an attempt to pay a winer fails for whatever reason /// @dev This can happen due to a deliberate attack by the winner with a /// from a bad acting contract, or it could be from out-of-gas attack. /// @param winner the address of the winner /// @param move the winning move /// @param loser the address of the losing address /// @param payout the total ethere paid to the winer, which will always be zero. event WinnerForefit(address winner, Move move, address loser, uint payout); /// @title Opening Move Event /// @notice Emitted when a player makes an opening move (there are no other /// moves stored in the contract), or the player makes the same move that is /// already been played, in which case the play 'gets in line' for resolution. /// The contract will have a limit at which only so many duplicate moves can /// be made before the contract reverts further attempts. The limit will be /// indicated by turning the `maxReached` value `true`. Without plays /// resolving, any more duplicate plays will be reverted by the contract. /// @dev when `maxReached` returns `false`, the UI can allow additional duplicate /// plays. When it reads `true` the UI should prevent duplicate plays as this /// will just waste gas. /// @param move The move that was made /// @param maxReached a flag indicating the contract will no longer accept /// plays with this type of move until pending plays resolve. event OpeningMove(Move move, bool maxReached); /// @title Refund Failure Occurred /// @notice Emitted when the contract is being closed and an attempt to refund /// a pending players bet failed. This can happen if the player is a contract /// and ran out of gas, or for other reasons. Either way, the ether is lost to /// the player at that point and must be refunded manually if desired. /// @param player address of the player that had the refund reverted. /// @param bet the value of the attempted refund. event RefundFailure(address player, uint bet); /// @title Game is closed for playing, calling `play` will revert. /// @notice Emitted when the owner of the contract closes the game and attempts /// to refund any unresolved plays. This effectively shuts down the game. /// After the game is closed, the owner my withdraw any remaining funds from the /// contract. event GameClosed(); /// @title Owner of the contract. /// @notice A number of functions on the contract require authorization from the owner address payable private owner; /// @title Que of opening moves, first-in-first-out, of unresolved (duplicate) plays. /// @dev This is implemented by a child contract for convenience. BetQueue private openingMovers; /// @title The minimum allowed bet. /// @notice All bets must be at least this value for the `play` method to accept the move. uint public minimumBet; /// @title The current opening move /// @notice This represents the opening move of a round. /// @dev this is public knowledge, anyone can see what the opening move is. Move public openingMove; /// @title The contract is open and accepting moves. /// @notice when `true` the contract allows playing, once set to `false` no other /// plays can be made. bool public open; /// @title The maximum number of duplicate plays. /// @notice The maximum number of duplicate plays that are allowed to queue up /// at one time, after which a circuit breaker kicks in and disallows that particular /// move until such time as plays have been resolved. uint private maxQueueCount; /// @title Rock Paper Scissors Contract Constructor /// @notice Constructs the contract and initializes the queue. /// @param minBet the minimum bet required when making a move by calling `play`. constructor(uint minBet) public { } /// @title Payable default function allowing deposits. /// @notice Allows anyone to add value to the running balance of the /// contract, thus temporarily boosting payouts from wins. function() external payable { } /// @title Play a move or Rock, Paper or Scissors. /// @notice Makes a move of Rock, Paper or Scissors. The method /// is payable and requires a minimum bet indicated by `minimmumBet`. /// If the play resolves, a `WinnerPayout` event is emitted, if it /// is the first play in a round an `OpeningMove` event will be emitted. /// @dev if the queue of unresolved plays equals or exceeds the /// `maxQueueCount` the contract call will be reverted. Also, if the /// game is closed, the call will be reverted. If the bet is lower /// than the minimum, the play will be reverted. /// @param move The player's move, Rock, Paper, or Scissors. /// @return a boolean value, `true` if this play wins, `false` if the /// play does not win, or is an opening move. function play(Move move) public payable returns (bool isWinner) { require(open, 'Game is finished.'); require(msg.value >= minimumBet,'Bet is too low.'); require(move == Move.Rock || move == Move.Paper || move == Move.Scissors,'Move is invalid.'); isWinner = false; if(openingMove == Move.None) { openingMove = move; openingMovers.enqueue(msg.sender,msg.value); emit OpeningMove(openingMove, false); } else if(move == openingMove) { require(<FILL_ME>) openingMovers.enqueue(msg.sender,msg.value); emit OpeningMove(openingMove, openingMovers.count() >= maxQueueCount); } else { (address payable otherPlayer, uint otherBet) = openingMovers.dequeue(); Move otherMove = openingMove; if(openingMovers.isEmpty()) { openingMove = Move.None; } uint payout = (address(this).balance - msg.value - otherBet - openingMovers.totalAmount())/2; if((move == Move.Rock && otherMove == Move.Scissors) || (move == Move.Paper && otherMove == Move.Rock) || (move == Move.Scissors && otherMove == Move.Paper)) { isWinner = true; payout = payout + msg.value + otherBet / 2; emit WinnerPayout(msg.sender, move, otherPlayer, payout); // If transfer fails, whole play reverts. msg.sender.transfer(payout); } else { payout = payout + msg.value/2 + otherBet; if(otherPlayer.send(payout)) { emit WinnerPayout(otherPlayer, otherMove, msg.sender, payout); } else { // Winner Bad Actor? Loser Out of Gas? Money kept in // running total. Yes, the loser could be a bad actor // not send enough gas to cause this to happen. // Leave it as part of the skullduggery nature of the game. emit WinnerForefit(otherPlayer, otherMove, msg.sender, payout); } } } } /// @title Set Maximum Number of Allowed Unresolved Plays /// @notice Allows the owner to specifiy the number of unresolved /// plays the contract will allow to be held at one time. Acts as /// a circuit breaker against one or many players loading up on one /// particular move. /// @dev only the owner of the contract may call this function. /// @param maxSize the maximum number of plays allowed in the queue. function setMaxQueueSize(uint maxSize) external { } /// @title Ends the Game /// @notice Ends the game, returning any unresolved plays to their /// originating addresses, if possible. If transfers fail, a /// `RefundFailure` event will be raised and it will be up to the /// owner of the contract to manually resolve any issues. /// @dev Only the owner of the contract may call this method. function end() external { } /// @title Withdraws any remaining contract ballance. /// @notice Sends any remaining contract value to the owner of the /// contract. May only be called after play has been suspened by /// calling teh `end()` method. /// @dev Only the owner of the contract may call this method, after /// the game has been ended. function withdraw() external { } }
openingMovers.count()<maxQueueCount,"Too Many Bets of the same type."
370,111
openingMovers.count()<maxQueueCount
"Not enough NFTs left!"
//SPDX-License-Identifier: MIT pragma solidity ^0.6.6; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract NFTResolutions is ERC721, Ownable { uint public constant ethCost = 0.01 ether; uint256 public tokenCounter; constructor() public ERC721("NFT Resolution", "NFTR") { } function mintResolution(string memory tokenURI) public payable returns (uint256) { require(<FILL_ME>) require(msg.value >= ethCost, "Insufficient funds!"); uint256 newItemId = tokenCounter; _safeMint(msg.sender, newItemId); _setTokenURI(newItemId, tokenURI); tokenCounter = tokenCounter + 1; return newItemId; } function withdraw() public payable onlyOwner { } }
tokenCounter+1<=2022,"Not enough NFTs left!"
370,121
tokenCounter+1<=2022
"AAM: adapter exists!"
pragma solidity 0.6.2; pragma experimental ABIEncoderV2; interface ERC20 { function approve(address, uint256) external returns (bool); function transfer(address, uint256) external returns (bool); function transferFrom(address, address, uint256) external returns (bool); function balanceOf(address) external view returns (uint256); function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); } interface Adapter { /** * @dev MUST return name of the protocol. */ function getProtocolName() external pure returns (string memory); /** * @dev MUST return amount of the given asset locked on the protocol by the given user. */ function getAssetAmount(address asset, address user) external view returns (int128); /** * @dev MUST return struct with underlying assets rates for the given asset. */ function getUnderlyingRates(address asset) external view returns (Component[] memory); } struct ProtocolDetail { string name; AssetBalance[] balances; AssetRate[] rates; } struct ProtocolBalance { string name; AssetBalance[] balances; } struct ProtocolRate { string name; AssetRate[] rates; } struct AssetBalance { address asset; int256 amount; uint8 decimals; } struct AssetRate { address asset; Component[] components; } struct Component { address underlying; uint256 rate; } contract Ownable { modifier onlyOwner { } address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @notice Initializes owner variable with msg.sender address. */ constructor() internal { } /** * @notice Transfers ownership to the desired address. * The function is callable only by the owner. */ function transferOwnership(address _owner) external onlyOwner { } } /** * @title Base contract for AdapterRegistry. */ contract AdapterAssetsManager is Ownable { address internal constant INITIAL_ADAPTER = address(1); mapping(address => address) internal adapters; mapping(address => address[]) internal assets; /** * @notice Initializes contract storage. * @param _adapters Array with adapters. * @param _assets Nested array of supported assets for each adapter. */ constructor( address[] memory _adapters, address[][] memory _assets ) internal { } /** * @notice Adds new adapter to adapters list. * The function is callable only by the owner. * @param newAdapter Address of new adapter. * @param _assets Addresses of adapter's assets. */ function addAdapter( address newAdapter, address[] memory _assets ) public onlyOwner { require(newAdapter != address(0), "AAM: zero adapter!"); require(newAdapter != INITIAL_ADAPTER, "AAM: initial adapter!"); require(<FILL_ME>) adapters[newAdapter] = adapters[INITIAL_ADAPTER]; adapters[INITIAL_ADAPTER] = newAdapter; assets[newAdapter] = _assets; } /** * @notice Removes one of adapters from adapters list. * The function is callable only by the owner. * @param adapter Address of adapter to be removed. */ function removeAdapter( address adapter ) public onlyOwner { } /** * @notice Adds new asset to adapter. * The function is callable only by the owner. * @param adapter Address of adapter. * @param asset Address of new adapter's asset. */ function addAdapterAsset( address adapter, address asset ) public onlyOwner { } /** * @notice Removes one of adapter's assets by its index. * The function is callable only by the owner. * @param adapter Address of adapter. * @param assetIndex Index of adapter's asset to be removed. */ function removeAdapterAsset( address adapter, uint256 assetIndex ) public onlyOwner { } /** * @param adapter Address of adapter. * @return Array of adapter's assets. */ function getAdapterAssets( address adapter ) public view returns (address[] memory) { } /** * @return Array of adapters. */ function getAdapters() public view returns (address[] memory) { } /** * @param adapter Address of adapter. * @return Whether adapter is valid. */ function isValidAdapter( address adapter ) public view returns (bool) { } } /** * @title Registry for protocol adapters. * @notice getBalances() and getRates() functions * with different arguments implement the main functionality. */ contract AdapterRegistry is AdapterAssetsManager { address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; constructor( address[] memory _adapters, address[][] memory _assets ) public AdapterAssetsManager(_adapters, _assets) {} /** * @return All the amounts and rates of supported assets * via supported adapters by the given user. */ function getBalancesAndRates( address user ) external view returns(ProtocolDetail[] memory) { } /** * @return All the amounts of supported assets * via supported adapters by the given user. */ function getBalances( address user ) external view returns(ProtocolBalance[] memory) { } /** * @return All the exchange rates for supported assets * via the supported adapters. */ function getRates() external view returns (ProtocolRate[] memory) { } /** * @return All the amounts of supported assets * via the given adapter by the given user. */ function getBalances( address user, address adapter ) public view returns (AssetBalance[] memory) { } /** * @return All the amounts of the given assets * via the given adapter by the given user. */ function getBalances( address user, address adapter, address[] memory assets ) public view returns (AssetBalance[] memory) { } /** * @return All the exchange rates for supported assets * via the given adapter. */ function getRates( address adapter ) public view returns (AssetRate[] memory) { } /** * @return All the exchange rates for the given assets * via the given adapter. */ function getRates( address adapter, address[] memory assets ) public view returns (AssetRate[] memory) { } function getAssetDecimals( address asset ) internal view returns (uint8) { } }
adapters[newAdapter]==address(0),"AAM: adapter exists!"
370,292
adapters[newAdapter]==address(0)
"AAM: invalid adapter!"
pragma solidity 0.6.2; pragma experimental ABIEncoderV2; interface ERC20 { function approve(address, uint256) external returns (bool); function transfer(address, uint256) external returns (bool); function transferFrom(address, address, uint256) external returns (bool); function balanceOf(address) external view returns (uint256); function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); } interface Adapter { /** * @dev MUST return name of the protocol. */ function getProtocolName() external pure returns (string memory); /** * @dev MUST return amount of the given asset locked on the protocol by the given user. */ function getAssetAmount(address asset, address user) external view returns (int128); /** * @dev MUST return struct with underlying assets rates for the given asset. */ function getUnderlyingRates(address asset) external view returns (Component[] memory); } struct ProtocolDetail { string name; AssetBalance[] balances; AssetRate[] rates; } struct ProtocolBalance { string name; AssetBalance[] balances; } struct ProtocolRate { string name; AssetRate[] rates; } struct AssetBalance { address asset; int256 amount; uint8 decimals; } struct AssetRate { address asset; Component[] components; } struct Component { address underlying; uint256 rate; } contract Ownable { modifier onlyOwner { } address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @notice Initializes owner variable with msg.sender address. */ constructor() internal { } /** * @notice Transfers ownership to the desired address. * The function is callable only by the owner. */ function transferOwnership(address _owner) external onlyOwner { } } /** * @title Base contract for AdapterRegistry. */ contract AdapterAssetsManager is Ownable { address internal constant INITIAL_ADAPTER = address(1); mapping(address => address) internal adapters; mapping(address => address[]) internal assets; /** * @notice Initializes contract storage. * @param _adapters Array with adapters. * @param _assets Nested array of supported assets for each adapter. */ constructor( address[] memory _adapters, address[][] memory _assets ) internal { } /** * @notice Adds new adapter to adapters list. * The function is callable only by the owner. * @param newAdapter Address of new adapter. * @param _assets Addresses of adapter's assets. */ function addAdapter( address newAdapter, address[] memory _assets ) public onlyOwner { } /** * @notice Removes one of adapters from adapters list. * The function is callable only by the owner. * @param adapter Address of adapter to be removed. */ function removeAdapter( address adapter ) public onlyOwner { require(<FILL_ME>) address prevAdapter; address currentAdapter = adapters[adapter]; while (currentAdapter != adapter) { prevAdapter = currentAdapter; currentAdapter = adapters[currentAdapter]; } delete assets[adapter]; adapters[prevAdapter] = adapters[adapter]; adapters[adapter] = address(0); } /** * @notice Adds new asset to adapter. * The function is callable only by the owner. * @param adapter Address of adapter. * @param asset Address of new adapter's asset. */ function addAdapterAsset( address adapter, address asset ) public onlyOwner { } /** * @notice Removes one of adapter's assets by its index. * The function is callable only by the owner. * @param adapter Address of adapter. * @param assetIndex Index of adapter's asset to be removed. */ function removeAdapterAsset( address adapter, uint256 assetIndex ) public onlyOwner { } /** * @param adapter Address of adapter. * @return Array of adapter's assets. */ function getAdapterAssets( address adapter ) public view returns (address[] memory) { } /** * @return Array of adapters. */ function getAdapters() public view returns (address[] memory) { } /** * @param adapter Address of adapter. * @return Whether adapter is valid. */ function isValidAdapter( address adapter ) public view returns (bool) { } } /** * @title Registry for protocol adapters. * @notice getBalances() and getRates() functions * with different arguments implement the main functionality. */ contract AdapterRegistry is AdapterAssetsManager { address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; constructor( address[] memory _adapters, address[][] memory _assets ) public AdapterAssetsManager(_adapters, _assets) {} /** * @return All the amounts and rates of supported assets * via supported adapters by the given user. */ function getBalancesAndRates( address user ) external view returns(ProtocolDetail[] memory) { } /** * @return All the amounts of supported assets * via supported adapters by the given user. */ function getBalances( address user ) external view returns(ProtocolBalance[] memory) { } /** * @return All the exchange rates for supported assets * via the supported adapters. */ function getRates() external view returns (ProtocolRate[] memory) { } /** * @return All the amounts of supported assets * via the given adapter by the given user. */ function getBalances( address user, address adapter ) public view returns (AssetBalance[] memory) { } /** * @return All the amounts of the given assets * via the given adapter by the given user. */ function getBalances( address user, address adapter, address[] memory assets ) public view returns (AssetBalance[] memory) { } /** * @return All the exchange rates for supported assets * via the given adapter. */ function getRates( address adapter ) public view returns (AssetRate[] memory) { } /** * @return All the exchange rates for the given assets * via the given adapter. */ function getRates( address adapter, address[] memory assets ) public view returns (AssetRate[] memory) { } function getAssetDecimals( address asset ) internal view returns (uint8) { } }
isValidAdapter(adapter),"AAM: invalid adapter!"
370,292
isValidAdapter(adapter)
'Not eligible for pre-sale'
// contracts/GenerativeCollection.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import '@openzeppelin/contracts/token/ERC721/ERC721.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol'; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import '@openzeppelin/contracts/utils/Counters.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; interface PresaleContractInterface { function balanceOf(address owner) external view returns (uint256 balance); } error NotEnoughEther(uint256 requiredEtherAmount); error ExceededMaxSupply(uint256 maxSupply); error ExceededMaxPurchaseable(uint256 maxPurchaseable); contract GenerativeCollection is ERC721, ERC721Enumerable, ERC721URIStorage, ERC721Burnable, ReentrancyGuard, Pausable, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; uint256 public constant MAX_SUPPLY = 10_000; uint256 public constant MAX_NFT_PURCHASEABLE = 20; uint256 private _reserved = 500; uint256 private _mintPrice = 0.04 ether; PresaleContractInterface public presaleContract; bool private _isPresale = true; string _metadataBaseURI; constructor() ERC721('BoringStone Genesis Collection', 'NFTFAM') { } modifier whenPresale(address sender) { if (_isPresale) { require(<FILL_ME>) } _; } modifier whenAmountIsZero(uint256 numberOfTokens) { } modifier whenNotExceedMaxPurchaseable(uint256 numberOfTokens) { } modifier whenNotExceedMaxSupply(uint256 numberOfTokens) { } modifier hasEnoughEther(uint256 numberOfTokens) { } function mintNft(uint256 numberOfTokens) public payable nonReentrant whenPresale(msg.sender) whenNotPaused whenAmountIsZero(numberOfTokens) whenNotExceedMaxPurchaseable(numberOfTokens) whenNotExceedMaxSupply(numberOfTokens) hasEnoughEther(numberOfTokens) { } function giveAwayNft(address to, uint256 numberOfTokens) public nonReentrant onlyOwner { } function endPresale() public onlyOwner { } function isPresale() public view virtual returns (bool) { } function setPresaleContract(address contractAddress) public onlyOwner { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function getMintPrice() public view returns (uint256) { } function setMintPrice(uint256 newPrice) public onlyOwner { } function _baseURI() internal view override returns (string memory) { } function baseURI() public view virtual returns (string memory) { } function setBaseURI(string memory baseUri) public onlyOwner { } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override(ERC721, ERC721Enumerable) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } function withdraw() external onlyOwner { } receive() external payable {} }
presaleContract.balanceOf(sender)>0,'Not eligible for pre-sale'
370,318
presaleContract.balanceOf(sender)>0
"dataStore address error"
pragma solidity ^0.5.11; import "./SafeMath.sol"; import "./HDOTStorage.sol"; contract HDOTLogic { using SafeMath for uint256; string public constant name = "HDOTLogic"; uint256 public constant TASKINIT = 0; uint256 public constant TASKPROCESSING = 1; uint256 public constant TASKCANCELLED = 2; uint256 public constant TASKDONE = 3; uint256 public constant MINTTASK = 1; uint256 public constant BURNTASK = 2; address private caller; HDOTStorage private store; constructor(address aCaller) public{ } modifier onlyCaller(){ } function mintLogic(uint256 value,address to,string calldata proof, bytes32 taskHash, address supportAddress, uint256 requireNum) external onlyCaller returns(uint256){ } function burnLogic(address from, uint256 value,string calldata dotAddress, string calldata proof,bytes32 taskHash, address supportAddress, uint256 requireNum) external onlyCaller returns(uint256){ } function transferLogic(address sender,address to,uint256 value) external onlyCaller returns(bool) { require(to != address(0), "cannot transfer to address zero"); require(sender != to, "sender need != to"); require(value > 0, "value need > 0"); require(<FILL_ME>) uint256 balanceFrom = store.balanceOf(sender); uint256 balanceTo = store.balanceOf(to); require(value <= balanceFrom, "insufficient funds"); balanceFrom = balanceFrom.safeSub(value); balanceTo = balanceTo.safeAdd(value); store.setBalance(sender,balanceFrom); store.setBalance(to,balanceTo); return true; } function transferFromLogic(address sender,address from,address to,uint256 value) external onlyCaller returns(bool) { } function approveLogic(address sender,address spender,uint256 value) external onlyCaller returns(bool success){ } function resetStoreLogic(address storeAddress) external onlyCaller { } function getTotalSupply() public view returns (uint256 supply) { } function balanceOf(address owner) public view returns (uint256 balance) { } function getAllowed(address owner, address spender) public view returns (uint256 remaining){ } function getStoreAddress() public view returns(address){ } function supportTask(uint256 taskType, bytes32 taskHash, address oneAddress, uint256 requireNum) private returns(uint256){ } function cancelTask(bytes32 taskHash) external onlyCaller returns(uint256){ } }
address(store)!=address(0),"dataStore address error"
370,505
address(store)!=address(0)
"Cannot claim twice per quarter"
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "../Ownable.sol" ; //@title SEPA Token contract interface interface SEPA_token { function balanceOf(address owner) external returns (uint256); function transfer(address to, uint256 amount) external returns (bool); function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); function _approve(address owner, address spender, uint256 amount) external ; } //@title SEPA Team Tokens Lock Contract contract SEPA_Treasury is Ownable { address public token_addr ; SEPA_token token_contract = SEPA_token(token_addr) ; uint256 public MONTH = 2628000 ; uint256 public DAY = 86400 ; uint256 public PERC_per_MONTH = 10 ; uint256 public last_claim ; uint256 public start_lock ; uint256 public locked ; /** * @dev Lock tokens by approving the contract to take them. * @param value Amount of tokens you want to lock in the contract */ function lock_tokens(uint256 value) external payable onlyOwner { } function withdraw(address _addr) external onlyOwner { require(block.timestamp >= start_lock + 90 * DAY, "Cannot be claimed in first 90 days") ; require(<FILL_ME>) last_claim = block.timestamp ; token_contract.transfer(_addr, locked * PERC_per_MONTH/100) ; } /** * @dev Set SEPA Token contract address * @param addr Address of SEPA Token contract */ function set_token_contract(address addr) external onlyOwner { } }
block.timestamp-last_claim>=3*MONTH,"Cannot claim twice per quarter"
370,511
block.timestamp-last_claim>=3*MONTH
'SDAO_REGISTRAR_ERC721_GENERATOR: INVALID_ERC721_ADDRESS'
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import {SDaoRegistrar} from '../SDaoRegistrar.sol'; interface IERC721Minter is IERC721 { function mintTo(address to, uint256 tokenId) external; } /** * @title SDaoRegistrarERC721Generator contract. * @dev Implementation of the {ISDaoRegistrarERC721Generator}. * A token is minted for each registration. * Only one token is allowed by account. */ abstract contract SDaoRegistrarERC721Generator is SDaoRegistrar { IERC721Minter public immutable ERC721_TOKEN; /** * @dev Constructor. * @param erc721Minter The address of the ERC721 Minter. */ constructor(IERC721Minter erc721Minter) { require(<FILL_ME>) ERC721_TOKEN = erc721Minter; } /** * @dev Hook that is called before any registration. * * It will pass if and only if the balance of the account is zero or the account is the owner. * * @param account The address for which the registration is made. * @param labelHash The hash of the label to register. */ function _beforeRegistration(address account, bytes32 labelHash) internal virtual override { } /** * @dev Hook that is called after any registration. * * The associated ERC721 is minted and given to the account. * * @param account The address for which the registration is made. * @param labelHash The hash of the label to register. */ function _afterRegistration(address account, bytes32 labelHash) internal virtual override { } }
address(erc721Minter)!=address(0),'SDAO_REGISTRAR_ERC721_GENERATOR: INVALID_ERC721_ADDRESS'
370,628
address(erc721Minter)!=address(0)
'SDAO_REGISTRAR_ERC721_GENERATOR: ALREADY_TOKEN_OWNER'
// SPDX-License-Identifier: MIT pragma solidity >=0.8.4; import '@openzeppelin/contracts/token/ERC721/IERC721.sol'; import {SDaoRegistrar} from '../SDaoRegistrar.sol'; interface IERC721Minter is IERC721 { function mintTo(address to, uint256 tokenId) external; } /** * @title SDaoRegistrarERC721Generator contract. * @dev Implementation of the {ISDaoRegistrarERC721Generator}. * A token is minted for each registration. * Only one token is allowed by account. */ abstract contract SDaoRegistrarERC721Generator is SDaoRegistrar { IERC721Minter public immutable ERC721_TOKEN; /** * @dev Constructor. * @param erc721Minter The address of the ERC721 Minter. */ constructor(IERC721Minter erc721Minter) { } /** * @dev Hook that is called before any registration. * * It will pass if and only if the balance of the account is zero or the account is the owner. * * @param account The address for which the registration is made. * @param labelHash The hash of the label to register. */ function _beforeRegistration(address account, bytes32 labelHash) internal virtual override { super._beforeRegistration(account, labelHash); require(<FILL_ME>) } /** * @dev Hook that is called after any registration. * * The associated ERC721 is minted and given to the account. * * @param account The address for which the registration is made. * @param labelHash The hash of the label to register. */ function _afterRegistration(address account, bytes32 labelHash) internal virtual override { } }
ERC721_TOKEN.balanceOf(account)==0||account==owner(),'SDAO_REGISTRAR_ERC721_GENERATOR: ALREADY_TOKEN_OWNER'
370,628
ERC721_TOKEN.balanceOf(account)==0||account==owner()
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; contract CleverGirls is ERC721Enumerable, Ownable { using Address for address; // Starting and stopping sale and presale bool public saleActive = false; bool public presaleActive = false; // Reserved for the team, customs, giveaways, collabs and so on. uint256 public reserved = 70; // Price of each token uint256 public price = 0.05 ether; // Maximum limit of tokens that can ever exist uint256 constant MAX_SUPPLY = 5555; // The base link that leads to the image / video of the token string public baseTokenURI; // Team addresses for withdrawals address public a1; address public a2; address public a3; address public a4; address public a5; // List of addresses that have a number of reserved tokens for presale mapping (address => uint256) public presaleReserved; constructor (string memory newBaseURI) ERC721 ("Clever Girls", "CG") { } // Override so the openzeppelin tokenURI() method will use this method to create the full tokenURI instead function _baseURI() internal view virtual override returns (string memory) { } // See which address owns which tokens function tokensOfOwner(address addr) public view returns(uint256[] memory) { } // Exclusive presale minting function mintPresale(uint256 _amount) public payable { } // Standard mint function function mintToken(uint256 _amount) public payable { } // Admin minting function to reserve tokens for the team, collabs, customs and giveaways function mintReserved(uint256 _amount) public onlyOwner { } // Edit reserved presale spots function editPresaleReserved(address[] memory _a, uint256[] memory _amount) public onlyOwner { } // Start and stop presale function setPresaleActive(bool val) public onlyOwner { } // Start and stop sale function setSaleActive(bool val) public onlyOwner { } // Set new baseURI function setBaseURI(string memory baseURI) public onlyOwner { } // Set a different price in case ETH changes drastically function setPrice(uint256 newPrice) public onlyOwner { } // Set team addresses function setAddresses(address[] memory _a) public onlyOwner { } // Withdraw funds from contract for the team function withdrawTeam(uint256 amount) public payable onlyOwner { uint256 percent = amount / 100; require(<FILL_ME>) // 43% for Fat Baby <3 require(payable(a2).send(percent * 24)); // 24% for Steamed Bun require(payable(a3).send(percent * 24)); // 24% for SINCOS require(payable(a4).send(percent * 5)); // 5% for the collection wallet require(payable(a5).send(percent * 4)); // 4% for ghost kid for writing and helping } }
payable(a1).send(percent*43)
370,717
payable(a1).send(percent*43)
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; contract CleverGirls is ERC721Enumerable, Ownable { using Address for address; // Starting and stopping sale and presale bool public saleActive = false; bool public presaleActive = false; // Reserved for the team, customs, giveaways, collabs and so on. uint256 public reserved = 70; // Price of each token uint256 public price = 0.05 ether; // Maximum limit of tokens that can ever exist uint256 constant MAX_SUPPLY = 5555; // The base link that leads to the image / video of the token string public baseTokenURI; // Team addresses for withdrawals address public a1; address public a2; address public a3; address public a4; address public a5; // List of addresses that have a number of reserved tokens for presale mapping (address => uint256) public presaleReserved; constructor (string memory newBaseURI) ERC721 ("Clever Girls", "CG") { } // Override so the openzeppelin tokenURI() method will use this method to create the full tokenURI instead function _baseURI() internal view virtual override returns (string memory) { } // See which address owns which tokens function tokensOfOwner(address addr) public view returns(uint256[] memory) { } // Exclusive presale minting function mintPresale(uint256 _amount) public payable { } // Standard mint function function mintToken(uint256 _amount) public payable { } // Admin minting function to reserve tokens for the team, collabs, customs and giveaways function mintReserved(uint256 _amount) public onlyOwner { } // Edit reserved presale spots function editPresaleReserved(address[] memory _a, uint256[] memory _amount) public onlyOwner { } // Start and stop presale function setPresaleActive(bool val) public onlyOwner { } // Start and stop sale function setSaleActive(bool val) public onlyOwner { } // Set new baseURI function setBaseURI(string memory baseURI) public onlyOwner { } // Set a different price in case ETH changes drastically function setPrice(uint256 newPrice) public onlyOwner { } // Set team addresses function setAddresses(address[] memory _a) public onlyOwner { } // Withdraw funds from contract for the team function withdrawTeam(uint256 amount) public payable onlyOwner { uint256 percent = amount / 100; require(payable(a1).send(percent * 43)); // 43% for Fat Baby <3 require(<FILL_ME>) // 24% for Steamed Bun require(payable(a3).send(percent * 24)); // 24% for SINCOS require(payable(a4).send(percent * 5)); // 5% for the collection wallet require(payable(a5).send(percent * 4)); // 4% for ghost kid for writing and helping } }
payable(a2).send(percent*24)
370,717
payable(a2).send(percent*24)
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; contract CleverGirls is ERC721Enumerable, Ownable { using Address for address; // Starting and stopping sale and presale bool public saleActive = false; bool public presaleActive = false; // Reserved for the team, customs, giveaways, collabs and so on. uint256 public reserved = 70; // Price of each token uint256 public price = 0.05 ether; // Maximum limit of tokens that can ever exist uint256 constant MAX_SUPPLY = 5555; // The base link that leads to the image / video of the token string public baseTokenURI; // Team addresses for withdrawals address public a1; address public a2; address public a3; address public a4; address public a5; // List of addresses that have a number of reserved tokens for presale mapping (address => uint256) public presaleReserved; constructor (string memory newBaseURI) ERC721 ("Clever Girls", "CG") { } // Override so the openzeppelin tokenURI() method will use this method to create the full tokenURI instead function _baseURI() internal view virtual override returns (string memory) { } // See which address owns which tokens function tokensOfOwner(address addr) public view returns(uint256[] memory) { } // Exclusive presale minting function mintPresale(uint256 _amount) public payable { } // Standard mint function function mintToken(uint256 _amount) public payable { } // Admin minting function to reserve tokens for the team, collabs, customs and giveaways function mintReserved(uint256 _amount) public onlyOwner { } // Edit reserved presale spots function editPresaleReserved(address[] memory _a, uint256[] memory _amount) public onlyOwner { } // Start and stop presale function setPresaleActive(bool val) public onlyOwner { } // Start and stop sale function setSaleActive(bool val) public onlyOwner { } // Set new baseURI function setBaseURI(string memory baseURI) public onlyOwner { } // Set a different price in case ETH changes drastically function setPrice(uint256 newPrice) public onlyOwner { } // Set team addresses function setAddresses(address[] memory _a) public onlyOwner { } // Withdraw funds from contract for the team function withdrawTeam(uint256 amount) public payable onlyOwner { uint256 percent = amount / 100; require(payable(a1).send(percent * 43)); // 43% for Fat Baby <3 require(payable(a2).send(percent * 24)); // 24% for Steamed Bun require(<FILL_ME>) // 24% for SINCOS require(payable(a4).send(percent * 5)); // 5% for the collection wallet require(payable(a5).send(percent * 4)); // 4% for ghost kid for writing and helping } }
payable(a3).send(percent*24)
370,717
payable(a3).send(percent*24)
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; contract CleverGirls is ERC721Enumerable, Ownable { using Address for address; // Starting and stopping sale and presale bool public saleActive = false; bool public presaleActive = false; // Reserved for the team, customs, giveaways, collabs and so on. uint256 public reserved = 70; // Price of each token uint256 public price = 0.05 ether; // Maximum limit of tokens that can ever exist uint256 constant MAX_SUPPLY = 5555; // The base link that leads to the image / video of the token string public baseTokenURI; // Team addresses for withdrawals address public a1; address public a2; address public a3; address public a4; address public a5; // List of addresses that have a number of reserved tokens for presale mapping (address => uint256) public presaleReserved; constructor (string memory newBaseURI) ERC721 ("Clever Girls", "CG") { } // Override so the openzeppelin tokenURI() method will use this method to create the full tokenURI instead function _baseURI() internal view virtual override returns (string memory) { } // See which address owns which tokens function tokensOfOwner(address addr) public view returns(uint256[] memory) { } // Exclusive presale minting function mintPresale(uint256 _amount) public payable { } // Standard mint function function mintToken(uint256 _amount) public payable { } // Admin minting function to reserve tokens for the team, collabs, customs and giveaways function mintReserved(uint256 _amount) public onlyOwner { } // Edit reserved presale spots function editPresaleReserved(address[] memory _a, uint256[] memory _amount) public onlyOwner { } // Start and stop presale function setPresaleActive(bool val) public onlyOwner { } // Start and stop sale function setSaleActive(bool val) public onlyOwner { } // Set new baseURI function setBaseURI(string memory baseURI) public onlyOwner { } // Set a different price in case ETH changes drastically function setPrice(uint256 newPrice) public onlyOwner { } // Set team addresses function setAddresses(address[] memory _a) public onlyOwner { } // Withdraw funds from contract for the team function withdrawTeam(uint256 amount) public payable onlyOwner { uint256 percent = amount / 100; require(payable(a1).send(percent * 43)); // 43% for Fat Baby <3 require(payable(a2).send(percent * 24)); // 24% for Steamed Bun require(payable(a3).send(percent * 24)); // 24% for SINCOS require(<FILL_ME>) // 5% for the collection wallet require(payable(a5).send(percent * 4)); // 4% for ghost kid for writing and helping } }
payable(a4).send(percent*5)
370,717
payable(a4).send(percent*5)
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol'; import '@openzeppelin/contracts/access/Ownable.sol'; contract CleverGirls is ERC721Enumerable, Ownable { using Address for address; // Starting and stopping sale and presale bool public saleActive = false; bool public presaleActive = false; // Reserved for the team, customs, giveaways, collabs and so on. uint256 public reserved = 70; // Price of each token uint256 public price = 0.05 ether; // Maximum limit of tokens that can ever exist uint256 constant MAX_SUPPLY = 5555; // The base link that leads to the image / video of the token string public baseTokenURI; // Team addresses for withdrawals address public a1; address public a2; address public a3; address public a4; address public a5; // List of addresses that have a number of reserved tokens for presale mapping (address => uint256) public presaleReserved; constructor (string memory newBaseURI) ERC721 ("Clever Girls", "CG") { } // Override so the openzeppelin tokenURI() method will use this method to create the full tokenURI instead function _baseURI() internal view virtual override returns (string memory) { } // See which address owns which tokens function tokensOfOwner(address addr) public view returns(uint256[] memory) { } // Exclusive presale minting function mintPresale(uint256 _amount) public payable { } // Standard mint function function mintToken(uint256 _amount) public payable { } // Admin minting function to reserve tokens for the team, collabs, customs and giveaways function mintReserved(uint256 _amount) public onlyOwner { } // Edit reserved presale spots function editPresaleReserved(address[] memory _a, uint256[] memory _amount) public onlyOwner { } // Start and stop presale function setPresaleActive(bool val) public onlyOwner { } // Start and stop sale function setSaleActive(bool val) public onlyOwner { } // Set new baseURI function setBaseURI(string memory baseURI) public onlyOwner { } // Set a different price in case ETH changes drastically function setPrice(uint256 newPrice) public onlyOwner { } // Set team addresses function setAddresses(address[] memory _a) public onlyOwner { } // Withdraw funds from contract for the team function withdrawTeam(uint256 amount) public payable onlyOwner { uint256 percent = amount / 100; require(payable(a1).send(percent * 43)); // 43% for Fat Baby <3 require(payable(a2).send(percent * 24)); // 24% for Steamed Bun require(payable(a3).send(percent * 24)); // 24% for SINCOS require(payable(a4).send(percent * 5)); // 5% for the collection wallet require(<FILL_ME>) // 4% for ghost kid for writing and helping } }
payable(a5).send(percent*4)
370,717
payable(a5).send(percent*4)
"No artworks remaining in tier!"
pragma solidity ^0.8.0; //SPDX-License-Identifier: MIT import "./ILockingLayers.sol"; import "./VRFConsumerBase.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @dev LockingLayers is an ERC721 contract that contains the logic and source of ownership * for Whole Picture. The core mechanics breakdown as follows: * - Each artwork consists of 4 layers. * - A Layer contain a canvasId. * - Each layer shifts its canvasId after X blocks, unless the layer is locked. * - Layers are revealed over time, and the entire process ends after all layers are revelaed and * all layer shifts have finished. * * Schema is: * - artworkId => owned by address * - canvasIds[NUM_LAYERS] => owned by artwork => NUM_LAYERS = 4 so each artwork ownes 4 canvasIds * * Layer Mappings: * - Mappings from canvasId => canvas are stored offchain in IPFS. Mapping json file can be viewed * - at ipfs://QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD * * IMPORTANT NOTES: * - canvasIds and actionIds are 1 indexed, not 0 indexed. This is because a 0 index signifies that * a layer is not locked, and an actionId of 0 signifies that the action has not happened yet. */ contract LockingLayers is ILockingLayers, ERC721, VRFConsumerBase, Ownable { using SafeMath for uint256; // Total number of artworks to create uint16 constant TOTAL_ARTWORK_SUPPLY = 1200; // The layerIds owned by each artwork uint8 constant NUM_LAYERS = 4; // Actions are shifts per each layer // NOTE: all actions are 1 indexed, not 0 indexed. This is because an action idx of // 0 means that layer does nto exist yet uint8 constant ACTIONS_PER_LAYER = 5; // Defines number blocks required to trigger an action uint16 constant BLOCKS_PER_ACTION = 4444; // Total number of actions for the project uint16 constant MAX_ACTIONS = ACTIONS_PER_LAYER * NUM_LAYERS; // There will be the same number of layerIds because each artwork is guaranteed to have 4 layers uint16 constant NUM_CANVAS_IDS = TOTAL_ARTWORK_SUPPLY; // Number of artworks in each tier uint16[3] totalArtworksInTier = [200, 800, 200]; // remaining artworks in each tier that can be purchased uint16[3] artworksRemainingInTier = [200, 800, 200]; // CID of the mappings from canvasId to canvas! View on ipfs. string constant provinanceRecord = "QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD"; // First artwork will be id of 0 uint16 nextArtworkId = 0; // Records the official uint256 private _startBlock = 0; // True once artwork has begun (once VRF has been received) bool private isArtworkStarted = false; // Block that stores first time of first purchase uint256 public firstPurchaseBlock = 0; // If not all artworks are sold, will trigger start this many blocks after first artwork purchased uint256 public constant AUTOMATIC_START_BLOCK_DELAY = 184000; // Mapping to the artwork tier for each token // artworkId => tier mapping(uint256 => ArtworkTier) public artworkTier; // The constant number of locks for each purchase tier. uint8[4] locksPerTier = [1, 2, 4]; // Remaining locks per artwork -- each lock will decrement value // artworkId => _locksRemaining mapping(uint256 => uint8) _locksRemaining; // A record of locked layers for each token: // artworkId => lockedCanvasId[NUM_LAYERS] // NOTE: a value of 0 signifies that a layer is NOT locked // - Example: // - lockedLayersForToken[100][1] = 10 // - can be read as artworkId 100 has layer 1 (0 indexed) locked with canvasId 10. // - lockedLayerForToken[100][0] = 0 // - can be read as artworkId 100's layer 0 is NOT locked mapping(uint256 => uint16[NUM_LAYERS]) lockedLayersForToken; // A record of if an artwork is locked and at which action it was locked. // canvasId => actionId[NUM_LAYERS] -> ~7 actions per layer so uint8 is good for actionId // canvasIds are reused for each layer to save on storage costs. // - Example: // - lockedLayerHistory[10][1] = 2 // - can be read as canvasId 10 for second layer (0 indexed) was locked on action 2 // - lockedLayerHistory[10][2] = 0 // - can be read as canvasId 10 has NOT BEEN LOCKED for third layer mapping(uint16 => uint8[NUM_LAYERS]) lockedLayerHistory; // Offsets for layerIds for each layer, used when finding base id for next layer // The [0] index is set by Chainlink VRF (https://docs.chain.link/docs/chainlink-vrf-api-reference) // Later indexes are only influenced by participants locking layers, so the artwork is // more connected with the behaviour of the participants. // INVARIANT: Can only change for future UNLOCKED layer, can never be altered for // past layers. Needs to be deterministic for past/current layers. // - Example: // - layerIdStartOffset[1] = 19413 // - can be read as the starting canvasId will be offset by 19413 uint256[NUM_LAYERS] public canvasIdStartOffsets; // CHAINLINK VRF properties -- want to keep locally to test gas spend bytes32 constant keyHash = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445; uint256 constant vrfFee = 2000000000000000000; // Store the current URI -- URI may change if domain is updated string baseURI = "https://su3p5zea28.execute-api.us-west-1.amazonaws.com/prod/metadata/"; constructor() ERC721("Whole Picture", "WP") VRFConsumerBase( 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952, 0x514910771AF9Ca656af840dff83E8264EcF986CA ) public { } /** * @dev Metadata base uri */ function _baseURI() internal view override returns (string memory) { } /** * @dev Returns the currnet price in wei for an artwork in a given tier. * Pricing is a bonding curve, using 4 quadratic easing sections: * - Enthusiast tier is an ease out curve * - Collector tier is ease in segment until midway point, then ease out * - Strata tier is ease in. */ function currentPrice(ArtworkTier tier) public override view returns (uint256) { } /** * @dev Get the price and available artworks for a given tier * - Returns: * - uint256 => PRICE in wei * - uint256 => available artworks */ function getTierPurchaseData(ArtworkTier tier) public override view returns (uint256, uint16) { } /** * @dev Returns the number of artworks issued. */ function totalArtworks() public override pure returns (uint16) { } /** * @dev Returns the total artworks remaining across all tiers. */ function availableArtworks() public override view returns (uint16) { } /** * @dev The number of blocks remaining until next layer is revealed. */ function blocksUntilNextLayerRevealed() public override view returns (uint256) { } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function canLock(uint256 artworkId) public override view returns (bool) { } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function locksRemaining(uint256 artworkId) public view returns (uint8) { } /** * @dev Get canvasIds for each layer for artwork. */ function getCanvasIds(uint256 artworkId) public override view returns (uint16, uint16, uint16, uint16) { } /** * @dev Returns the startBlock for the artwork. * There are two conditions for the artwork to start -- either all artworks are sold, * or the automatic trigger started after the first artwork has sold has been reached. */ function startBlock() public view returns (uint256) { } /** * @dev Check whether the artwork has started. */ function hasStarted() public view returns (bool) { } /** * @dev Gets the overall action since the start of the process. * NOTE: Actions are 1 indexed! 0 means no actions because has not begun. */ function getAction() public view returns (uint8) { } /** * @dev Returns the current layer as well as the current action. * - Returns: * - (layer, actionInLayer) * - If action == 0, then layer is not revealed */ function getCurrentLayerAndAction() public view returns (uint8, uint8) { } /** * @dev Purchases an artwork. * - Returns the artworkID of purchased work. * - Reverts if insuffiscient funds or no artworks left. */ function purchase(ArtworkTier tier) public override payable returns (uint256) { require(<FILL_ME>) // Validate payment amount uint256 weiRequired = currentPrice(tier); require(msg.value >= weiRequired, "Not enough payment sent!"); uint256 newArtworkId = nextArtworkId; // check if first sale, and if so set first sale block if(newArtworkId == 0) { firstPurchaseBlock = block.number; } // mint new artwork! _safeMint(_msgSender(), newArtworkId); // record tier and the number of locks artworkTier[newArtworkId] = tier; _locksRemaining[newArtworkId] = locksPerTier[uint256(tier)]; // decrement artworks available in tier artworksRemainingInTier[uint256(tier)] -= 1; // incriment artwork to the next artworkId nextArtworkId++; // check if all artworks sold, then trigger startBlock if not already started if(nextArtworkId == TOTAL_ARTWORK_SUPPLY) { if(!hasStarted()) { requestStartArtwork(); } } emit ArtworkPurchased(newArtworkId, uint8(tier)); return newArtworkId; } /** * @dev Request to start the artwork! * - Acheived by requesting a random number from Chainlink VRF. * - Will automatically be requested after the last sale -- or can be requested * manually once sale period has ended. * Requirements: * Can only occur after: * - All works have been sold * - Sale period ended (X blocks past the block of the first purchase) * - Has not already been started * - Enough LINK on contract */ function requestStartArtwork() public returns (bytes32) { } /** * @dev Respond to Chainlink VRF * - This will start artwork if not already started */ function fulfillRandomness(bytes32 /*requestId*/, uint256 randomness) internal override { } /** * @dev Start the artwork! This sets the start seed and start block. * - Can only be called once */ function startArtwork(uint256 randomSeed) internal { } /** * @dev Lock artwork layer. * - Reverts if cannot lock. * - Emits LayerLocked event */ function lockLayer(uint256 artworkId) public override { } /** * @dev Valid canvasIds are always 1 indexed! An index of 0 means canvas is not yet revealed. */ function incrimentCanvasId(uint16 canvasId) internal pure returns (uint16) { } /** * @dev Gets the corresponding canvasId for an artwork and layer at a given action. * This function calculates the current canvas by starting at first canvas of the current * layer and recreating past actions, which leads to the current valid layer. * - Each artworkID should ALWAYS return a unique canvas ID for the same action state. * - CanvasIds are 1 indexed, so a revealed canvas should NEVER return 0! */ function getCanvasIdForAction(uint256 artworkId, uint8 layer, uint8 action) internal view returns (uint16) { } /** * @dev Ease in quadratic lerp function -- x * x, invert for ease out */ function easeInQuad(uint256 min, uint256 max, uint256 numerator, uint256 denominator) internal pure returns (uint256) { } /** * @dev Updates the URI in case of domain change or switch to IPFS in the future; */ function setBaseURI(string calldata newURI) public onlyOwner { } /** * @dev Withdrawl funds to owner * - This saves gas vs if each payment was sent to owner */ function withdrawlFunds() public { } }
artworksRemainingInTier[uint256(tier)]>0,"No artworks remaining in tier!"
370,752
artworksRemainingInTier[uint256(tier)]>0
"Artwork has already been started!"
pragma solidity ^0.8.0; //SPDX-License-Identifier: MIT import "./ILockingLayers.sol"; import "./VRFConsumerBase.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @dev LockingLayers is an ERC721 contract that contains the logic and source of ownership * for Whole Picture. The core mechanics breakdown as follows: * - Each artwork consists of 4 layers. * - A Layer contain a canvasId. * - Each layer shifts its canvasId after X blocks, unless the layer is locked. * - Layers are revealed over time, and the entire process ends after all layers are revelaed and * all layer shifts have finished. * * Schema is: * - artworkId => owned by address * - canvasIds[NUM_LAYERS] => owned by artwork => NUM_LAYERS = 4 so each artwork ownes 4 canvasIds * * Layer Mappings: * - Mappings from canvasId => canvas are stored offchain in IPFS. Mapping json file can be viewed * - at ipfs://QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD * * IMPORTANT NOTES: * - canvasIds and actionIds are 1 indexed, not 0 indexed. This is because a 0 index signifies that * a layer is not locked, and an actionId of 0 signifies that the action has not happened yet. */ contract LockingLayers is ILockingLayers, ERC721, VRFConsumerBase, Ownable { using SafeMath for uint256; // Total number of artworks to create uint16 constant TOTAL_ARTWORK_SUPPLY = 1200; // The layerIds owned by each artwork uint8 constant NUM_LAYERS = 4; // Actions are shifts per each layer // NOTE: all actions are 1 indexed, not 0 indexed. This is because an action idx of // 0 means that layer does nto exist yet uint8 constant ACTIONS_PER_LAYER = 5; // Defines number blocks required to trigger an action uint16 constant BLOCKS_PER_ACTION = 4444; // Total number of actions for the project uint16 constant MAX_ACTIONS = ACTIONS_PER_LAYER * NUM_LAYERS; // There will be the same number of layerIds because each artwork is guaranteed to have 4 layers uint16 constant NUM_CANVAS_IDS = TOTAL_ARTWORK_SUPPLY; // Number of artworks in each tier uint16[3] totalArtworksInTier = [200, 800, 200]; // remaining artworks in each tier that can be purchased uint16[3] artworksRemainingInTier = [200, 800, 200]; // CID of the mappings from canvasId to canvas! View on ipfs. string constant provinanceRecord = "QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD"; // First artwork will be id of 0 uint16 nextArtworkId = 0; // Records the official uint256 private _startBlock = 0; // True once artwork has begun (once VRF has been received) bool private isArtworkStarted = false; // Block that stores first time of first purchase uint256 public firstPurchaseBlock = 0; // If not all artworks are sold, will trigger start this many blocks after first artwork purchased uint256 public constant AUTOMATIC_START_BLOCK_DELAY = 184000; // Mapping to the artwork tier for each token // artworkId => tier mapping(uint256 => ArtworkTier) public artworkTier; // The constant number of locks for each purchase tier. uint8[4] locksPerTier = [1, 2, 4]; // Remaining locks per artwork -- each lock will decrement value // artworkId => _locksRemaining mapping(uint256 => uint8) _locksRemaining; // A record of locked layers for each token: // artworkId => lockedCanvasId[NUM_LAYERS] // NOTE: a value of 0 signifies that a layer is NOT locked // - Example: // - lockedLayersForToken[100][1] = 10 // - can be read as artworkId 100 has layer 1 (0 indexed) locked with canvasId 10. // - lockedLayerForToken[100][0] = 0 // - can be read as artworkId 100's layer 0 is NOT locked mapping(uint256 => uint16[NUM_LAYERS]) lockedLayersForToken; // A record of if an artwork is locked and at which action it was locked. // canvasId => actionId[NUM_LAYERS] -> ~7 actions per layer so uint8 is good for actionId // canvasIds are reused for each layer to save on storage costs. // - Example: // - lockedLayerHistory[10][1] = 2 // - can be read as canvasId 10 for second layer (0 indexed) was locked on action 2 // - lockedLayerHistory[10][2] = 0 // - can be read as canvasId 10 has NOT BEEN LOCKED for third layer mapping(uint16 => uint8[NUM_LAYERS]) lockedLayerHistory; // Offsets for layerIds for each layer, used when finding base id for next layer // The [0] index is set by Chainlink VRF (https://docs.chain.link/docs/chainlink-vrf-api-reference) // Later indexes are only influenced by participants locking layers, so the artwork is // more connected with the behaviour of the participants. // INVARIANT: Can only change for future UNLOCKED layer, can never be altered for // past layers. Needs to be deterministic for past/current layers. // - Example: // - layerIdStartOffset[1] = 19413 // - can be read as the starting canvasId will be offset by 19413 uint256[NUM_LAYERS] public canvasIdStartOffsets; // CHAINLINK VRF properties -- want to keep locally to test gas spend bytes32 constant keyHash = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445; uint256 constant vrfFee = 2000000000000000000; // Store the current URI -- URI may change if domain is updated string baseURI = "https://su3p5zea28.execute-api.us-west-1.amazonaws.com/prod/metadata/"; constructor() ERC721("Whole Picture", "WP") VRFConsumerBase( 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952, 0x514910771AF9Ca656af840dff83E8264EcF986CA ) public { } /** * @dev Metadata base uri */ function _baseURI() internal view override returns (string memory) { } /** * @dev Returns the currnet price in wei for an artwork in a given tier. * Pricing is a bonding curve, using 4 quadratic easing sections: * - Enthusiast tier is an ease out curve * - Collector tier is ease in segment until midway point, then ease out * - Strata tier is ease in. */ function currentPrice(ArtworkTier tier) public override view returns (uint256) { } /** * @dev Get the price and available artworks for a given tier * - Returns: * - uint256 => PRICE in wei * - uint256 => available artworks */ function getTierPurchaseData(ArtworkTier tier) public override view returns (uint256, uint16) { } /** * @dev Returns the number of artworks issued. */ function totalArtworks() public override pure returns (uint16) { } /** * @dev Returns the total artworks remaining across all tiers. */ function availableArtworks() public override view returns (uint16) { } /** * @dev The number of blocks remaining until next layer is revealed. */ function blocksUntilNextLayerRevealed() public override view returns (uint256) { } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function canLock(uint256 artworkId) public override view returns (bool) { } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function locksRemaining(uint256 artworkId) public view returns (uint8) { } /** * @dev Get canvasIds for each layer for artwork. */ function getCanvasIds(uint256 artworkId) public override view returns (uint16, uint16, uint16, uint16) { } /** * @dev Returns the startBlock for the artwork. * There are two conditions for the artwork to start -- either all artworks are sold, * or the automatic trigger started after the first artwork has sold has been reached. */ function startBlock() public view returns (uint256) { } /** * @dev Check whether the artwork has started. */ function hasStarted() public view returns (bool) { } /** * @dev Gets the overall action since the start of the process. * NOTE: Actions are 1 indexed! 0 means no actions because has not begun. */ function getAction() public view returns (uint8) { } /** * @dev Returns the current layer as well as the current action. * - Returns: * - (layer, actionInLayer) * - If action == 0, then layer is not revealed */ function getCurrentLayerAndAction() public view returns (uint8, uint8) { } /** * @dev Purchases an artwork. * - Returns the artworkID of purchased work. * - Reverts if insuffiscient funds or no artworks left. */ function purchase(ArtworkTier tier) public override payable returns (uint256) { } /** * @dev Request to start the artwork! * - Acheived by requesting a random number from Chainlink VRF. * - Will automatically be requested after the last sale -- or can be requested * manually once sale period has ended. * Requirements: * Can only occur after: * - All works have been sold * - Sale period ended (X blocks past the block of the first purchase) * - Has not already been started * - Enough LINK on contract */ function requestStartArtwork() public returns (bytes32) { require(<FILL_ME>) // Require all artworks sold or after sale period has ended require( availableArtworks() == 0 || firstPurchaseBlock > 0 && block.number > firstPurchaseBlock + AUTOMATIC_START_BLOCK_DELAY, "Cannot start the artwork before all works are sold out or until after sale period" ); // Request randomness from VRF return requestRandomness(keyHash, vrfFee, block.number); } /** * @dev Respond to Chainlink VRF * - This will start artwork if not already started */ function fulfillRandomness(bytes32 /*requestId*/, uint256 randomness) internal override { } /** * @dev Start the artwork! This sets the start seed and start block. * - Can only be called once */ function startArtwork(uint256 randomSeed) internal { } /** * @dev Lock artwork layer. * - Reverts if cannot lock. * - Emits LayerLocked event */ function lockLayer(uint256 artworkId) public override { } /** * @dev Valid canvasIds are always 1 indexed! An index of 0 means canvas is not yet revealed. */ function incrimentCanvasId(uint16 canvasId) internal pure returns (uint16) { } /** * @dev Gets the corresponding canvasId for an artwork and layer at a given action. * This function calculates the current canvas by starting at first canvas of the current * layer and recreating past actions, which leads to the current valid layer. * - Each artworkID should ALWAYS return a unique canvas ID for the same action state. * - CanvasIds are 1 indexed, so a revealed canvas should NEVER return 0! */ function getCanvasIdForAction(uint256 artworkId, uint8 layer, uint8 action) internal view returns (uint16) { } /** * @dev Ease in quadratic lerp function -- x * x, invert for ease out */ function easeInQuad(uint256 min, uint256 max, uint256 numerator, uint256 denominator) internal pure returns (uint256) { } /** * @dev Updates the URI in case of domain change or switch to IPFS in the future; */ function setBaseURI(string calldata newURI) public onlyOwner { } /** * @dev Withdrawl funds to owner * - This saves gas vs if each payment was sent to owner */ function withdrawlFunds() public { } }
!hasStarted(),"Artwork has already been started!"
370,752
!hasStarted()
"Cannot start the artwork before all works are sold out or until after sale period"
pragma solidity ^0.8.0; //SPDX-License-Identifier: MIT import "./ILockingLayers.sol"; import "./VRFConsumerBase.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @dev LockingLayers is an ERC721 contract that contains the logic and source of ownership * for Whole Picture. The core mechanics breakdown as follows: * - Each artwork consists of 4 layers. * - A Layer contain a canvasId. * - Each layer shifts its canvasId after X blocks, unless the layer is locked. * - Layers are revealed over time, and the entire process ends after all layers are revelaed and * all layer shifts have finished. * * Schema is: * - artworkId => owned by address * - canvasIds[NUM_LAYERS] => owned by artwork => NUM_LAYERS = 4 so each artwork ownes 4 canvasIds * * Layer Mappings: * - Mappings from canvasId => canvas are stored offchain in IPFS. Mapping json file can be viewed * - at ipfs://QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD * * IMPORTANT NOTES: * - canvasIds and actionIds are 1 indexed, not 0 indexed. This is because a 0 index signifies that * a layer is not locked, and an actionId of 0 signifies that the action has not happened yet. */ contract LockingLayers is ILockingLayers, ERC721, VRFConsumerBase, Ownable { using SafeMath for uint256; // Total number of artworks to create uint16 constant TOTAL_ARTWORK_SUPPLY = 1200; // The layerIds owned by each artwork uint8 constant NUM_LAYERS = 4; // Actions are shifts per each layer // NOTE: all actions are 1 indexed, not 0 indexed. This is because an action idx of // 0 means that layer does nto exist yet uint8 constant ACTIONS_PER_LAYER = 5; // Defines number blocks required to trigger an action uint16 constant BLOCKS_PER_ACTION = 4444; // Total number of actions for the project uint16 constant MAX_ACTIONS = ACTIONS_PER_LAYER * NUM_LAYERS; // There will be the same number of layerIds because each artwork is guaranteed to have 4 layers uint16 constant NUM_CANVAS_IDS = TOTAL_ARTWORK_SUPPLY; // Number of artworks in each tier uint16[3] totalArtworksInTier = [200, 800, 200]; // remaining artworks in each tier that can be purchased uint16[3] artworksRemainingInTier = [200, 800, 200]; // CID of the mappings from canvasId to canvas! View on ipfs. string constant provinanceRecord = "QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD"; // First artwork will be id of 0 uint16 nextArtworkId = 0; // Records the official uint256 private _startBlock = 0; // True once artwork has begun (once VRF has been received) bool private isArtworkStarted = false; // Block that stores first time of first purchase uint256 public firstPurchaseBlock = 0; // If not all artworks are sold, will trigger start this many blocks after first artwork purchased uint256 public constant AUTOMATIC_START_BLOCK_DELAY = 184000; // Mapping to the artwork tier for each token // artworkId => tier mapping(uint256 => ArtworkTier) public artworkTier; // The constant number of locks for each purchase tier. uint8[4] locksPerTier = [1, 2, 4]; // Remaining locks per artwork -- each lock will decrement value // artworkId => _locksRemaining mapping(uint256 => uint8) _locksRemaining; // A record of locked layers for each token: // artworkId => lockedCanvasId[NUM_LAYERS] // NOTE: a value of 0 signifies that a layer is NOT locked // - Example: // - lockedLayersForToken[100][1] = 10 // - can be read as artworkId 100 has layer 1 (0 indexed) locked with canvasId 10. // - lockedLayerForToken[100][0] = 0 // - can be read as artworkId 100's layer 0 is NOT locked mapping(uint256 => uint16[NUM_LAYERS]) lockedLayersForToken; // A record of if an artwork is locked and at which action it was locked. // canvasId => actionId[NUM_LAYERS] -> ~7 actions per layer so uint8 is good for actionId // canvasIds are reused for each layer to save on storage costs. // - Example: // - lockedLayerHistory[10][1] = 2 // - can be read as canvasId 10 for second layer (0 indexed) was locked on action 2 // - lockedLayerHistory[10][2] = 0 // - can be read as canvasId 10 has NOT BEEN LOCKED for third layer mapping(uint16 => uint8[NUM_LAYERS]) lockedLayerHistory; // Offsets for layerIds for each layer, used when finding base id for next layer // The [0] index is set by Chainlink VRF (https://docs.chain.link/docs/chainlink-vrf-api-reference) // Later indexes are only influenced by participants locking layers, so the artwork is // more connected with the behaviour of the participants. // INVARIANT: Can only change for future UNLOCKED layer, can never be altered for // past layers. Needs to be deterministic for past/current layers. // - Example: // - layerIdStartOffset[1] = 19413 // - can be read as the starting canvasId will be offset by 19413 uint256[NUM_LAYERS] public canvasIdStartOffsets; // CHAINLINK VRF properties -- want to keep locally to test gas spend bytes32 constant keyHash = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445; uint256 constant vrfFee = 2000000000000000000; // Store the current URI -- URI may change if domain is updated string baseURI = "https://su3p5zea28.execute-api.us-west-1.amazonaws.com/prod/metadata/"; constructor() ERC721("Whole Picture", "WP") VRFConsumerBase( 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952, 0x514910771AF9Ca656af840dff83E8264EcF986CA ) public { } /** * @dev Metadata base uri */ function _baseURI() internal view override returns (string memory) { } /** * @dev Returns the currnet price in wei for an artwork in a given tier. * Pricing is a bonding curve, using 4 quadratic easing sections: * - Enthusiast tier is an ease out curve * - Collector tier is ease in segment until midway point, then ease out * - Strata tier is ease in. */ function currentPrice(ArtworkTier tier) public override view returns (uint256) { } /** * @dev Get the price and available artworks for a given tier * - Returns: * - uint256 => PRICE in wei * - uint256 => available artworks */ function getTierPurchaseData(ArtworkTier tier) public override view returns (uint256, uint16) { } /** * @dev Returns the number of artworks issued. */ function totalArtworks() public override pure returns (uint16) { } /** * @dev Returns the total artworks remaining across all tiers. */ function availableArtworks() public override view returns (uint16) { } /** * @dev The number of blocks remaining until next layer is revealed. */ function blocksUntilNextLayerRevealed() public override view returns (uint256) { } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function canLock(uint256 artworkId) public override view returns (bool) { } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function locksRemaining(uint256 artworkId) public view returns (uint8) { } /** * @dev Get canvasIds for each layer for artwork. */ function getCanvasIds(uint256 artworkId) public override view returns (uint16, uint16, uint16, uint16) { } /** * @dev Returns the startBlock for the artwork. * There are two conditions for the artwork to start -- either all artworks are sold, * or the automatic trigger started after the first artwork has sold has been reached. */ function startBlock() public view returns (uint256) { } /** * @dev Check whether the artwork has started. */ function hasStarted() public view returns (bool) { } /** * @dev Gets the overall action since the start of the process. * NOTE: Actions are 1 indexed! 0 means no actions because has not begun. */ function getAction() public view returns (uint8) { } /** * @dev Returns the current layer as well as the current action. * - Returns: * - (layer, actionInLayer) * - If action == 0, then layer is not revealed */ function getCurrentLayerAndAction() public view returns (uint8, uint8) { } /** * @dev Purchases an artwork. * - Returns the artworkID of purchased work. * - Reverts if insuffiscient funds or no artworks left. */ function purchase(ArtworkTier tier) public override payable returns (uint256) { } /** * @dev Request to start the artwork! * - Acheived by requesting a random number from Chainlink VRF. * - Will automatically be requested after the last sale -- or can be requested * manually once sale period has ended. * Requirements: * Can only occur after: * - All works have been sold * - Sale period ended (X blocks past the block of the first purchase) * - Has not already been started * - Enough LINK on contract */ function requestStartArtwork() public returns (bytes32) { require(!hasStarted(), "Artwork has already been started!"); // Require all artworks sold or after sale period has ended require(<FILL_ME>) // Request randomness from VRF return requestRandomness(keyHash, vrfFee, block.number); } /** * @dev Respond to Chainlink VRF * - This will start artwork if not already started */ function fulfillRandomness(bytes32 /*requestId*/, uint256 randomness) internal override { } /** * @dev Start the artwork! This sets the start seed and start block. * - Can only be called once */ function startArtwork(uint256 randomSeed) internal { } /** * @dev Lock artwork layer. * - Reverts if cannot lock. * - Emits LayerLocked event */ function lockLayer(uint256 artworkId) public override { } /** * @dev Valid canvasIds are always 1 indexed! An index of 0 means canvas is not yet revealed. */ function incrimentCanvasId(uint16 canvasId) internal pure returns (uint16) { } /** * @dev Gets the corresponding canvasId for an artwork and layer at a given action. * This function calculates the current canvas by starting at first canvas of the current * layer and recreating past actions, which leads to the current valid layer. * - Each artworkID should ALWAYS return a unique canvas ID for the same action state. * - CanvasIds are 1 indexed, so a revealed canvas should NEVER return 0! */ function getCanvasIdForAction(uint256 artworkId, uint8 layer, uint8 action) internal view returns (uint16) { } /** * @dev Ease in quadratic lerp function -- x * x, invert for ease out */ function easeInQuad(uint256 min, uint256 max, uint256 numerator, uint256 denominator) internal pure returns (uint256) { } /** * @dev Updates the URI in case of domain change or switch to IPFS in the future; */ function setBaseURI(string calldata newURI) public onlyOwner { } /** * @dev Withdrawl funds to owner * - This saves gas vs if each payment was sent to owner */ function withdrawlFunds() public { } }
availableArtworks()==0||firstPurchaseBlock>0&&block.number>firstPurchaseBlock+AUTOMATIC_START_BLOCK_DELAY,"Cannot start the artwork before all works are sold out or until after sale period"
370,752
availableArtworks()==0||firstPurchaseBlock>0&&block.number>firstPurchaseBlock+AUTOMATIC_START_BLOCK_DELAY
"Art event has not begun!"
pragma solidity ^0.8.0; //SPDX-License-Identifier: MIT import "./ILockingLayers.sol"; import "./VRFConsumerBase.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @dev LockingLayers is an ERC721 contract that contains the logic and source of ownership * for Whole Picture. The core mechanics breakdown as follows: * - Each artwork consists of 4 layers. * - A Layer contain a canvasId. * - Each layer shifts its canvasId after X blocks, unless the layer is locked. * - Layers are revealed over time, and the entire process ends after all layers are revelaed and * all layer shifts have finished. * * Schema is: * - artworkId => owned by address * - canvasIds[NUM_LAYERS] => owned by artwork => NUM_LAYERS = 4 so each artwork ownes 4 canvasIds * * Layer Mappings: * - Mappings from canvasId => canvas are stored offchain in IPFS. Mapping json file can be viewed * - at ipfs://QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD * * IMPORTANT NOTES: * - canvasIds and actionIds are 1 indexed, not 0 indexed. This is because a 0 index signifies that * a layer is not locked, and an actionId of 0 signifies that the action has not happened yet. */ contract LockingLayers is ILockingLayers, ERC721, VRFConsumerBase, Ownable { using SafeMath for uint256; // Total number of artworks to create uint16 constant TOTAL_ARTWORK_SUPPLY = 1200; // The layerIds owned by each artwork uint8 constant NUM_LAYERS = 4; // Actions are shifts per each layer // NOTE: all actions are 1 indexed, not 0 indexed. This is because an action idx of // 0 means that layer does nto exist yet uint8 constant ACTIONS_PER_LAYER = 5; // Defines number blocks required to trigger an action uint16 constant BLOCKS_PER_ACTION = 4444; // Total number of actions for the project uint16 constant MAX_ACTIONS = ACTIONS_PER_LAYER * NUM_LAYERS; // There will be the same number of layerIds because each artwork is guaranteed to have 4 layers uint16 constant NUM_CANVAS_IDS = TOTAL_ARTWORK_SUPPLY; // Number of artworks in each tier uint16[3] totalArtworksInTier = [200, 800, 200]; // remaining artworks in each tier that can be purchased uint16[3] artworksRemainingInTier = [200, 800, 200]; // CID of the mappings from canvasId to canvas! View on ipfs. string constant provinanceRecord = "QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD"; // First artwork will be id of 0 uint16 nextArtworkId = 0; // Records the official uint256 private _startBlock = 0; // True once artwork has begun (once VRF has been received) bool private isArtworkStarted = false; // Block that stores first time of first purchase uint256 public firstPurchaseBlock = 0; // If not all artworks are sold, will trigger start this many blocks after first artwork purchased uint256 public constant AUTOMATIC_START_BLOCK_DELAY = 184000; // Mapping to the artwork tier for each token // artworkId => tier mapping(uint256 => ArtworkTier) public artworkTier; // The constant number of locks for each purchase tier. uint8[4] locksPerTier = [1, 2, 4]; // Remaining locks per artwork -- each lock will decrement value // artworkId => _locksRemaining mapping(uint256 => uint8) _locksRemaining; // A record of locked layers for each token: // artworkId => lockedCanvasId[NUM_LAYERS] // NOTE: a value of 0 signifies that a layer is NOT locked // - Example: // - lockedLayersForToken[100][1] = 10 // - can be read as artworkId 100 has layer 1 (0 indexed) locked with canvasId 10. // - lockedLayerForToken[100][0] = 0 // - can be read as artworkId 100's layer 0 is NOT locked mapping(uint256 => uint16[NUM_LAYERS]) lockedLayersForToken; // A record of if an artwork is locked and at which action it was locked. // canvasId => actionId[NUM_LAYERS] -> ~7 actions per layer so uint8 is good for actionId // canvasIds are reused for each layer to save on storage costs. // - Example: // - lockedLayerHistory[10][1] = 2 // - can be read as canvasId 10 for second layer (0 indexed) was locked on action 2 // - lockedLayerHistory[10][2] = 0 // - can be read as canvasId 10 has NOT BEEN LOCKED for third layer mapping(uint16 => uint8[NUM_LAYERS]) lockedLayerHistory; // Offsets for layerIds for each layer, used when finding base id for next layer // The [0] index is set by Chainlink VRF (https://docs.chain.link/docs/chainlink-vrf-api-reference) // Later indexes are only influenced by participants locking layers, so the artwork is // more connected with the behaviour of the participants. // INVARIANT: Can only change for future UNLOCKED layer, can never be altered for // past layers. Needs to be deterministic for past/current layers. // - Example: // - layerIdStartOffset[1] = 19413 // - can be read as the starting canvasId will be offset by 19413 uint256[NUM_LAYERS] public canvasIdStartOffsets; // CHAINLINK VRF properties -- want to keep locally to test gas spend bytes32 constant keyHash = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445; uint256 constant vrfFee = 2000000000000000000; // Store the current URI -- URI may change if domain is updated string baseURI = "https://su3p5zea28.execute-api.us-west-1.amazonaws.com/prod/metadata/"; constructor() ERC721("Whole Picture", "WP") VRFConsumerBase( 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952, 0x514910771AF9Ca656af840dff83E8264EcF986CA ) public { } /** * @dev Metadata base uri */ function _baseURI() internal view override returns (string memory) { } /** * @dev Returns the currnet price in wei for an artwork in a given tier. * Pricing is a bonding curve, using 4 quadratic easing sections: * - Enthusiast tier is an ease out curve * - Collector tier is ease in segment until midway point, then ease out * - Strata tier is ease in. */ function currentPrice(ArtworkTier tier) public override view returns (uint256) { } /** * @dev Get the price and available artworks for a given tier * - Returns: * - uint256 => PRICE in wei * - uint256 => available artworks */ function getTierPurchaseData(ArtworkTier tier) public override view returns (uint256, uint16) { } /** * @dev Returns the number of artworks issued. */ function totalArtworks() public override pure returns (uint16) { } /** * @dev Returns the total artworks remaining across all tiers. */ function availableArtworks() public override view returns (uint16) { } /** * @dev The number of blocks remaining until next layer is revealed. */ function blocksUntilNextLayerRevealed() public override view returns (uint256) { } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function canLock(uint256 artworkId) public override view returns (bool) { } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function locksRemaining(uint256 artworkId) public view returns (uint8) { } /** * @dev Get canvasIds for each layer for artwork. */ function getCanvasIds(uint256 artworkId) public override view returns (uint16, uint16, uint16, uint16) { } /** * @dev Returns the startBlock for the artwork. * There are two conditions for the artwork to start -- either all artworks are sold, * or the automatic trigger started after the first artwork has sold has been reached. */ function startBlock() public view returns (uint256) { } /** * @dev Check whether the artwork has started. */ function hasStarted() public view returns (bool) { } /** * @dev Gets the overall action since the start of the process. * NOTE: Actions are 1 indexed! 0 means no actions because has not begun. */ function getAction() public view returns (uint8) { } /** * @dev Returns the current layer as well as the current action. * - Returns: * - (layer, actionInLayer) * - If action == 0, then layer is not revealed */ function getCurrentLayerAndAction() public view returns (uint8, uint8) { } /** * @dev Purchases an artwork. * - Returns the artworkID of purchased work. * - Reverts if insuffiscient funds or no artworks left. */ function purchase(ArtworkTier tier) public override payable returns (uint256) { } /** * @dev Request to start the artwork! * - Acheived by requesting a random number from Chainlink VRF. * - Will automatically be requested after the last sale -- or can be requested * manually once sale period has ended. * Requirements: * Can only occur after: * - All works have been sold * - Sale period ended (X blocks past the block of the first purchase) * - Has not already been started * - Enough LINK on contract */ function requestStartArtwork() public returns (bytes32) { } /** * @dev Respond to Chainlink VRF * - This will start artwork if not already started */ function fulfillRandomness(bytes32 /*requestId*/, uint256 randomness) internal override { } /** * @dev Start the artwork! This sets the start seed and start block. * - Can only be called once */ function startArtwork(uint256 randomSeed) internal { } /** * @dev Lock artwork layer. * - Reverts if cannot lock. * - Emits LayerLocked event */ function lockLayer(uint256 artworkId) public override { require(<FILL_ME>) require(_exists(artworkId), "Artwork does not exist!"); // require locking party to be owner require(_msgSender() == ownerOf(artworkId), "Must be artwork owner!"); // require locks remaining require(canLock(artworkId), "No locks remaining!"); // first determine active layer and current action (uint8 currentLayer, uint8 currentAction) = getCurrentLayerAndAction(); // Ensure we are not on action 0, which means cannot lock require(currentAction > 0, "Canvas is not yet revealed!"); // recreate history to determine current canvas uint16 currentCanvasId = getCanvasIdForAction(artworkId, currentLayer, currentAction); // ensure not already locked so user does not waste lock uint8 currLockedValue = lockedLayerHistory[currentCanvasId][currentLayer]; require(currLockedValue == 0, "Layer must not be already locked!"); require(currentCanvasId > 0, "Invalid canvas id of 0!"); // is this needed??? // update locked layer by idx mapping lockedLayersForToken[artworkId][currentLayer] = currentCanvasId; // update canvasId locked layer mapping lockedLayerHistory[currentCanvasId][currentLayer] = currentAction; // Update start canvasId offset for next layer if(currentLayer < NUM_LAYERS - 1) { canvasIdStartOffsets[currentLayer + 1] = (block.number + canvasIdStartOffsets[currentLayer]) % TOTAL_ARTWORK_SUPPLY; } _locksRemaining[artworkId] -= 1; emit LayerLocked(artworkId, currentLayer, currentCanvasId); } /** * @dev Valid canvasIds are always 1 indexed! An index of 0 means canvas is not yet revealed. */ function incrimentCanvasId(uint16 canvasId) internal pure returns (uint16) { } /** * @dev Gets the corresponding canvasId for an artwork and layer at a given action. * This function calculates the current canvas by starting at first canvas of the current * layer and recreating past actions, which leads to the current valid layer. * - Each artworkID should ALWAYS return a unique canvas ID for the same action state. * - CanvasIds are 1 indexed, so a revealed canvas should NEVER return 0! */ function getCanvasIdForAction(uint256 artworkId, uint8 layer, uint8 action) internal view returns (uint16) { } /** * @dev Ease in quadratic lerp function -- x * x, invert for ease out */ function easeInQuad(uint256 min, uint256 max, uint256 numerator, uint256 denominator) internal pure returns (uint256) { } /** * @dev Updates the URI in case of domain change or switch to IPFS in the future; */ function setBaseURI(string calldata newURI) public onlyOwner { } /** * @dev Withdrawl funds to owner * - This saves gas vs if each payment was sent to owner */ function withdrawlFunds() public { } }
hasStarted(),"Art event has not begun!"
370,752
hasStarted()
"Must be artwork owner!"
pragma solidity ^0.8.0; //SPDX-License-Identifier: MIT import "./ILockingLayers.sol"; import "./VRFConsumerBase.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @dev LockingLayers is an ERC721 contract that contains the logic and source of ownership * for Whole Picture. The core mechanics breakdown as follows: * - Each artwork consists of 4 layers. * - A Layer contain a canvasId. * - Each layer shifts its canvasId after X blocks, unless the layer is locked. * - Layers are revealed over time, and the entire process ends after all layers are revelaed and * all layer shifts have finished. * * Schema is: * - artworkId => owned by address * - canvasIds[NUM_LAYERS] => owned by artwork => NUM_LAYERS = 4 so each artwork ownes 4 canvasIds * * Layer Mappings: * - Mappings from canvasId => canvas are stored offchain in IPFS. Mapping json file can be viewed * - at ipfs://QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD * * IMPORTANT NOTES: * - canvasIds and actionIds are 1 indexed, not 0 indexed. This is because a 0 index signifies that * a layer is not locked, and an actionId of 0 signifies that the action has not happened yet. */ contract LockingLayers is ILockingLayers, ERC721, VRFConsumerBase, Ownable { using SafeMath for uint256; // Total number of artworks to create uint16 constant TOTAL_ARTWORK_SUPPLY = 1200; // The layerIds owned by each artwork uint8 constant NUM_LAYERS = 4; // Actions are shifts per each layer // NOTE: all actions are 1 indexed, not 0 indexed. This is because an action idx of // 0 means that layer does nto exist yet uint8 constant ACTIONS_PER_LAYER = 5; // Defines number blocks required to trigger an action uint16 constant BLOCKS_PER_ACTION = 4444; // Total number of actions for the project uint16 constant MAX_ACTIONS = ACTIONS_PER_LAYER * NUM_LAYERS; // There will be the same number of layerIds because each artwork is guaranteed to have 4 layers uint16 constant NUM_CANVAS_IDS = TOTAL_ARTWORK_SUPPLY; // Number of artworks in each tier uint16[3] totalArtworksInTier = [200, 800, 200]; // remaining artworks in each tier that can be purchased uint16[3] artworksRemainingInTier = [200, 800, 200]; // CID of the mappings from canvasId to canvas! View on ipfs. string constant provinanceRecord = "QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD"; // First artwork will be id of 0 uint16 nextArtworkId = 0; // Records the official uint256 private _startBlock = 0; // True once artwork has begun (once VRF has been received) bool private isArtworkStarted = false; // Block that stores first time of first purchase uint256 public firstPurchaseBlock = 0; // If not all artworks are sold, will trigger start this many blocks after first artwork purchased uint256 public constant AUTOMATIC_START_BLOCK_DELAY = 184000; // Mapping to the artwork tier for each token // artworkId => tier mapping(uint256 => ArtworkTier) public artworkTier; // The constant number of locks for each purchase tier. uint8[4] locksPerTier = [1, 2, 4]; // Remaining locks per artwork -- each lock will decrement value // artworkId => _locksRemaining mapping(uint256 => uint8) _locksRemaining; // A record of locked layers for each token: // artworkId => lockedCanvasId[NUM_LAYERS] // NOTE: a value of 0 signifies that a layer is NOT locked // - Example: // - lockedLayersForToken[100][1] = 10 // - can be read as artworkId 100 has layer 1 (0 indexed) locked with canvasId 10. // - lockedLayerForToken[100][0] = 0 // - can be read as artworkId 100's layer 0 is NOT locked mapping(uint256 => uint16[NUM_LAYERS]) lockedLayersForToken; // A record of if an artwork is locked and at which action it was locked. // canvasId => actionId[NUM_LAYERS] -> ~7 actions per layer so uint8 is good for actionId // canvasIds are reused for each layer to save on storage costs. // - Example: // - lockedLayerHistory[10][1] = 2 // - can be read as canvasId 10 for second layer (0 indexed) was locked on action 2 // - lockedLayerHistory[10][2] = 0 // - can be read as canvasId 10 has NOT BEEN LOCKED for third layer mapping(uint16 => uint8[NUM_LAYERS]) lockedLayerHistory; // Offsets for layerIds for each layer, used when finding base id for next layer // The [0] index is set by Chainlink VRF (https://docs.chain.link/docs/chainlink-vrf-api-reference) // Later indexes are only influenced by participants locking layers, so the artwork is // more connected with the behaviour of the participants. // INVARIANT: Can only change for future UNLOCKED layer, can never be altered for // past layers. Needs to be deterministic for past/current layers. // - Example: // - layerIdStartOffset[1] = 19413 // - can be read as the starting canvasId will be offset by 19413 uint256[NUM_LAYERS] public canvasIdStartOffsets; // CHAINLINK VRF properties -- want to keep locally to test gas spend bytes32 constant keyHash = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445; uint256 constant vrfFee = 2000000000000000000; // Store the current URI -- URI may change if domain is updated string baseURI = "https://su3p5zea28.execute-api.us-west-1.amazonaws.com/prod/metadata/"; constructor() ERC721("Whole Picture", "WP") VRFConsumerBase( 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952, 0x514910771AF9Ca656af840dff83E8264EcF986CA ) public { } /** * @dev Metadata base uri */ function _baseURI() internal view override returns (string memory) { } /** * @dev Returns the currnet price in wei for an artwork in a given tier. * Pricing is a bonding curve, using 4 quadratic easing sections: * - Enthusiast tier is an ease out curve * - Collector tier is ease in segment until midway point, then ease out * - Strata tier is ease in. */ function currentPrice(ArtworkTier tier) public override view returns (uint256) { } /** * @dev Get the price and available artworks for a given tier * - Returns: * - uint256 => PRICE in wei * - uint256 => available artworks */ function getTierPurchaseData(ArtworkTier tier) public override view returns (uint256, uint16) { } /** * @dev Returns the number of artworks issued. */ function totalArtworks() public override pure returns (uint16) { } /** * @dev Returns the total artworks remaining across all tiers. */ function availableArtworks() public override view returns (uint16) { } /** * @dev The number of blocks remaining until next layer is revealed. */ function blocksUntilNextLayerRevealed() public override view returns (uint256) { } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function canLock(uint256 artworkId) public override view returns (bool) { } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function locksRemaining(uint256 artworkId) public view returns (uint8) { } /** * @dev Get canvasIds for each layer for artwork. */ function getCanvasIds(uint256 artworkId) public override view returns (uint16, uint16, uint16, uint16) { } /** * @dev Returns the startBlock for the artwork. * There are two conditions for the artwork to start -- either all artworks are sold, * or the automatic trigger started after the first artwork has sold has been reached. */ function startBlock() public view returns (uint256) { } /** * @dev Check whether the artwork has started. */ function hasStarted() public view returns (bool) { } /** * @dev Gets the overall action since the start of the process. * NOTE: Actions are 1 indexed! 0 means no actions because has not begun. */ function getAction() public view returns (uint8) { } /** * @dev Returns the current layer as well as the current action. * - Returns: * - (layer, actionInLayer) * - If action == 0, then layer is not revealed */ function getCurrentLayerAndAction() public view returns (uint8, uint8) { } /** * @dev Purchases an artwork. * - Returns the artworkID of purchased work. * - Reverts if insuffiscient funds or no artworks left. */ function purchase(ArtworkTier tier) public override payable returns (uint256) { } /** * @dev Request to start the artwork! * - Acheived by requesting a random number from Chainlink VRF. * - Will automatically be requested after the last sale -- or can be requested * manually once sale period has ended. * Requirements: * Can only occur after: * - All works have been sold * - Sale period ended (X blocks past the block of the first purchase) * - Has not already been started * - Enough LINK on contract */ function requestStartArtwork() public returns (bytes32) { } /** * @dev Respond to Chainlink VRF * - This will start artwork if not already started */ function fulfillRandomness(bytes32 /*requestId*/, uint256 randomness) internal override { } /** * @dev Start the artwork! This sets the start seed and start block. * - Can only be called once */ function startArtwork(uint256 randomSeed) internal { } /** * @dev Lock artwork layer. * - Reverts if cannot lock. * - Emits LayerLocked event */ function lockLayer(uint256 artworkId) public override { require(hasStarted(), "Art event has not begun!"); require(_exists(artworkId), "Artwork does not exist!"); // require locking party to be owner require(<FILL_ME>) // require locks remaining require(canLock(artworkId), "No locks remaining!"); // first determine active layer and current action (uint8 currentLayer, uint8 currentAction) = getCurrentLayerAndAction(); // Ensure we are not on action 0, which means cannot lock require(currentAction > 0, "Canvas is not yet revealed!"); // recreate history to determine current canvas uint16 currentCanvasId = getCanvasIdForAction(artworkId, currentLayer, currentAction); // ensure not already locked so user does not waste lock uint8 currLockedValue = lockedLayerHistory[currentCanvasId][currentLayer]; require(currLockedValue == 0, "Layer must not be already locked!"); require(currentCanvasId > 0, "Invalid canvas id of 0!"); // is this needed??? // update locked layer by idx mapping lockedLayersForToken[artworkId][currentLayer] = currentCanvasId; // update canvasId locked layer mapping lockedLayerHistory[currentCanvasId][currentLayer] = currentAction; // Update start canvasId offset for next layer if(currentLayer < NUM_LAYERS - 1) { canvasIdStartOffsets[currentLayer + 1] = (block.number + canvasIdStartOffsets[currentLayer]) % TOTAL_ARTWORK_SUPPLY; } _locksRemaining[artworkId] -= 1; emit LayerLocked(artworkId, currentLayer, currentCanvasId); } /** * @dev Valid canvasIds are always 1 indexed! An index of 0 means canvas is not yet revealed. */ function incrimentCanvasId(uint16 canvasId) internal pure returns (uint16) { } /** * @dev Gets the corresponding canvasId for an artwork and layer at a given action. * This function calculates the current canvas by starting at first canvas of the current * layer and recreating past actions, which leads to the current valid layer. * - Each artworkID should ALWAYS return a unique canvas ID for the same action state. * - CanvasIds are 1 indexed, so a revealed canvas should NEVER return 0! */ function getCanvasIdForAction(uint256 artworkId, uint8 layer, uint8 action) internal view returns (uint16) { } /** * @dev Ease in quadratic lerp function -- x * x, invert for ease out */ function easeInQuad(uint256 min, uint256 max, uint256 numerator, uint256 denominator) internal pure returns (uint256) { } /** * @dev Updates the URI in case of domain change or switch to IPFS in the future; */ function setBaseURI(string calldata newURI) public onlyOwner { } /** * @dev Withdrawl funds to owner * - This saves gas vs if each payment was sent to owner */ function withdrawlFunds() public { } }
_msgSender()==ownerOf(artworkId),"Must be artwork owner!"
370,752
_msgSender()==ownerOf(artworkId)
"No locks remaining!"
pragma solidity ^0.8.0; //SPDX-License-Identifier: MIT import "./ILockingLayers.sol"; import "./VRFConsumerBase.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @dev LockingLayers is an ERC721 contract that contains the logic and source of ownership * for Whole Picture. The core mechanics breakdown as follows: * - Each artwork consists of 4 layers. * - A Layer contain a canvasId. * - Each layer shifts its canvasId after X blocks, unless the layer is locked. * - Layers are revealed over time, and the entire process ends after all layers are revelaed and * all layer shifts have finished. * * Schema is: * - artworkId => owned by address * - canvasIds[NUM_LAYERS] => owned by artwork => NUM_LAYERS = 4 so each artwork ownes 4 canvasIds * * Layer Mappings: * - Mappings from canvasId => canvas are stored offchain in IPFS. Mapping json file can be viewed * - at ipfs://QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD * * IMPORTANT NOTES: * - canvasIds and actionIds are 1 indexed, not 0 indexed. This is because a 0 index signifies that * a layer is not locked, and an actionId of 0 signifies that the action has not happened yet. */ contract LockingLayers is ILockingLayers, ERC721, VRFConsumerBase, Ownable { using SafeMath for uint256; // Total number of artworks to create uint16 constant TOTAL_ARTWORK_SUPPLY = 1200; // The layerIds owned by each artwork uint8 constant NUM_LAYERS = 4; // Actions are shifts per each layer // NOTE: all actions are 1 indexed, not 0 indexed. This is because an action idx of // 0 means that layer does nto exist yet uint8 constant ACTIONS_PER_LAYER = 5; // Defines number blocks required to trigger an action uint16 constant BLOCKS_PER_ACTION = 4444; // Total number of actions for the project uint16 constant MAX_ACTIONS = ACTIONS_PER_LAYER * NUM_LAYERS; // There will be the same number of layerIds because each artwork is guaranteed to have 4 layers uint16 constant NUM_CANVAS_IDS = TOTAL_ARTWORK_SUPPLY; // Number of artworks in each tier uint16[3] totalArtworksInTier = [200, 800, 200]; // remaining artworks in each tier that can be purchased uint16[3] artworksRemainingInTier = [200, 800, 200]; // CID of the mappings from canvasId to canvas! View on ipfs. string constant provinanceRecord = "QmZ7Lpf5T4NhawAKsWAmomG5sxkSN6USfRVRW5nMzjrHdD"; // First artwork will be id of 0 uint16 nextArtworkId = 0; // Records the official uint256 private _startBlock = 0; // True once artwork has begun (once VRF has been received) bool private isArtworkStarted = false; // Block that stores first time of first purchase uint256 public firstPurchaseBlock = 0; // If not all artworks are sold, will trigger start this many blocks after first artwork purchased uint256 public constant AUTOMATIC_START_BLOCK_DELAY = 184000; // Mapping to the artwork tier for each token // artworkId => tier mapping(uint256 => ArtworkTier) public artworkTier; // The constant number of locks for each purchase tier. uint8[4] locksPerTier = [1, 2, 4]; // Remaining locks per artwork -- each lock will decrement value // artworkId => _locksRemaining mapping(uint256 => uint8) _locksRemaining; // A record of locked layers for each token: // artworkId => lockedCanvasId[NUM_LAYERS] // NOTE: a value of 0 signifies that a layer is NOT locked // - Example: // - lockedLayersForToken[100][1] = 10 // - can be read as artworkId 100 has layer 1 (0 indexed) locked with canvasId 10. // - lockedLayerForToken[100][0] = 0 // - can be read as artworkId 100's layer 0 is NOT locked mapping(uint256 => uint16[NUM_LAYERS]) lockedLayersForToken; // A record of if an artwork is locked and at which action it was locked. // canvasId => actionId[NUM_LAYERS] -> ~7 actions per layer so uint8 is good for actionId // canvasIds are reused for each layer to save on storage costs. // - Example: // - lockedLayerHistory[10][1] = 2 // - can be read as canvasId 10 for second layer (0 indexed) was locked on action 2 // - lockedLayerHistory[10][2] = 0 // - can be read as canvasId 10 has NOT BEEN LOCKED for third layer mapping(uint16 => uint8[NUM_LAYERS]) lockedLayerHistory; // Offsets for layerIds for each layer, used when finding base id for next layer // The [0] index is set by Chainlink VRF (https://docs.chain.link/docs/chainlink-vrf-api-reference) // Later indexes are only influenced by participants locking layers, so the artwork is // more connected with the behaviour of the participants. // INVARIANT: Can only change for future UNLOCKED layer, can never be altered for // past layers. Needs to be deterministic for past/current layers. // - Example: // - layerIdStartOffset[1] = 19413 // - can be read as the starting canvasId will be offset by 19413 uint256[NUM_LAYERS] public canvasIdStartOffsets; // CHAINLINK VRF properties -- want to keep locally to test gas spend bytes32 constant keyHash = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445; uint256 constant vrfFee = 2000000000000000000; // Store the current URI -- URI may change if domain is updated string baseURI = "https://su3p5zea28.execute-api.us-west-1.amazonaws.com/prod/metadata/"; constructor() ERC721("Whole Picture", "WP") VRFConsumerBase( 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952, 0x514910771AF9Ca656af840dff83E8264EcF986CA ) public { } /** * @dev Metadata base uri */ function _baseURI() internal view override returns (string memory) { } /** * @dev Returns the currnet price in wei for an artwork in a given tier. * Pricing is a bonding curve, using 4 quadratic easing sections: * - Enthusiast tier is an ease out curve * - Collector tier is ease in segment until midway point, then ease out * - Strata tier is ease in. */ function currentPrice(ArtworkTier tier) public override view returns (uint256) { } /** * @dev Get the price and available artworks for a given tier * - Returns: * - uint256 => PRICE in wei * - uint256 => available artworks */ function getTierPurchaseData(ArtworkTier tier) public override view returns (uint256, uint16) { } /** * @dev Returns the number of artworks issued. */ function totalArtworks() public override pure returns (uint16) { } /** * @dev Returns the total artworks remaining across all tiers. */ function availableArtworks() public override view returns (uint16) { } /** * @dev The number of blocks remaining until next layer is revealed. */ function blocksUntilNextLayerRevealed() public override view returns (uint256) { } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function canLock(uint256 artworkId) public override view returns (bool) { } /** * @dev Checks if an artwork can lock the current layer. * - if no locks remaining or if layer is already locked, cannot lock */ function locksRemaining(uint256 artworkId) public view returns (uint8) { } /** * @dev Get canvasIds for each layer for artwork. */ function getCanvasIds(uint256 artworkId) public override view returns (uint16, uint16, uint16, uint16) { } /** * @dev Returns the startBlock for the artwork. * There are two conditions for the artwork to start -- either all artworks are sold, * or the automatic trigger started after the first artwork has sold has been reached. */ function startBlock() public view returns (uint256) { } /** * @dev Check whether the artwork has started. */ function hasStarted() public view returns (bool) { } /** * @dev Gets the overall action since the start of the process. * NOTE: Actions are 1 indexed! 0 means no actions because has not begun. */ function getAction() public view returns (uint8) { } /** * @dev Returns the current layer as well as the current action. * - Returns: * - (layer, actionInLayer) * - If action == 0, then layer is not revealed */ function getCurrentLayerAndAction() public view returns (uint8, uint8) { } /** * @dev Purchases an artwork. * - Returns the artworkID of purchased work. * - Reverts if insuffiscient funds or no artworks left. */ function purchase(ArtworkTier tier) public override payable returns (uint256) { } /** * @dev Request to start the artwork! * - Acheived by requesting a random number from Chainlink VRF. * - Will automatically be requested after the last sale -- or can be requested * manually once sale period has ended. * Requirements: * Can only occur after: * - All works have been sold * - Sale period ended (X blocks past the block of the first purchase) * - Has not already been started * - Enough LINK on contract */ function requestStartArtwork() public returns (bytes32) { } /** * @dev Respond to Chainlink VRF * - This will start artwork if not already started */ function fulfillRandomness(bytes32 /*requestId*/, uint256 randomness) internal override { } /** * @dev Start the artwork! This sets the start seed and start block. * - Can only be called once */ function startArtwork(uint256 randomSeed) internal { } /** * @dev Lock artwork layer. * - Reverts if cannot lock. * - Emits LayerLocked event */ function lockLayer(uint256 artworkId) public override { require(hasStarted(), "Art event has not begun!"); require(_exists(artworkId), "Artwork does not exist!"); // require locking party to be owner require(_msgSender() == ownerOf(artworkId), "Must be artwork owner!"); // require locks remaining require(<FILL_ME>) // first determine active layer and current action (uint8 currentLayer, uint8 currentAction) = getCurrentLayerAndAction(); // Ensure we are not on action 0, which means cannot lock require(currentAction > 0, "Canvas is not yet revealed!"); // recreate history to determine current canvas uint16 currentCanvasId = getCanvasIdForAction(artworkId, currentLayer, currentAction); // ensure not already locked so user does not waste lock uint8 currLockedValue = lockedLayerHistory[currentCanvasId][currentLayer]; require(currLockedValue == 0, "Layer must not be already locked!"); require(currentCanvasId > 0, "Invalid canvas id of 0!"); // is this needed??? // update locked layer by idx mapping lockedLayersForToken[artworkId][currentLayer] = currentCanvasId; // update canvasId locked layer mapping lockedLayerHistory[currentCanvasId][currentLayer] = currentAction; // Update start canvasId offset for next layer if(currentLayer < NUM_LAYERS - 1) { canvasIdStartOffsets[currentLayer + 1] = (block.number + canvasIdStartOffsets[currentLayer]) % TOTAL_ARTWORK_SUPPLY; } _locksRemaining[artworkId] -= 1; emit LayerLocked(artworkId, currentLayer, currentCanvasId); } /** * @dev Valid canvasIds are always 1 indexed! An index of 0 means canvas is not yet revealed. */ function incrimentCanvasId(uint16 canvasId) internal pure returns (uint16) { } /** * @dev Gets the corresponding canvasId for an artwork and layer at a given action. * This function calculates the current canvas by starting at first canvas of the current * layer and recreating past actions, which leads to the current valid layer. * - Each artworkID should ALWAYS return a unique canvas ID for the same action state. * - CanvasIds are 1 indexed, so a revealed canvas should NEVER return 0! */ function getCanvasIdForAction(uint256 artworkId, uint8 layer, uint8 action) internal view returns (uint16) { } /** * @dev Ease in quadratic lerp function -- x * x, invert for ease out */ function easeInQuad(uint256 min, uint256 max, uint256 numerator, uint256 denominator) internal pure returns (uint256) { } /** * @dev Updates the URI in case of domain change or switch to IPFS in the future; */ function setBaseURI(string calldata newURI) public onlyOwner { } /** * @dev Withdrawl funds to owner * - This saves gas vs if each payment was sent to owner */ function withdrawlFunds() public { } }
canLock(artworkId),"No locks remaining!"
370,752
canLock(artworkId)
'Presale is still active'
@v4.3.0 /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } contract C01Project is ERC721("C-01 Official Collection", "C-01"), ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; string private baseURI; string private blindURI; uint256 public constant BUY_LIMIT_PER_TX = 2; uint256 public constant MAX_NFT_PUBLIC = 8728; uint256 private constant MAX_NFT = 8888; uint256 public NFTPrice = 250000000000000000; // 0.25 ETH bool public reveal; bool public isActive; bool public isPresaleActive; bool private freeMintActive; bytes32 public root; uint256 public constant WHITELIST_MAX_MINT = 2; mapping(address => uint256) public whiteListClaimed; mapping(address => bool) private giveawayMintClaimed; uint256 public giveawayCount; /* * Function to reveal all C-01 */ function revealNow() external onlyOwner { } /* * Function setIsActive to activate/desactivate the smart contract */ function setIsActive( bool _isActive ) external onlyOwner { } /* * Function setPresaleActive to activate/desactivate the whitelist/raffle presale */ function setPresaleActive( bool _isActive ) external onlyOwner { } /* * Function setFreeMintActive to activate/desactivate the free mint capability */ function setFreeMintActive( bool _isActive ) external onlyOwner { } /* * Function to set Base and Blind URI */ function setURIs( string memory _blindURI, string memory _URI ) external onlyOwner { } /* * Function to withdraw collected amount during minting by the owner */ function withdraw( ) public onlyOwner { } /* * Function to mint new NFTs during the public sale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFT( uint256 _numOfTokens ) public payable { require(isActive, 'Contract is not active'); require(<FILL_ME>) require(_numOfTokens <= BUY_LIMIT_PER_TX, "Cannot mint above limit"); require(totalSupply().add(_numOfTokens).sub(giveawayCount) <= MAX_NFT_PUBLIC, "Purchase would exceed max public supply of NFTs"); require(NFTPrice.mul(_numOfTokens) == msg.value, "Ether value sent is not correct"); for(uint i = 0; i < _numOfTokens; i++) { _safeMint(msg.sender, totalSupply().sub(giveawayCount)); } } /* * Function to mint new NFTs during the presale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFTDuringPresale( uint256 _numOfTokens, bytes32[] memory _proof ) public payable { } /* * Function to mint NFTs for giveaway and partnerships */ function mintByOwner( address _to, uint256 _tokenId ) public onlyOwner { } /* * Function to mint all NFTs for giveaway and partnerships */ function mintMultipleByOwner( address[] memory _to, uint256[] memory _tokenId ) public onlyOwner { } /* * Function to get token URI of given token ID * URI will be blank untill totalSupply reaches MAX_NFT_PUBLIC */ function tokenURI( uint256 _tokenId ) public view virtual override returns (string memory) { } // Set Root for whitelist and raffle to participate in presale function setRoot(uint256 _root) onlyOwner() public { } // Verify MerkleProof function verify(bytes32[] memory proof, bytes32 leaf) public view returns (bool) { } // Standard functions to be overridden in ERC721Enumerable function supportsInterface( bytes4 _interfaceId ) public view override (ERC721, ERC721Enumerable) returns (bool) { } function _beforeTokenTransfer( address _from, address _to, uint256 _tokenId ) internal override(ERC721, ERC721Enumerable) { } }
!isPresaleActive,'Presale is still active'
370,828
!isPresaleActive
"Purchase would exceed max public supply of NFTs"
@v4.3.0 /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } contract C01Project is ERC721("C-01 Official Collection", "C-01"), ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; string private baseURI; string private blindURI; uint256 public constant BUY_LIMIT_PER_TX = 2; uint256 public constant MAX_NFT_PUBLIC = 8728; uint256 private constant MAX_NFT = 8888; uint256 public NFTPrice = 250000000000000000; // 0.25 ETH bool public reveal; bool public isActive; bool public isPresaleActive; bool private freeMintActive; bytes32 public root; uint256 public constant WHITELIST_MAX_MINT = 2; mapping(address => uint256) public whiteListClaimed; mapping(address => bool) private giveawayMintClaimed; uint256 public giveawayCount; /* * Function to reveal all C-01 */ function revealNow() external onlyOwner { } /* * Function setIsActive to activate/desactivate the smart contract */ function setIsActive( bool _isActive ) external onlyOwner { } /* * Function setPresaleActive to activate/desactivate the whitelist/raffle presale */ function setPresaleActive( bool _isActive ) external onlyOwner { } /* * Function setFreeMintActive to activate/desactivate the free mint capability */ function setFreeMintActive( bool _isActive ) external onlyOwner { } /* * Function to set Base and Blind URI */ function setURIs( string memory _blindURI, string memory _URI ) external onlyOwner { } /* * Function to withdraw collected amount during minting by the owner */ function withdraw( ) public onlyOwner { } /* * Function to mint new NFTs during the public sale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFT( uint256 _numOfTokens ) public payable { require(isActive, 'Contract is not active'); require(!isPresaleActive, 'Presale is still active'); require(_numOfTokens <= BUY_LIMIT_PER_TX, "Cannot mint above limit"); require(<FILL_ME>) require(NFTPrice.mul(_numOfTokens) == msg.value, "Ether value sent is not correct"); for(uint i = 0; i < _numOfTokens; i++) { _safeMint(msg.sender, totalSupply().sub(giveawayCount)); } } /* * Function to mint new NFTs during the presale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFTDuringPresale( uint256 _numOfTokens, bytes32[] memory _proof ) public payable { } /* * Function to mint NFTs for giveaway and partnerships */ function mintByOwner( address _to, uint256 _tokenId ) public onlyOwner { } /* * Function to mint all NFTs for giveaway and partnerships */ function mintMultipleByOwner( address[] memory _to, uint256[] memory _tokenId ) public onlyOwner { } /* * Function to get token URI of given token ID * URI will be blank untill totalSupply reaches MAX_NFT_PUBLIC */ function tokenURI( uint256 _tokenId ) public view virtual override returns (string memory) { } // Set Root for whitelist and raffle to participate in presale function setRoot(uint256 _root) onlyOwner() public { } // Verify MerkleProof function verify(bytes32[] memory proof, bytes32 leaf) public view returns (bool) { } // Standard functions to be overridden in ERC721Enumerable function supportsInterface( bytes4 _interfaceId ) public view override (ERC721, ERC721Enumerable) returns (bool) { } function _beforeTokenTransfer( address _from, address _to, uint256 _tokenId ) internal override(ERC721, ERC721Enumerable) { } }
totalSupply().add(_numOfTokens).sub(giveawayCount)<=MAX_NFT_PUBLIC,"Purchase would exceed max public supply of NFTs"
370,828
totalSupply().add(_numOfTokens).sub(giveawayCount)<=MAX_NFT_PUBLIC
"Not whitelisted"
@v4.3.0 /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } contract C01Project is ERC721("C-01 Official Collection", "C-01"), ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; string private baseURI; string private blindURI; uint256 public constant BUY_LIMIT_PER_TX = 2; uint256 public constant MAX_NFT_PUBLIC = 8728; uint256 private constant MAX_NFT = 8888; uint256 public NFTPrice = 250000000000000000; // 0.25 ETH bool public reveal; bool public isActive; bool public isPresaleActive; bool private freeMintActive; bytes32 public root; uint256 public constant WHITELIST_MAX_MINT = 2; mapping(address => uint256) public whiteListClaimed; mapping(address => bool) private giveawayMintClaimed; uint256 public giveawayCount; /* * Function to reveal all C-01 */ function revealNow() external onlyOwner { } /* * Function setIsActive to activate/desactivate the smart contract */ function setIsActive( bool _isActive ) external onlyOwner { } /* * Function setPresaleActive to activate/desactivate the whitelist/raffle presale */ function setPresaleActive( bool _isActive ) external onlyOwner { } /* * Function setFreeMintActive to activate/desactivate the free mint capability */ function setFreeMintActive( bool _isActive ) external onlyOwner { } /* * Function to set Base and Blind URI */ function setURIs( string memory _blindURI, string memory _URI ) external onlyOwner { } /* * Function to withdraw collected amount during minting by the owner */ function withdraw( ) public onlyOwner { } /* * Function to mint new NFTs during the public sale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFT( uint256 _numOfTokens ) public payable { } /* * Function to mint new NFTs during the presale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFTDuringPresale( uint256 _numOfTokens, bytes32[] memory _proof ) public payable { require(isActive, 'Sale is not active'); require(isPresaleActive, 'Whitelist is not active'); require(<FILL_ME>) if (!freeMintActive){ require(totalSupply() < MAX_NFT_PUBLIC, 'All public tokens have been minted'); require(_numOfTokens <= WHITELIST_MAX_MINT, 'Cannot purchase this many tokens'); require(totalSupply().add(_numOfTokens).sub(giveawayCount) <= MAX_NFT_PUBLIC, 'Purchase would exceed max public supply of NFTs'); require(whiteListClaimed[msg.sender].add(_numOfTokens) <= WHITELIST_MAX_MINT, 'Purchase exceeds max whiteed'); require(NFTPrice.mul(_numOfTokens) == msg.value, "Ether value sent is not correct"); for (uint256 i = 0; i < _numOfTokens; i++) { whiteListClaimed[msg.sender] += 1; _safeMint(msg.sender, totalSupply().sub(giveawayCount)); } } else{ require(totalSupply() < MAX_NFT, 'All tokens have been minted'); require(_numOfTokens == 1, 'Cannot purchase this many tokens'); require(!giveawayMintClaimed[msg.sender], 'Already claimed giveaway'); giveawayMintClaimed[msg.sender] = true; _safeMint(msg.sender, totalSupply()); } } /* * Function to mint NFTs for giveaway and partnerships */ function mintByOwner( address _to, uint256 _tokenId ) public onlyOwner { } /* * Function to mint all NFTs for giveaway and partnerships */ function mintMultipleByOwner( address[] memory _to, uint256[] memory _tokenId ) public onlyOwner { } /* * Function to get token URI of given token ID * URI will be blank untill totalSupply reaches MAX_NFT_PUBLIC */ function tokenURI( uint256 _tokenId ) public view virtual override returns (string memory) { } // Set Root for whitelist and raffle to participate in presale function setRoot(uint256 _root) onlyOwner() public { } // Verify MerkleProof function verify(bytes32[] memory proof, bytes32 leaf) public view returns (bool) { } // Standard functions to be overridden in ERC721Enumerable function supportsInterface( bytes4 _interfaceId ) public view override (ERC721, ERC721Enumerable) returns (bool) { } function _beforeTokenTransfer( address _from, address _to, uint256 _tokenId ) internal override(ERC721, ERC721Enumerable) { } }
verify(_proof,bytes32(uint256(uint160(msg.sender)))),"Not whitelisted"
370,828
verify(_proof,bytes32(uint256(uint160(msg.sender))))
'All public tokens have been minted'
@v4.3.0 /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } contract C01Project is ERC721("C-01 Official Collection", "C-01"), ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; string private baseURI; string private blindURI; uint256 public constant BUY_LIMIT_PER_TX = 2; uint256 public constant MAX_NFT_PUBLIC = 8728; uint256 private constant MAX_NFT = 8888; uint256 public NFTPrice = 250000000000000000; // 0.25 ETH bool public reveal; bool public isActive; bool public isPresaleActive; bool private freeMintActive; bytes32 public root; uint256 public constant WHITELIST_MAX_MINT = 2; mapping(address => uint256) public whiteListClaimed; mapping(address => bool) private giveawayMintClaimed; uint256 public giveawayCount; /* * Function to reveal all C-01 */ function revealNow() external onlyOwner { } /* * Function setIsActive to activate/desactivate the smart contract */ function setIsActive( bool _isActive ) external onlyOwner { } /* * Function setPresaleActive to activate/desactivate the whitelist/raffle presale */ function setPresaleActive( bool _isActive ) external onlyOwner { } /* * Function setFreeMintActive to activate/desactivate the free mint capability */ function setFreeMintActive( bool _isActive ) external onlyOwner { } /* * Function to set Base and Blind URI */ function setURIs( string memory _blindURI, string memory _URI ) external onlyOwner { } /* * Function to withdraw collected amount during minting by the owner */ function withdraw( ) public onlyOwner { } /* * Function to mint new NFTs during the public sale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFT( uint256 _numOfTokens ) public payable { } /* * Function to mint new NFTs during the presale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFTDuringPresale( uint256 _numOfTokens, bytes32[] memory _proof ) public payable { require(isActive, 'Sale is not active'); require(isPresaleActive, 'Whitelist is not active'); require(verify(_proof, bytes32(uint256(uint160(msg.sender)))), "Not whitelisted"); if (!freeMintActive){ require(<FILL_ME>) require(_numOfTokens <= WHITELIST_MAX_MINT, 'Cannot purchase this many tokens'); require(totalSupply().add(_numOfTokens).sub(giveawayCount) <= MAX_NFT_PUBLIC, 'Purchase would exceed max public supply of NFTs'); require(whiteListClaimed[msg.sender].add(_numOfTokens) <= WHITELIST_MAX_MINT, 'Purchase exceeds max whiteed'); require(NFTPrice.mul(_numOfTokens) == msg.value, "Ether value sent is not correct"); for (uint256 i = 0; i < _numOfTokens; i++) { whiteListClaimed[msg.sender] += 1; _safeMint(msg.sender, totalSupply().sub(giveawayCount)); } } else{ require(totalSupply() < MAX_NFT, 'All tokens have been minted'); require(_numOfTokens == 1, 'Cannot purchase this many tokens'); require(!giveawayMintClaimed[msg.sender], 'Already claimed giveaway'); giveawayMintClaimed[msg.sender] = true; _safeMint(msg.sender, totalSupply()); } } /* * Function to mint NFTs for giveaway and partnerships */ function mintByOwner( address _to, uint256 _tokenId ) public onlyOwner { } /* * Function to mint all NFTs for giveaway and partnerships */ function mintMultipleByOwner( address[] memory _to, uint256[] memory _tokenId ) public onlyOwner { } /* * Function to get token URI of given token ID * URI will be blank untill totalSupply reaches MAX_NFT_PUBLIC */ function tokenURI( uint256 _tokenId ) public view virtual override returns (string memory) { } // Set Root for whitelist and raffle to participate in presale function setRoot(uint256 _root) onlyOwner() public { } // Verify MerkleProof function verify(bytes32[] memory proof, bytes32 leaf) public view returns (bool) { } // Standard functions to be overridden in ERC721Enumerable function supportsInterface( bytes4 _interfaceId ) public view override (ERC721, ERC721Enumerable) returns (bool) { } function _beforeTokenTransfer( address _from, address _to, uint256 _tokenId ) internal override(ERC721, ERC721Enumerable) { } }
totalSupply()<MAX_NFT_PUBLIC,'All public tokens have been minted'
370,828
totalSupply()<MAX_NFT_PUBLIC
'Purchase exceeds max whiteed'
@v4.3.0 /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } contract C01Project is ERC721("C-01 Official Collection", "C-01"), ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; string private baseURI; string private blindURI; uint256 public constant BUY_LIMIT_PER_TX = 2; uint256 public constant MAX_NFT_PUBLIC = 8728; uint256 private constant MAX_NFT = 8888; uint256 public NFTPrice = 250000000000000000; // 0.25 ETH bool public reveal; bool public isActive; bool public isPresaleActive; bool private freeMintActive; bytes32 public root; uint256 public constant WHITELIST_MAX_MINT = 2; mapping(address => uint256) public whiteListClaimed; mapping(address => bool) private giveawayMintClaimed; uint256 public giveawayCount; /* * Function to reveal all C-01 */ function revealNow() external onlyOwner { } /* * Function setIsActive to activate/desactivate the smart contract */ function setIsActive( bool _isActive ) external onlyOwner { } /* * Function setPresaleActive to activate/desactivate the whitelist/raffle presale */ function setPresaleActive( bool _isActive ) external onlyOwner { } /* * Function setFreeMintActive to activate/desactivate the free mint capability */ function setFreeMintActive( bool _isActive ) external onlyOwner { } /* * Function to set Base and Blind URI */ function setURIs( string memory _blindURI, string memory _URI ) external onlyOwner { } /* * Function to withdraw collected amount during minting by the owner */ function withdraw( ) public onlyOwner { } /* * Function to mint new NFTs during the public sale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFT( uint256 _numOfTokens ) public payable { } /* * Function to mint new NFTs during the presale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFTDuringPresale( uint256 _numOfTokens, bytes32[] memory _proof ) public payable { require(isActive, 'Sale is not active'); require(isPresaleActive, 'Whitelist is not active'); require(verify(_proof, bytes32(uint256(uint160(msg.sender)))), "Not whitelisted"); if (!freeMintActive){ require(totalSupply() < MAX_NFT_PUBLIC, 'All public tokens have been minted'); require(_numOfTokens <= WHITELIST_MAX_MINT, 'Cannot purchase this many tokens'); require(totalSupply().add(_numOfTokens).sub(giveawayCount) <= MAX_NFT_PUBLIC, 'Purchase would exceed max public supply of NFTs'); require(<FILL_ME>) require(NFTPrice.mul(_numOfTokens) == msg.value, "Ether value sent is not correct"); for (uint256 i = 0; i < _numOfTokens; i++) { whiteListClaimed[msg.sender] += 1; _safeMint(msg.sender, totalSupply().sub(giveawayCount)); } } else{ require(totalSupply() < MAX_NFT, 'All tokens have been minted'); require(_numOfTokens == 1, 'Cannot purchase this many tokens'); require(!giveawayMintClaimed[msg.sender], 'Already claimed giveaway'); giveawayMintClaimed[msg.sender] = true; _safeMint(msg.sender, totalSupply()); } } /* * Function to mint NFTs for giveaway and partnerships */ function mintByOwner( address _to, uint256 _tokenId ) public onlyOwner { } /* * Function to mint all NFTs for giveaway and partnerships */ function mintMultipleByOwner( address[] memory _to, uint256[] memory _tokenId ) public onlyOwner { } /* * Function to get token URI of given token ID * URI will be blank untill totalSupply reaches MAX_NFT_PUBLIC */ function tokenURI( uint256 _tokenId ) public view virtual override returns (string memory) { } // Set Root for whitelist and raffle to participate in presale function setRoot(uint256 _root) onlyOwner() public { } // Verify MerkleProof function verify(bytes32[] memory proof, bytes32 leaf) public view returns (bool) { } // Standard functions to be overridden in ERC721Enumerable function supportsInterface( bytes4 _interfaceId ) public view override (ERC721, ERC721Enumerable) returns (bool) { } function _beforeTokenTransfer( address _from, address _to, uint256 _tokenId ) internal override(ERC721, ERC721Enumerable) { } }
whiteListClaimed[msg.sender].add(_numOfTokens)<=WHITELIST_MAX_MINT,'Purchase exceeds max whiteed'
370,828
whiteListClaimed[msg.sender].add(_numOfTokens)<=WHITELIST_MAX_MINT
'All tokens have been minted'
@v4.3.0 /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } contract C01Project is ERC721("C-01 Official Collection", "C-01"), ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; string private baseURI; string private blindURI; uint256 public constant BUY_LIMIT_PER_TX = 2; uint256 public constant MAX_NFT_PUBLIC = 8728; uint256 private constant MAX_NFT = 8888; uint256 public NFTPrice = 250000000000000000; // 0.25 ETH bool public reveal; bool public isActive; bool public isPresaleActive; bool private freeMintActive; bytes32 public root; uint256 public constant WHITELIST_MAX_MINT = 2; mapping(address => uint256) public whiteListClaimed; mapping(address => bool) private giveawayMintClaimed; uint256 public giveawayCount; /* * Function to reveal all C-01 */ function revealNow() external onlyOwner { } /* * Function setIsActive to activate/desactivate the smart contract */ function setIsActive( bool _isActive ) external onlyOwner { } /* * Function setPresaleActive to activate/desactivate the whitelist/raffle presale */ function setPresaleActive( bool _isActive ) external onlyOwner { } /* * Function setFreeMintActive to activate/desactivate the free mint capability */ function setFreeMintActive( bool _isActive ) external onlyOwner { } /* * Function to set Base and Blind URI */ function setURIs( string memory _blindURI, string memory _URI ) external onlyOwner { } /* * Function to withdraw collected amount during minting by the owner */ function withdraw( ) public onlyOwner { } /* * Function to mint new NFTs during the public sale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFT( uint256 _numOfTokens ) public payable { } /* * Function to mint new NFTs during the presale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFTDuringPresale( uint256 _numOfTokens, bytes32[] memory _proof ) public payable { require(isActive, 'Sale is not active'); require(isPresaleActive, 'Whitelist is not active'); require(verify(_proof, bytes32(uint256(uint160(msg.sender)))), "Not whitelisted"); if (!freeMintActive){ require(totalSupply() < MAX_NFT_PUBLIC, 'All public tokens have been minted'); require(_numOfTokens <= WHITELIST_MAX_MINT, 'Cannot purchase this many tokens'); require(totalSupply().add(_numOfTokens).sub(giveawayCount) <= MAX_NFT_PUBLIC, 'Purchase would exceed max public supply of NFTs'); require(whiteListClaimed[msg.sender].add(_numOfTokens) <= WHITELIST_MAX_MINT, 'Purchase exceeds max whiteed'); require(NFTPrice.mul(_numOfTokens) == msg.value, "Ether value sent is not correct"); for (uint256 i = 0; i < _numOfTokens; i++) { whiteListClaimed[msg.sender] += 1; _safeMint(msg.sender, totalSupply().sub(giveawayCount)); } } else{ require(<FILL_ME>) require(_numOfTokens == 1, 'Cannot purchase this many tokens'); require(!giveawayMintClaimed[msg.sender], 'Already claimed giveaway'); giveawayMintClaimed[msg.sender] = true; _safeMint(msg.sender, totalSupply()); } } /* * Function to mint NFTs for giveaway and partnerships */ function mintByOwner( address _to, uint256 _tokenId ) public onlyOwner { } /* * Function to mint all NFTs for giveaway and partnerships */ function mintMultipleByOwner( address[] memory _to, uint256[] memory _tokenId ) public onlyOwner { } /* * Function to get token URI of given token ID * URI will be blank untill totalSupply reaches MAX_NFT_PUBLIC */ function tokenURI( uint256 _tokenId ) public view virtual override returns (string memory) { } // Set Root for whitelist and raffle to participate in presale function setRoot(uint256 _root) onlyOwner() public { } // Verify MerkleProof function verify(bytes32[] memory proof, bytes32 leaf) public view returns (bool) { } // Standard functions to be overridden in ERC721Enumerable function supportsInterface( bytes4 _interfaceId ) public view override (ERC721, ERC721Enumerable) returns (bool) { } function _beforeTokenTransfer( address _from, address _to, uint256 _tokenId ) internal override(ERC721, ERC721Enumerable) { } }
totalSupply()<MAX_NFT,'All tokens have been minted'
370,828
totalSupply()<MAX_NFT
'Already claimed giveaway'
@v4.3.0 /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } contract C01Project is ERC721("C-01 Official Collection", "C-01"), ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; string private baseURI; string private blindURI; uint256 public constant BUY_LIMIT_PER_TX = 2; uint256 public constant MAX_NFT_PUBLIC = 8728; uint256 private constant MAX_NFT = 8888; uint256 public NFTPrice = 250000000000000000; // 0.25 ETH bool public reveal; bool public isActive; bool public isPresaleActive; bool private freeMintActive; bytes32 public root; uint256 public constant WHITELIST_MAX_MINT = 2; mapping(address => uint256) public whiteListClaimed; mapping(address => bool) private giveawayMintClaimed; uint256 public giveawayCount; /* * Function to reveal all C-01 */ function revealNow() external onlyOwner { } /* * Function setIsActive to activate/desactivate the smart contract */ function setIsActive( bool _isActive ) external onlyOwner { } /* * Function setPresaleActive to activate/desactivate the whitelist/raffle presale */ function setPresaleActive( bool _isActive ) external onlyOwner { } /* * Function setFreeMintActive to activate/desactivate the free mint capability */ function setFreeMintActive( bool _isActive ) external onlyOwner { } /* * Function to set Base and Blind URI */ function setURIs( string memory _blindURI, string memory _URI ) external onlyOwner { } /* * Function to withdraw collected amount during minting by the owner */ function withdraw( ) public onlyOwner { } /* * Function to mint new NFTs during the public sale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFT( uint256 _numOfTokens ) public payable { } /* * Function to mint new NFTs during the presale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFTDuringPresale( uint256 _numOfTokens, bytes32[] memory _proof ) public payable { require(isActive, 'Sale is not active'); require(isPresaleActive, 'Whitelist is not active'); require(verify(_proof, bytes32(uint256(uint160(msg.sender)))), "Not whitelisted"); if (!freeMintActive){ require(totalSupply() < MAX_NFT_PUBLIC, 'All public tokens have been minted'); require(_numOfTokens <= WHITELIST_MAX_MINT, 'Cannot purchase this many tokens'); require(totalSupply().add(_numOfTokens).sub(giveawayCount) <= MAX_NFT_PUBLIC, 'Purchase would exceed max public supply of NFTs'); require(whiteListClaimed[msg.sender].add(_numOfTokens) <= WHITELIST_MAX_MINT, 'Purchase exceeds max whiteed'); require(NFTPrice.mul(_numOfTokens) == msg.value, "Ether value sent is not correct"); for (uint256 i = 0; i < _numOfTokens; i++) { whiteListClaimed[msg.sender] += 1; _safeMint(msg.sender, totalSupply().sub(giveawayCount)); } } else{ require(totalSupply() < MAX_NFT, 'All tokens have been minted'); require(_numOfTokens == 1, 'Cannot purchase this many tokens'); require(<FILL_ME>) giveawayMintClaimed[msg.sender] = true; _safeMint(msg.sender, totalSupply()); } } /* * Function to mint NFTs for giveaway and partnerships */ function mintByOwner( address _to, uint256 _tokenId ) public onlyOwner { } /* * Function to mint all NFTs for giveaway and partnerships */ function mintMultipleByOwner( address[] memory _to, uint256[] memory _tokenId ) public onlyOwner { } /* * Function to get token URI of given token ID * URI will be blank untill totalSupply reaches MAX_NFT_PUBLIC */ function tokenURI( uint256 _tokenId ) public view virtual override returns (string memory) { } // Set Root for whitelist and raffle to participate in presale function setRoot(uint256 _root) onlyOwner() public { } // Verify MerkleProof function verify(bytes32[] memory proof, bytes32 leaf) public view returns (bool) { } // Standard functions to be overridden in ERC721Enumerable function supportsInterface( bytes4 _interfaceId ) public view override (ERC721, ERC721Enumerable) returns (bool) { } function _beforeTokenTransfer( address _from, address _to, uint256 _tokenId ) internal override(ERC721, ERC721Enumerable) { } }
!giveawayMintClaimed[msg.sender],'Already claimed giveaway'
370,828
!giveawayMintClaimed[msg.sender]
"Tokens number to mint must exceed number of public tokens"
@v4.3.0 /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } contract C01Project is ERC721("C-01 Official Collection", "C-01"), ERC721Enumerable, Ownable { using SafeMath for uint256; using Strings for uint256; string private baseURI; string private blindURI; uint256 public constant BUY_LIMIT_PER_TX = 2; uint256 public constant MAX_NFT_PUBLIC = 8728; uint256 private constant MAX_NFT = 8888; uint256 public NFTPrice = 250000000000000000; // 0.25 ETH bool public reveal; bool public isActive; bool public isPresaleActive; bool private freeMintActive; bytes32 public root; uint256 public constant WHITELIST_MAX_MINT = 2; mapping(address => uint256) public whiteListClaimed; mapping(address => bool) private giveawayMintClaimed; uint256 public giveawayCount; /* * Function to reveal all C-01 */ function revealNow() external onlyOwner { } /* * Function setIsActive to activate/desactivate the smart contract */ function setIsActive( bool _isActive ) external onlyOwner { } /* * Function setPresaleActive to activate/desactivate the whitelist/raffle presale */ function setPresaleActive( bool _isActive ) external onlyOwner { } /* * Function setFreeMintActive to activate/desactivate the free mint capability */ function setFreeMintActive( bool _isActive ) external onlyOwner { } /* * Function to set Base and Blind URI */ function setURIs( string memory _blindURI, string memory _URI ) external onlyOwner { } /* * Function to withdraw collected amount during minting by the owner */ function withdraw( ) public onlyOwner { } /* * Function to mint new NFTs during the public sale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFT( uint256 _numOfTokens ) public payable { } /* * Function to mint new NFTs during the presale * It is payable. Amount is calculated as per (NFTPrice.mul(_numOfTokens)) */ function mintNFTDuringPresale( uint256 _numOfTokens, bytes32[] memory _proof ) public payable { } /* * Function to mint NFTs for giveaway and partnerships */ function mintByOwner( address _to, uint256 _tokenId ) public onlyOwner { } /* * Function to mint all NFTs for giveaway and partnerships */ function mintMultipleByOwner( address[] memory _to, uint256[] memory _tokenId ) public onlyOwner { require(_to.length == _tokenId.length, "Should have same length"); for(uint256 i = 0; i < _to.length; i++){ require(<FILL_ME>) require(_tokenId[i] < MAX_NFT, "Tokens number to mint cannot exceed number of MAX tokens"); _safeMint(_to[i], _tokenId[i]); giveawayCount = giveawayCount.add(1); } } /* * Function to get token URI of given token ID * URI will be blank untill totalSupply reaches MAX_NFT_PUBLIC */ function tokenURI( uint256 _tokenId ) public view virtual override returns (string memory) { } // Set Root for whitelist and raffle to participate in presale function setRoot(uint256 _root) onlyOwner() public { } // Verify MerkleProof function verify(bytes32[] memory proof, bytes32 leaf) public view returns (bool) { } // Standard functions to be overridden in ERC721Enumerable function supportsInterface( bytes4 _interfaceId ) public view override (ERC721, ERC721Enumerable) returns (bool) { } function _beforeTokenTransfer( address _from, address _to, uint256 _tokenId ) internal override(ERC721, ERC721Enumerable) { } }
_tokenId[i]>=MAX_NFT_PUBLIC,"Tokens number to mint must exceed number of public tokens"
370,828
_tokenId[i]>=MAX_NFT_PUBLIC