comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"chroma not in canvas"
pragma solidity 0.7.6; pragma abicoder v2; 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) { } /** * @dev Returns the remainder of dividing two unsigned integers, throws on overflow. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } interface IERC721 is IERC165 { event Transfer( address indexed from, address indexed to, uint256 indexed tokenId ); event Approval( address indexed owner, address indexed approved, uint256 indexed tokenId ); event ApprovalForAll( address indexed owner, address indexed operator, bool approved ); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom( address from, address to, uint256 tokenId ) external; function transferFrom( address from, address to, uint256 tokenId ) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } interface ERC721TokenReceiver { function onERC721Received( address _operator, address _from, uint256 _tokenId, bytes calldata _data ) external returns (bytes4); } interface ChromaInterface { function toHex(uint256 _id) external view returns (string memory); } contract ChromaticCanvas is IERC721 { using SafeMath for uint256; bytes4 internal constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02; mapping(bytes4 => bool) internal supportedInterfaces; mapping(uint256 => address) public idToOwner; mapping(uint256 => address) internal idToApproval; mapping(address => mapping(address => bool)) internal ownerToOperators; mapping(address => uint256[]) public ownerToIds; mapping(uint256 => uint256) public idToOwnerIndex; string internal nftName = "Chromatic Canvas"; string internal nftSymbol = unicode"□"; uint256 public numTokens = 0; address public chroma; bool private reentrancyLock = false; /* Prevent a contract function from being reentrant-called. */ modifier reentrancyGuard() { } modifier canTransfer(uint256 _tokenId) { } modifier canOperate(uint256 _tokenId) { } modifier validNFToken(uint256 _tokenId) { } constructor(address payable _adminAddress, address _chroma) { } function _addNFToken(address _to, uint256 _tokenId) internal { } function _removeNFToken(address _from, uint256 _tokenId) internal { } function _getOwnerNFTCount(address _owner) internal view returns (uint256) { } function _safeTransferFrom( address _from, address _to, uint256 _tokenId, bytes memory _data ) private canTransfer(_tokenId) validNFToken(_tokenId) { } function _clearApproval(uint256 _tokenId) private { } ////////////////////////// //// Enumerable //// ////////////////////////// function totalSupply() public view returns (uint256) { } function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256) { } ////////////////////////// //// Administration //// ////////////////////////// address payable public adminAddress; uint256 public maxHeight = 64; uint256 public maxWidth = 64; uint256 public canvasCreationPrice = 0; modifier onlyAdmin() { } function setAdmin(address payable _newAdmin) external onlyAdmin { } function setMaxDimensions(uint256 _maxHeight, uint256 _maxWidth) external onlyAdmin { } function setCanvasCreationPrice(uint256 _price) external onlyAdmin { } ////////////////////////// //// ERC 721 and 165 //// ////////////////////////// function isContract(address _addr) internal view returns (bool addressCheck) { } function supportsInterface(bytes4 _interfaceID) external view override returns (bool) { } function safeTransferFrom( address _from, address _to, uint256 _tokenId, bytes calldata _data ) external override { } function safeTransferFrom( address _from, address _to, uint256 _tokenId ) external override { } function transferFrom( address _from, address _to, uint256 _tokenId ) external override canTransfer(_tokenId) validNFToken(_tokenId) { } function approve(address _approved, uint256 _tokenId) external override canOperate(_tokenId) validNFToken(_tokenId) { } function setApprovalForAll(address _operator, bool _approved) external override { } function balanceOf(address _owner) external view override returns (uint256) { } function ownerOf(uint256 _tokenId) external view override returns (address _owner) { } function getApproved(uint256 _tokenId) external view override validNFToken(_tokenId) returns (address) { } function isApprovedForAll(address _owner, address _operator) external view override returns (bool) { } function _transfer(address _to, uint256 _tokenId) internal { } ////////////////////////// //// Canvas //// ////////////////////////// event CanvasCreated( uint256 indexed canvasId, uint256 baseChromaId, uint256 height, uint256 width, string name, string author ); event BaseChromaChanged(uint256 indexed canvasId, uint256 baseChromaId); event ChromaAddedToCanvas(uint256 indexed canvasId, uint256 chromaId); event ChromaRemovedFromCanvas(uint256 indexed canvasId, uint256 chromaId); event LocationAddedToChroma( uint256 indexed canvasId, uint256 chromaId, uint256 key, uint256 y, uint256 x ); event LocationRemovedFromChroma( uint256 indexed canvasId, uint256 chromaId, uint256 key ); event CanvasLocked(uint256 indexed canvasId, address owner); event CanvasUnlocked(uint256 indexed canvasId, address owner); event CanvasDestroyed(uint256 indexed canvasId, address destroyer); event CanvasCreationPriceChanged(uint256 newPrice); event NameChanged(uint256 indexed canvasId, string name); event AuthorChanged(uint256 indexed canvasId, string author); uint256 public tokenIndex = 0; mapping(uint256 => string) public idToName; mapping(uint256 => string) public idToAuthor; mapping(uint256 => uint128[2]) public idToDimensions; mapping(uint256 => uint256[]) public canvasToChroma; mapping(uint256 => uint256) public chromaToCanvasIndex; mapping(uint256 => uint256) public chromaToCanvas; mapping(uint256 => address) public lockedBy; mapping(uint256 => uint256) public baseChroma; mapping(uint256 => mapping(uint256 => uint256)) public locationToChroma; mapping(uint256 => mapping(uint256 => uint256)) public locationToChromaIndex; mapping(uint256 => uint256[]) public chromaToLocations; modifier notLocked(uint256 _canvasId) { } modifier onlyCanvasOwner(uint256 _canvasId) { } function lockUntilTransfer(uint256 _canvasId) external onlyCanvasOwner(_canvasId) { } function _unlockCanvas(uint256 _canvasId) internal { } function changeName(uint256 _canvasId, string calldata _name) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) { } function changeAuthor(uint256 _canvasId, string calldata _author) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) { } function createCanvas( uint256 _baseChromaId, uint128 _height, uint128 _width, string calldata _name, string calldata _author ) external payable reentrancyGuard { } function destroyCanvas(uint256 _canvasId) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) { } function changeBaseChroma(uint256 _baseChromaId, uint256 _canvasId) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) { } function addChromaToCanvas( uint256 _canvasId, uint256 _chromaId, uint128[][] calldata _locations ) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) { } function addChromaLocations( uint256 _canvasId, uint256 _chromaId, uint128[][] calldata _locations ) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) { } function removeChromaFromCanvas(uint256 _canvasId, uint256 _chromaId) external onlyCanvasOwner(_canvasId) notLocked(_canvasId) { require(<FILL_ME>) _removeChromaFromCanvas(_chromaId); } function _removeChromaFromCanvas(uint256 _chromaId) internal { } function _addChromaToLocation( uint256 _canvasId, uint256 _chromaId, uint256 key ) internal { } function _removeChromaFromLocation( uint256 _canvasId, uint128[][] calldata _locations ) internal { } function _removeChromaFromLocation( uint256 _canvasId, uint256 _chromaId, uint256 key ) internal { } function idToHeight(uint _id) public view returns(uint128) { } function idToWidth(uint _id) public view returns(uint128) { } function getOwnedTokenIds(address owner) public view returns (uint256[] memory) { } function getChromaCount(uint256 _canvasId) public view returns (uint) { } function getChromaInCanvas(uint256 _canvasId) public view returns (uint256[] memory) { } function getChromaInCanvasInHex(uint256 _canvasId) public view returns (string[] memory) { } function getBaseChromaHex(uint256 _canvasId) public view returns (string memory) { } function getData(uint256 _canvasId) public view returns (string[][] memory) { } ////////////////////////// //// Metadata //// ////////////////////////// /** * @dev Returns a descriptive name for a collection of NFTokens. * @return _name Representing name. */ function name() external view returns (string memory _name) { } /** * @dev Returns an abbreviated name for NFTokens. * @return _symbol Representing symbol. */ function symbol() external view returns (string memory _symbol) { } }
chromaToCanvas[_chromaId]==_canvasId,"chroma not in canvas"
365,365
chromaToCanvas[_chromaId]==_canvasId
null
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { } } /*Token Contract*/ contract BBBToken is StandardToken, Ownable { using SafeMath for uint256; // Token 資訊 string public constant NAME = "M724 Coin"; string public constant SYMBOL = "M724"; uint8 public constant DECIMALS = 18; // Sale period1. uint256 public startDate1; uint256 public endDate1; // Sale period2. uint256 public startDate2; uint256 public endDate2; //目前銷售額 uint256 public saleCap; // Address Where Token are keep address public tokenWallet; // Address where funds are collected. address public fundWallet; // Amount of raised money in wei. uint256 public weiRaised; // Event event TokenPurchase(address indexed purchaser, uint256 value, uint256 amount); // Modifiers modifier uninitialized() { } constructor() public {} // Trigger with Transfer event // Fallback function can be used to buy tokens function () public payable { } function getDate() public view returns(uint256 _date) { } //初始化合約 function initialize(address _tokenWallet, address _fundWallet, uint256 _start1, uint256 _end1, uint256 _saleCap, uint256 _totalSupply) public onlyOwner uninitialized { } //設定銷售期間 function setPeriod(uint period, uint256 _start, uint256 _end) public onlyOwner { } // For pushing pre-ICO records function sendForPreICO(address buyer, uint256 amount) public onlyOwner { } //Set SaleCap function setSaleCap(uint256 _saleCap) public onlyOwner { require(<FILL_ME>) uint256 amount=0; //目前銷售額 大於 新銷售額 if (balances[tokenWallet] > _saleCap) { amount = balances[tokenWallet].sub(_saleCap); balances[0xb1] = balances[0xb1].add(amount); } else { amount = _saleCap.sub(balances[tokenWallet]); balances[0xb1] = balances[0xb1].sub(amount); } balances[tokenWallet] = _saleCap; saleCap = _saleCap; } //Calcute Bouns function getBonusByTime(uint256 atTime) public constant returns (uint256) { } function getBounsByAmount(uint256 etherAmount, uint256 tokenAmount) public pure returns (uint256) { } //終止合約 function finalize() public onlyOwner { } //確認是否正常銷售 function saleActive() public constant returns (bool) { } //Get CurrentTS function getCurrentTimestamp() internal view returns (uint256) { } //購買Token function buyTokens(address sender, uint256 value) internal { } }
balances[0xb1].add(balances[tokenWallet]).sub(_saleCap)>0
365,478
balances[0xb1].add(balances[tokenWallet]).sub(_saleCap)>0
null
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { } } /*Token Contract*/ contract BBBToken is StandardToken, Ownable { using SafeMath for uint256; // Token 資訊 string public constant NAME = "M724 Coin"; string public constant SYMBOL = "M724"; uint8 public constant DECIMALS = 18; // Sale period1. uint256 public startDate1; uint256 public endDate1; // Sale period2. uint256 public startDate2; uint256 public endDate2; //目前銷售額 uint256 public saleCap; // Address Where Token are keep address public tokenWallet; // Address where funds are collected. address public fundWallet; // Amount of raised money in wei. uint256 public weiRaised; // Event event TokenPurchase(address indexed purchaser, uint256 value, uint256 amount); // Modifiers modifier uninitialized() { } constructor() public {} // Trigger with Transfer event // Fallback function can be used to buy tokens function () public payable { } function getDate() public view returns(uint256 _date) { } //初始化合約 function initialize(address _tokenWallet, address _fundWallet, uint256 _start1, uint256 _end1, uint256 _saleCap, uint256 _totalSupply) public onlyOwner uninitialized { } //設定銷售期間 function setPeriod(uint period, uint256 _start, uint256 _end) public onlyOwner { } // For pushing pre-ICO records function sendForPreICO(address buyer, uint256 amount) public onlyOwner { } //Set SaleCap function setSaleCap(uint256 _saleCap) public onlyOwner { } //Calcute Bouns function getBonusByTime(uint256 atTime) public constant returns (uint256) { } function getBounsByAmount(uint256 etherAmount, uint256 tokenAmount) public pure returns (uint256) { } //終止合約 function finalize() public onlyOwner { require(<FILL_ME>) // Transfer the rest of token to tokenWallet balances[tokenWallet] = balances[tokenWallet].add(balances[0xb1]); balances[0xb1] = 0; } //確認是否正常銷售 function saleActive() public constant returns (bool) { } //Get CurrentTS function getCurrentTimestamp() internal view returns (uint256) { } //購買Token function buyTokens(address sender, uint256 value) internal { } }
!saleActive()
365,478
!saleActive()
null
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { } function approve(address _spender, uint256 _value) public returns (bool) { } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { } } /*Token Contract*/ contract BBBToken is StandardToken, Ownable { using SafeMath for uint256; // Token 資訊 string public constant NAME = "M724 Coin"; string public constant SYMBOL = "M724"; uint8 public constant DECIMALS = 18; // Sale period1. uint256 public startDate1; uint256 public endDate1; // Sale period2. uint256 public startDate2; uint256 public endDate2; //目前銷售額 uint256 public saleCap; // Address Where Token are keep address public tokenWallet; // Address where funds are collected. address public fundWallet; // Amount of raised money in wei. uint256 public weiRaised; // Event event TokenPurchase(address indexed purchaser, uint256 value, uint256 amount); // Modifiers modifier uninitialized() { } constructor() public {} // Trigger with Transfer event // Fallback function can be used to buy tokens function () public payable { } function getDate() public view returns(uint256 _date) { } //初始化合約 function initialize(address _tokenWallet, address _fundWallet, uint256 _start1, uint256 _end1, uint256 _saleCap, uint256 _totalSupply) public onlyOwner uninitialized { } //設定銷售期間 function setPeriod(uint period, uint256 _start, uint256 _end) public onlyOwner { } // For pushing pre-ICO records function sendForPreICO(address buyer, uint256 amount) public onlyOwner { } //Set SaleCap function setSaleCap(uint256 _saleCap) public onlyOwner { } //Calcute Bouns function getBonusByTime(uint256 atTime) public constant returns (uint256) { } function getBounsByAmount(uint256 etherAmount, uint256 tokenAmount) public pure returns (uint256) { } //終止合約 function finalize() public onlyOwner { } //確認是否正常銷售 function saleActive() public constant returns (bool) { } //Get CurrentTS function getCurrentTimestamp() internal view returns (uint256) { } //購買Token function buyTokens(address sender, uint256 value) internal { //Check Sale Status require(<FILL_ME>) //Minum buying limit require(value >= 0.5 ether); // Calculate token amount to be purchased uint256 bonus = getBonusByTime(getCurrentTimestamp()); uint256 amount = value.mul(bonus); // 第一階段銷售期,每次購買量超過500Ether,多增加10% if (getCurrentTimestamp() >= startDate1 && getCurrentTimestamp() < endDate1) { uint256 p1Bouns = getBounsByAmount(value, amount); amount = amount + p1Bouns; } // We have enough token to sale require(saleCap >= amount); // Transfer balances[tokenWallet] = balances[tokenWallet].sub(amount); balances[sender] = balances[sender].add(amount); saleCap = saleCap - amount; // Update state. weiRaised = weiRaised + value; // Forward the fund to fund collection wallet. //tokenWallet.transfer(msg.value); fundWallet.transfer(msg.value); } }
saleActive()
365,478
saleActive()
"You already minted NFT"
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract OwnableDelegateProxy {} contract OpenSeaProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } contract GangPass is ERC1155Supply, Ownable { using ECDSA for bytes32; address private whitelistSigner = 0xb1A7559274Bc1e92c355C7244255DC291AFEDB00; address private withdrawalAddress = 0x80c74C907071482Ec7E52d6C11185DAeAFE084Ab; address private proxyRegistryAddress = 0xa5409ec958C83C3f309868babACA7c86DCB077c1; bool public saleIsActive; bool public publicSaleIsActive; uint[4] public maxSupplies = [0, 650, 200, 100]; //number of max supplies for each tokenId uint[4] public reservedTiers = [0, 30, 15, 4]; //number of reserved tiers for each tokenId. They are not included in max supplies uint[4] public prices = [0, 0.099 ether, 0.19 ether, 0.29 ether]; string public name = "Gang Pass"; string public symbol = "GANG"; bytes32 private DOMAIN_SEPARATOR; bytes32 private constant TYPEHASH = keccak256("mintToken(address to,uint tokenId)"); mapping(address => bool) public isMinted; mapping(uint => uint) public mintedReservedTiers; //number of minted reserved tiers for each tokenId modifier onlyAddress() { } constructor() ERC1155("https://ipfs.io/ipfs/QmYx2UKvLsMBBhknwm35Ai7jESe5Yu2v6GZua9k1bcBbaz/{id}.json") { } function mintToken(uint tokenId, bytes calldata signature) external payable onlyAddress { uint currentSupply = totalSupply(tokenId) - mintedReservedTiers[tokenId]; //excluding minted reserved tiers require(whitelistSigner != address(0), "Whitelist signer is not set yet"); require(saleIsActive, "Sale is not active yet"); require(<FILL_ME>) require(currentSupply < maxSupplies[tokenId], "Exceeds max supply for the corresponding tier"); require(msg.value >= prices[tokenId], "Not enough ETH for transaction"); bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, keccak256(abi.encode(TYPEHASH, msg.sender, tokenId)) ) ); address signer = digest.recover(signature); require(signer == whitelistSigner, "Invalid signature"); isMinted[msg.sender] = true; _mint(msg.sender, tokenId, 1, ""); } function publicMint(uint tokenId) external payable onlyAddress { } function giveAway(address to, uint tokenId) external onlyOwner { } function setURI(string memory _newuri) external onlyOwner { } function setWhitelistSigner(address _newWhitelistSigner) external onlyOwner { } function setProxyRegistryAddress(address _proxyRegistryAddress) external onlyOwner { } function setWithdrawalAddress(address _withdrawalAddress) external onlyOwner { } function setSaleState() external onlyOwner { } function setPublicSaleState() external onlyOwner { } function setMaxSupplies(uint t1, uint t2, uint t3) external onlyOwner { } function setPrices(uint256 price_t1, uint256 price_t2, uint256 price_t3) external onlyOwner { } function withdraw() external onlyOwner { } function _withdraw(address _address, uint256 _amount) private { } //@dev - allow gasless OpenSea listing function isApprovedForAll(address owner, address operator) public view override returns (bool) { } }
!isMinted[msg.sender],"You already minted NFT"
365,551
!isMinted[msg.sender]
"Receiver address already minted NFT"
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract OwnableDelegateProxy {} contract OpenSeaProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } contract GangPass is ERC1155Supply, Ownable { using ECDSA for bytes32; address private whitelistSigner = 0xb1A7559274Bc1e92c355C7244255DC291AFEDB00; address private withdrawalAddress = 0x80c74C907071482Ec7E52d6C11185DAeAFE084Ab; address private proxyRegistryAddress = 0xa5409ec958C83C3f309868babACA7c86DCB077c1; bool public saleIsActive; bool public publicSaleIsActive; uint[4] public maxSupplies = [0, 650, 200, 100]; //number of max supplies for each tokenId uint[4] public reservedTiers = [0, 30, 15, 4]; //number of reserved tiers for each tokenId. They are not included in max supplies uint[4] public prices = [0, 0.099 ether, 0.19 ether, 0.29 ether]; string public name = "Gang Pass"; string public symbol = "GANG"; bytes32 private DOMAIN_SEPARATOR; bytes32 private constant TYPEHASH = keccak256("mintToken(address to,uint tokenId)"); mapping(address => bool) public isMinted; mapping(uint => uint) public mintedReservedTiers; //number of minted reserved tiers for each tokenId modifier onlyAddress() { } constructor() ERC1155("https://ipfs.io/ipfs/QmYx2UKvLsMBBhknwm35Ai7jESe5Yu2v6GZua9k1bcBbaz/{id}.json") { } function mintToken(uint tokenId, bytes calldata signature) external payable onlyAddress { } function publicMint(uint tokenId) external payable onlyAddress { } function giveAway(address to, uint tokenId) external onlyOwner { require(<FILL_ME>) require(balanceOf(to, tokenId) == 0, "Receiver address already has corresponding tier"); require(tokenId == 1 || tokenId == 2 || tokenId == 3, "Only Tier1, Tier2 and Tier3"); require(mintedReservedTiers[tokenId] < reservedTiers[tokenId], "All reserved NFTs for the corresponding tier are minted"); mintedReservedTiers[tokenId] += 1; _mint(to, tokenId, 1, ""); } function setURI(string memory _newuri) external onlyOwner { } function setWhitelistSigner(address _newWhitelistSigner) external onlyOwner { } function setProxyRegistryAddress(address _proxyRegistryAddress) external onlyOwner { } function setWithdrawalAddress(address _withdrawalAddress) external onlyOwner { } function setSaleState() external onlyOwner { } function setPublicSaleState() external onlyOwner { } function setMaxSupplies(uint t1, uint t2, uint t3) external onlyOwner { } function setPrices(uint256 price_t1, uint256 price_t2, uint256 price_t3) external onlyOwner { } function withdraw() external onlyOwner { } function _withdraw(address _address, uint256 _amount) private { } //@dev - allow gasless OpenSea listing function isApprovedForAll(address owner, address operator) public view override returns (bool) { } }
!isMinted[to],"Receiver address already minted NFT"
365,551
!isMinted[to]
"Receiver address already has corresponding tier"
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract OwnableDelegateProxy {} contract OpenSeaProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } contract GangPass is ERC1155Supply, Ownable { using ECDSA for bytes32; address private whitelistSigner = 0xb1A7559274Bc1e92c355C7244255DC291AFEDB00; address private withdrawalAddress = 0x80c74C907071482Ec7E52d6C11185DAeAFE084Ab; address private proxyRegistryAddress = 0xa5409ec958C83C3f309868babACA7c86DCB077c1; bool public saleIsActive; bool public publicSaleIsActive; uint[4] public maxSupplies = [0, 650, 200, 100]; //number of max supplies for each tokenId uint[4] public reservedTiers = [0, 30, 15, 4]; //number of reserved tiers for each tokenId. They are not included in max supplies uint[4] public prices = [0, 0.099 ether, 0.19 ether, 0.29 ether]; string public name = "Gang Pass"; string public symbol = "GANG"; bytes32 private DOMAIN_SEPARATOR; bytes32 private constant TYPEHASH = keccak256("mintToken(address to,uint tokenId)"); mapping(address => bool) public isMinted; mapping(uint => uint) public mintedReservedTiers; //number of minted reserved tiers for each tokenId modifier onlyAddress() { } constructor() ERC1155("https://ipfs.io/ipfs/QmYx2UKvLsMBBhknwm35Ai7jESe5Yu2v6GZua9k1bcBbaz/{id}.json") { } function mintToken(uint tokenId, bytes calldata signature) external payable onlyAddress { } function publicMint(uint tokenId) external payable onlyAddress { } function giveAway(address to, uint tokenId) external onlyOwner { require(!isMinted[to], "Receiver address already minted NFT"); require(<FILL_ME>) require(tokenId == 1 || tokenId == 2 || tokenId == 3, "Only Tier1, Tier2 and Tier3"); require(mintedReservedTiers[tokenId] < reservedTiers[tokenId], "All reserved NFTs for the corresponding tier are minted"); mintedReservedTiers[tokenId] += 1; _mint(to, tokenId, 1, ""); } function setURI(string memory _newuri) external onlyOwner { } function setWhitelistSigner(address _newWhitelistSigner) external onlyOwner { } function setProxyRegistryAddress(address _proxyRegistryAddress) external onlyOwner { } function setWithdrawalAddress(address _withdrawalAddress) external onlyOwner { } function setSaleState() external onlyOwner { } function setPublicSaleState() external onlyOwner { } function setMaxSupplies(uint t1, uint t2, uint t3) external onlyOwner { } function setPrices(uint256 price_t1, uint256 price_t2, uint256 price_t3) external onlyOwner { } function withdraw() external onlyOwner { } function _withdraw(address _address, uint256 _amount) private { } //@dev - allow gasless OpenSea listing function isApprovedForAll(address owner, address operator) public view override returns (bool) { } }
balanceOf(to,tokenId)==0,"Receiver address already has corresponding tier"
365,551
balanceOf(to,tokenId)==0
"All reserved NFTs for the corresponding tier are minted"
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract OwnableDelegateProxy {} contract OpenSeaProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } contract GangPass is ERC1155Supply, Ownable { using ECDSA for bytes32; address private whitelistSigner = 0xb1A7559274Bc1e92c355C7244255DC291AFEDB00; address private withdrawalAddress = 0x80c74C907071482Ec7E52d6C11185DAeAFE084Ab; address private proxyRegistryAddress = 0xa5409ec958C83C3f309868babACA7c86DCB077c1; bool public saleIsActive; bool public publicSaleIsActive; uint[4] public maxSupplies = [0, 650, 200, 100]; //number of max supplies for each tokenId uint[4] public reservedTiers = [0, 30, 15, 4]; //number of reserved tiers for each tokenId. They are not included in max supplies uint[4] public prices = [0, 0.099 ether, 0.19 ether, 0.29 ether]; string public name = "Gang Pass"; string public symbol = "GANG"; bytes32 private DOMAIN_SEPARATOR; bytes32 private constant TYPEHASH = keccak256("mintToken(address to,uint tokenId)"); mapping(address => bool) public isMinted; mapping(uint => uint) public mintedReservedTiers; //number of minted reserved tiers for each tokenId modifier onlyAddress() { } constructor() ERC1155("https://ipfs.io/ipfs/QmYx2UKvLsMBBhknwm35Ai7jESe5Yu2v6GZua9k1bcBbaz/{id}.json") { } function mintToken(uint tokenId, bytes calldata signature) external payable onlyAddress { } function publicMint(uint tokenId) external payable onlyAddress { } function giveAway(address to, uint tokenId) external onlyOwner { require(!isMinted[to], "Receiver address already minted NFT"); require(balanceOf(to, tokenId) == 0, "Receiver address already has corresponding tier"); require(tokenId == 1 || tokenId == 2 || tokenId == 3, "Only Tier1, Tier2 and Tier3"); require(<FILL_ME>) mintedReservedTiers[tokenId] += 1; _mint(to, tokenId, 1, ""); } function setURI(string memory _newuri) external onlyOwner { } function setWhitelistSigner(address _newWhitelistSigner) external onlyOwner { } function setProxyRegistryAddress(address _proxyRegistryAddress) external onlyOwner { } function setWithdrawalAddress(address _withdrawalAddress) external onlyOwner { } function setSaleState() external onlyOwner { } function setPublicSaleState() external onlyOwner { } function setMaxSupplies(uint t1, uint t2, uint t3) external onlyOwner { } function setPrices(uint256 price_t1, uint256 price_t2, uint256 price_t3) external onlyOwner { } function withdraw() external onlyOwner { } function _withdraw(address _address, uint256 _amount) private { } //@dev - allow gasless OpenSea listing function isApprovedForAll(address owner, address operator) public view override returns (bool) { } }
mintedReservedTiers[tokenId]<reservedTiers[tokenId],"All reserved NFTs for the corresponding tier are minted"
365,551
mintedReservedTiers[tokenId]<reservedTiers[tokenId]
"Sorry, there are not enough artworks remaining."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "ERC721.sol"; import "IERC2981.sol"; import "Pausable.sol"; import "ReentrancyGuard.sol"; import "Ownable.sol"; import "MerkleProof.sol"; import "Counters.sol"; contract AETest is ERC721, IERC2981, Pausable, Ownable, ReentrancyGuard { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; bool public prelive; bool public slLive; bool public freezeURI; bool public contractRoyalties; // need to apend 0x to front to indicate it is hexadecimal bytes32 private merkleRoot = 0xa7bae61bd9404e894cac665ce5323269569929ca9102d3f44727be92eb37ba71; //IMPORTANT: the below must be updated!!! uint32 public constant MAX_NFT = 20; //IMPORTANT: the below must be updated!!! uint32 public constant MAX_WLIST = 10; //IMPORTANT: the below must be updated!!! uint32 private constant MAX_MINT = 3; uint32 public WTLST_COUNT = 0; //IMPORTANT: the below must be updated!!! uint256 public PRICE = 0.00001 ether; //IMPORTANT: the below must be updated!!! uint256 public XILE_PRICE = 0.000005 ether; //IMPORTANT: the below must be updated address private _artist = 0xFD11a824E61A03F8bf25e489D2B49f44558614c8; string private _contractURI; string private _metadataBaseURI; // ** MODIFIERS ** // // *************** // modifier saleLive() { } modifier preSaleLive() { } modifier allocTokens(uint32 numToMint) { require(<FILL_ME>) _; } modifier maxOwned(uint32 numToMint) { } modifier correctPayment(uint256 mintPrice, uint32 numToMint) { } modifier whiteListed(bytes32[] calldata merkleProof) { } constructor(string memory _cURI, string memory _mURI) ERC721("HogBlox Digital Tapestries", "HDT") { } function aeMint(uint32 mintNum) external payable nonReentrant saleLive allocTokens(mintNum) maxOwned(mintNum) correctPayment(PRICE, mintNum) { } function preMint(uint32 mintNum, bytes32[] calldata merkleProof) external payable nonReentrant preSaleLive whiteListed(merkleProof) maxOwned(mintNum) correctPayment(PRICE, mintNum) { } // testing code - to consider function safeMint(address to) public onlyOwner allocTokens(1) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override whenNotPaused { } // ** TOKEN FREEZING ** // // ******************** // function freezeAll() external onlyOwner { } // ** ADMIN ** // // *********** // function _baseURI() internal view override returns (string memory) { } function withdrawFunds(uint256 _amt) public onlyOwner { } function metaURI(string calldata _URI) external onlyOwner { } function cntURI(string calldata _URI) external onlyOwner { } // ** SETTINGS ** // // ************** // function tglLive() external onlyOwner { } function tglPresale() external onlyOwner { } /** * @dev Reserve ability to make use of {IERC165-royaltyInfo} standard to implement royalties. */ function tglRoyalties() external onlyOwner { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function updatePrice(uint256 pce) external onlyOwner { } function setMerkleRoot(bytes32 _root) external onlyOwner { } function setArtist(address to) external onlyOwner returns (address) { } function contractURI() external view returns (string memory) { } function tokenCount() public view returns (uint256) { } /** * @dev See {IERC165-royaltyInfo}. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view override returns (address receiver, uint256 royaltyAmount) { } }
_tokenIdCounter.current()+numToMint<=MAX_NFT,"Sorry, there are not enough artworks remaining."
365,565
_tokenIdCounter.current()+numToMint<=MAX_NFT
"Limit of 3 per wallet"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "ERC721.sol"; import "IERC2981.sol"; import "Pausable.sol"; import "ReentrancyGuard.sol"; import "Ownable.sol"; import "MerkleProof.sol"; import "Counters.sol"; contract AETest is ERC721, IERC2981, Pausable, Ownable, ReentrancyGuard { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; bool public prelive; bool public slLive; bool public freezeURI; bool public contractRoyalties; // need to apend 0x to front to indicate it is hexadecimal bytes32 private merkleRoot = 0xa7bae61bd9404e894cac665ce5323269569929ca9102d3f44727be92eb37ba71; //IMPORTANT: the below must be updated!!! uint32 public constant MAX_NFT = 20; //IMPORTANT: the below must be updated!!! uint32 public constant MAX_WLIST = 10; //IMPORTANT: the below must be updated!!! uint32 private constant MAX_MINT = 3; uint32 public WTLST_COUNT = 0; //IMPORTANT: the below must be updated!!! uint256 public PRICE = 0.00001 ether; //IMPORTANT: the below must be updated!!! uint256 public XILE_PRICE = 0.000005 ether; //IMPORTANT: the below must be updated address private _artist = 0xFD11a824E61A03F8bf25e489D2B49f44558614c8; string private _contractURI; string private _metadataBaseURI; // ** MODIFIERS ** // // *************** // modifier saleLive() { } modifier preSaleLive() { } modifier allocTokens(uint32 numToMint) { } modifier maxOwned(uint32 numToMint) { require(<FILL_ME>) _; } modifier correctPayment(uint256 mintPrice, uint32 numToMint) { } modifier whiteListed(bytes32[] calldata merkleProof) { } constructor(string memory _cURI, string memory _mURI) ERC721("HogBlox Digital Tapestries", "HDT") { } function aeMint(uint32 mintNum) external payable nonReentrant saleLive allocTokens(mintNum) maxOwned(mintNum) correctPayment(PRICE, mintNum) { } function preMint(uint32 mintNum, bytes32[] calldata merkleProof) external payable nonReentrant preSaleLive whiteListed(merkleProof) maxOwned(mintNum) correctPayment(PRICE, mintNum) { } // testing code - to consider function safeMint(address to) public onlyOwner allocTokens(1) { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override whenNotPaused { } // ** TOKEN FREEZING ** // // ******************** // function freezeAll() external onlyOwner { } // ** ADMIN ** // // *********** // function _baseURI() internal view override returns (string memory) { } function withdrawFunds(uint256 _amt) public onlyOwner { } function metaURI(string calldata _URI) external onlyOwner { } function cntURI(string calldata _URI) external onlyOwner { } // ** SETTINGS ** // // ************** // function tglLive() external onlyOwner { } function tglPresale() external onlyOwner { } /** * @dev Reserve ability to make use of {IERC165-royaltyInfo} standard to implement royalties. */ function tglRoyalties() external onlyOwner { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function updatePrice(uint256 pce) external onlyOwner { } function setMerkleRoot(bytes32 _root) external onlyOwner { } function setArtist(address to) external onlyOwner returns (address) { } function contractURI() external view returns (string memory) { } function tokenCount() public view returns (uint256) { } /** * @dev See {IERC165-royaltyInfo}. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view override returns (address receiver, uint256 royaltyAmount) { } }
balanceOf(msg.sender)+numToMint<=MAX_MINT,"Limit of 3 per wallet"
365,565
balanceOf(msg.sender)+numToMint<=MAX_MINT
"Enoji:INVALID_OWNER"
//SPDX-License-Identifier: Unlicense pragma solidity 0.8.6; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; contract EnojiDataRegistry { IERC721 public enoji; mapping(uint256 => string) dataByTokenId; constructor(address _enoji) { } function setData(uint256 _tokenId, string memory data) external { require(<FILL_ME>) dataByTokenId[_tokenId] = data; } function getData(uint256 _tokenId) external view returns (string memory) { } }
enoji.ownerOf(_tokenId)==msg.sender,"Enoji:INVALID_OWNER"
365,610
enoji.ownerOf(_tokenId)==msg.sender
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "./common/meta-transactions/ContentMixin.sol"; import "./common/meta-transactions/NativeMetaTransaction.sol"; contract OwnableDelegateProxy {} /** * Used to delegate ownership of a contract to another address, to save on unneeded transactions to approve contract use for users */ contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } /** * @title ERC721Tradable * ERC721Tradable - ERC721 contract that whitelists a trading address, and has minting functionality. */ abstract contract ERC721Tradable is ERC721, ContextMixin, NativeMetaTransaction, Ownable { using SafeMath for uint256; using Counters for Counters.Counter; /** * We rely on the OZ Counter util to keep track of the next available ID. * We track the nextTokenId instead of the currentTokenId to save users on gas costs. * Read more about it here: https://shiny.mirror.xyz/OUampBbIz9ebEicfGnQf5At_ReMHlZy0tB4glb9xQ0E */ Counters.Counter internal _nextTokenId; bool isMintingActive; bool isAllowListActive; mapping(address => uint8) private _allowList; uint mintPrice = 68000000000000000; uint MAX_SUPPLY = 8888; address proxyRegistryAddress; constructor( string memory _name, string memory _symbol, address _proxyRegistryAddress ) ERC721(_name, _symbol) { } function setAllowList(address[] calldata addresses, uint8 numAllowedToMint) external onlyOwner { } function getIsAllowListActive() external view returns(bool){ } function getIsMintingActive() external view returns(bool) { } function setAllowListActive(bool isActive) external onlyOwner { } function setIsMintingActive(bool _isActive) external onlyOwner { } function getIsInAllowList(address _to) external view returns(bool){ } function getMaxNumAllowedToMint(address _addr) external view returns(uint) { } /** * @dev Mints a token to an address with a tokenURI. * @param _to address of the future owner of the token */ function mintTo(address _to) external payable { require(msg.value == mintPrice, "Not enough ETH sent; check price!"); require(isMintingActive == true, "Minting not active yet"); require(<FILL_ME>) uint256 currentTokenId = _nextTokenId.current(); _nextTokenId.increment(); _safeMint(_to, currentTokenId); } function mintAllowList(uint8 numberOfTokens) external payable { } function mintFromSale(uint8 numberOfTokens) external payable { } /** @dev Returns the total tokens minted so far. 1 is always subtracted from the Counter since it tracks the next available tokenId. */ function totalSupply() public view returns (uint256) { } function withdraw(uint amount) external onlyOwner { } function baseTokenURI() virtual public pure returns (string memory); function tokenURI(uint256 _tokenId) override public pure returns (string memory) { } /** * Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings. */ function isApprovedForAll(address owner, address operator) override public view returns (bool) { } /** * This is used instead of msg.sender as transactions won't be sent by the original token owner, but by OpenSea. */ function _msgSender() internal override view returns (address sender) { } }
_nextTokenId.current()<=MAX_SUPPLY
365,745
_nextTokenId.current()<=MAX_SUPPLY
"Contracts not set"
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./interfaces/IWnD.sol"; import "./interfaces/IGP.sol"; import "./interfaces/ITrainingGrounds.sol"; import "./interfaces/ISacrificialAlter.sol"; import "hardhat/console.sol"; contract TrainingGrounds is ITrainingGrounds, Ownable, ReentrancyGuard, IERC721Receiver, Pausable { using EnumerableSet for EnumerableSet.UintSet; //magic rune tokenId uint256 public constant magicRune = 7; //whip tokenId uint256 public constant whip = 6; // maximum rank for a Wizard/Dragon uint8 public constant MAX_RANK = 8; //time to stake for reward uint80 public constant timeToStakeForReward = 2 days; uint16 public constant MAX_WHIP_EMISSION = 16000; uint16 public constant MAX_MAGIC_RUNE_EMISSION = 1600; uint16 public curWhipsEmitted; uint16 public curMagicRunesEmitted; struct StakeWizard { uint16 tokenId; uint80 lastClaimTime; address owner; } // dragons are in both pools at the same time struct StakeDragon { uint16 tokenId; uint80 lastClaimTime; address owner; uint256 value; // uint256 because the previous variables pack an entire 32bits } struct Deposits { EnumerableSet.UintSet towerWizards; EnumerableSet.UintSet trainingWizards; EnumerableSet.UintSet dragons; } // address => allowedToCallFunctions mapping(address => bool) private admins; uint256 private totalRankStaked; uint256 private numWizardsStaked; event TokenStaked(address indexed owner, uint256 indexed tokenId, bool indexed isWizard, bool isTraining); event WizardClaimed(address indexed owner, uint256 indexed tokenId, bool indexed unstaked); event DragonClaimed(address indexed owner, uint256 indexed tokenId, bool indexed unstaked); // reference to the WnD NFT contract IWnD public wndNFT; // reference to the $GP contract for minting $GP earnings IGP public gpToken; // reference to sacrificial alter ISacrificialAlter public alter; // maps tokenId to stake mapping(uint256 => StakeWizard) private tower; // maps tokenId to stake mapping(uint256 => StakeWizard) private training; // maps rank to all Dragon staked with that rank mapping(uint256 => StakeDragon[]) private flight; // tracks location of each Dragon in Flight mapping(uint256 => uint256) private flightIndices; mapping(address => Deposits) private _deposits; // any rewards distributed when no dragons are staked uint256 private unaccountedRewards = 0; // amount of $GP due for each rank point staked uint256 private gpPerRank = 0; // wizards earn 12000 $GP per day uint256 public constant DAILY_GP_RATE = 2000 ether; // dragons take a 20% tax on all $GP claimed uint256 public constant GP_CLAIM_TAX_PERCENTAGE_UNTRAINED = 50; // dragons take a 20% tax on all $GP claimed uint256 public constant GP_CLAIM_TAX_PERCENTAGE = 20; // Max earn from staking is 500 million $GP for the training ground uint256 public constant MAXIMUM_GLOBAL_GP = 500000000 ether; // wizards must have 2 days worth of emissions to unstake or else they're still guarding the tower uint256 public constant MINIMUM_TO_EXIT = 2 days; // amount of $GP earned so far uint256 public totalGPEarned; // the last time $GP was claimed uint256 private lastClaimTimestamp; // emergency rescue to allow unstaking without any checks but without $GP bool public rescueEnabled = false; /** */ constructor() { } /** CRITICAL TO SETUP */ modifier requireContractsSet() { require(<FILL_ME>) _; } function setContracts(address _wndNFT, address _gp, address _alter) external onlyOwner { } function depositsOf(address account) external view returns (uint256[] memory) { } /** Used to determine if a staked token is owned. Used to allow game logic to occur outside this contract. * This might not be necessary if the training mechanic is in this contract instead */ function ownsToken(uint256 tokenId) external view returns (bool) { } function isTokenStaked(uint256 tokenId, bool isTraining) external view override returns (bool) { } function calculateGpRewards(uint256 tokenId) external view returns (uint256 owed) { } function calculateErcEmissionRewards(uint256 tokenId) external view returns (uint256 owed) { } /** STAKING */ /** * adds Wizards and Dragons to the Tower and Flight * @param tokenIds the IDs of the Wizards and Dragons to stake */ function addManyToTowerAndFlight(address tokenOwner, uint16[] calldata tokenIds) external override nonReentrant { } /** * adds Wizards and Dragons to the Tower and Flight * @param seed the seed for random logic * @param tokenIds the IDs of the Wizards and Dragons to stake */ function addManyToTrainingAndFlight(uint256 seed, address tokenOwner, uint16[] calldata tokenIds) external override nonReentrant { } /** * adds a single Wizard to the Tower * @param account the address of the staker * @param tokenId the ID of the Wizard to add to the Tower */ function _addWizardToTower(address account, uint256 tokenId) internal whenNotPaused { } function _addWizardToTraining(address account, uint256 tokenId) internal whenNotPaused { } /** * adds a single Dragon to the Flight * @param account the address of the staker * @param tokenId the ID of the Dragon to add to the Flight */ function _addDragonToFlight(address account, uint256 tokenId) internal { } /** CLAIMING / UNSTAKING */ /** * realize $GP earnings and optionally unstake tokens from the Tower / Flight * to unstake a Wizard it will require it has 2 days worth of $GP unclaimed * @param tokenIds the IDs of the tokens to claim earnings from * @param unstake whether or not to unstake ALL of the tokens listed in tokenIds */ function claimManyFromTowerAndFlight(address tokenOwner, uint16[] calldata tokenIds, bool unstake) external override whenNotPaused _updateEarnings nonReentrant { } /** * realize $GP earnings and optionally unstake tokens from the Tower / Flight * to unstake a Wizard it will require it has 2 days worth of $GP unclaimed * @param tokenIds the IDs of the tokens to claim earnings from * @param unstake whether or not to unstake ALL of the tokens listed in tokenIds */ function claimManyFromTrainingAndFlight(uint256 seed, address tokenOwner, uint16[] calldata tokenIds, bool unstake) external override whenNotPaused nonReentrant { } /** * @param seed a random value to select a recipient from * @return the address of the recipient (either the caller or the Dragon thief's owner) */ function selectRecipient(uint256 seed, address tokenOwner) internal view returns (address) { } /** * realize $GP earnings for a single Wizard and optionally unstake it * if not unstaking, pay a 20% tax to the staked Dragons * if unstaking, there is a 50% chance all $GP is stolen * @param tokenId the ID of the Wizards to claim earnings from * @param unstake whether or not to unstake the Wizards * @return owed - the amount of $GP earned */ function _claimWizardFromTower(uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint256 owed) { } /** Get the tax percent owed to dragons. If the address doesn't contain a 1:10 ratio of whips to staked wizards, * they are subject to an untrained tax */ function getTaxPercent(address addr) internal returns (uint256) { } function _claimWizardFromTraining(uint256 seed, uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint16 owed) { } /** * realize $GP earnings for a single Dragon and optionally unstake it * Dragons earn $GP proportional to their rank * @param tokenId the ID of the Dragon to claim earnings from * @param unstake whether or not to unstake the Dragon */ function _claimDragonFromFlight(uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint256 owedGP, uint16 owedRunes) { } /** * emergency unstake tokens * @param tokenIds the IDs of the tokens to claim earnings from */ function rescue(uint256[] calldata tokenIds) external nonReentrant { } /** ADMIN */ /** * allows owner to enable "rescue mode" * simplifies accounting, prioritizes tokens out in emergency */ function setRescueEnabled(bool _enabled) external onlyOwner { } /** * enables owner to pause / unpause contract */ function setPaused(bool _paused) external requireContractsSet onlyOwner { } /** READ ONLY */ /** * gets the rank score for a Dragon * @param tokenId the ID of the Dragon to get the rank score for * @return the rank score of the Dragon (5-8) */ function _rankForDragon(uint256 tokenId) internal view returns (uint8) { } /** * chooses a random Dragon thief when a newly minted token is stolen * @param seed a random value to choose a Dragon from * @return the owner of the randomly selected Dragon thief */ function randomDragonOwner(uint256 seed) public view override returns (address) { } /** Deterministically random. This assumes the call was a part of commit+reveal design * that disallowed the benefactor of this outcome to make this call */ function random(uint16 tokenId, uint80 lastClaim, address owner) internal view returns (uint256) { } function onERC721Received( address, address from, uint256, bytes calldata ) external pure override returns (bytes4) { } /** * enables an address to mint / burn * @param addr the address to enable */ function addAdmin(address addr) external onlyOwner { } /** * disables an address from minting / burning * @param addr the address to disbale */ function removeAdmin(address addr) external onlyOwner { } /** * add $GP to claimable pot for the Flight * @param amount $GP to add to the pot */ function _payDragonTax(uint256 amount) internal { } modifier _updateEarnings() { } }
address(wndNFT)!=address(0)&&address(gpToken)!=address(0)&&address(alter)!=address(0),"Contracts not set"
365,805
address(wndNFT)!=address(0)&&address(gpToken)!=address(0)&&address(alter)!=address(0)
"Only admins can stake"
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./interfaces/IWnD.sol"; import "./interfaces/IGP.sol"; import "./interfaces/ITrainingGrounds.sol"; import "./interfaces/ISacrificialAlter.sol"; import "hardhat/console.sol"; contract TrainingGrounds is ITrainingGrounds, Ownable, ReentrancyGuard, IERC721Receiver, Pausable { using EnumerableSet for EnumerableSet.UintSet; //magic rune tokenId uint256 public constant magicRune = 7; //whip tokenId uint256 public constant whip = 6; // maximum rank for a Wizard/Dragon uint8 public constant MAX_RANK = 8; //time to stake for reward uint80 public constant timeToStakeForReward = 2 days; uint16 public constant MAX_WHIP_EMISSION = 16000; uint16 public constant MAX_MAGIC_RUNE_EMISSION = 1600; uint16 public curWhipsEmitted; uint16 public curMagicRunesEmitted; struct StakeWizard { uint16 tokenId; uint80 lastClaimTime; address owner; } // dragons are in both pools at the same time struct StakeDragon { uint16 tokenId; uint80 lastClaimTime; address owner; uint256 value; // uint256 because the previous variables pack an entire 32bits } struct Deposits { EnumerableSet.UintSet towerWizards; EnumerableSet.UintSet trainingWizards; EnumerableSet.UintSet dragons; } // address => allowedToCallFunctions mapping(address => bool) private admins; uint256 private totalRankStaked; uint256 private numWizardsStaked; event TokenStaked(address indexed owner, uint256 indexed tokenId, bool indexed isWizard, bool isTraining); event WizardClaimed(address indexed owner, uint256 indexed tokenId, bool indexed unstaked); event DragonClaimed(address indexed owner, uint256 indexed tokenId, bool indexed unstaked); // reference to the WnD NFT contract IWnD public wndNFT; // reference to the $GP contract for minting $GP earnings IGP public gpToken; // reference to sacrificial alter ISacrificialAlter public alter; // maps tokenId to stake mapping(uint256 => StakeWizard) private tower; // maps tokenId to stake mapping(uint256 => StakeWizard) private training; // maps rank to all Dragon staked with that rank mapping(uint256 => StakeDragon[]) private flight; // tracks location of each Dragon in Flight mapping(uint256 => uint256) private flightIndices; mapping(address => Deposits) private _deposits; // any rewards distributed when no dragons are staked uint256 private unaccountedRewards = 0; // amount of $GP due for each rank point staked uint256 private gpPerRank = 0; // wizards earn 12000 $GP per day uint256 public constant DAILY_GP_RATE = 2000 ether; // dragons take a 20% tax on all $GP claimed uint256 public constant GP_CLAIM_TAX_PERCENTAGE_UNTRAINED = 50; // dragons take a 20% tax on all $GP claimed uint256 public constant GP_CLAIM_TAX_PERCENTAGE = 20; // Max earn from staking is 500 million $GP for the training ground uint256 public constant MAXIMUM_GLOBAL_GP = 500000000 ether; // wizards must have 2 days worth of emissions to unstake or else they're still guarding the tower uint256 public constant MINIMUM_TO_EXIT = 2 days; // amount of $GP earned so far uint256 public totalGPEarned; // the last time $GP was claimed uint256 private lastClaimTimestamp; // emergency rescue to allow unstaking without any checks but without $GP bool public rescueEnabled = false; /** */ constructor() { } /** CRITICAL TO SETUP */ modifier requireContractsSet() { } function setContracts(address _wndNFT, address _gp, address _alter) external onlyOwner { } function depositsOf(address account) external view returns (uint256[] memory) { } /** Used to determine if a staked token is owned. Used to allow game logic to occur outside this contract. * This might not be necessary if the training mechanic is in this contract instead */ function ownsToken(uint256 tokenId) external view returns (bool) { } function isTokenStaked(uint256 tokenId, bool isTraining) external view override returns (bool) { } function calculateGpRewards(uint256 tokenId) external view returns (uint256 owed) { } function calculateErcEmissionRewards(uint256 tokenId) external view returns (uint256 owed) { } /** STAKING */ /** * adds Wizards and Dragons to the Tower and Flight * @param tokenIds the IDs of the Wizards and Dragons to stake */ function addManyToTowerAndFlight(address tokenOwner, uint16[] calldata tokenIds) external override nonReentrant { require(<FILL_ME>) for (uint i = 0; i < tokenIds.length; i++) { if (wndNFT.ownerOf(tokenIds[i]) != address(this)) { // a mint + stake will send directly to the staking contract require(wndNFT.ownerOf(tokenIds[i]) == tokenOwner, "You don't own this token"); wndNFT.transferFrom(tokenOwner, address(this), tokenIds[i]); } else if (tokenIds[i] == 0) { continue; // there may be gaps in the array for stolen tokens } if (wndNFT.isWizard(tokenIds[i])) _addWizardToTower(tokenOwner, tokenIds[i]); else _addDragonToFlight(tokenOwner, tokenIds[i]); } } /** * adds Wizards and Dragons to the Tower and Flight * @param seed the seed for random logic * @param tokenIds the IDs of the Wizards and Dragons to stake */ function addManyToTrainingAndFlight(uint256 seed, address tokenOwner, uint16[] calldata tokenIds) external override nonReentrant { } /** * adds a single Wizard to the Tower * @param account the address of the staker * @param tokenId the ID of the Wizard to add to the Tower */ function _addWizardToTower(address account, uint256 tokenId) internal whenNotPaused { } function _addWizardToTraining(address account, uint256 tokenId) internal whenNotPaused { } /** * adds a single Dragon to the Flight * @param account the address of the staker * @param tokenId the ID of the Dragon to add to the Flight */ function _addDragonToFlight(address account, uint256 tokenId) internal { } /** CLAIMING / UNSTAKING */ /** * realize $GP earnings and optionally unstake tokens from the Tower / Flight * to unstake a Wizard it will require it has 2 days worth of $GP unclaimed * @param tokenIds the IDs of the tokens to claim earnings from * @param unstake whether or not to unstake ALL of the tokens listed in tokenIds */ function claimManyFromTowerAndFlight(address tokenOwner, uint16[] calldata tokenIds, bool unstake) external override whenNotPaused _updateEarnings nonReentrant { } /** * realize $GP earnings and optionally unstake tokens from the Tower / Flight * to unstake a Wizard it will require it has 2 days worth of $GP unclaimed * @param tokenIds the IDs of the tokens to claim earnings from * @param unstake whether or not to unstake ALL of the tokens listed in tokenIds */ function claimManyFromTrainingAndFlight(uint256 seed, address tokenOwner, uint16[] calldata tokenIds, bool unstake) external override whenNotPaused nonReentrant { } /** * @param seed a random value to select a recipient from * @return the address of the recipient (either the caller or the Dragon thief's owner) */ function selectRecipient(uint256 seed, address tokenOwner) internal view returns (address) { } /** * realize $GP earnings for a single Wizard and optionally unstake it * if not unstaking, pay a 20% tax to the staked Dragons * if unstaking, there is a 50% chance all $GP is stolen * @param tokenId the ID of the Wizards to claim earnings from * @param unstake whether or not to unstake the Wizards * @return owed - the amount of $GP earned */ function _claimWizardFromTower(uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint256 owed) { } /** Get the tax percent owed to dragons. If the address doesn't contain a 1:10 ratio of whips to staked wizards, * they are subject to an untrained tax */ function getTaxPercent(address addr) internal returns (uint256) { } function _claimWizardFromTraining(uint256 seed, uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint16 owed) { } /** * realize $GP earnings for a single Dragon and optionally unstake it * Dragons earn $GP proportional to their rank * @param tokenId the ID of the Dragon to claim earnings from * @param unstake whether or not to unstake the Dragon */ function _claimDragonFromFlight(uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint256 owedGP, uint16 owedRunes) { } /** * emergency unstake tokens * @param tokenIds the IDs of the tokens to claim earnings from */ function rescue(uint256[] calldata tokenIds) external nonReentrant { } /** ADMIN */ /** * allows owner to enable "rescue mode" * simplifies accounting, prioritizes tokens out in emergency */ function setRescueEnabled(bool _enabled) external onlyOwner { } /** * enables owner to pause / unpause contract */ function setPaused(bool _paused) external requireContractsSet onlyOwner { } /** READ ONLY */ /** * gets the rank score for a Dragon * @param tokenId the ID of the Dragon to get the rank score for * @return the rank score of the Dragon (5-8) */ function _rankForDragon(uint256 tokenId) internal view returns (uint8) { } /** * chooses a random Dragon thief when a newly minted token is stolen * @param seed a random value to choose a Dragon from * @return the owner of the randomly selected Dragon thief */ function randomDragonOwner(uint256 seed) public view override returns (address) { } /** Deterministically random. This assumes the call was a part of commit+reveal design * that disallowed the benefactor of this outcome to make this call */ function random(uint16 tokenId, uint80 lastClaim, address owner) internal view returns (uint256) { } function onERC721Received( address, address from, uint256, bytes calldata ) external pure override returns (bytes4) { } /** * enables an address to mint / burn * @param addr the address to enable */ function addAdmin(address addr) external onlyOwner { } /** * disables an address from minting / burning * @param addr the address to disbale */ function removeAdmin(address addr) external onlyOwner { } /** * add $GP to claimable pot for the Flight * @param amount $GP to add to the pot */ function _payDragonTax(uint256 amount) internal { } modifier _updateEarnings() { } }
admins[_msgSender()],"Only admins can stake"
365,805
admins[_msgSender()]
"You don't own this token"
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./interfaces/IWnD.sol"; import "./interfaces/IGP.sol"; import "./interfaces/ITrainingGrounds.sol"; import "./interfaces/ISacrificialAlter.sol"; import "hardhat/console.sol"; contract TrainingGrounds is ITrainingGrounds, Ownable, ReentrancyGuard, IERC721Receiver, Pausable { using EnumerableSet for EnumerableSet.UintSet; //magic rune tokenId uint256 public constant magicRune = 7; //whip tokenId uint256 public constant whip = 6; // maximum rank for a Wizard/Dragon uint8 public constant MAX_RANK = 8; //time to stake for reward uint80 public constant timeToStakeForReward = 2 days; uint16 public constant MAX_WHIP_EMISSION = 16000; uint16 public constant MAX_MAGIC_RUNE_EMISSION = 1600; uint16 public curWhipsEmitted; uint16 public curMagicRunesEmitted; struct StakeWizard { uint16 tokenId; uint80 lastClaimTime; address owner; } // dragons are in both pools at the same time struct StakeDragon { uint16 tokenId; uint80 lastClaimTime; address owner; uint256 value; // uint256 because the previous variables pack an entire 32bits } struct Deposits { EnumerableSet.UintSet towerWizards; EnumerableSet.UintSet trainingWizards; EnumerableSet.UintSet dragons; } // address => allowedToCallFunctions mapping(address => bool) private admins; uint256 private totalRankStaked; uint256 private numWizardsStaked; event TokenStaked(address indexed owner, uint256 indexed tokenId, bool indexed isWizard, bool isTraining); event WizardClaimed(address indexed owner, uint256 indexed tokenId, bool indexed unstaked); event DragonClaimed(address indexed owner, uint256 indexed tokenId, bool indexed unstaked); // reference to the WnD NFT contract IWnD public wndNFT; // reference to the $GP contract for minting $GP earnings IGP public gpToken; // reference to sacrificial alter ISacrificialAlter public alter; // maps tokenId to stake mapping(uint256 => StakeWizard) private tower; // maps tokenId to stake mapping(uint256 => StakeWizard) private training; // maps rank to all Dragon staked with that rank mapping(uint256 => StakeDragon[]) private flight; // tracks location of each Dragon in Flight mapping(uint256 => uint256) private flightIndices; mapping(address => Deposits) private _deposits; // any rewards distributed when no dragons are staked uint256 private unaccountedRewards = 0; // amount of $GP due for each rank point staked uint256 private gpPerRank = 0; // wizards earn 12000 $GP per day uint256 public constant DAILY_GP_RATE = 2000 ether; // dragons take a 20% tax on all $GP claimed uint256 public constant GP_CLAIM_TAX_PERCENTAGE_UNTRAINED = 50; // dragons take a 20% tax on all $GP claimed uint256 public constant GP_CLAIM_TAX_PERCENTAGE = 20; // Max earn from staking is 500 million $GP for the training ground uint256 public constant MAXIMUM_GLOBAL_GP = 500000000 ether; // wizards must have 2 days worth of emissions to unstake or else they're still guarding the tower uint256 public constant MINIMUM_TO_EXIT = 2 days; // amount of $GP earned so far uint256 public totalGPEarned; // the last time $GP was claimed uint256 private lastClaimTimestamp; // emergency rescue to allow unstaking without any checks but without $GP bool public rescueEnabled = false; /** */ constructor() { } /** CRITICAL TO SETUP */ modifier requireContractsSet() { } function setContracts(address _wndNFT, address _gp, address _alter) external onlyOwner { } function depositsOf(address account) external view returns (uint256[] memory) { } /** Used to determine if a staked token is owned. Used to allow game logic to occur outside this contract. * This might not be necessary if the training mechanic is in this contract instead */ function ownsToken(uint256 tokenId) external view returns (bool) { } function isTokenStaked(uint256 tokenId, bool isTraining) external view override returns (bool) { } function calculateGpRewards(uint256 tokenId) external view returns (uint256 owed) { } function calculateErcEmissionRewards(uint256 tokenId) external view returns (uint256 owed) { } /** STAKING */ /** * adds Wizards and Dragons to the Tower and Flight * @param tokenIds the IDs of the Wizards and Dragons to stake */ function addManyToTowerAndFlight(address tokenOwner, uint16[] calldata tokenIds) external override nonReentrant { require(admins[_msgSender()], "Only admins can stake"); for (uint i = 0; i < tokenIds.length; i++) { if (wndNFT.ownerOf(tokenIds[i]) != address(this)) { // a mint + stake will send directly to the staking contract require(<FILL_ME>) wndNFT.transferFrom(tokenOwner, address(this), tokenIds[i]); } else if (tokenIds[i] == 0) { continue; // there may be gaps in the array for stolen tokens } if (wndNFT.isWizard(tokenIds[i])) _addWizardToTower(tokenOwner, tokenIds[i]); else _addDragonToFlight(tokenOwner, tokenIds[i]); } } /** * adds Wizards and Dragons to the Tower and Flight * @param seed the seed for random logic * @param tokenIds the IDs of the Wizards and Dragons to stake */ function addManyToTrainingAndFlight(uint256 seed, address tokenOwner, uint16[] calldata tokenIds) external override nonReentrant { } /** * adds a single Wizard to the Tower * @param account the address of the staker * @param tokenId the ID of the Wizard to add to the Tower */ function _addWizardToTower(address account, uint256 tokenId) internal whenNotPaused { } function _addWizardToTraining(address account, uint256 tokenId) internal whenNotPaused { } /** * adds a single Dragon to the Flight * @param account the address of the staker * @param tokenId the ID of the Dragon to add to the Flight */ function _addDragonToFlight(address account, uint256 tokenId) internal { } /** CLAIMING / UNSTAKING */ /** * realize $GP earnings and optionally unstake tokens from the Tower / Flight * to unstake a Wizard it will require it has 2 days worth of $GP unclaimed * @param tokenIds the IDs of the tokens to claim earnings from * @param unstake whether or not to unstake ALL of the tokens listed in tokenIds */ function claimManyFromTowerAndFlight(address tokenOwner, uint16[] calldata tokenIds, bool unstake) external override whenNotPaused _updateEarnings nonReentrant { } /** * realize $GP earnings and optionally unstake tokens from the Tower / Flight * to unstake a Wizard it will require it has 2 days worth of $GP unclaimed * @param tokenIds the IDs of the tokens to claim earnings from * @param unstake whether or not to unstake ALL of the tokens listed in tokenIds */ function claimManyFromTrainingAndFlight(uint256 seed, address tokenOwner, uint16[] calldata tokenIds, bool unstake) external override whenNotPaused nonReentrant { } /** * @param seed a random value to select a recipient from * @return the address of the recipient (either the caller or the Dragon thief's owner) */ function selectRecipient(uint256 seed, address tokenOwner) internal view returns (address) { } /** * realize $GP earnings for a single Wizard and optionally unstake it * if not unstaking, pay a 20% tax to the staked Dragons * if unstaking, there is a 50% chance all $GP is stolen * @param tokenId the ID of the Wizards to claim earnings from * @param unstake whether or not to unstake the Wizards * @return owed - the amount of $GP earned */ function _claimWizardFromTower(uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint256 owed) { } /** Get the tax percent owed to dragons. If the address doesn't contain a 1:10 ratio of whips to staked wizards, * they are subject to an untrained tax */ function getTaxPercent(address addr) internal returns (uint256) { } function _claimWizardFromTraining(uint256 seed, uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint16 owed) { } /** * realize $GP earnings for a single Dragon and optionally unstake it * Dragons earn $GP proportional to their rank * @param tokenId the ID of the Dragon to claim earnings from * @param unstake whether or not to unstake the Dragon */ function _claimDragonFromFlight(uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint256 owedGP, uint16 owedRunes) { } /** * emergency unstake tokens * @param tokenIds the IDs of the tokens to claim earnings from */ function rescue(uint256[] calldata tokenIds) external nonReentrant { } /** ADMIN */ /** * allows owner to enable "rescue mode" * simplifies accounting, prioritizes tokens out in emergency */ function setRescueEnabled(bool _enabled) external onlyOwner { } /** * enables owner to pause / unpause contract */ function setPaused(bool _paused) external requireContractsSet onlyOwner { } /** READ ONLY */ /** * gets the rank score for a Dragon * @param tokenId the ID of the Dragon to get the rank score for * @return the rank score of the Dragon (5-8) */ function _rankForDragon(uint256 tokenId) internal view returns (uint8) { } /** * chooses a random Dragon thief when a newly minted token is stolen * @param seed a random value to choose a Dragon from * @return the owner of the randomly selected Dragon thief */ function randomDragonOwner(uint256 seed) public view override returns (address) { } /** Deterministically random. This assumes the call was a part of commit+reveal design * that disallowed the benefactor of this outcome to make this call */ function random(uint16 tokenId, uint80 lastClaim, address owner) internal view returns (uint256) { } function onERC721Received( address, address from, uint256, bytes calldata ) external pure override returns (bytes4) { } /** * enables an address to mint / burn * @param addr the address to enable */ function addAdmin(address addr) external onlyOwner { } /** * disables an address from minting / burning * @param addr the address to disbale */ function removeAdmin(address addr) external onlyOwner { } /** * add $GP to claimable pot for the Flight * @param amount $GP to add to the pot */ function _payDragonTax(uint256 amount) internal { } modifier _updateEarnings() { } }
wndNFT.ownerOf(tokenIds[i])==tokenOwner,"You don't own this token"
365,805
wndNFT.ownerOf(tokenIds[i])==tokenOwner
"Doesn't own token"
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./interfaces/IWnD.sol"; import "./interfaces/IGP.sol"; import "./interfaces/ITrainingGrounds.sol"; import "./interfaces/ISacrificialAlter.sol"; import "hardhat/console.sol"; contract TrainingGrounds is ITrainingGrounds, Ownable, ReentrancyGuard, IERC721Receiver, Pausable { using EnumerableSet for EnumerableSet.UintSet; //magic rune tokenId uint256 public constant magicRune = 7; //whip tokenId uint256 public constant whip = 6; // maximum rank for a Wizard/Dragon uint8 public constant MAX_RANK = 8; //time to stake for reward uint80 public constant timeToStakeForReward = 2 days; uint16 public constant MAX_WHIP_EMISSION = 16000; uint16 public constant MAX_MAGIC_RUNE_EMISSION = 1600; uint16 public curWhipsEmitted; uint16 public curMagicRunesEmitted; struct StakeWizard { uint16 tokenId; uint80 lastClaimTime; address owner; } // dragons are in both pools at the same time struct StakeDragon { uint16 tokenId; uint80 lastClaimTime; address owner; uint256 value; // uint256 because the previous variables pack an entire 32bits } struct Deposits { EnumerableSet.UintSet towerWizards; EnumerableSet.UintSet trainingWizards; EnumerableSet.UintSet dragons; } // address => allowedToCallFunctions mapping(address => bool) private admins; uint256 private totalRankStaked; uint256 private numWizardsStaked; event TokenStaked(address indexed owner, uint256 indexed tokenId, bool indexed isWizard, bool isTraining); event WizardClaimed(address indexed owner, uint256 indexed tokenId, bool indexed unstaked); event DragonClaimed(address indexed owner, uint256 indexed tokenId, bool indexed unstaked); // reference to the WnD NFT contract IWnD public wndNFT; // reference to the $GP contract for minting $GP earnings IGP public gpToken; // reference to sacrificial alter ISacrificialAlter public alter; // maps tokenId to stake mapping(uint256 => StakeWizard) private tower; // maps tokenId to stake mapping(uint256 => StakeWizard) private training; // maps rank to all Dragon staked with that rank mapping(uint256 => StakeDragon[]) private flight; // tracks location of each Dragon in Flight mapping(uint256 => uint256) private flightIndices; mapping(address => Deposits) private _deposits; // any rewards distributed when no dragons are staked uint256 private unaccountedRewards = 0; // amount of $GP due for each rank point staked uint256 private gpPerRank = 0; // wizards earn 12000 $GP per day uint256 public constant DAILY_GP_RATE = 2000 ether; // dragons take a 20% tax on all $GP claimed uint256 public constant GP_CLAIM_TAX_PERCENTAGE_UNTRAINED = 50; // dragons take a 20% tax on all $GP claimed uint256 public constant GP_CLAIM_TAX_PERCENTAGE = 20; // Max earn from staking is 500 million $GP for the training ground uint256 public constant MAXIMUM_GLOBAL_GP = 500000000 ether; // wizards must have 2 days worth of emissions to unstake or else they're still guarding the tower uint256 public constant MINIMUM_TO_EXIT = 2 days; // amount of $GP earned so far uint256 public totalGPEarned; // the last time $GP was claimed uint256 private lastClaimTimestamp; // emergency rescue to allow unstaking without any checks but without $GP bool public rescueEnabled = false; /** */ constructor() { } /** CRITICAL TO SETUP */ modifier requireContractsSet() { } function setContracts(address _wndNFT, address _gp, address _alter) external onlyOwner { } function depositsOf(address account) external view returns (uint256[] memory) { } /** Used to determine if a staked token is owned. Used to allow game logic to occur outside this contract. * This might not be necessary if the training mechanic is in this contract instead */ function ownsToken(uint256 tokenId) external view returns (bool) { } function isTokenStaked(uint256 tokenId, bool isTraining) external view override returns (bool) { } function calculateGpRewards(uint256 tokenId) external view returns (uint256 owed) { } function calculateErcEmissionRewards(uint256 tokenId) external view returns (uint256 owed) { } /** STAKING */ /** * adds Wizards and Dragons to the Tower and Flight * @param tokenIds the IDs of the Wizards and Dragons to stake */ function addManyToTowerAndFlight(address tokenOwner, uint16[] calldata tokenIds) external override nonReentrant { } /** * adds Wizards and Dragons to the Tower and Flight * @param seed the seed for random logic * @param tokenIds the IDs of the Wizards and Dragons to stake */ function addManyToTrainingAndFlight(uint256 seed, address tokenOwner, uint16[] calldata tokenIds) external override nonReentrant { } /** * adds a single Wizard to the Tower * @param account the address of the staker * @param tokenId the ID of the Wizard to add to the Tower */ function _addWizardToTower(address account, uint256 tokenId) internal whenNotPaused { } function _addWizardToTraining(address account, uint256 tokenId) internal whenNotPaused { } /** * adds a single Dragon to the Flight * @param account the address of the staker * @param tokenId the ID of the Dragon to add to the Flight */ function _addDragonToFlight(address account, uint256 tokenId) internal { } /** CLAIMING / UNSTAKING */ /** * realize $GP earnings and optionally unstake tokens from the Tower / Flight * to unstake a Wizard it will require it has 2 days worth of $GP unclaimed * @param tokenIds the IDs of the tokens to claim earnings from * @param unstake whether or not to unstake ALL of the tokens listed in tokenIds */ function claimManyFromTowerAndFlight(address tokenOwner, uint16[] calldata tokenIds, bool unstake) external override whenNotPaused _updateEarnings nonReentrant { } /** * realize $GP earnings and optionally unstake tokens from the Tower / Flight * to unstake a Wizard it will require it has 2 days worth of $GP unclaimed * @param tokenIds the IDs of the tokens to claim earnings from * @param unstake whether or not to unstake ALL of the tokens listed in tokenIds */ function claimManyFromTrainingAndFlight(uint256 seed, address tokenOwner, uint16[] calldata tokenIds, bool unstake) external override whenNotPaused nonReentrant { } /** * @param seed a random value to select a recipient from * @return the address of the recipient (either the caller or the Dragon thief's owner) */ function selectRecipient(uint256 seed, address tokenOwner) internal view returns (address) { } /** * realize $GP earnings for a single Wizard and optionally unstake it * if not unstaking, pay a 20% tax to the staked Dragons * if unstaking, there is a 50% chance all $GP is stolen * @param tokenId the ID of the Wizards to claim earnings from * @param unstake whether or not to unstake the Wizards * @return owed - the amount of $GP earned */ function _claimWizardFromTower(uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint256 owed) { require(<FILL_ME>) StakeWizard memory stake = tower[tokenId]; require(tokenOwner == stake.owner, "Invalid token owner"); require(!(unstake && block.timestamp - stake.lastClaimTime < MINIMUM_TO_EXIT), "Still guarding the tower"); if (totalGPEarned < MAXIMUM_GLOBAL_GP) { owed = (block.timestamp - stake.lastClaimTime) * DAILY_GP_RATE / 1 days; } else if (stake.lastClaimTime > lastClaimTimestamp) { owed = 0; // $GP production stopped already } else { owed = (lastClaimTimestamp - stake.lastClaimTime) * DAILY_GP_RATE / 1 days; // stop earning additional $GP if it's all been earned } if (unstake) { if (random(stake.tokenId, stake.lastClaimTime, stake.owner) & 1 == 1) { // 50% chance of all $GP stolen _payDragonTax(owed); owed = 0; } delete tower[tokenId]; numWizardsStaked -= 1; _deposits[stake.owner].towerWizards.remove(tokenId); // Always transfer last to guard against reentrance wndNFT.safeTransferFrom(address(this), stake.owner, tokenId, ""); // send back Wizard } else { uint256 taxPercent = getTaxPercent(stake.owner); _payDragonTax(owed * taxPercent / 100); // percentage tax to staked dragons owed = owed * (100 - taxPercent) / 100; // remainder goes to Wizard owner tower[tokenId] = StakeWizard({ owner: stake.owner, tokenId: uint16(tokenId), lastClaimTime: uint80(block.timestamp) }); // reset stake } emit WizardClaimed(stake.owner, tokenId, unstake); } /** Get the tax percent owed to dragons. If the address doesn't contain a 1:10 ratio of whips to staked wizards, * they are subject to an untrained tax */ function getTaxPercent(address addr) internal returns (uint256) { } function _claimWizardFromTraining(uint256 seed, uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint16 owed) { } /** * realize $GP earnings for a single Dragon and optionally unstake it * Dragons earn $GP proportional to their rank * @param tokenId the ID of the Dragon to claim earnings from * @param unstake whether or not to unstake the Dragon */ function _claimDragonFromFlight(uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint256 owedGP, uint16 owedRunes) { } /** * emergency unstake tokens * @param tokenIds the IDs of the tokens to claim earnings from */ function rescue(uint256[] calldata tokenIds) external nonReentrant { } /** ADMIN */ /** * allows owner to enable "rescue mode" * simplifies accounting, prioritizes tokens out in emergency */ function setRescueEnabled(bool _enabled) external onlyOwner { } /** * enables owner to pause / unpause contract */ function setPaused(bool _paused) external requireContractsSet onlyOwner { } /** READ ONLY */ /** * gets the rank score for a Dragon * @param tokenId the ID of the Dragon to get the rank score for * @return the rank score of the Dragon (5-8) */ function _rankForDragon(uint256 tokenId) internal view returns (uint8) { } /** * chooses a random Dragon thief when a newly minted token is stolen * @param seed a random value to choose a Dragon from * @return the owner of the randomly selected Dragon thief */ function randomDragonOwner(uint256 seed) public view override returns (address) { } /** Deterministically random. This assumes the call was a part of commit+reveal design * that disallowed the benefactor of this outcome to make this call */ function random(uint16 tokenId, uint80 lastClaim, address owner) internal view returns (uint256) { } function onERC721Received( address, address from, uint256, bytes calldata ) external pure override returns (bytes4) { } /** * enables an address to mint / burn * @param addr the address to enable */ function addAdmin(address addr) external onlyOwner { } /** * disables an address from minting / burning * @param addr the address to disbale */ function removeAdmin(address addr) external onlyOwner { } /** * add $GP to claimable pot for the Flight * @param amount $GP to add to the pot */ function _payDragonTax(uint256 amount) internal { } modifier _updateEarnings() { } }
wndNFT.ownerOf(tokenId)==address(this),"Doesn't own token"
365,805
wndNFT.ownerOf(tokenId)==address(this)
"Still guarding the tower"
// SPDX-License-Identifier: MIT LICENSE pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "./interfaces/IWnD.sol"; import "./interfaces/IGP.sol"; import "./interfaces/ITrainingGrounds.sol"; import "./interfaces/ISacrificialAlter.sol"; import "hardhat/console.sol"; contract TrainingGrounds is ITrainingGrounds, Ownable, ReentrancyGuard, IERC721Receiver, Pausable { using EnumerableSet for EnumerableSet.UintSet; //magic rune tokenId uint256 public constant magicRune = 7; //whip tokenId uint256 public constant whip = 6; // maximum rank for a Wizard/Dragon uint8 public constant MAX_RANK = 8; //time to stake for reward uint80 public constant timeToStakeForReward = 2 days; uint16 public constant MAX_WHIP_EMISSION = 16000; uint16 public constant MAX_MAGIC_RUNE_EMISSION = 1600; uint16 public curWhipsEmitted; uint16 public curMagicRunesEmitted; struct StakeWizard { uint16 tokenId; uint80 lastClaimTime; address owner; } // dragons are in both pools at the same time struct StakeDragon { uint16 tokenId; uint80 lastClaimTime; address owner; uint256 value; // uint256 because the previous variables pack an entire 32bits } struct Deposits { EnumerableSet.UintSet towerWizards; EnumerableSet.UintSet trainingWizards; EnumerableSet.UintSet dragons; } // address => allowedToCallFunctions mapping(address => bool) private admins; uint256 private totalRankStaked; uint256 private numWizardsStaked; event TokenStaked(address indexed owner, uint256 indexed tokenId, bool indexed isWizard, bool isTraining); event WizardClaimed(address indexed owner, uint256 indexed tokenId, bool indexed unstaked); event DragonClaimed(address indexed owner, uint256 indexed tokenId, bool indexed unstaked); // reference to the WnD NFT contract IWnD public wndNFT; // reference to the $GP contract for minting $GP earnings IGP public gpToken; // reference to sacrificial alter ISacrificialAlter public alter; // maps tokenId to stake mapping(uint256 => StakeWizard) private tower; // maps tokenId to stake mapping(uint256 => StakeWizard) private training; // maps rank to all Dragon staked with that rank mapping(uint256 => StakeDragon[]) private flight; // tracks location of each Dragon in Flight mapping(uint256 => uint256) private flightIndices; mapping(address => Deposits) private _deposits; // any rewards distributed when no dragons are staked uint256 private unaccountedRewards = 0; // amount of $GP due for each rank point staked uint256 private gpPerRank = 0; // wizards earn 12000 $GP per day uint256 public constant DAILY_GP_RATE = 2000 ether; // dragons take a 20% tax on all $GP claimed uint256 public constant GP_CLAIM_TAX_PERCENTAGE_UNTRAINED = 50; // dragons take a 20% tax on all $GP claimed uint256 public constant GP_CLAIM_TAX_PERCENTAGE = 20; // Max earn from staking is 500 million $GP for the training ground uint256 public constant MAXIMUM_GLOBAL_GP = 500000000 ether; // wizards must have 2 days worth of emissions to unstake or else they're still guarding the tower uint256 public constant MINIMUM_TO_EXIT = 2 days; // amount of $GP earned so far uint256 public totalGPEarned; // the last time $GP was claimed uint256 private lastClaimTimestamp; // emergency rescue to allow unstaking without any checks but without $GP bool public rescueEnabled = false; /** */ constructor() { } /** CRITICAL TO SETUP */ modifier requireContractsSet() { } function setContracts(address _wndNFT, address _gp, address _alter) external onlyOwner { } function depositsOf(address account) external view returns (uint256[] memory) { } /** Used to determine if a staked token is owned. Used to allow game logic to occur outside this contract. * This might not be necessary if the training mechanic is in this contract instead */ function ownsToken(uint256 tokenId) external view returns (bool) { } function isTokenStaked(uint256 tokenId, bool isTraining) external view override returns (bool) { } function calculateGpRewards(uint256 tokenId) external view returns (uint256 owed) { } function calculateErcEmissionRewards(uint256 tokenId) external view returns (uint256 owed) { } /** STAKING */ /** * adds Wizards and Dragons to the Tower and Flight * @param tokenIds the IDs of the Wizards and Dragons to stake */ function addManyToTowerAndFlight(address tokenOwner, uint16[] calldata tokenIds) external override nonReentrant { } /** * adds Wizards and Dragons to the Tower and Flight * @param seed the seed for random logic * @param tokenIds the IDs of the Wizards and Dragons to stake */ function addManyToTrainingAndFlight(uint256 seed, address tokenOwner, uint16[] calldata tokenIds) external override nonReentrant { } /** * adds a single Wizard to the Tower * @param account the address of the staker * @param tokenId the ID of the Wizard to add to the Tower */ function _addWizardToTower(address account, uint256 tokenId) internal whenNotPaused { } function _addWizardToTraining(address account, uint256 tokenId) internal whenNotPaused { } /** * adds a single Dragon to the Flight * @param account the address of the staker * @param tokenId the ID of the Dragon to add to the Flight */ function _addDragonToFlight(address account, uint256 tokenId) internal { } /** CLAIMING / UNSTAKING */ /** * realize $GP earnings and optionally unstake tokens from the Tower / Flight * to unstake a Wizard it will require it has 2 days worth of $GP unclaimed * @param tokenIds the IDs of the tokens to claim earnings from * @param unstake whether or not to unstake ALL of the tokens listed in tokenIds */ function claimManyFromTowerAndFlight(address tokenOwner, uint16[] calldata tokenIds, bool unstake) external override whenNotPaused _updateEarnings nonReentrant { } /** * realize $GP earnings and optionally unstake tokens from the Tower / Flight * to unstake a Wizard it will require it has 2 days worth of $GP unclaimed * @param tokenIds the IDs of the tokens to claim earnings from * @param unstake whether or not to unstake ALL of the tokens listed in tokenIds */ function claimManyFromTrainingAndFlight(uint256 seed, address tokenOwner, uint16[] calldata tokenIds, bool unstake) external override whenNotPaused nonReentrant { } /** * @param seed a random value to select a recipient from * @return the address of the recipient (either the caller or the Dragon thief's owner) */ function selectRecipient(uint256 seed, address tokenOwner) internal view returns (address) { } /** * realize $GP earnings for a single Wizard and optionally unstake it * if not unstaking, pay a 20% tax to the staked Dragons * if unstaking, there is a 50% chance all $GP is stolen * @param tokenId the ID of the Wizards to claim earnings from * @param unstake whether or not to unstake the Wizards * @return owed - the amount of $GP earned */ function _claimWizardFromTower(uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint256 owed) { require(wndNFT.ownerOf(tokenId) == address(this), "Doesn't own token"); StakeWizard memory stake = tower[tokenId]; require(tokenOwner == stake.owner, "Invalid token owner"); require(<FILL_ME>) if (totalGPEarned < MAXIMUM_GLOBAL_GP) { owed = (block.timestamp - stake.lastClaimTime) * DAILY_GP_RATE / 1 days; } else if (stake.lastClaimTime > lastClaimTimestamp) { owed = 0; // $GP production stopped already } else { owed = (lastClaimTimestamp - stake.lastClaimTime) * DAILY_GP_RATE / 1 days; // stop earning additional $GP if it's all been earned } if (unstake) { if (random(stake.tokenId, stake.lastClaimTime, stake.owner) & 1 == 1) { // 50% chance of all $GP stolen _payDragonTax(owed); owed = 0; } delete tower[tokenId]; numWizardsStaked -= 1; _deposits[stake.owner].towerWizards.remove(tokenId); // Always transfer last to guard against reentrance wndNFT.safeTransferFrom(address(this), stake.owner, tokenId, ""); // send back Wizard } else { uint256 taxPercent = getTaxPercent(stake.owner); _payDragonTax(owed * taxPercent / 100); // percentage tax to staked dragons owed = owed * (100 - taxPercent) / 100; // remainder goes to Wizard owner tower[tokenId] = StakeWizard({ owner: stake.owner, tokenId: uint16(tokenId), lastClaimTime: uint80(block.timestamp) }); // reset stake } emit WizardClaimed(stake.owner, tokenId, unstake); } /** Get the tax percent owed to dragons. If the address doesn't contain a 1:10 ratio of whips to staked wizards, * they are subject to an untrained tax */ function getTaxPercent(address addr) internal returns (uint256) { } function _claimWizardFromTraining(uint256 seed, uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint16 owed) { } /** * realize $GP earnings for a single Dragon and optionally unstake it * Dragons earn $GP proportional to their rank * @param tokenId the ID of the Dragon to claim earnings from * @param unstake whether or not to unstake the Dragon */ function _claimDragonFromFlight(uint256 tokenId, bool unstake, address tokenOwner) internal returns (uint256 owedGP, uint16 owedRunes) { } /** * emergency unstake tokens * @param tokenIds the IDs of the tokens to claim earnings from */ function rescue(uint256[] calldata tokenIds) external nonReentrant { } /** ADMIN */ /** * allows owner to enable "rescue mode" * simplifies accounting, prioritizes tokens out in emergency */ function setRescueEnabled(bool _enabled) external onlyOwner { } /** * enables owner to pause / unpause contract */ function setPaused(bool _paused) external requireContractsSet onlyOwner { } /** READ ONLY */ /** * gets the rank score for a Dragon * @param tokenId the ID of the Dragon to get the rank score for * @return the rank score of the Dragon (5-8) */ function _rankForDragon(uint256 tokenId) internal view returns (uint8) { } /** * chooses a random Dragon thief when a newly minted token is stolen * @param seed a random value to choose a Dragon from * @return the owner of the randomly selected Dragon thief */ function randomDragonOwner(uint256 seed) public view override returns (address) { } /** Deterministically random. This assumes the call was a part of commit+reveal design * that disallowed the benefactor of this outcome to make this call */ function random(uint16 tokenId, uint80 lastClaim, address owner) internal view returns (uint256) { } function onERC721Received( address, address from, uint256, bytes calldata ) external pure override returns (bytes4) { } /** * enables an address to mint / burn * @param addr the address to enable */ function addAdmin(address addr) external onlyOwner { } /** * disables an address from minting / burning * @param addr the address to disbale */ function removeAdmin(address addr) external onlyOwner { } /** * add $GP to claimable pot for the Flight * @param amount $GP to add to the pot */ function _payDragonTax(uint256 amount) internal { } modifier _updateEarnings() { } }
!(unstake&&block.timestamp-stake.lastClaimTime<MINIMUM_TO_EXIT),"Still guarding the tower"
365,805
!(unstake&&block.timestamp-stake.lastClaimTime<MINIMUM_TO_EXIT)
null
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { } modifier notThisAddress(address _address) { } modifier notNullOrThisAddress(address _address) { } modifier notSameAddresses(address _address1, address _address2) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { // Require that sender is the assigned destructor require(<FILL_ME>) // Disable self-destruction selfDestructionDisabled = true; // Emit event emit SelfDestructionDisabledEvent(msg.sender); } /// @notice Destroy this contract function triggerSelfDestruction() public { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { } modifier notDeployer() { } modifier onlyOperator() { } modifier notOperator() { } modifier onlyDeployerOrOperator() { } modifier notDeployerOrOperator() { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Servable * @notice An ownable that contains registered services and their actions */ contract Servable is Ownable { // // Types // ----------------------------------------------------------------------------------------------------------------- struct ServiceInfo { bool registered; uint256 activationTimestamp; mapping(bytes32 => bool) actionsEnabledMap; bytes32[] actionsList; } // // Variables // ----------------------------------------------------------------------------------------------------------------- mapping(address => ServiceInfo) internal registeredServicesMap; uint256 public serviceActivationTimeout; // // Events // ----------------------------------------------------------------------------------------------------------------- event ServiceActivationTimeoutEvent(uint256 timeoutInSeconds); event RegisterServiceEvent(address service); event RegisterServiceDeferredEvent(address service, uint256 timeout); event DeregisterServiceEvent(address service); event EnableServiceActionEvent(address service, string action); event DisableServiceActionEvent(address service, string action); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Set the service activation timeout /// @param timeoutInSeconds The set timeout in unit of seconds function setServiceActivationTimeout(uint256 timeoutInSeconds) public onlyDeployer { } /// @notice Register a service contract whose activation is immediate /// @param service The address of the service contract to be registered function registerService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Register a service contract whose activation is deferred by the service activation timeout /// @param service The address of the service contract to be registered function registerServiceDeferred(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Deregister a service contract /// @param service The address of the service contract to be deregistered function deregisterService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in an already registered service contract /// @param service The address of the registered service contract /// @param action The name of the action to be enabled function enableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in a service contract /// @param service The address of the service contract /// @param action The name of the action to be disabled function disableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Gauge whether a service contract is registered /// @param service The address of the service contract /// @return true if service is registered, else false function isRegisteredService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract is registered and active /// @param service The address of the service contract /// @return true if service is registered and activate, else false function isRegisteredActiveService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract action is enabled which implies also registered and active /// @param service The address of the service contract /// @param action The name of action function isEnabledServiceAction(address service, string memory action) public view returns (bool) { } // // Internal functions // ----------------------------------------------------------------------------------------------------------------- function hashString(string memory _string) internal pure returns (bytes32) { } // // Private functions // ----------------------------------------------------------------------------------------------------------------- function _registerService(address service, uint256 timeout) private { } // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyActiveService() { } modifier onlyEnabledServiceAction(string memory action) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title FraudChallenge * @notice Where fraud challenge results are found */ contract FraudChallenge is Ownable, Servable { // // Constants // ----------------------------------------------------------------------------------------------------------------- string constant public ADD_SEIZED_WALLET_ACTION = "add_seized_wallet"; string constant public ADD_DOUBLE_SPENDER_WALLET_ACTION = "add_double_spender_wallet"; string constant public ADD_FRAUDULENT_ORDER_ACTION = "add_fraudulent_order"; string constant public ADD_FRAUDULENT_TRADE_ACTION = "add_fraudulent_trade"; string constant public ADD_FRAUDULENT_PAYMENT_ACTION = "add_fraudulent_payment"; // // Variables // ----------------------------------------------------------------------------------------------------------------- address[] public doubleSpenderWallets; mapping(address => bool) public doubleSpenderByWallet; bytes32[] public fraudulentOrderHashes; mapping(bytes32 => bool) public fraudulentByOrderHash; bytes32[] public fraudulentTradeHashes; mapping(bytes32 => bool) public fraudulentByTradeHash; bytes32[] public fraudulentPaymentHashes; mapping(bytes32 => bool) public fraudulentByPaymentHash; // // Events // ----------------------------------------------------------------------------------------------------------------- event AddDoubleSpenderWalletEvent(address wallet); event AddFraudulentOrderHashEvent(bytes32 hash); event AddFraudulentTradeHashEvent(bytes32 hash); event AddFraudulentPaymentHashEvent(bytes32 hash); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the double spender status of given wallet /// @param wallet The wallet address for which to check double spender status /// @return true if wallet is double spender, false otherwise function isDoubleSpenderWallet(address wallet) public view returns (bool) { } /// @notice Get the number of wallets tagged as double spenders /// @return Number of double spender wallets function doubleSpenderWalletsCount() public view returns (uint256) { } /// @notice Add given wallets to store of double spender wallets if not already present /// @param wallet The first wallet to add function addDoubleSpenderWallet(address wallet) public onlyEnabledServiceAction(ADD_DOUBLE_SPENDER_WALLET_ACTION) { } /// @notice Get the number of fraudulent order hashes function fraudulentOrderHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent order /// @param hash The hash to be tested function isFraudulentOrderHash(bytes32 hash) public view returns (bool) { } /// @notice Add given order hash to store of fraudulent order hashes if not already present function addFraudulentOrderHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_ORDER_ACTION) { } /// @notice Get the number of fraudulent trade hashes function fraudulentTradeHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent trade /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent trade, else false function isFraudulentTradeHash(bytes32 hash) public view returns (bool) { } /// @notice Add given trade hash to store of fraudulent trade hashes if not already present function addFraudulentTradeHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_TRADE_ACTION) { } /// @notice Get the number of fraudulent payment hashes function fraudulentPaymentHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent payment /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent payment, else null function isFraudulentPaymentHash(bytes32 hash) public view returns (bool) { } /// @notice Add given payment hash to store of fraudulent payment hashes if not already present function addFraudulentPaymentHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_PAYMENT_ACTION) { } }
destructor()==msg.sender
365,824
destructor()==msg.sender
null
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { } modifier notThisAddress(address _address) { } modifier notNullOrThisAddress(address _address) { } modifier notSameAddresses(address _address1, address _address2) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { } /// @notice Destroy this contract function triggerSelfDestruction() public { // Require that sender is the assigned destructor require(destructor() == msg.sender); // Require that self-destruction has not been disabled require(<FILL_ME>) // Emit event emit TriggerSelfDestructionEvent(msg.sender); // Self-destruct and reward destructor selfdestruct(msg.sender); } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { } modifier notDeployer() { } modifier onlyOperator() { } modifier notOperator() { } modifier onlyDeployerOrOperator() { } modifier notDeployerOrOperator() { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Servable * @notice An ownable that contains registered services and their actions */ contract Servable is Ownable { // // Types // ----------------------------------------------------------------------------------------------------------------- struct ServiceInfo { bool registered; uint256 activationTimestamp; mapping(bytes32 => bool) actionsEnabledMap; bytes32[] actionsList; } // // Variables // ----------------------------------------------------------------------------------------------------------------- mapping(address => ServiceInfo) internal registeredServicesMap; uint256 public serviceActivationTimeout; // // Events // ----------------------------------------------------------------------------------------------------------------- event ServiceActivationTimeoutEvent(uint256 timeoutInSeconds); event RegisterServiceEvent(address service); event RegisterServiceDeferredEvent(address service, uint256 timeout); event DeregisterServiceEvent(address service); event EnableServiceActionEvent(address service, string action); event DisableServiceActionEvent(address service, string action); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Set the service activation timeout /// @param timeoutInSeconds The set timeout in unit of seconds function setServiceActivationTimeout(uint256 timeoutInSeconds) public onlyDeployer { } /// @notice Register a service contract whose activation is immediate /// @param service The address of the service contract to be registered function registerService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Register a service contract whose activation is deferred by the service activation timeout /// @param service The address of the service contract to be registered function registerServiceDeferred(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Deregister a service contract /// @param service The address of the service contract to be deregistered function deregisterService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in an already registered service contract /// @param service The address of the registered service contract /// @param action The name of the action to be enabled function enableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in a service contract /// @param service The address of the service contract /// @param action The name of the action to be disabled function disableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Gauge whether a service contract is registered /// @param service The address of the service contract /// @return true if service is registered, else false function isRegisteredService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract is registered and active /// @param service The address of the service contract /// @return true if service is registered and activate, else false function isRegisteredActiveService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract action is enabled which implies also registered and active /// @param service The address of the service contract /// @param action The name of action function isEnabledServiceAction(address service, string memory action) public view returns (bool) { } // // Internal functions // ----------------------------------------------------------------------------------------------------------------- function hashString(string memory _string) internal pure returns (bytes32) { } // // Private functions // ----------------------------------------------------------------------------------------------------------------- function _registerService(address service, uint256 timeout) private { } // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyActiveService() { } modifier onlyEnabledServiceAction(string memory action) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title FraudChallenge * @notice Where fraud challenge results are found */ contract FraudChallenge is Ownable, Servable { // // Constants // ----------------------------------------------------------------------------------------------------------------- string constant public ADD_SEIZED_WALLET_ACTION = "add_seized_wallet"; string constant public ADD_DOUBLE_SPENDER_WALLET_ACTION = "add_double_spender_wallet"; string constant public ADD_FRAUDULENT_ORDER_ACTION = "add_fraudulent_order"; string constant public ADD_FRAUDULENT_TRADE_ACTION = "add_fraudulent_trade"; string constant public ADD_FRAUDULENT_PAYMENT_ACTION = "add_fraudulent_payment"; // // Variables // ----------------------------------------------------------------------------------------------------------------- address[] public doubleSpenderWallets; mapping(address => bool) public doubleSpenderByWallet; bytes32[] public fraudulentOrderHashes; mapping(bytes32 => bool) public fraudulentByOrderHash; bytes32[] public fraudulentTradeHashes; mapping(bytes32 => bool) public fraudulentByTradeHash; bytes32[] public fraudulentPaymentHashes; mapping(bytes32 => bool) public fraudulentByPaymentHash; // // Events // ----------------------------------------------------------------------------------------------------------------- event AddDoubleSpenderWalletEvent(address wallet); event AddFraudulentOrderHashEvent(bytes32 hash); event AddFraudulentTradeHashEvent(bytes32 hash); event AddFraudulentPaymentHashEvent(bytes32 hash); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the double spender status of given wallet /// @param wallet The wallet address for which to check double spender status /// @return true if wallet is double spender, false otherwise function isDoubleSpenderWallet(address wallet) public view returns (bool) { } /// @notice Get the number of wallets tagged as double spenders /// @return Number of double spender wallets function doubleSpenderWalletsCount() public view returns (uint256) { } /// @notice Add given wallets to store of double spender wallets if not already present /// @param wallet The first wallet to add function addDoubleSpenderWallet(address wallet) public onlyEnabledServiceAction(ADD_DOUBLE_SPENDER_WALLET_ACTION) { } /// @notice Get the number of fraudulent order hashes function fraudulentOrderHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent order /// @param hash The hash to be tested function isFraudulentOrderHash(bytes32 hash) public view returns (bool) { } /// @notice Add given order hash to store of fraudulent order hashes if not already present function addFraudulentOrderHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_ORDER_ACTION) { } /// @notice Get the number of fraudulent trade hashes function fraudulentTradeHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent trade /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent trade, else false function isFraudulentTradeHash(bytes32 hash) public view returns (bool) { } /// @notice Add given trade hash to store of fraudulent trade hashes if not already present function addFraudulentTradeHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_TRADE_ACTION) { } /// @notice Get the number of fraudulent payment hashes function fraudulentPaymentHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent payment /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent payment, else null function isFraudulentPaymentHash(bytes32 hash) public view returns (bool) { } /// @notice Add given payment hash to store of fraudulent payment hashes if not already present function addFraudulentPaymentHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_PAYMENT_ACTION) { } }
!selfDestructionDisabled
365,824
!selfDestructionDisabled
null
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { } modifier notThisAddress(address _address) { } modifier notNullOrThisAddress(address _address) { } modifier notSameAddresses(address _address1, address _address2) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { } /// @notice Destroy this contract function triggerSelfDestruction() public { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { require(<FILL_ME>) _; } modifier notDeployer() { } modifier onlyOperator() { } modifier notOperator() { } modifier onlyDeployerOrOperator() { } modifier notDeployerOrOperator() { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Servable * @notice An ownable that contains registered services and their actions */ contract Servable is Ownable { // // Types // ----------------------------------------------------------------------------------------------------------------- struct ServiceInfo { bool registered; uint256 activationTimestamp; mapping(bytes32 => bool) actionsEnabledMap; bytes32[] actionsList; } // // Variables // ----------------------------------------------------------------------------------------------------------------- mapping(address => ServiceInfo) internal registeredServicesMap; uint256 public serviceActivationTimeout; // // Events // ----------------------------------------------------------------------------------------------------------------- event ServiceActivationTimeoutEvent(uint256 timeoutInSeconds); event RegisterServiceEvent(address service); event RegisterServiceDeferredEvent(address service, uint256 timeout); event DeregisterServiceEvent(address service); event EnableServiceActionEvent(address service, string action); event DisableServiceActionEvent(address service, string action); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Set the service activation timeout /// @param timeoutInSeconds The set timeout in unit of seconds function setServiceActivationTimeout(uint256 timeoutInSeconds) public onlyDeployer { } /// @notice Register a service contract whose activation is immediate /// @param service The address of the service contract to be registered function registerService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Register a service contract whose activation is deferred by the service activation timeout /// @param service The address of the service contract to be registered function registerServiceDeferred(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Deregister a service contract /// @param service The address of the service contract to be deregistered function deregisterService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in an already registered service contract /// @param service The address of the registered service contract /// @param action The name of the action to be enabled function enableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in a service contract /// @param service The address of the service contract /// @param action The name of the action to be disabled function disableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Gauge whether a service contract is registered /// @param service The address of the service contract /// @return true if service is registered, else false function isRegisteredService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract is registered and active /// @param service The address of the service contract /// @return true if service is registered and activate, else false function isRegisteredActiveService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract action is enabled which implies also registered and active /// @param service The address of the service contract /// @param action The name of action function isEnabledServiceAction(address service, string memory action) public view returns (bool) { } // // Internal functions // ----------------------------------------------------------------------------------------------------------------- function hashString(string memory _string) internal pure returns (bytes32) { } // // Private functions // ----------------------------------------------------------------------------------------------------------------- function _registerService(address service, uint256 timeout) private { } // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyActiveService() { } modifier onlyEnabledServiceAction(string memory action) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title FraudChallenge * @notice Where fraud challenge results are found */ contract FraudChallenge is Ownable, Servable { // // Constants // ----------------------------------------------------------------------------------------------------------------- string constant public ADD_SEIZED_WALLET_ACTION = "add_seized_wallet"; string constant public ADD_DOUBLE_SPENDER_WALLET_ACTION = "add_double_spender_wallet"; string constant public ADD_FRAUDULENT_ORDER_ACTION = "add_fraudulent_order"; string constant public ADD_FRAUDULENT_TRADE_ACTION = "add_fraudulent_trade"; string constant public ADD_FRAUDULENT_PAYMENT_ACTION = "add_fraudulent_payment"; // // Variables // ----------------------------------------------------------------------------------------------------------------- address[] public doubleSpenderWallets; mapping(address => bool) public doubleSpenderByWallet; bytes32[] public fraudulentOrderHashes; mapping(bytes32 => bool) public fraudulentByOrderHash; bytes32[] public fraudulentTradeHashes; mapping(bytes32 => bool) public fraudulentByTradeHash; bytes32[] public fraudulentPaymentHashes; mapping(bytes32 => bool) public fraudulentByPaymentHash; // // Events // ----------------------------------------------------------------------------------------------------------------- event AddDoubleSpenderWalletEvent(address wallet); event AddFraudulentOrderHashEvent(bytes32 hash); event AddFraudulentTradeHashEvent(bytes32 hash); event AddFraudulentPaymentHashEvent(bytes32 hash); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the double spender status of given wallet /// @param wallet The wallet address for which to check double spender status /// @return true if wallet is double spender, false otherwise function isDoubleSpenderWallet(address wallet) public view returns (bool) { } /// @notice Get the number of wallets tagged as double spenders /// @return Number of double spender wallets function doubleSpenderWalletsCount() public view returns (uint256) { } /// @notice Add given wallets to store of double spender wallets if not already present /// @param wallet The first wallet to add function addDoubleSpenderWallet(address wallet) public onlyEnabledServiceAction(ADD_DOUBLE_SPENDER_WALLET_ACTION) { } /// @notice Get the number of fraudulent order hashes function fraudulentOrderHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent order /// @param hash The hash to be tested function isFraudulentOrderHash(bytes32 hash) public view returns (bool) { } /// @notice Add given order hash to store of fraudulent order hashes if not already present function addFraudulentOrderHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_ORDER_ACTION) { } /// @notice Get the number of fraudulent trade hashes function fraudulentTradeHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent trade /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent trade, else false function isFraudulentTradeHash(bytes32 hash) public view returns (bool) { } /// @notice Add given trade hash to store of fraudulent trade hashes if not already present function addFraudulentTradeHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_TRADE_ACTION) { } /// @notice Get the number of fraudulent payment hashes function fraudulentPaymentHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent payment /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent payment, else null function isFraudulentPaymentHash(bytes32 hash) public view returns (bool) { } /// @notice Add given payment hash to store of fraudulent payment hashes if not already present function addFraudulentPaymentHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_PAYMENT_ACTION) { } }
isDeployer()
365,824
isDeployer()
null
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { } modifier notThisAddress(address _address) { } modifier notNullOrThisAddress(address _address) { } modifier notSameAddresses(address _address1, address _address2) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { } /// @notice Destroy this contract function triggerSelfDestruction() public { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { } modifier notDeployer() { require(<FILL_ME>) _; } modifier onlyOperator() { } modifier notOperator() { } modifier onlyDeployerOrOperator() { } modifier notDeployerOrOperator() { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Servable * @notice An ownable that contains registered services and their actions */ contract Servable is Ownable { // // Types // ----------------------------------------------------------------------------------------------------------------- struct ServiceInfo { bool registered; uint256 activationTimestamp; mapping(bytes32 => bool) actionsEnabledMap; bytes32[] actionsList; } // // Variables // ----------------------------------------------------------------------------------------------------------------- mapping(address => ServiceInfo) internal registeredServicesMap; uint256 public serviceActivationTimeout; // // Events // ----------------------------------------------------------------------------------------------------------------- event ServiceActivationTimeoutEvent(uint256 timeoutInSeconds); event RegisterServiceEvent(address service); event RegisterServiceDeferredEvent(address service, uint256 timeout); event DeregisterServiceEvent(address service); event EnableServiceActionEvent(address service, string action); event DisableServiceActionEvent(address service, string action); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Set the service activation timeout /// @param timeoutInSeconds The set timeout in unit of seconds function setServiceActivationTimeout(uint256 timeoutInSeconds) public onlyDeployer { } /// @notice Register a service contract whose activation is immediate /// @param service The address of the service contract to be registered function registerService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Register a service contract whose activation is deferred by the service activation timeout /// @param service The address of the service contract to be registered function registerServiceDeferred(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Deregister a service contract /// @param service The address of the service contract to be deregistered function deregisterService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in an already registered service contract /// @param service The address of the registered service contract /// @param action The name of the action to be enabled function enableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in a service contract /// @param service The address of the service contract /// @param action The name of the action to be disabled function disableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Gauge whether a service contract is registered /// @param service The address of the service contract /// @return true if service is registered, else false function isRegisteredService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract is registered and active /// @param service The address of the service contract /// @return true if service is registered and activate, else false function isRegisteredActiveService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract action is enabled which implies also registered and active /// @param service The address of the service contract /// @param action The name of action function isEnabledServiceAction(address service, string memory action) public view returns (bool) { } // // Internal functions // ----------------------------------------------------------------------------------------------------------------- function hashString(string memory _string) internal pure returns (bytes32) { } // // Private functions // ----------------------------------------------------------------------------------------------------------------- function _registerService(address service, uint256 timeout) private { } // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyActiveService() { } modifier onlyEnabledServiceAction(string memory action) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title FraudChallenge * @notice Where fraud challenge results are found */ contract FraudChallenge is Ownable, Servable { // // Constants // ----------------------------------------------------------------------------------------------------------------- string constant public ADD_SEIZED_WALLET_ACTION = "add_seized_wallet"; string constant public ADD_DOUBLE_SPENDER_WALLET_ACTION = "add_double_spender_wallet"; string constant public ADD_FRAUDULENT_ORDER_ACTION = "add_fraudulent_order"; string constant public ADD_FRAUDULENT_TRADE_ACTION = "add_fraudulent_trade"; string constant public ADD_FRAUDULENT_PAYMENT_ACTION = "add_fraudulent_payment"; // // Variables // ----------------------------------------------------------------------------------------------------------------- address[] public doubleSpenderWallets; mapping(address => bool) public doubleSpenderByWallet; bytes32[] public fraudulentOrderHashes; mapping(bytes32 => bool) public fraudulentByOrderHash; bytes32[] public fraudulentTradeHashes; mapping(bytes32 => bool) public fraudulentByTradeHash; bytes32[] public fraudulentPaymentHashes; mapping(bytes32 => bool) public fraudulentByPaymentHash; // // Events // ----------------------------------------------------------------------------------------------------------------- event AddDoubleSpenderWalletEvent(address wallet); event AddFraudulentOrderHashEvent(bytes32 hash); event AddFraudulentTradeHashEvent(bytes32 hash); event AddFraudulentPaymentHashEvent(bytes32 hash); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the double spender status of given wallet /// @param wallet The wallet address for which to check double spender status /// @return true if wallet is double spender, false otherwise function isDoubleSpenderWallet(address wallet) public view returns (bool) { } /// @notice Get the number of wallets tagged as double spenders /// @return Number of double spender wallets function doubleSpenderWalletsCount() public view returns (uint256) { } /// @notice Add given wallets to store of double spender wallets if not already present /// @param wallet The first wallet to add function addDoubleSpenderWallet(address wallet) public onlyEnabledServiceAction(ADD_DOUBLE_SPENDER_WALLET_ACTION) { } /// @notice Get the number of fraudulent order hashes function fraudulentOrderHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent order /// @param hash The hash to be tested function isFraudulentOrderHash(bytes32 hash) public view returns (bool) { } /// @notice Add given order hash to store of fraudulent order hashes if not already present function addFraudulentOrderHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_ORDER_ACTION) { } /// @notice Get the number of fraudulent trade hashes function fraudulentTradeHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent trade /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent trade, else false function isFraudulentTradeHash(bytes32 hash) public view returns (bool) { } /// @notice Add given trade hash to store of fraudulent trade hashes if not already present function addFraudulentTradeHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_TRADE_ACTION) { } /// @notice Get the number of fraudulent payment hashes function fraudulentPaymentHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent payment /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent payment, else null function isFraudulentPaymentHash(bytes32 hash) public view returns (bool) { } /// @notice Add given payment hash to store of fraudulent payment hashes if not already present function addFraudulentPaymentHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_PAYMENT_ACTION) { } }
!isDeployer()
365,824
!isDeployer()
null
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { } modifier notThisAddress(address _address) { } modifier notNullOrThisAddress(address _address) { } modifier notSameAddresses(address _address1, address _address2) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { } /// @notice Destroy this contract function triggerSelfDestruction() public { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { } modifier notDeployer() { } modifier onlyOperator() { require(<FILL_ME>) _; } modifier notOperator() { } modifier onlyDeployerOrOperator() { } modifier notDeployerOrOperator() { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Servable * @notice An ownable that contains registered services and their actions */ contract Servable is Ownable { // // Types // ----------------------------------------------------------------------------------------------------------------- struct ServiceInfo { bool registered; uint256 activationTimestamp; mapping(bytes32 => bool) actionsEnabledMap; bytes32[] actionsList; } // // Variables // ----------------------------------------------------------------------------------------------------------------- mapping(address => ServiceInfo) internal registeredServicesMap; uint256 public serviceActivationTimeout; // // Events // ----------------------------------------------------------------------------------------------------------------- event ServiceActivationTimeoutEvent(uint256 timeoutInSeconds); event RegisterServiceEvent(address service); event RegisterServiceDeferredEvent(address service, uint256 timeout); event DeregisterServiceEvent(address service); event EnableServiceActionEvent(address service, string action); event DisableServiceActionEvent(address service, string action); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Set the service activation timeout /// @param timeoutInSeconds The set timeout in unit of seconds function setServiceActivationTimeout(uint256 timeoutInSeconds) public onlyDeployer { } /// @notice Register a service contract whose activation is immediate /// @param service The address of the service contract to be registered function registerService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Register a service contract whose activation is deferred by the service activation timeout /// @param service The address of the service contract to be registered function registerServiceDeferred(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Deregister a service contract /// @param service The address of the service contract to be deregistered function deregisterService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in an already registered service contract /// @param service The address of the registered service contract /// @param action The name of the action to be enabled function enableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in a service contract /// @param service The address of the service contract /// @param action The name of the action to be disabled function disableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Gauge whether a service contract is registered /// @param service The address of the service contract /// @return true if service is registered, else false function isRegisteredService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract is registered and active /// @param service The address of the service contract /// @return true if service is registered and activate, else false function isRegisteredActiveService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract action is enabled which implies also registered and active /// @param service The address of the service contract /// @param action The name of action function isEnabledServiceAction(address service, string memory action) public view returns (bool) { } // // Internal functions // ----------------------------------------------------------------------------------------------------------------- function hashString(string memory _string) internal pure returns (bytes32) { } // // Private functions // ----------------------------------------------------------------------------------------------------------------- function _registerService(address service, uint256 timeout) private { } // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyActiveService() { } modifier onlyEnabledServiceAction(string memory action) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title FraudChallenge * @notice Where fraud challenge results are found */ contract FraudChallenge is Ownable, Servable { // // Constants // ----------------------------------------------------------------------------------------------------------------- string constant public ADD_SEIZED_WALLET_ACTION = "add_seized_wallet"; string constant public ADD_DOUBLE_SPENDER_WALLET_ACTION = "add_double_spender_wallet"; string constant public ADD_FRAUDULENT_ORDER_ACTION = "add_fraudulent_order"; string constant public ADD_FRAUDULENT_TRADE_ACTION = "add_fraudulent_trade"; string constant public ADD_FRAUDULENT_PAYMENT_ACTION = "add_fraudulent_payment"; // // Variables // ----------------------------------------------------------------------------------------------------------------- address[] public doubleSpenderWallets; mapping(address => bool) public doubleSpenderByWallet; bytes32[] public fraudulentOrderHashes; mapping(bytes32 => bool) public fraudulentByOrderHash; bytes32[] public fraudulentTradeHashes; mapping(bytes32 => bool) public fraudulentByTradeHash; bytes32[] public fraudulentPaymentHashes; mapping(bytes32 => bool) public fraudulentByPaymentHash; // // Events // ----------------------------------------------------------------------------------------------------------------- event AddDoubleSpenderWalletEvent(address wallet); event AddFraudulentOrderHashEvent(bytes32 hash); event AddFraudulentTradeHashEvent(bytes32 hash); event AddFraudulentPaymentHashEvent(bytes32 hash); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the double spender status of given wallet /// @param wallet The wallet address for which to check double spender status /// @return true if wallet is double spender, false otherwise function isDoubleSpenderWallet(address wallet) public view returns (bool) { } /// @notice Get the number of wallets tagged as double spenders /// @return Number of double spender wallets function doubleSpenderWalletsCount() public view returns (uint256) { } /// @notice Add given wallets to store of double spender wallets if not already present /// @param wallet The first wallet to add function addDoubleSpenderWallet(address wallet) public onlyEnabledServiceAction(ADD_DOUBLE_SPENDER_WALLET_ACTION) { } /// @notice Get the number of fraudulent order hashes function fraudulentOrderHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent order /// @param hash The hash to be tested function isFraudulentOrderHash(bytes32 hash) public view returns (bool) { } /// @notice Add given order hash to store of fraudulent order hashes if not already present function addFraudulentOrderHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_ORDER_ACTION) { } /// @notice Get the number of fraudulent trade hashes function fraudulentTradeHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent trade /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent trade, else false function isFraudulentTradeHash(bytes32 hash) public view returns (bool) { } /// @notice Add given trade hash to store of fraudulent trade hashes if not already present function addFraudulentTradeHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_TRADE_ACTION) { } /// @notice Get the number of fraudulent payment hashes function fraudulentPaymentHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent payment /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent payment, else null function isFraudulentPaymentHash(bytes32 hash) public view returns (bool) { } /// @notice Add given payment hash to store of fraudulent payment hashes if not already present function addFraudulentPaymentHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_PAYMENT_ACTION) { } }
isOperator()
365,824
isOperator()
null
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { } modifier notThisAddress(address _address) { } modifier notNullOrThisAddress(address _address) { } modifier notSameAddresses(address _address1, address _address2) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { } /// @notice Destroy this contract function triggerSelfDestruction() public { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { } modifier notDeployer() { } modifier onlyOperator() { } modifier notOperator() { require(<FILL_ME>) _; } modifier onlyDeployerOrOperator() { } modifier notDeployerOrOperator() { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Servable * @notice An ownable that contains registered services and their actions */ contract Servable is Ownable { // // Types // ----------------------------------------------------------------------------------------------------------------- struct ServiceInfo { bool registered; uint256 activationTimestamp; mapping(bytes32 => bool) actionsEnabledMap; bytes32[] actionsList; } // // Variables // ----------------------------------------------------------------------------------------------------------------- mapping(address => ServiceInfo) internal registeredServicesMap; uint256 public serviceActivationTimeout; // // Events // ----------------------------------------------------------------------------------------------------------------- event ServiceActivationTimeoutEvent(uint256 timeoutInSeconds); event RegisterServiceEvent(address service); event RegisterServiceDeferredEvent(address service, uint256 timeout); event DeregisterServiceEvent(address service); event EnableServiceActionEvent(address service, string action); event DisableServiceActionEvent(address service, string action); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Set the service activation timeout /// @param timeoutInSeconds The set timeout in unit of seconds function setServiceActivationTimeout(uint256 timeoutInSeconds) public onlyDeployer { } /// @notice Register a service contract whose activation is immediate /// @param service The address of the service contract to be registered function registerService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Register a service contract whose activation is deferred by the service activation timeout /// @param service The address of the service contract to be registered function registerServiceDeferred(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Deregister a service contract /// @param service The address of the service contract to be deregistered function deregisterService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in an already registered service contract /// @param service The address of the registered service contract /// @param action The name of the action to be enabled function enableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in a service contract /// @param service The address of the service contract /// @param action The name of the action to be disabled function disableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Gauge whether a service contract is registered /// @param service The address of the service contract /// @return true if service is registered, else false function isRegisteredService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract is registered and active /// @param service The address of the service contract /// @return true if service is registered and activate, else false function isRegisteredActiveService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract action is enabled which implies also registered and active /// @param service The address of the service contract /// @param action The name of action function isEnabledServiceAction(address service, string memory action) public view returns (bool) { } // // Internal functions // ----------------------------------------------------------------------------------------------------------------- function hashString(string memory _string) internal pure returns (bytes32) { } // // Private functions // ----------------------------------------------------------------------------------------------------------------- function _registerService(address service, uint256 timeout) private { } // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyActiveService() { } modifier onlyEnabledServiceAction(string memory action) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title FraudChallenge * @notice Where fraud challenge results are found */ contract FraudChallenge is Ownable, Servable { // // Constants // ----------------------------------------------------------------------------------------------------------------- string constant public ADD_SEIZED_WALLET_ACTION = "add_seized_wallet"; string constant public ADD_DOUBLE_SPENDER_WALLET_ACTION = "add_double_spender_wallet"; string constant public ADD_FRAUDULENT_ORDER_ACTION = "add_fraudulent_order"; string constant public ADD_FRAUDULENT_TRADE_ACTION = "add_fraudulent_trade"; string constant public ADD_FRAUDULENT_PAYMENT_ACTION = "add_fraudulent_payment"; // // Variables // ----------------------------------------------------------------------------------------------------------------- address[] public doubleSpenderWallets; mapping(address => bool) public doubleSpenderByWallet; bytes32[] public fraudulentOrderHashes; mapping(bytes32 => bool) public fraudulentByOrderHash; bytes32[] public fraudulentTradeHashes; mapping(bytes32 => bool) public fraudulentByTradeHash; bytes32[] public fraudulentPaymentHashes; mapping(bytes32 => bool) public fraudulentByPaymentHash; // // Events // ----------------------------------------------------------------------------------------------------------------- event AddDoubleSpenderWalletEvent(address wallet); event AddFraudulentOrderHashEvent(bytes32 hash); event AddFraudulentTradeHashEvent(bytes32 hash); event AddFraudulentPaymentHashEvent(bytes32 hash); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the double spender status of given wallet /// @param wallet The wallet address for which to check double spender status /// @return true if wallet is double spender, false otherwise function isDoubleSpenderWallet(address wallet) public view returns (bool) { } /// @notice Get the number of wallets tagged as double spenders /// @return Number of double spender wallets function doubleSpenderWalletsCount() public view returns (uint256) { } /// @notice Add given wallets to store of double spender wallets if not already present /// @param wallet The first wallet to add function addDoubleSpenderWallet(address wallet) public onlyEnabledServiceAction(ADD_DOUBLE_SPENDER_WALLET_ACTION) { } /// @notice Get the number of fraudulent order hashes function fraudulentOrderHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent order /// @param hash The hash to be tested function isFraudulentOrderHash(bytes32 hash) public view returns (bool) { } /// @notice Add given order hash to store of fraudulent order hashes if not already present function addFraudulentOrderHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_ORDER_ACTION) { } /// @notice Get the number of fraudulent trade hashes function fraudulentTradeHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent trade /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent trade, else false function isFraudulentTradeHash(bytes32 hash) public view returns (bool) { } /// @notice Add given trade hash to store of fraudulent trade hashes if not already present function addFraudulentTradeHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_TRADE_ACTION) { } /// @notice Get the number of fraudulent payment hashes function fraudulentPaymentHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent payment /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent payment, else null function isFraudulentPaymentHash(bytes32 hash) public view returns (bool) { } /// @notice Add given payment hash to store of fraudulent payment hashes if not already present function addFraudulentPaymentHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_PAYMENT_ACTION) { } }
!isOperator()
365,824
!isOperator()
null
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { } modifier notThisAddress(address _address) { } modifier notNullOrThisAddress(address _address) { } modifier notSameAddresses(address _address1, address _address2) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { } /// @notice Destroy this contract function triggerSelfDestruction() public { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { } modifier notDeployer() { } modifier onlyOperator() { } modifier notOperator() { } modifier onlyDeployerOrOperator() { require(<FILL_ME>) _; } modifier notDeployerOrOperator() { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Servable * @notice An ownable that contains registered services and their actions */ contract Servable is Ownable { // // Types // ----------------------------------------------------------------------------------------------------------------- struct ServiceInfo { bool registered; uint256 activationTimestamp; mapping(bytes32 => bool) actionsEnabledMap; bytes32[] actionsList; } // // Variables // ----------------------------------------------------------------------------------------------------------------- mapping(address => ServiceInfo) internal registeredServicesMap; uint256 public serviceActivationTimeout; // // Events // ----------------------------------------------------------------------------------------------------------------- event ServiceActivationTimeoutEvent(uint256 timeoutInSeconds); event RegisterServiceEvent(address service); event RegisterServiceDeferredEvent(address service, uint256 timeout); event DeregisterServiceEvent(address service); event EnableServiceActionEvent(address service, string action); event DisableServiceActionEvent(address service, string action); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Set the service activation timeout /// @param timeoutInSeconds The set timeout in unit of seconds function setServiceActivationTimeout(uint256 timeoutInSeconds) public onlyDeployer { } /// @notice Register a service contract whose activation is immediate /// @param service The address of the service contract to be registered function registerService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Register a service contract whose activation is deferred by the service activation timeout /// @param service The address of the service contract to be registered function registerServiceDeferred(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Deregister a service contract /// @param service The address of the service contract to be deregistered function deregisterService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in an already registered service contract /// @param service The address of the registered service contract /// @param action The name of the action to be enabled function enableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in a service contract /// @param service The address of the service contract /// @param action The name of the action to be disabled function disableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Gauge whether a service contract is registered /// @param service The address of the service contract /// @return true if service is registered, else false function isRegisteredService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract is registered and active /// @param service The address of the service contract /// @return true if service is registered and activate, else false function isRegisteredActiveService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract action is enabled which implies also registered and active /// @param service The address of the service contract /// @param action The name of action function isEnabledServiceAction(address service, string memory action) public view returns (bool) { } // // Internal functions // ----------------------------------------------------------------------------------------------------------------- function hashString(string memory _string) internal pure returns (bytes32) { } // // Private functions // ----------------------------------------------------------------------------------------------------------------- function _registerService(address service, uint256 timeout) private { } // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyActiveService() { } modifier onlyEnabledServiceAction(string memory action) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title FraudChallenge * @notice Where fraud challenge results are found */ contract FraudChallenge is Ownable, Servable { // // Constants // ----------------------------------------------------------------------------------------------------------------- string constant public ADD_SEIZED_WALLET_ACTION = "add_seized_wallet"; string constant public ADD_DOUBLE_SPENDER_WALLET_ACTION = "add_double_spender_wallet"; string constant public ADD_FRAUDULENT_ORDER_ACTION = "add_fraudulent_order"; string constant public ADD_FRAUDULENT_TRADE_ACTION = "add_fraudulent_trade"; string constant public ADD_FRAUDULENT_PAYMENT_ACTION = "add_fraudulent_payment"; // // Variables // ----------------------------------------------------------------------------------------------------------------- address[] public doubleSpenderWallets; mapping(address => bool) public doubleSpenderByWallet; bytes32[] public fraudulentOrderHashes; mapping(bytes32 => bool) public fraudulentByOrderHash; bytes32[] public fraudulentTradeHashes; mapping(bytes32 => bool) public fraudulentByTradeHash; bytes32[] public fraudulentPaymentHashes; mapping(bytes32 => bool) public fraudulentByPaymentHash; // // Events // ----------------------------------------------------------------------------------------------------------------- event AddDoubleSpenderWalletEvent(address wallet); event AddFraudulentOrderHashEvent(bytes32 hash); event AddFraudulentTradeHashEvent(bytes32 hash); event AddFraudulentPaymentHashEvent(bytes32 hash); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the double spender status of given wallet /// @param wallet The wallet address for which to check double spender status /// @return true if wallet is double spender, false otherwise function isDoubleSpenderWallet(address wallet) public view returns (bool) { } /// @notice Get the number of wallets tagged as double spenders /// @return Number of double spender wallets function doubleSpenderWalletsCount() public view returns (uint256) { } /// @notice Add given wallets to store of double spender wallets if not already present /// @param wallet The first wallet to add function addDoubleSpenderWallet(address wallet) public onlyEnabledServiceAction(ADD_DOUBLE_SPENDER_WALLET_ACTION) { } /// @notice Get the number of fraudulent order hashes function fraudulentOrderHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent order /// @param hash The hash to be tested function isFraudulentOrderHash(bytes32 hash) public view returns (bool) { } /// @notice Add given order hash to store of fraudulent order hashes if not already present function addFraudulentOrderHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_ORDER_ACTION) { } /// @notice Get the number of fraudulent trade hashes function fraudulentTradeHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent trade /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent trade, else false function isFraudulentTradeHash(bytes32 hash) public view returns (bool) { } /// @notice Add given trade hash to store of fraudulent trade hashes if not already present function addFraudulentTradeHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_TRADE_ACTION) { } /// @notice Get the number of fraudulent payment hashes function fraudulentPaymentHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent payment /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent payment, else null function isFraudulentPaymentHash(bytes32 hash) public view returns (bool) { } /// @notice Add given payment hash to store of fraudulent payment hashes if not already present function addFraudulentPaymentHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_PAYMENT_ACTION) { } }
isDeployerOrOperator()
365,824
isDeployerOrOperator()
null
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { } modifier notThisAddress(address _address) { } modifier notNullOrThisAddress(address _address) { } modifier notSameAddresses(address _address1, address _address2) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { } /// @notice Destroy this contract function triggerSelfDestruction() public { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { } modifier notDeployer() { } modifier onlyOperator() { } modifier notOperator() { } modifier onlyDeployerOrOperator() { } modifier notDeployerOrOperator() { require(<FILL_ME>) _; } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Servable * @notice An ownable that contains registered services and their actions */ contract Servable is Ownable { // // Types // ----------------------------------------------------------------------------------------------------------------- struct ServiceInfo { bool registered; uint256 activationTimestamp; mapping(bytes32 => bool) actionsEnabledMap; bytes32[] actionsList; } // // Variables // ----------------------------------------------------------------------------------------------------------------- mapping(address => ServiceInfo) internal registeredServicesMap; uint256 public serviceActivationTimeout; // // Events // ----------------------------------------------------------------------------------------------------------------- event ServiceActivationTimeoutEvent(uint256 timeoutInSeconds); event RegisterServiceEvent(address service); event RegisterServiceDeferredEvent(address service, uint256 timeout); event DeregisterServiceEvent(address service); event EnableServiceActionEvent(address service, string action); event DisableServiceActionEvent(address service, string action); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Set the service activation timeout /// @param timeoutInSeconds The set timeout in unit of seconds function setServiceActivationTimeout(uint256 timeoutInSeconds) public onlyDeployer { } /// @notice Register a service contract whose activation is immediate /// @param service The address of the service contract to be registered function registerService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Register a service contract whose activation is deferred by the service activation timeout /// @param service The address of the service contract to be registered function registerServiceDeferred(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Deregister a service contract /// @param service The address of the service contract to be deregistered function deregisterService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in an already registered service contract /// @param service The address of the registered service contract /// @param action The name of the action to be enabled function enableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in a service contract /// @param service The address of the service contract /// @param action The name of the action to be disabled function disableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Gauge whether a service contract is registered /// @param service The address of the service contract /// @return true if service is registered, else false function isRegisteredService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract is registered and active /// @param service The address of the service contract /// @return true if service is registered and activate, else false function isRegisteredActiveService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract action is enabled which implies also registered and active /// @param service The address of the service contract /// @param action The name of action function isEnabledServiceAction(address service, string memory action) public view returns (bool) { } // // Internal functions // ----------------------------------------------------------------------------------------------------------------- function hashString(string memory _string) internal pure returns (bytes32) { } // // Private functions // ----------------------------------------------------------------------------------------------------------------- function _registerService(address service, uint256 timeout) private { } // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyActiveService() { } modifier onlyEnabledServiceAction(string memory action) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title FraudChallenge * @notice Where fraud challenge results are found */ contract FraudChallenge is Ownable, Servable { // // Constants // ----------------------------------------------------------------------------------------------------------------- string constant public ADD_SEIZED_WALLET_ACTION = "add_seized_wallet"; string constant public ADD_DOUBLE_SPENDER_WALLET_ACTION = "add_double_spender_wallet"; string constant public ADD_FRAUDULENT_ORDER_ACTION = "add_fraudulent_order"; string constant public ADD_FRAUDULENT_TRADE_ACTION = "add_fraudulent_trade"; string constant public ADD_FRAUDULENT_PAYMENT_ACTION = "add_fraudulent_payment"; // // Variables // ----------------------------------------------------------------------------------------------------------------- address[] public doubleSpenderWallets; mapping(address => bool) public doubleSpenderByWallet; bytes32[] public fraudulentOrderHashes; mapping(bytes32 => bool) public fraudulentByOrderHash; bytes32[] public fraudulentTradeHashes; mapping(bytes32 => bool) public fraudulentByTradeHash; bytes32[] public fraudulentPaymentHashes; mapping(bytes32 => bool) public fraudulentByPaymentHash; // // Events // ----------------------------------------------------------------------------------------------------------------- event AddDoubleSpenderWalletEvent(address wallet); event AddFraudulentOrderHashEvent(bytes32 hash); event AddFraudulentTradeHashEvent(bytes32 hash); event AddFraudulentPaymentHashEvent(bytes32 hash); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the double spender status of given wallet /// @param wallet The wallet address for which to check double spender status /// @return true if wallet is double spender, false otherwise function isDoubleSpenderWallet(address wallet) public view returns (bool) { } /// @notice Get the number of wallets tagged as double spenders /// @return Number of double spender wallets function doubleSpenderWalletsCount() public view returns (uint256) { } /// @notice Add given wallets to store of double spender wallets if not already present /// @param wallet The first wallet to add function addDoubleSpenderWallet(address wallet) public onlyEnabledServiceAction(ADD_DOUBLE_SPENDER_WALLET_ACTION) { } /// @notice Get the number of fraudulent order hashes function fraudulentOrderHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent order /// @param hash The hash to be tested function isFraudulentOrderHash(bytes32 hash) public view returns (bool) { } /// @notice Add given order hash to store of fraudulent order hashes if not already present function addFraudulentOrderHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_ORDER_ACTION) { } /// @notice Get the number of fraudulent trade hashes function fraudulentTradeHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent trade /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent trade, else false function isFraudulentTradeHash(bytes32 hash) public view returns (bool) { } /// @notice Add given trade hash to store of fraudulent trade hashes if not already present function addFraudulentTradeHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_TRADE_ACTION) { } /// @notice Get the number of fraudulent payment hashes function fraudulentPaymentHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent payment /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent payment, else null function isFraudulentPaymentHash(bytes32 hash) public view returns (bool) { } /// @notice Add given payment hash to store of fraudulent payment hashes if not already present function addFraudulentPaymentHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_PAYMENT_ACTION) { } }
!isDeployerOrOperator()
365,824
!isDeployerOrOperator()
null
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { } modifier notThisAddress(address _address) { } modifier notNullOrThisAddress(address _address) { } modifier notSameAddresses(address _address1, address _address2) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { } /// @notice Destroy this contract function triggerSelfDestruction() public { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { } modifier notDeployer() { } modifier onlyOperator() { } modifier notOperator() { } modifier onlyDeployerOrOperator() { } modifier notDeployerOrOperator() { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Servable * @notice An ownable that contains registered services and their actions */ contract Servable is Ownable { // // Types // ----------------------------------------------------------------------------------------------------------------- struct ServiceInfo { bool registered; uint256 activationTimestamp; mapping(bytes32 => bool) actionsEnabledMap; bytes32[] actionsList; } // // Variables // ----------------------------------------------------------------------------------------------------------------- mapping(address => ServiceInfo) internal registeredServicesMap; uint256 public serviceActivationTimeout; // // Events // ----------------------------------------------------------------------------------------------------------------- event ServiceActivationTimeoutEvent(uint256 timeoutInSeconds); event RegisterServiceEvent(address service); event RegisterServiceDeferredEvent(address service, uint256 timeout); event DeregisterServiceEvent(address service); event EnableServiceActionEvent(address service, string action); event DisableServiceActionEvent(address service, string action); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Set the service activation timeout /// @param timeoutInSeconds The set timeout in unit of seconds function setServiceActivationTimeout(uint256 timeoutInSeconds) public onlyDeployer { } /// @notice Register a service contract whose activation is immediate /// @param service The address of the service contract to be registered function registerService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Register a service contract whose activation is deferred by the service activation timeout /// @param service The address of the service contract to be registered function registerServiceDeferred(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Deregister a service contract /// @param service The address of the service contract to be deregistered function deregisterService(address service) public onlyDeployer notNullOrThisAddress(service) { require(<FILL_ME>) registeredServicesMap[service].registered = false; // Emit event emit DeregisterServiceEvent(service); } /// @notice Enable a named action in an already registered service contract /// @param service The address of the registered service contract /// @param action The name of the action to be enabled function enableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in a service contract /// @param service The address of the service contract /// @param action The name of the action to be disabled function disableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Gauge whether a service contract is registered /// @param service The address of the service contract /// @return true if service is registered, else false function isRegisteredService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract is registered and active /// @param service The address of the service contract /// @return true if service is registered and activate, else false function isRegisteredActiveService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract action is enabled which implies also registered and active /// @param service The address of the service contract /// @param action The name of action function isEnabledServiceAction(address service, string memory action) public view returns (bool) { } // // Internal functions // ----------------------------------------------------------------------------------------------------------------- function hashString(string memory _string) internal pure returns (bytes32) { } // // Private functions // ----------------------------------------------------------------------------------------------------------------- function _registerService(address service, uint256 timeout) private { } // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyActiveService() { } modifier onlyEnabledServiceAction(string memory action) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title FraudChallenge * @notice Where fraud challenge results are found */ contract FraudChallenge is Ownable, Servable { // // Constants // ----------------------------------------------------------------------------------------------------------------- string constant public ADD_SEIZED_WALLET_ACTION = "add_seized_wallet"; string constant public ADD_DOUBLE_SPENDER_WALLET_ACTION = "add_double_spender_wallet"; string constant public ADD_FRAUDULENT_ORDER_ACTION = "add_fraudulent_order"; string constant public ADD_FRAUDULENT_TRADE_ACTION = "add_fraudulent_trade"; string constant public ADD_FRAUDULENT_PAYMENT_ACTION = "add_fraudulent_payment"; // // Variables // ----------------------------------------------------------------------------------------------------------------- address[] public doubleSpenderWallets; mapping(address => bool) public doubleSpenderByWallet; bytes32[] public fraudulentOrderHashes; mapping(bytes32 => bool) public fraudulentByOrderHash; bytes32[] public fraudulentTradeHashes; mapping(bytes32 => bool) public fraudulentByTradeHash; bytes32[] public fraudulentPaymentHashes; mapping(bytes32 => bool) public fraudulentByPaymentHash; // // Events // ----------------------------------------------------------------------------------------------------------------- event AddDoubleSpenderWalletEvent(address wallet); event AddFraudulentOrderHashEvent(bytes32 hash); event AddFraudulentTradeHashEvent(bytes32 hash); event AddFraudulentPaymentHashEvent(bytes32 hash); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the double spender status of given wallet /// @param wallet The wallet address for which to check double spender status /// @return true if wallet is double spender, false otherwise function isDoubleSpenderWallet(address wallet) public view returns (bool) { } /// @notice Get the number of wallets tagged as double spenders /// @return Number of double spender wallets function doubleSpenderWalletsCount() public view returns (uint256) { } /// @notice Add given wallets to store of double spender wallets if not already present /// @param wallet The first wallet to add function addDoubleSpenderWallet(address wallet) public onlyEnabledServiceAction(ADD_DOUBLE_SPENDER_WALLET_ACTION) { } /// @notice Get the number of fraudulent order hashes function fraudulentOrderHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent order /// @param hash The hash to be tested function isFraudulentOrderHash(bytes32 hash) public view returns (bool) { } /// @notice Add given order hash to store of fraudulent order hashes if not already present function addFraudulentOrderHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_ORDER_ACTION) { } /// @notice Get the number of fraudulent trade hashes function fraudulentTradeHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent trade /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent trade, else false function isFraudulentTradeHash(bytes32 hash) public view returns (bool) { } /// @notice Add given trade hash to store of fraudulent trade hashes if not already present function addFraudulentTradeHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_TRADE_ACTION) { } /// @notice Get the number of fraudulent payment hashes function fraudulentPaymentHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent payment /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent payment, else null function isFraudulentPaymentHash(bytes32 hash) public view returns (bool) { } /// @notice Add given payment hash to store of fraudulent payment hashes if not already present function addFraudulentPaymentHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_PAYMENT_ACTION) { } }
registeredServicesMap[service].registered
365,824
registeredServicesMap[service].registered
null
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { } modifier notThisAddress(address _address) { } modifier notNullOrThisAddress(address _address) { } modifier notSameAddresses(address _address1, address _address2) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { } /// @notice Destroy this contract function triggerSelfDestruction() public { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { } modifier notDeployer() { } modifier onlyOperator() { } modifier notOperator() { } modifier onlyDeployerOrOperator() { } modifier notDeployerOrOperator() { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Servable * @notice An ownable that contains registered services and their actions */ contract Servable is Ownable { // // Types // ----------------------------------------------------------------------------------------------------------------- struct ServiceInfo { bool registered; uint256 activationTimestamp; mapping(bytes32 => bool) actionsEnabledMap; bytes32[] actionsList; } // // Variables // ----------------------------------------------------------------------------------------------------------------- mapping(address => ServiceInfo) internal registeredServicesMap; uint256 public serviceActivationTimeout; // // Events // ----------------------------------------------------------------------------------------------------------------- event ServiceActivationTimeoutEvent(uint256 timeoutInSeconds); event RegisterServiceEvent(address service); event RegisterServiceDeferredEvent(address service, uint256 timeout); event DeregisterServiceEvent(address service); event EnableServiceActionEvent(address service, string action); event DisableServiceActionEvent(address service, string action); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Set the service activation timeout /// @param timeoutInSeconds The set timeout in unit of seconds function setServiceActivationTimeout(uint256 timeoutInSeconds) public onlyDeployer { } /// @notice Register a service contract whose activation is immediate /// @param service The address of the service contract to be registered function registerService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Register a service contract whose activation is deferred by the service activation timeout /// @param service The address of the service contract to be registered function registerServiceDeferred(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Deregister a service contract /// @param service The address of the service contract to be deregistered function deregisterService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in an already registered service contract /// @param service The address of the registered service contract /// @param action The name of the action to be enabled function enableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { require(registeredServicesMap[service].registered); bytes32 actionHash = hashString(action); require(<FILL_ME>) registeredServicesMap[service].actionsEnabledMap[actionHash] = true; registeredServicesMap[service].actionsList.push(actionHash); // Emit event emit EnableServiceActionEvent(service, action); } /// @notice Enable a named action in a service contract /// @param service The address of the service contract /// @param action The name of the action to be disabled function disableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Gauge whether a service contract is registered /// @param service The address of the service contract /// @return true if service is registered, else false function isRegisteredService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract is registered and active /// @param service The address of the service contract /// @return true if service is registered and activate, else false function isRegisteredActiveService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract action is enabled which implies also registered and active /// @param service The address of the service contract /// @param action The name of action function isEnabledServiceAction(address service, string memory action) public view returns (bool) { } // // Internal functions // ----------------------------------------------------------------------------------------------------------------- function hashString(string memory _string) internal pure returns (bytes32) { } // // Private functions // ----------------------------------------------------------------------------------------------------------------- function _registerService(address service, uint256 timeout) private { } // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyActiveService() { } modifier onlyEnabledServiceAction(string memory action) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title FraudChallenge * @notice Where fraud challenge results are found */ contract FraudChallenge is Ownable, Servable { // // Constants // ----------------------------------------------------------------------------------------------------------------- string constant public ADD_SEIZED_WALLET_ACTION = "add_seized_wallet"; string constant public ADD_DOUBLE_SPENDER_WALLET_ACTION = "add_double_spender_wallet"; string constant public ADD_FRAUDULENT_ORDER_ACTION = "add_fraudulent_order"; string constant public ADD_FRAUDULENT_TRADE_ACTION = "add_fraudulent_trade"; string constant public ADD_FRAUDULENT_PAYMENT_ACTION = "add_fraudulent_payment"; // // Variables // ----------------------------------------------------------------------------------------------------------------- address[] public doubleSpenderWallets; mapping(address => bool) public doubleSpenderByWallet; bytes32[] public fraudulentOrderHashes; mapping(bytes32 => bool) public fraudulentByOrderHash; bytes32[] public fraudulentTradeHashes; mapping(bytes32 => bool) public fraudulentByTradeHash; bytes32[] public fraudulentPaymentHashes; mapping(bytes32 => bool) public fraudulentByPaymentHash; // // Events // ----------------------------------------------------------------------------------------------------------------- event AddDoubleSpenderWalletEvent(address wallet); event AddFraudulentOrderHashEvent(bytes32 hash); event AddFraudulentTradeHashEvent(bytes32 hash); event AddFraudulentPaymentHashEvent(bytes32 hash); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the double spender status of given wallet /// @param wallet The wallet address for which to check double spender status /// @return true if wallet is double spender, false otherwise function isDoubleSpenderWallet(address wallet) public view returns (bool) { } /// @notice Get the number of wallets tagged as double spenders /// @return Number of double spender wallets function doubleSpenderWalletsCount() public view returns (uint256) { } /// @notice Add given wallets to store of double spender wallets if not already present /// @param wallet The first wallet to add function addDoubleSpenderWallet(address wallet) public onlyEnabledServiceAction(ADD_DOUBLE_SPENDER_WALLET_ACTION) { } /// @notice Get the number of fraudulent order hashes function fraudulentOrderHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent order /// @param hash The hash to be tested function isFraudulentOrderHash(bytes32 hash) public view returns (bool) { } /// @notice Add given order hash to store of fraudulent order hashes if not already present function addFraudulentOrderHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_ORDER_ACTION) { } /// @notice Get the number of fraudulent trade hashes function fraudulentTradeHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent trade /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent trade, else false function isFraudulentTradeHash(bytes32 hash) public view returns (bool) { } /// @notice Add given trade hash to store of fraudulent trade hashes if not already present function addFraudulentTradeHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_TRADE_ACTION) { } /// @notice Get the number of fraudulent payment hashes function fraudulentPaymentHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent payment /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent payment, else null function isFraudulentPaymentHash(bytes32 hash) public view returns (bool) { } /// @notice Add given payment hash to store of fraudulent payment hashes if not already present function addFraudulentPaymentHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_PAYMENT_ACTION) { } }
!registeredServicesMap[service].actionsEnabledMap[actionHash]
365,824
!registeredServicesMap[service].actionsEnabledMap[actionHash]
null
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { } modifier notThisAddress(address _address) { } modifier notNullOrThisAddress(address _address) { } modifier notSameAddresses(address _address1, address _address2) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { } /// @notice Destroy this contract function triggerSelfDestruction() public { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { } modifier notDeployer() { } modifier onlyOperator() { } modifier notOperator() { } modifier onlyDeployerOrOperator() { } modifier notDeployerOrOperator() { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Servable * @notice An ownable that contains registered services and their actions */ contract Servable is Ownable { // // Types // ----------------------------------------------------------------------------------------------------------------- struct ServiceInfo { bool registered; uint256 activationTimestamp; mapping(bytes32 => bool) actionsEnabledMap; bytes32[] actionsList; } // // Variables // ----------------------------------------------------------------------------------------------------------------- mapping(address => ServiceInfo) internal registeredServicesMap; uint256 public serviceActivationTimeout; // // Events // ----------------------------------------------------------------------------------------------------------------- event ServiceActivationTimeoutEvent(uint256 timeoutInSeconds); event RegisterServiceEvent(address service); event RegisterServiceDeferredEvent(address service, uint256 timeout); event DeregisterServiceEvent(address service); event EnableServiceActionEvent(address service, string action); event DisableServiceActionEvent(address service, string action); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Set the service activation timeout /// @param timeoutInSeconds The set timeout in unit of seconds function setServiceActivationTimeout(uint256 timeoutInSeconds) public onlyDeployer { } /// @notice Register a service contract whose activation is immediate /// @param service The address of the service contract to be registered function registerService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Register a service contract whose activation is deferred by the service activation timeout /// @param service The address of the service contract to be registered function registerServiceDeferred(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Deregister a service contract /// @param service The address of the service contract to be deregistered function deregisterService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in an already registered service contract /// @param service The address of the registered service contract /// @param action The name of the action to be enabled function enableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in a service contract /// @param service The address of the service contract /// @param action The name of the action to be disabled function disableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { bytes32 actionHash = hashString(action); require(<FILL_ME>) registeredServicesMap[service].actionsEnabledMap[actionHash] = false; // Emit event emit DisableServiceActionEvent(service, action); } /// @notice Gauge whether a service contract is registered /// @param service The address of the service contract /// @return true if service is registered, else false function isRegisteredService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract is registered and active /// @param service The address of the service contract /// @return true if service is registered and activate, else false function isRegisteredActiveService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract action is enabled which implies also registered and active /// @param service The address of the service contract /// @param action The name of action function isEnabledServiceAction(address service, string memory action) public view returns (bool) { } // // Internal functions // ----------------------------------------------------------------------------------------------------------------- function hashString(string memory _string) internal pure returns (bytes32) { } // // Private functions // ----------------------------------------------------------------------------------------------------------------- function _registerService(address service, uint256 timeout) private { } // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyActiveService() { } modifier onlyEnabledServiceAction(string memory action) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title FraudChallenge * @notice Where fraud challenge results are found */ contract FraudChallenge is Ownable, Servable { // // Constants // ----------------------------------------------------------------------------------------------------------------- string constant public ADD_SEIZED_WALLET_ACTION = "add_seized_wallet"; string constant public ADD_DOUBLE_SPENDER_WALLET_ACTION = "add_double_spender_wallet"; string constant public ADD_FRAUDULENT_ORDER_ACTION = "add_fraudulent_order"; string constant public ADD_FRAUDULENT_TRADE_ACTION = "add_fraudulent_trade"; string constant public ADD_FRAUDULENT_PAYMENT_ACTION = "add_fraudulent_payment"; // // Variables // ----------------------------------------------------------------------------------------------------------------- address[] public doubleSpenderWallets; mapping(address => bool) public doubleSpenderByWallet; bytes32[] public fraudulentOrderHashes; mapping(bytes32 => bool) public fraudulentByOrderHash; bytes32[] public fraudulentTradeHashes; mapping(bytes32 => bool) public fraudulentByTradeHash; bytes32[] public fraudulentPaymentHashes; mapping(bytes32 => bool) public fraudulentByPaymentHash; // // Events // ----------------------------------------------------------------------------------------------------------------- event AddDoubleSpenderWalletEvent(address wallet); event AddFraudulentOrderHashEvent(bytes32 hash); event AddFraudulentTradeHashEvent(bytes32 hash); event AddFraudulentPaymentHashEvent(bytes32 hash); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the double spender status of given wallet /// @param wallet The wallet address for which to check double spender status /// @return true if wallet is double spender, false otherwise function isDoubleSpenderWallet(address wallet) public view returns (bool) { } /// @notice Get the number of wallets tagged as double spenders /// @return Number of double spender wallets function doubleSpenderWalletsCount() public view returns (uint256) { } /// @notice Add given wallets to store of double spender wallets if not already present /// @param wallet The first wallet to add function addDoubleSpenderWallet(address wallet) public onlyEnabledServiceAction(ADD_DOUBLE_SPENDER_WALLET_ACTION) { } /// @notice Get the number of fraudulent order hashes function fraudulentOrderHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent order /// @param hash The hash to be tested function isFraudulentOrderHash(bytes32 hash) public view returns (bool) { } /// @notice Add given order hash to store of fraudulent order hashes if not already present function addFraudulentOrderHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_ORDER_ACTION) { } /// @notice Get the number of fraudulent trade hashes function fraudulentTradeHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent trade /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent trade, else false function isFraudulentTradeHash(bytes32 hash) public view returns (bool) { } /// @notice Add given trade hash to store of fraudulent trade hashes if not already present function addFraudulentTradeHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_TRADE_ACTION) { } /// @notice Get the number of fraudulent payment hashes function fraudulentPaymentHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent payment /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent payment, else null function isFraudulentPaymentHash(bytes32 hash) public view returns (bool) { } /// @notice Add given payment hash to store of fraudulent payment hashes if not already present function addFraudulentPaymentHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_PAYMENT_ACTION) { } }
registeredServicesMap[service].actionsEnabledMap[actionHash]
365,824
registeredServicesMap[service].actionsEnabledMap[actionHash]
null
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { } modifier notThisAddress(address _address) { } modifier notNullOrThisAddress(address _address) { } modifier notSameAddresses(address _address1, address _address2) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { } /// @notice Destroy this contract function triggerSelfDestruction() public { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { } modifier notDeployer() { } modifier onlyOperator() { } modifier notOperator() { } modifier onlyDeployerOrOperator() { } modifier notDeployerOrOperator() { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Servable * @notice An ownable that contains registered services and their actions */ contract Servable is Ownable { // // Types // ----------------------------------------------------------------------------------------------------------------- struct ServiceInfo { bool registered; uint256 activationTimestamp; mapping(bytes32 => bool) actionsEnabledMap; bytes32[] actionsList; } // // Variables // ----------------------------------------------------------------------------------------------------------------- mapping(address => ServiceInfo) internal registeredServicesMap; uint256 public serviceActivationTimeout; // // Events // ----------------------------------------------------------------------------------------------------------------- event ServiceActivationTimeoutEvent(uint256 timeoutInSeconds); event RegisterServiceEvent(address service); event RegisterServiceDeferredEvent(address service, uint256 timeout); event DeregisterServiceEvent(address service); event EnableServiceActionEvent(address service, string action); event DisableServiceActionEvent(address service, string action); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Set the service activation timeout /// @param timeoutInSeconds The set timeout in unit of seconds function setServiceActivationTimeout(uint256 timeoutInSeconds) public onlyDeployer { } /// @notice Register a service contract whose activation is immediate /// @param service The address of the service contract to be registered function registerService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Register a service contract whose activation is deferred by the service activation timeout /// @param service The address of the service contract to be registered function registerServiceDeferred(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Deregister a service contract /// @param service The address of the service contract to be deregistered function deregisterService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in an already registered service contract /// @param service The address of the registered service contract /// @param action The name of the action to be enabled function enableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in a service contract /// @param service The address of the service contract /// @param action The name of the action to be disabled function disableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Gauge whether a service contract is registered /// @param service The address of the service contract /// @return true if service is registered, else false function isRegisteredService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract is registered and active /// @param service The address of the service contract /// @return true if service is registered and activate, else false function isRegisteredActiveService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract action is enabled which implies also registered and active /// @param service The address of the service contract /// @param action The name of action function isEnabledServiceAction(address service, string memory action) public view returns (bool) { } // // Internal functions // ----------------------------------------------------------------------------------------------------------------- function hashString(string memory _string) internal pure returns (bytes32) { } // // Private functions // ----------------------------------------------------------------------------------------------------------------- function _registerService(address service, uint256 timeout) private { } // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyActiveService() { require(<FILL_ME>) _; } modifier onlyEnabledServiceAction(string memory action) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title FraudChallenge * @notice Where fraud challenge results are found */ contract FraudChallenge is Ownable, Servable { // // Constants // ----------------------------------------------------------------------------------------------------------------- string constant public ADD_SEIZED_WALLET_ACTION = "add_seized_wallet"; string constant public ADD_DOUBLE_SPENDER_WALLET_ACTION = "add_double_spender_wallet"; string constant public ADD_FRAUDULENT_ORDER_ACTION = "add_fraudulent_order"; string constant public ADD_FRAUDULENT_TRADE_ACTION = "add_fraudulent_trade"; string constant public ADD_FRAUDULENT_PAYMENT_ACTION = "add_fraudulent_payment"; // // Variables // ----------------------------------------------------------------------------------------------------------------- address[] public doubleSpenderWallets; mapping(address => bool) public doubleSpenderByWallet; bytes32[] public fraudulentOrderHashes; mapping(bytes32 => bool) public fraudulentByOrderHash; bytes32[] public fraudulentTradeHashes; mapping(bytes32 => bool) public fraudulentByTradeHash; bytes32[] public fraudulentPaymentHashes; mapping(bytes32 => bool) public fraudulentByPaymentHash; // // Events // ----------------------------------------------------------------------------------------------------------------- event AddDoubleSpenderWalletEvent(address wallet); event AddFraudulentOrderHashEvent(bytes32 hash); event AddFraudulentTradeHashEvent(bytes32 hash); event AddFraudulentPaymentHashEvent(bytes32 hash); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the double spender status of given wallet /// @param wallet The wallet address for which to check double spender status /// @return true if wallet is double spender, false otherwise function isDoubleSpenderWallet(address wallet) public view returns (bool) { } /// @notice Get the number of wallets tagged as double spenders /// @return Number of double spender wallets function doubleSpenderWalletsCount() public view returns (uint256) { } /// @notice Add given wallets to store of double spender wallets if not already present /// @param wallet The first wallet to add function addDoubleSpenderWallet(address wallet) public onlyEnabledServiceAction(ADD_DOUBLE_SPENDER_WALLET_ACTION) { } /// @notice Get the number of fraudulent order hashes function fraudulentOrderHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent order /// @param hash The hash to be tested function isFraudulentOrderHash(bytes32 hash) public view returns (bool) { } /// @notice Add given order hash to store of fraudulent order hashes if not already present function addFraudulentOrderHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_ORDER_ACTION) { } /// @notice Get the number of fraudulent trade hashes function fraudulentTradeHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent trade /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent trade, else false function isFraudulentTradeHash(bytes32 hash) public view returns (bool) { } /// @notice Add given trade hash to store of fraudulent trade hashes if not already present function addFraudulentTradeHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_TRADE_ACTION) { } /// @notice Get the number of fraudulent payment hashes function fraudulentPaymentHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent payment /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent payment, else null function isFraudulentPaymentHash(bytes32 hash) public view returns (bool) { } /// @notice Add given payment hash to store of fraudulent payment hashes if not already present function addFraudulentPaymentHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_PAYMENT_ACTION) { } }
isRegisteredActiveService(msg.sender)
365,824
isRegisteredActiveService(msg.sender)
null
pragma solidity >=0.4.25 <0.6.0; pragma experimental ABIEncoderV2; /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Modifiable * @notice A contract with basic modifiers */ contract Modifiable { // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier notNullAddress(address _address) { } modifier notThisAddress(address _address) { } modifier notNullOrThisAddress(address _address) { } modifier notSameAddresses(address _address1, address _address2) { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title SelfDestructible * @notice Contract that allows for self-destruction */ contract SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- bool public selfDestructionDisabled; // // Events // ----------------------------------------------------------------------------------------------------------------- event SelfDestructionDisabledEvent(address wallet); event TriggerSelfDestructionEvent(address wallet); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the address of the destructor role function destructor() public view returns (address); /// @notice Disable self-destruction of this contract /// @dev This operation can not be undone function disableSelfDestruction() public { } /// @notice Destroy this contract function triggerSelfDestruction() public { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Ownable * @notice A modifiable that has ownership roles */ contract Ownable is Modifiable, SelfDestructible { // // Variables // ----------------------------------------------------------------------------------------------------------------- address public deployer; address public operator; // // Events // ----------------------------------------------------------------------------------------------------------------- event SetDeployerEvent(address oldDeployer, address newDeployer); event SetOperatorEvent(address oldOperator, address newOperator); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address _deployer) internal notNullOrThisAddress(_deployer) { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Return the address that is able to initiate self-destruction function destructor() public view returns (address) { } /// @notice Set the deployer of this contract /// @param newDeployer The address of the new deployer function setDeployer(address newDeployer) public onlyDeployer notNullOrThisAddress(newDeployer) { } /// @notice Set the operator of this contract /// @param newOperator The address of the new operator function setOperator(address newOperator) public onlyOperator notNullOrThisAddress(newOperator) { } /// @notice Gauge whether message sender is deployer or not /// @return true if msg.sender is deployer, else false function isDeployer() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or not /// @return true if msg.sender is operator, else false function isOperator() internal view returns (bool) { } /// @notice Gauge whether message sender is operator or deployer on the one hand, or none of these on these on /// on the other hand /// @return true if msg.sender is operator, else false function isDeployerOrOperator() internal view returns (bool) { } // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyDeployer() { } modifier notDeployer() { } modifier onlyOperator() { } modifier notOperator() { } modifier onlyDeployerOrOperator() { } modifier notDeployerOrOperator() { } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title Servable * @notice An ownable that contains registered services and their actions */ contract Servable is Ownable { // // Types // ----------------------------------------------------------------------------------------------------------------- struct ServiceInfo { bool registered; uint256 activationTimestamp; mapping(bytes32 => bool) actionsEnabledMap; bytes32[] actionsList; } // // Variables // ----------------------------------------------------------------------------------------------------------------- mapping(address => ServiceInfo) internal registeredServicesMap; uint256 public serviceActivationTimeout; // // Events // ----------------------------------------------------------------------------------------------------------------- event ServiceActivationTimeoutEvent(uint256 timeoutInSeconds); event RegisterServiceEvent(address service); event RegisterServiceDeferredEvent(address service, uint256 timeout); event DeregisterServiceEvent(address service); event EnableServiceActionEvent(address service, string action); event DisableServiceActionEvent(address service, string action); // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Set the service activation timeout /// @param timeoutInSeconds The set timeout in unit of seconds function setServiceActivationTimeout(uint256 timeoutInSeconds) public onlyDeployer { } /// @notice Register a service contract whose activation is immediate /// @param service The address of the service contract to be registered function registerService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Register a service contract whose activation is deferred by the service activation timeout /// @param service The address of the service contract to be registered function registerServiceDeferred(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Deregister a service contract /// @param service The address of the service contract to be deregistered function deregisterService(address service) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in an already registered service contract /// @param service The address of the registered service contract /// @param action The name of the action to be enabled function enableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Enable a named action in a service contract /// @param service The address of the service contract /// @param action The name of the action to be disabled function disableServiceAction(address service, string memory action) public onlyDeployer notNullOrThisAddress(service) { } /// @notice Gauge whether a service contract is registered /// @param service The address of the service contract /// @return true if service is registered, else false function isRegisteredService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract is registered and active /// @param service The address of the service contract /// @return true if service is registered and activate, else false function isRegisteredActiveService(address service) public view returns (bool) { } /// @notice Gauge whether a service contract action is enabled which implies also registered and active /// @param service The address of the service contract /// @param action The name of action function isEnabledServiceAction(address service, string memory action) public view returns (bool) { } // // Internal functions // ----------------------------------------------------------------------------------------------------------------- function hashString(string memory _string) internal pure returns (bytes32) { } // // Private functions // ----------------------------------------------------------------------------------------------------------------- function _registerService(address service, uint256 timeout) private { } // // Modifiers // ----------------------------------------------------------------------------------------------------------------- modifier onlyActiveService() { } modifier onlyEnabledServiceAction(string memory action) { require(<FILL_ME>) _; } } /* * Hubii Nahmii * * Compliant with the Hubii Nahmii specification v0.12. * * Copyright (C) 2017-2018 Hubii AS */ /** * @title FraudChallenge * @notice Where fraud challenge results are found */ contract FraudChallenge is Ownable, Servable { // // Constants // ----------------------------------------------------------------------------------------------------------------- string constant public ADD_SEIZED_WALLET_ACTION = "add_seized_wallet"; string constant public ADD_DOUBLE_SPENDER_WALLET_ACTION = "add_double_spender_wallet"; string constant public ADD_FRAUDULENT_ORDER_ACTION = "add_fraudulent_order"; string constant public ADD_FRAUDULENT_TRADE_ACTION = "add_fraudulent_trade"; string constant public ADD_FRAUDULENT_PAYMENT_ACTION = "add_fraudulent_payment"; // // Variables // ----------------------------------------------------------------------------------------------------------------- address[] public doubleSpenderWallets; mapping(address => bool) public doubleSpenderByWallet; bytes32[] public fraudulentOrderHashes; mapping(bytes32 => bool) public fraudulentByOrderHash; bytes32[] public fraudulentTradeHashes; mapping(bytes32 => bool) public fraudulentByTradeHash; bytes32[] public fraudulentPaymentHashes; mapping(bytes32 => bool) public fraudulentByPaymentHash; // // Events // ----------------------------------------------------------------------------------------------------------------- event AddDoubleSpenderWalletEvent(address wallet); event AddFraudulentOrderHashEvent(bytes32 hash); event AddFraudulentTradeHashEvent(bytes32 hash); event AddFraudulentPaymentHashEvent(bytes32 hash); // // Constructor // ----------------------------------------------------------------------------------------------------------------- constructor(address deployer) Ownable(deployer) public { } // // Functions // ----------------------------------------------------------------------------------------------------------------- /// @notice Get the double spender status of given wallet /// @param wallet The wallet address for which to check double spender status /// @return true if wallet is double spender, false otherwise function isDoubleSpenderWallet(address wallet) public view returns (bool) { } /// @notice Get the number of wallets tagged as double spenders /// @return Number of double spender wallets function doubleSpenderWalletsCount() public view returns (uint256) { } /// @notice Add given wallets to store of double spender wallets if not already present /// @param wallet The first wallet to add function addDoubleSpenderWallet(address wallet) public onlyEnabledServiceAction(ADD_DOUBLE_SPENDER_WALLET_ACTION) { } /// @notice Get the number of fraudulent order hashes function fraudulentOrderHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent order /// @param hash The hash to be tested function isFraudulentOrderHash(bytes32 hash) public view returns (bool) { } /// @notice Add given order hash to store of fraudulent order hashes if not already present function addFraudulentOrderHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_ORDER_ACTION) { } /// @notice Get the number of fraudulent trade hashes function fraudulentTradeHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent trade /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent trade, else false function isFraudulentTradeHash(bytes32 hash) public view returns (bool) { } /// @notice Add given trade hash to store of fraudulent trade hashes if not already present function addFraudulentTradeHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_TRADE_ACTION) { } /// @notice Get the number of fraudulent payment hashes function fraudulentPaymentHashesCount() public view returns (uint256) { } /// @notice Get the state about whether the given hash equals the hash of a fraudulent payment /// @param hash The hash to be tested /// @return true if hash is the one of a fraudulent payment, else null function isFraudulentPaymentHash(bytes32 hash) public view returns (bool) { } /// @notice Add given payment hash to store of fraudulent payment hashes if not already present function addFraudulentPaymentHash(bytes32 hash) public onlyEnabledServiceAction(ADD_FRAUDULENT_PAYMENT_ACTION) { } }
isEnabledServiceAction(msg.sender,action)
365,824
isEnabledServiceAction(msg.sender,action)
"Max NFT per address exceeded"
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } pragma solidity >=0.7.0 <0.9.0; contract JungleEraPanda is ERC721Enumerable, Ownable { using Strings for uint256; string baseURI; string public baseExtension = ".json"; uint256 public cost = 0.08 ether; uint256 public maxSupply = 9999; uint256 public maxMintAmount = 5; uint256 public maxOwnerAmount = 5; uint256 public maxOwnerAmountPresale = 3; bool public paused = true; bool public revealed = false; string public notRevealedUri; bool public onlyWhitelisted = true; address[] public whitelistedAddresses; mapping(address => uint256) public addressMintedBalance; constructor( string memory _name, string memory _symbol, string memory _initBaseURI, string memory _initNotRevealedUri ) ERC721(_name, _symbol) { } // internal function _baseURI() internal view virtual override returns (string memory) { } function isWhitelisted(address _user) public view returns (bool) { } function whitelistUsers(address[] calldata _users) public onlyOwner { } function setOnlyWhitelisted(bool _state) public onlyOwner { } // public function mint(uint256 _mintAmount) public payable { uint256 supply = totalSupply(); uint256 ownerMintedCount = addressMintedBalance[msg.sender]; require(!paused, "The contract is paused"); require(_mintAmount > 0, "Need to mint at least 1 NFT"); require(_mintAmount <= maxMintAmount, "Max mint amount per session exceeded"); require(supply + _mintAmount <= maxSupply, "Max NFT limit exceeded"); require(<FILL_ME>) if (msg.sender != owner()) { if(onlyWhitelisted == true) { require(isWhitelisted(msg.sender), "User is not whitelisted"); require(ownerMintedCount + _mintAmount <= maxOwnerAmountPresale, "Presale max NFT per address exceeded"); } require(msg.value >= cost * _mintAmount, "Insufficient funds"); } for (uint256 i = 1; i <= _mintAmount; i++) { addressMintedBalance[msg.sender]++; _safeMint(msg.sender, supply + i); } } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } //only owner function reveal() public onlyOwner { } function setCost(uint256 _newCost) public onlyOwner { } function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner { } function setmaxOwnerAmount(uint256 _newmaxOwnerAmount) public onlyOwner { } function setmaxOwnerAmountPresale(uint256 _newmaxOwnerAmountPresale) public onlyOwner { } function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function setBaseExtension(string memory _newBaseExtension) public onlyOwner { } function pause(bool _state) public onlyOwner { } function withdraw() public payable onlyOwner { } }
ownerMintedCount+_mintAmount<=maxOwnerAmount,"Max NFT per address exceeded"
365,874
ownerMintedCount+_mintAmount<=maxOwnerAmount
"Presale max NFT per address exceeded"
pragma solidity ^0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } pragma solidity >=0.7.0 <0.9.0; contract JungleEraPanda is ERC721Enumerable, Ownable { using Strings for uint256; string baseURI; string public baseExtension = ".json"; uint256 public cost = 0.08 ether; uint256 public maxSupply = 9999; uint256 public maxMintAmount = 5; uint256 public maxOwnerAmount = 5; uint256 public maxOwnerAmountPresale = 3; bool public paused = true; bool public revealed = false; string public notRevealedUri; bool public onlyWhitelisted = true; address[] public whitelistedAddresses; mapping(address => uint256) public addressMintedBalance; constructor( string memory _name, string memory _symbol, string memory _initBaseURI, string memory _initNotRevealedUri ) ERC721(_name, _symbol) { } // internal function _baseURI() internal view virtual override returns (string memory) { } function isWhitelisted(address _user) public view returns (bool) { } function whitelistUsers(address[] calldata _users) public onlyOwner { } function setOnlyWhitelisted(bool _state) public onlyOwner { } // public function mint(uint256 _mintAmount) public payable { uint256 supply = totalSupply(); uint256 ownerMintedCount = addressMintedBalance[msg.sender]; require(!paused, "The contract is paused"); require(_mintAmount > 0, "Need to mint at least 1 NFT"); require(_mintAmount <= maxMintAmount, "Max mint amount per session exceeded"); require(supply + _mintAmount <= maxSupply, "Max NFT limit exceeded"); require(ownerMintedCount + _mintAmount <= maxOwnerAmount, "Max NFT per address exceeded"); if (msg.sender != owner()) { if(onlyWhitelisted == true) { require(isWhitelisted(msg.sender), "User is not whitelisted"); require(<FILL_ME>) } require(msg.value >= cost * _mintAmount, "Insufficient funds"); } for (uint256 i = 1; i <= _mintAmount; i++) { addressMintedBalance[msg.sender]++; _safeMint(msg.sender, supply + i); } } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } //only owner function reveal() public onlyOwner { } function setCost(uint256 _newCost) public onlyOwner { } function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner { } function setmaxOwnerAmount(uint256 _newmaxOwnerAmount) public onlyOwner { } function setmaxOwnerAmountPresale(uint256 _newmaxOwnerAmountPresale) public onlyOwner { } function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function setBaseExtension(string memory _newBaseExtension) public onlyOwner { } function pause(bool _state) public onlyOwner { } function withdraw() public payable onlyOwner { } }
ownerMintedCount+_mintAmount<=maxOwnerAmountPresale,"Presale max NFT per address exceeded"
365,874
ownerMintedCount+_mintAmount<=maxOwnerAmountPresale
"Not enough tokens left"
pragma solidity ^0.8.2; contract CryptoSkullPunks is ERC721, ERC721Enumerable, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; //project info string public projectName = "Crypto Skull Punks"; string public projectSym = "SPUNK"; uint256 public mintPrice = 0.02 ether; uint256 public maxSupply = 10000; uint256 public mintLimit = 10; uint256 public freeMintAmount = 1000; bool public publicSaleState = false; constructor() ERC721(projectName, projectSym) {} function _baseURI() internal pure override returns (string memory) { } //toggle public sale function changeStatePublicSale() public onlyOwner returns(bool) { } //public mint function function mint(uint numberOfTokens) external payable { } //backend mint function mintInternal(address wallet, uint amount) internal { uint currentTokenSupply = _tokenIdCounter.current(); require(<FILL_ME>) for(uint i = 0; i< amount; i++){ currentTokenSupply++; _safeMint(wallet, currentTokenSupply); _tokenIdCounter.increment(); } } //change free mint amount function setfreeAmount(uint16 _newFreeMints) public onlyOwner() { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } // The following functions are overrides required by Solidity. function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } //cashout function withdraw() public onlyOwner { } }
(currentTokenSupply+amount)<=maxSupply,"Not enough tokens left"
365,885
(currentTokenSupply+amount)<=maxSupply
"Invalid wallet address"
pragma solidity 0.6.12; interface CCM { function crossChain(uint64 _toChainId, bytes calldata _toContract, bytes calldata _method, bytes calldata _txData) external returns (bool); } interface CCMProxy { function getEthCrossChainManager() external view returns (address); } /// @title The LockProxy contract for Switcheo TradeHub /// @author Switcheo Network /// @notice This contract faciliates deposits and withdrawals to Switcheo TradeHub. /// @dev The contract also allows for additional features in the future through "extension" contracts. contract LockProxy is ReentrancyGuard { using SafeMath for uint256; // used for cross-chain addExtension and removeExtension methods struct ExtensionTxArgs { bytes extensionAddress; } // used for cross-chain registerAsset method struct RegisterAssetTxArgs { bytes assetHash; bytes nativeAssetHash; } // used for cross-chain lock and unlock methods struct TransferTxArgs { bytes fromAssetHash; bytes toAssetHash; bytes toAddress; uint256 amount; uint256 feeAmount; bytes feeAddress; bytes fromAddress; uint256 nonce; } // used to create a unique salt for wallet creation bytes public constant SALT_PREFIX = "switcheo-eth-wallet-factory-v1"; address public constant ETH_ASSET_HASH = address(0); CCMProxy public ccmProxy; uint64 public counterpartChainId; uint256 public currentNonce = 0; // a mapping of assetHashes to the hash of // (associated proxy address on Switcheo TradeHub, associated asset hash on Switcheo TradeHub) mapping(address => bytes32) public registry; // a record of signed messages to prevent replay attacks mapping(bytes32 => bool) public seenMessages; // a mapping of extension contracts mapping(address => bool) public extensions; // a record of created wallets mapping(address => bool) public wallets; event LockEvent( address fromAssetHash, address fromAddress, uint64 toChainId, bytes toAssetHash, bytes toAddress, bytes txArgs ); event UnlockEvent( address toAssetHash, address toAddress, uint256 amount, bytes txArgs ); constructor(address _ccmProxyAddress, uint64 _counterpartChainId) public { } modifier onlyManagerContract() { } /// @dev Allow this contract to receive Ethereum receive() external payable {} /// @dev Allow this contract to receive ERC223 tokens /// An empty implementation is required so that the ERC223 token will not /// throw an error on transfer, this is specific to ERC223 tokens which /// require this implementation, e.g. DGTX function tokenFallback(address, uint, bytes calldata) external {} /// @dev Calculate the wallet address for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @param _bytecodeHash the hash of the wallet contract's bytecode /// @return the wallet address function getWalletAddress( address _ownerAddress, bytes calldata _swthAddress, bytes32 _bytecodeHash ) external view returns (address) { } /// @dev Create the wallet for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @return true if success function createWallet( address _ownerAddress, bytes calldata _swthAddress ) external nonReentrant returns (bool) { } /// @dev Add a contract as an extension /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function addExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Remove a contract from the extensions mapping /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function removeExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Marks an asset as registered by mapping the asset's address to /// the specified _fromContractAddr and assetHash on Switcheo TradeHub /// @param _argsBz the serialized RegisterAssetTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function registerAsset( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a deposit from a Wallet contract /// @param _walletAddress address of the wallet contract, the wallet contract /// does not receive ETH in this call, but _walletAddress still needs to be payable /// since the wallet contract can receive ETH, there would be compile errors otherwise /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: nonce, to prevent replay attacks /// @param _values[3]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens /// @param _v: the v value of the wallet owner's signature /// @param _rs: the r, s values of the wallet owner's signature function lockFromWallet( address payable _walletAddress, address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values, uint8 _v, bytes32[] calldata _rs ) external nonReentrant returns (bool) { require(<FILL_ME>) Wallet wallet = Wallet(_walletAddress); _validateLockFromWallet( wallet.owner(), _assetHash, _targetProxyHash, _toAssetHash, _feeAddress, _values, _v, _rs ); // it is very important that this function validates the success of a transfer correctly // since, once this line is passed, the deposit is assumed to be successful // which will eventually result in the specified amount of tokens being minted for the // wallet.swthAddress on Switcheo TradeHub _transferInFromWallet(_walletAddress, _assetHash, _values[0], _values[3]); _lock( _assetHash, _targetProxyHash, _toAssetHash, wallet.swthAddress(), _values[0], _values[1], _feeAddress ); return true; } /// @dev Performs a deposit /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAddress the hex version of the Switcheo TradeHub address to deposit to /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens function lock( address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAddress, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values ) external payable nonReentrant returns (bool) { } /// @dev Performs a withdrawal that was initiated on Switcheo TradeHub /// @param _argsBz the serialized TransferTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function unlock( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a transfer of funds, this is only callable by approved extension contracts /// the `nonReentrant` guard is intentionally not added to this function, to allow for more flexibility. /// The calling contract should be secure and have its own `nonReentrant` guard as needed. /// @param _receivingAddress the address to transfer to /// @param _assetHash the asset to transfer /// @param _amount the amount to transfer /// @return true if success function extensionTransfer( address _receivingAddress, address _assetHash, uint256 _amount ) external returns (bool) { } /// @dev Marks an asset as registered by associating it to a specified Switcheo TradeHub proxy and asset hash /// @param _assetHash the address of the asset to mark /// @param _proxyAddress the associated proxy address on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub function _markAssetAsRegistered( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private { } /// @dev Validates that an asset's registration matches the given params /// @param _assetHash the address of the asset to check /// @param _proxyAddress the expected proxy address on Switcheo TradeHub /// @param _toAssetHash the expected asset hash on Switcheo TradeHub function _validateAssetRegistration( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private view { } /// @dev validates the asset registration and calls the CCM contract function _lock( address _fromAssetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _toAddress, uint256 _amount, uint256 _feeAmount, bytes memory _feeAddress ) private { } /// @dev validate the signature for lockFromWallet function _validateLockFromWallet( address _walletOwner, address _assetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _feeAddress, uint256[] memory _values, uint8 _v, bytes32[] memory _rs ) private { } /// @dev transfers funds from a Wallet contract into this contract /// the difference between this contract's before and after balance must equal _amount /// this is assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferInFromWallet( address payable _walletAddress, address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from an address into this contract /// for ETH transfers, we only check that msg.value == _amount, and _callAmount is ignored /// for token transfers, the difference between this contract's before and after balance must equal _amount /// these checks are assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferIn( address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from this contract to the _toAddress function _transferOut( address _toAddress, address _assetHash, uint256 _amount ) private { } /// @dev validates a signature against the specified user address function _validateSignature( bytes32 _message, address _user, uint8 _v, bytes32 _r, bytes32 _s ) private pure { } function _serializeTransferTxArgs(TransferTxArgs memory args) private pure returns (bytes memory) { } function _deserializeTransferTxArgs(bytes memory valueBz) private pure returns (TransferTxArgs memory) { } function _deserializeRegisterAssetTxArgs(bytes memory valueBz) private pure returns (RegisterAssetTxArgs memory) { } function _deserializeExtensionTxArgs(bytes memory valueBz) private pure returns (ExtensionTxArgs memory) { } function _getCcm() private view returns (CCM) { } function _getNextNonce() private returns (uint256) { } function _getSalt( address _ownerAddress, bytes memory _swthAddress ) private pure returns (bytes32) { } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(ERC20 token, bytes memory data) private { } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `_isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function _isContract(address account) private view returns (bool) { } }
wallets[_walletAddress],"Invalid wallet address"
365,890
wallets[_walletAddress]
"Invalid extension"
pragma solidity 0.6.12; interface CCM { function crossChain(uint64 _toChainId, bytes calldata _toContract, bytes calldata _method, bytes calldata _txData) external returns (bool); } interface CCMProxy { function getEthCrossChainManager() external view returns (address); } /// @title The LockProxy contract for Switcheo TradeHub /// @author Switcheo Network /// @notice This contract faciliates deposits and withdrawals to Switcheo TradeHub. /// @dev The contract also allows for additional features in the future through "extension" contracts. contract LockProxy is ReentrancyGuard { using SafeMath for uint256; // used for cross-chain addExtension and removeExtension methods struct ExtensionTxArgs { bytes extensionAddress; } // used for cross-chain registerAsset method struct RegisterAssetTxArgs { bytes assetHash; bytes nativeAssetHash; } // used for cross-chain lock and unlock methods struct TransferTxArgs { bytes fromAssetHash; bytes toAssetHash; bytes toAddress; uint256 amount; uint256 feeAmount; bytes feeAddress; bytes fromAddress; uint256 nonce; } // used to create a unique salt for wallet creation bytes public constant SALT_PREFIX = "switcheo-eth-wallet-factory-v1"; address public constant ETH_ASSET_HASH = address(0); CCMProxy public ccmProxy; uint64 public counterpartChainId; uint256 public currentNonce = 0; // a mapping of assetHashes to the hash of // (associated proxy address on Switcheo TradeHub, associated asset hash on Switcheo TradeHub) mapping(address => bytes32) public registry; // a record of signed messages to prevent replay attacks mapping(bytes32 => bool) public seenMessages; // a mapping of extension contracts mapping(address => bool) public extensions; // a record of created wallets mapping(address => bool) public wallets; event LockEvent( address fromAssetHash, address fromAddress, uint64 toChainId, bytes toAssetHash, bytes toAddress, bytes txArgs ); event UnlockEvent( address toAssetHash, address toAddress, uint256 amount, bytes txArgs ); constructor(address _ccmProxyAddress, uint64 _counterpartChainId) public { } modifier onlyManagerContract() { } /// @dev Allow this contract to receive Ethereum receive() external payable {} /// @dev Allow this contract to receive ERC223 tokens /// An empty implementation is required so that the ERC223 token will not /// throw an error on transfer, this is specific to ERC223 tokens which /// require this implementation, e.g. DGTX function tokenFallback(address, uint, bytes calldata) external {} /// @dev Calculate the wallet address for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @param _bytecodeHash the hash of the wallet contract's bytecode /// @return the wallet address function getWalletAddress( address _ownerAddress, bytes calldata _swthAddress, bytes32 _bytecodeHash ) external view returns (address) { } /// @dev Create the wallet for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @return true if success function createWallet( address _ownerAddress, bytes calldata _swthAddress ) external nonReentrant returns (bool) { } /// @dev Add a contract as an extension /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function addExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Remove a contract from the extensions mapping /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function removeExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Marks an asset as registered by mapping the asset's address to /// the specified _fromContractAddr and assetHash on Switcheo TradeHub /// @param _argsBz the serialized RegisterAssetTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function registerAsset( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a deposit from a Wallet contract /// @param _walletAddress address of the wallet contract, the wallet contract /// does not receive ETH in this call, but _walletAddress still needs to be payable /// since the wallet contract can receive ETH, there would be compile errors otherwise /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: nonce, to prevent replay attacks /// @param _values[3]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens /// @param _v: the v value of the wallet owner's signature /// @param _rs: the r, s values of the wallet owner's signature function lockFromWallet( address payable _walletAddress, address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values, uint8 _v, bytes32[] calldata _rs ) external nonReentrant returns (bool) { } /// @dev Performs a deposit /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAddress the hex version of the Switcheo TradeHub address to deposit to /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens function lock( address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAddress, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values ) external payable nonReentrant returns (bool) { } /// @dev Performs a withdrawal that was initiated on Switcheo TradeHub /// @param _argsBz the serialized TransferTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function unlock( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a transfer of funds, this is only callable by approved extension contracts /// the `nonReentrant` guard is intentionally not added to this function, to allow for more flexibility. /// The calling contract should be secure and have its own `nonReentrant` guard as needed. /// @param _receivingAddress the address to transfer to /// @param _assetHash the asset to transfer /// @param _amount the amount to transfer /// @return true if success function extensionTransfer( address _receivingAddress, address _assetHash, uint256 _amount ) external returns (bool) { require(<FILL_ME>) if (_assetHash == ETH_ASSET_HASH) { // we use `call` here since the _receivingAddress could be a contract // see https://diligence.consensys.net/blog/2019/09/stop-using-soliditys-transfer-now/ // for more info (bool success, ) = _receivingAddress.call{value: _amount}(""); require(success, "Transfer failed"); return true; } ERC20 token = ERC20(_assetHash); _callOptionalReturn( token, abi.encodeWithSelector( token.approve.selector, _receivingAddress, _amount ) ); return true; } /// @dev Marks an asset as registered by associating it to a specified Switcheo TradeHub proxy and asset hash /// @param _assetHash the address of the asset to mark /// @param _proxyAddress the associated proxy address on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub function _markAssetAsRegistered( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private { } /// @dev Validates that an asset's registration matches the given params /// @param _assetHash the address of the asset to check /// @param _proxyAddress the expected proxy address on Switcheo TradeHub /// @param _toAssetHash the expected asset hash on Switcheo TradeHub function _validateAssetRegistration( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private view { } /// @dev validates the asset registration and calls the CCM contract function _lock( address _fromAssetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _toAddress, uint256 _amount, uint256 _feeAmount, bytes memory _feeAddress ) private { } /// @dev validate the signature for lockFromWallet function _validateLockFromWallet( address _walletOwner, address _assetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _feeAddress, uint256[] memory _values, uint8 _v, bytes32[] memory _rs ) private { } /// @dev transfers funds from a Wallet contract into this contract /// the difference between this contract's before and after balance must equal _amount /// this is assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferInFromWallet( address payable _walletAddress, address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from an address into this contract /// for ETH transfers, we only check that msg.value == _amount, and _callAmount is ignored /// for token transfers, the difference between this contract's before and after balance must equal _amount /// these checks are assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferIn( address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from this contract to the _toAddress function _transferOut( address _toAddress, address _assetHash, uint256 _amount ) private { } /// @dev validates a signature against the specified user address function _validateSignature( bytes32 _message, address _user, uint8 _v, bytes32 _r, bytes32 _s ) private pure { } function _serializeTransferTxArgs(TransferTxArgs memory args) private pure returns (bytes memory) { } function _deserializeTransferTxArgs(bytes memory valueBz) private pure returns (TransferTxArgs memory) { } function _deserializeRegisterAssetTxArgs(bytes memory valueBz) private pure returns (RegisterAssetTxArgs memory) { } function _deserializeExtensionTxArgs(bytes memory valueBz) private pure returns (ExtensionTxArgs memory) { } function _getCcm() private view returns (CCM) { } function _getNextNonce() private returns (uint256) { } function _getSalt( address _ownerAddress, bytes memory _swthAddress ) private pure returns (bytes32) { } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(ERC20 token, bytes memory data) private { } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `_isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function _isContract(address account) private view returns (bool) { } }
extensions[msg.sender]==true,"Invalid extension"
365,890
extensions[msg.sender]==true
"Asset already registered"
pragma solidity 0.6.12; interface CCM { function crossChain(uint64 _toChainId, bytes calldata _toContract, bytes calldata _method, bytes calldata _txData) external returns (bool); } interface CCMProxy { function getEthCrossChainManager() external view returns (address); } /// @title The LockProxy contract for Switcheo TradeHub /// @author Switcheo Network /// @notice This contract faciliates deposits and withdrawals to Switcheo TradeHub. /// @dev The contract also allows for additional features in the future through "extension" contracts. contract LockProxy is ReentrancyGuard { using SafeMath for uint256; // used for cross-chain addExtension and removeExtension methods struct ExtensionTxArgs { bytes extensionAddress; } // used for cross-chain registerAsset method struct RegisterAssetTxArgs { bytes assetHash; bytes nativeAssetHash; } // used for cross-chain lock and unlock methods struct TransferTxArgs { bytes fromAssetHash; bytes toAssetHash; bytes toAddress; uint256 amount; uint256 feeAmount; bytes feeAddress; bytes fromAddress; uint256 nonce; } // used to create a unique salt for wallet creation bytes public constant SALT_PREFIX = "switcheo-eth-wallet-factory-v1"; address public constant ETH_ASSET_HASH = address(0); CCMProxy public ccmProxy; uint64 public counterpartChainId; uint256 public currentNonce = 0; // a mapping of assetHashes to the hash of // (associated proxy address on Switcheo TradeHub, associated asset hash on Switcheo TradeHub) mapping(address => bytes32) public registry; // a record of signed messages to prevent replay attacks mapping(bytes32 => bool) public seenMessages; // a mapping of extension contracts mapping(address => bool) public extensions; // a record of created wallets mapping(address => bool) public wallets; event LockEvent( address fromAssetHash, address fromAddress, uint64 toChainId, bytes toAssetHash, bytes toAddress, bytes txArgs ); event UnlockEvent( address toAssetHash, address toAddress, uint256 amount, bytes txArgs ); constructor(address _ccmProxyAddress, uint64 _counterpartChainId) public { } modifier onlyManagerContract() { } /// @dev Allow this contract to receive Ethereum receive() external payable {} /// @dev Allow this contract to receive ERC223 tokens /// An empty implementation is required so that the ERC223 token will not /// throw an error on transfer, this is specific to ERC223 tokens which /// require this implementation, e.g. DGTX function tokenFallback(address, uint, bytes calldata) external {} /// @dev Calculate the wallet address for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @param _bytecodeHash the hash of the wallet contract's bytecode /// @return the wallet address function getWalletAddress( address _ownerAddress, bytes calldata _swthAddress, bytes32 _bytecodeHash ) external view returns (address) { } /// @dev Create the wallet for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @return true if success function createWallet( address _ownerAddress, bytes calldata _swthAddress ) external nonReentrant returns (bool) { } /// @dev Add a contract as an extension /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function addExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Remove a contract from the extensions mapping /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function removeExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Marks an asset as registered by mapping the asset's address to /// the specified _fromContractAddr and assetHash on Switcheo TradeHub /// @param _argsBz the serialized RegisterAssetTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function registerAsset( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a deposit from a Wallet contract /// @param _walletAddress address of the wallet contract, the wallet contract /// does not receive ETH in this call, but _walletAddress still needs to be payable /// since the wallet contract can receive ETH, there would be compile errors otherwise /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: nonce, to prevent replay attacks /// @param _values[3]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens /// @param _v: the v value of the wallet owner's signature /// @param _rs: the r, s values of the wallet owner's signature function lockFromWallet( address payable _walletAddress, address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values, uint8 _v, bytes32[] calldata _rs ) external nonReentrant returns (bool) { } /// @dev Performs a deposit /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAddress the hex version of the Switcheo TradeHub address to deposit to /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens function lock( address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAddress, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values ) external payable nonReentrant returns (bool) { } /// @dev Performs a withdrawal that was initiated on Switcheo TradeHub /// @param _argsBz the serialized TransferTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function unlock( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a transfer of funds, this is only callable by approved extension contracts /// the `nonReentrant` guard is intentionally not added to this function, to allow for more flexibility. /// The calling contract should be secure and have its own `nonReentrant` guard as needed. /// @param _receivingAddress the address to transfer to /// @param _assetHash the asset to transfer /// @param _amount the amount to transfer /// @return true if success function extensionTransfer( address _receivingAddress, address _assetHash, uint256 _amount ) external returns (bool) { } /// @dev Marks an asset as registered by associating it to a specified Switcheo TradeHub proxy and asset hash /// @param _assetHash the address of the asset to mark /// @param _proxyAddress the associated proxy address on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub function _markAssetAsRegistered( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private { require(_proxyAddress.length == 20, "Invalid proxyAddress"); require(<FILL_ME>) bytes32 value = keccak256(abi.encodePacked( _proxyAddress, _toAssetHash )); registry[_assetHash] = value; } /// @dev Validates that an asset's registration matches the given params /// @param _assetHash the address of the asset to check /// @param _proxyAddress the expected proxy address on Switcheo TradeHub /// @param _toAssetHash the expected asset hash on Switcheo TradeHub function _validateAssetRegistration( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private view { } /// @dev validates the asset registration and calls the CCM contract function _lock( address _fromAssetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _toAddress, uint256 _amount, uint256 _feeAmount, bytes memory _feeAddress ) private { } /// @dev validate the signature for lockFromWallet function _validateLockFromWallet( address _walletOwner, address _assetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _feeAddress, uint256[] memory _values, uint8 _v, bytes32[] memory _rs ) private { } /// @dev transfers funds from a Wallet contract into this contract /// the difference between this contract's before and after balance must equal _amount /// this is assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferInFromWallet( address payable _walletAddress, address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from an address into this contract /// for ETH transfers, we only check that msg.value == _amount, and _callAmount is ignored /// for token transfers, the difference between this contract's before and after balance must equal _amount /// these checks are assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferIn( address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from this contract to the _toAddress function _transferOut( address _toAddress, address _assetHash, uint256 _amount ) private { } /// @dev validates a signature against the specified user address function _validateSignature( bytes32 _message, address _user, uint8 _v, bytes32 _r, bytes32 _s ) private pure { } function _serializeTransferTxArgs(TransferTxArgs memory args) private pure returns (bytes memory) { } function _deserializeTransferTxArgs(bytes memory valueBz) private pure returns (TransferTxArgs memory) { } function _deserializeRegisterAssetTxArgs(bytes memory valueBz) private pure returns (RegisterAssetTxArgs memory) { } function _deserializeExtensionTxArgs(bytes memory valueBz) private pure returns (ExtensionTxArgs memory) { } function _getCcm() private view returns (CCM) { } function _getNextNonce() private returns (uint256) { } function _getSalt( address _ownerAddress, bytes memory _swthAddress ) private pure returns (bytes32) { } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(ERC20 token, bytes memory data) private { } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `_isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function _isContract(address account) private view returns (bool) { } }
registry[_assetHash]==bytes32(0),"Asset already registered"
365,890
registry[_assetHash]==bytes32(0)
"Asset not registered"
pragma solidity 0.6.12; interface CCM { function crossChain(uint64 _toChainId, bytes calldata _toContract, bytes calldata _method, bytes calldata _txData) external returns (bool); } interface CCMProxy { function getEthCrossChainManager() external view returns (address); } /// @title The LockProxy contract for Switcheo TradeHub /// @author Switcheo Network /// @notice This contract faciliates deposits and withdrawals to Switcheo TradeHub. /// @dev The contract also allows for additional features in the future through "extension" contracts. contract LockProxy is ReentrancyGuard { using SafeMath for uint256; // used for cross-chain addExtension and removeExtension methods struct ExtensionTxArgs { bytes extensionAddress; } // used for cross-chain registerAsset method struct RegisterAssetTxArgs { bytes assetHash; bytes nativeAssetHash; } // used for cross-chain lock and unlock methods struct TransferTxArgs { bytes fromAssetHash; bytes toAssetHash; bytes toAddress; uint256 amount; uint256 feeAmount; bytes feeAddress; bytes fromAddress; uint256 nonce; } // used to create a unique salt for wallet creation bytes public constant SALT_PREFIX = "switcheo-eth-wallet-factory-v1"; address public constant ETH_ASSET_HASH = address(0); CCMProxy public ccmProxy; uint64 public counterpartChainId; uint256 public currentNonce = 0; // a mapping of assetHashes to the hash of // (associated proxy address on Switcheo TradeHub, associated asset hash on Switcheo TradeHub) mapping(address => bytes32) public registry; // a record of signed messages to prevent replay attacks mapping(bytes32 => bool) public seenMessages; // a mapping of extension contracts mapping(address => bool) public extensions; // a record of created wallets mapping(address => bool) public wallets; event LockEvent( address fromAssetHash, address fromAddress, uint64 toChainId, bytes toAssetHash, bytes toAddress, bytes txArgs ); event UnlockEvent( address toAssetHash, address toAddress, uint256 amount, bytes txArgs ); constructor(address _ccmProxyAddress, uint64 _counterpartChainId) public { } modifier onlyManagerContract() { } /// @dev Allow this contract to receive Ethereum receive() external payable {} /// @dev Allow this contract to receive ERC223 tokens /// An empty implementation is required so that the ERC223 token will not /// throw an error on transfer, this is specific to ERC223 tokens which /// require this implementation, e.g. DGTX function tokenFallback(address, uint, bytes calldata) external {} /// @dev Calculate the wallet address for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @param _bytecodeHash the hash of the wallet contract's bytecode /// @return the wallet address function getWalletAddress( address _ownerAddress, bytes calldata _swthAddress, bytes32 _bytecodeHash ) external view returns (address) { } /// @dev Create the wallet for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @return true if success function createWallet( address _ownerAddress, bytes calldata _swthAddress ) external nonReentrant returns (bool) { } /// @dev Add a contract as an extension /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function addExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Remove a contract from the extensions mapping /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function removeExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Marks an asset as registered by mapping the asset's address to /// the specified _fromContractAddr and assetHash on Switcheo TradeHub /// @param _argsBz the serialized RegisterAssetTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function registerAsset( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a deposit from a Wallet contract /// @param _walletAddress address of the wallet contract, the wallet contract /// does not receive ETH in this call, but _walletAddress still needs to be payable /// since the wallet contract can receive ETH, there would be compile errors otherwise /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: nonce, to prevent replay attacks /// @param _values[3]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens /// @param _v: the v value of the wallet owner's signature /// @param _rs: the r, s values of the wallet owner's signature function lockFromWallet( address payable _walletAddress, address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values, uint8 _v, bytes32[] calldata _rs ) external nonReentrant returns (bool) { } /// @dev Performs a deposit /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAddress the hex version of the Switcheo TradeHub address to deposit to /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens function lock( address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAddress, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values ) external payable nonReentrant returns (bool) { } /// @dev Performs a withdrawal that was initiated on Switcheo TradeHub /// @param _argsBz the serialized TransferTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function unlock( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a transfer of funds, this is only callable by approved extension contracts /// the `nonReentrant` guard is intentionally not added to this function, to allow for more flexibility. /// The calling contract should be secure and have its own `nonReentrant` guard as needed. /// @param _receivingAddress the address to transfer to /// @param _assetHash the asset to transfer /// @param _amount the amount to transfer /// @return true if success function extensionTransfer( address _receivingAddress, address _assetHash, uint256 _amount ) external returns (bool) { } /// @dev Marks an asset as registered by associating it to a specified Switcheo TradeHub proxy and asset hash /// @param _assetHash the address of the asset to mark /// @param _proxyAddress the associated proxy address on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub function _markAssetAsRegistered( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private { } /// @dev Validates that an asset's registration matches the given params /// @param _assetHash the address of the asset to check /// @param _proxyAddress the expected proxy address on Switcheo TradeHub /// @param _toAssetHash the expected asset hash on Switcheo TradeHub function _validateAssetRegistration( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private view { require(_proxyAddress.length == 20, "Invalid proxyAddress"); bytes32 value = keccak256(abi.encodePacked( _proxyAddress, _toAssetHash )); require(<FILL_ME>) } /// @dev validates the asset registration and calls the CCM contract function _lock( address _fromAssetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _toAddress, uint256 _amount, uint256 _feeAmount, bytes memory _feeAddress ) private { } /// @dev validate the signature for lockFromWallet function _validateLockFromWallet( address _walletOwner, address _assetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _feeAddress, uint256[] memory _values, uint8 _v, bytes32[] memory _rs ) private { } /// @dev transfers funds from a Wallet contract into this contract /// the difference between this contract's before and after balance must equal _amount /// this is assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferInFromWallet( address payable _walletAddress, address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from an address into this contract /// for ETH transfers, we only check that msg.value == _amount, and _callAmount is ignored /// for token transfers, the difference between this contract's before and after balance must equal _amount /// these checks are assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferIn( address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from this contract to the _toAddress function _transferOut( address _toAddress, address _assetHash, uint256 _amount ) private { } /// @dev validates a signature against the specified user address function _validateSignature( bytes32 _message, address _user, uint8 _v, bytes32 _r, bytes32 _s ) private pure { } function _serializeTransferTxArgs(TransferTxArgs memory args) private pure returns (bytes memory) { } function _deserializeTransferTxArgs(bytes memory valueBz) private pure returns (TransferTxArgs memory) { } function _deserializeRegisterAssetTxArgs(bytes memory valueBz) private pure returns (RegisterAssetTxArgs memory) { } function _deserializeExtensionTxArgs(bytes memory valueBz) private pure returns (ExtensionTxArgs memory) { } function _getCcm() private view returns (CCM) { } function _getNextNonce() private returns (uint256) { } function _getSalt( address _ownerAddress, bytes memory _swthAddress ) private pure returns (bytes32) { } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(ERC20 token, bytes memory data) private { } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `_isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function _isContract(address account) private view returns (bool) { } }
registry[_assetHash]==value,"Asset not registered"
365,890
registry[_assetHash]==value
"EthCrossChainManager crossChain executed error!"
pragma solidity 0.6.12; interface CCM { function crossChain(uint64 _toChainId, bytes calldata _toContract, bytes calldata _method, bytes calldata _txData) external returns (bool); } interface CCMProxy { function getEthCrossChainManager() external view returns (address); } /// @title The LockProxy contract for Switcheo TradeHub /// @author Switcheo Network /// @notice This contract faciliates deposits and withdrawals to Switcheo TradeHub. /// @dev The contract also allows for additional features in the future through "extension" contracts. contract LockProxy is ReentrancyGuard { using SafeMath for uint256; // used for cross-chain addExtension and removeExtension methods struct ExtensionTxArgs { bytes extensionAddress; } // used for cross-chain registerAsset method struct RegisterAssetTxArgs { bytes assetHash; bytes nativeAssetHash; } // used for cross-chain lock and unlock methods struct TransferTxArgs { bytes fromAssetHash; bytes toAssetHash; bytes toAddress; uint256 amount; uint256 feeAmount; bytes feeAddress; bytes fromAddress; uint256 nonce; } // used to create a unique salt for wallet creation bytes public constant SALT_PREFIX = "switcheo-eth-wallet-factory-v1"; address public constant ETH_ASSET_HASH = address(0); CCMProxy public ccmProxy; uint64 public counterpartChainId; uint256 public currentNonce = 0; // a mapping of assetHashes to the hash of // (associated proxy address on Switcheo TradeHub, associated asset hash on Switcheo TradeHub) mapping(address => bytes32) public registry; // a record of signed messages to prevent replay attacks mapping(bytes32 => bool) public seenMessages; // a mapping of extension contracts mapping(address => bool) public extensions; // a record of created wallets mapping(address => bool) public wallets; event LockEvent( address fromAssetHash, address fromAddress, uint64 toChainId, bytes toAssetHash, bytes toAddress, bytes txArgs ); event UnlockEvent( address toAssetHash, address toAddress, uint256 amount, bytes txArgs ); constructor(address _ccmProxyAddress, uint64 _counterpartChainId) public { } modifier onlyManagerContract() { } /// @dev Allow this contract to receive Ethereum receive() external payable {} /// @dev Allow this contract to receive ERC223 tokens /// An empty implementation is required so that the ERC223 token will not /// throw an error on transfer, this is specific to ERC223 tokens which /// require this implementation, e.g. DGTX function tokenFallback(address, uint, bytes calldata) external {} /// @dev Calculate the wallet address for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @param _bytecodeHash the hash of the wallet contract's bytecode /// @return the wallet address function getWalletAddress( address _ownerAddress, bytes calldata _swthAddress, bytes32 _bytecodeHash ) external view returns (address) { } /// @dev Create the wallet for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @return true if success function createWallet( address _ownerAddress, bytes calldata _swthAddress ) external nonReentrant returns (bool) { } /// @dev Add a contract as an extension /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function addExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Remove a contract from the extensions mapping /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function removeExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Marks an asset as registered by mapping the asset's address to /// the specified _fromContractAddr and assetHash on Switcheo TradeHub /// @param _argsBz the serialized RegisterAssetTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function registerAsset( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a deposit from a Wallet contract /// @param _walletAddress address of the wallet contract, the wallet contract /// does not receive ETH in this call, but _walletAddress still needs to be payable /// since the wallet contract can receive ETH, there would be compile errors otherwise /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: nonce, to prevent replay attacks /// @param _values[3]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens /// @param _v: the v value of the wallet owner's signature /// @param _rs: the r, s values of the wallet owner's signature function lockFromWallet( address payable _walletAddress, address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values, uint8 _v, bytes32[] calldata _rs ) external nonReentrant returns (bool) { } /// @dev Performs a deposit /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAddress the hex version of the Switcheo TradeHub address to deposit to /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens function lock( address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAddress, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values ) external payable nonReentrant returns (bool) { } /// @dev Performs a withdrawal that was initiated on Switcheo TradeHub /// @param _argsBz the serialized TransferTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function unlock( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a transfer of funds, this is only callable by approved extension contracts /// the `nonReentrant` guard is intentionally not added to this function, to allow for more flexibility. /// The calling contract should be secure and have its own `nonReentrant` guard as needed. /// @param _receivingAddress the address to transfer to /// @param _assetHash the asset to transfer /// @param _amount the amount to transfer /// @return true if success function extensionTransfer( address _receivingAddress, address _assetHash, uint256 _amount ) external returns (bool) { } /// @dev Marks an asset as registered by associating it to a specified Switcheo TradeHub proxy and asset hash /// @param _assetHash the address of the asset to mark /// @param _proxyAddress the associated proxy address on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub function _markAssetAsRegistered( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private { } /// @dev Validates that an asset's registration matches the given params /// @param _assetHash the address of the asset to check /// @param _proxyAddress the expected proxy address on Switcheo TradeHub /// @param _toAssetHash the expected asset hash on Switcheo TradeHub function _validateAssetRegistration( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private view { } /// @dev validates the asset registration and calls the CCM contract function _lock( address _fromAssetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _toAddress, uint256 _amount, uint256 _feeAmount, bytes memory _feeAddress ) private { require(_targetProxyHash.length == 20, "Invalid targetProxyHash"); require(_toAssetHash.length > 0, "Empty toAssetHash"); require(_toAddress.length > 0, "Empty toAddress"); require(_amount > 0, "Amount must be more than zero"); require(_feeAmount < _amount, "Fee amount cannot be greater than amount"); _validateAssetRegistration(_fromAssetHash, _targetProxyHash, _toAssetHash); TransferTxArgs memory txArgs = TransferTxArgs({ fromAssetHash: Utils.addressToBytes(_fromAssetHash), toAssetHash: _toAssetHash, toAddress: _toAddress, amount: _amount, feeAmount: _feeAmount, feeAddress: _feeAddress, fromAddress: abi.encodePacked(msg.sender), nonce: _getNextNonce() }); bytes memory txData = _serializeTransferTxArgs(txArgs); CCM ccm = _getCcm(); require(<FILL_ME>) emit LockEvent(_fromAssetHash, msg.sender, counterpartChainId, _toAssetHash, _toAddress, txData); } /// @dev validate the signature for lockFromWallet function _validateLockFromWallet( address _walletOwner, address _assetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _feeAddress, uint256[] memory _values, uint8 _v, bytes32[] memory _rs ) private { } /// @dev transfers funds from a Wallet contract into this contract /// the difference between this contract's before and after balance must equal _amount /// this is assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferInFromWallet( address payable _walletAddress, address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from an address into this contract /// for ETH transfers, we only check that msg.value == _amount, and _callAmount is ignored /// for token transfers, the difference between this contract's before and after balance must equal _amount /// these checks are assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferIn( address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from this contract to the _toAddress function _transferOut( address _toAddress, address _assetHash, uint256 _amount ) private { } /// @dev validates a signature against the specified user address function _validateSignature( bytes32 _message, address _user, uint8 _v, bytes32 _r, bytes32 _s ) private pure { } function _serializeTransferTxArgs(TransferTxArgs memory args) private pure returns (bytes memory) { } function _deserializeTransferTxArgs(bytes memory valueBz) private pure returns (TransferTxArgs memory) { } function _deserializeRegisterAssetTxArgs(bytes memory valueBz) private pure returns (RegisterAssetTxArgs memory) { } function _deserializeExtensionTxArgs(bytes memory valueBz) private pure returns (ExtensionTxArgs memory) { } function _getCcm() private view returns (CCM) { } function _getNextNonce() private returns (uint256) { } function _getSalt( address _ownerAddress, bytes memory _swthAddress ) private pure returns (bytes32) { } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(ERC20 token, bytes memory data) private { } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `_isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function _isContract(address account) private view returns (bool) { } }
ccm.crossChain(counterpartChainId,_targetProxyHash,"unlock",txData),"EthCrossChainManager crossChain executed error!"
365,890
ccm.crossChain(counterpartChainId,_targetProxyHash,"unlock",txData)
"Message already seen"
pragma solidity 0.6.12; interface CCM { function crossChain(uint64 _toChainId, bytes calldata _toContract, bytes calldata _method, bytes calldata _txData) external returns (bool); } interface CCMProxy { function getEthCrossChainManager() external view returns (address); } /// @title The LockProxy contract for Switcheo TradeHub /// @author Switcheo Network /// @notice This contract faciliates deposits and withdrawals to Switcheo TradeHub. /// @dev The contract also allows for additional features in the future through "extension" contracts. contract LockProxy is ReentrancyGuard { using SafeMath for uint256; // used for cross-chain addExtension and removeExtension methods struct ExtensionTxArgs { bytes extensionAddress; } // used for cross-chain registerAsset method struct RegisterAssetTxArgs { bytes assetHash; bytes nativeAssetHash; } // used for cross-chain lock and unlock methods struct TransferTxArgs { bytes fromAssetHash; bytes toAssetHash; bytes toAddress; uint256 amount; uint256 feeAmount; bytes feeAddress; bytes fromAddress; uint256 nonce; } // used to create a unique salt for wallet creation bytes public constant SALT_PREFIX = "switcheo-eth-wallet-factory-v1"; address public constant ETH_ASSET_HASH = address(0); CCMProxy public ccmProxy; uint64 public counterpartChainId; uint256 public currentNonce = 0; // a mapping of assetHashes to the hash of // (associated proxy address on Switcheo TradeHub, associated asset hash on Switcheo TradeHub) mapping(address => bytes32) public registry; // a record of signed messages to prevent replay attacks mapping(bytes32 => bool) public seenMessages; // a mapping of extension contracts mapping(address => bool) public extensions; // a record of created wallets mapping(address => bool) public wallets; event LockEvent( address fromAssetHash, address fromAddress, uint64 toChainId, bytes toAssetHash, bytes toAddress, bytes txArgs ); event UnlockEvent( address toAssetHash, address toAddress, uint256 amount, bytes txArgs ); constructor(address _ccmProxyAddress, uint64 _counterpartChainId) public { } modifier onlyManagerContract() { } /// @dev Allow this contract to receive Ethereum receive() external payable {} /// @dev Allow this contract to receive ERC223 tokens /// An empty implementation is required so that the ERC223 token will not /// throw an error on transfer, this is specific to ERC223 tokens which /// require this implementation, e.g. DGTX function tokenFallback(address, uint, bytes calldata) external {} /// @dev Calculate the wallet address for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @param _bytecodeHash the hash of the wallet contract's bytecode /// @return the wallet address function getWalletAddress( address _ownerAddress, bytes calldata _swthAddress, bytes32 _bytecodeHash ) external view returns (address) { } /// @dev Create the wallet for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @return true if success function createWallet( address _ownerAddress, bytes calldata _swthAddress ) external nonReentrant returns (bool) { } /// @dev Add a contract as an extension /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function addExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Remove a contract from the extensions mapping /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function removeExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Marks an asset as registered by mapping the asset's address to /// the specified _fromContractAddr and assetHash on Switcheo TradeHub /// @param _argsBz the serialized RegisterAssetTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function registerAsset( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a deposit from a Wallet contract /// @param _walletAddress address of the wallet contract, the wallet contract /// does not receive ETH in this call, but _walletAddress still needs to be payable /// since the wallet contract can receive ETH, there would be compile errors otherwise /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: nonce, to prevent replay attacks /// @param _values[3]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens /// @param _v: the v value of the wallet owner's signature /// @param _rs: the r, s values of the wallet owner's signature function lockFromWallet( address payable _walletAddress, address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values, uint8 _v, bytes32[] calldata _rs ) external nonReentrant returns (bool) { } /// @dev Performs a deposit /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAddress the hex version of the Switcheo TradeHub address to deposit to /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens function lock( address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAddress, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values ) external payable nonReentrant returns (bool) { } /// @dev Performs a withdrawal that was initiated on Switcheo TradeHub /// @param _argsBz the serialized TransferTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function unlock( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a transfer of funds, this is only callable by approved extension contracts /// the `nonReentrant` guard is intentionally not added to this function, to allow for more flexibility. /// The calling contract should be secure and have its own `nonReentrant` guard as needed. /// @param _receivingAddress the address to transfer to /// @param _assetHash the asset to transfer /// @param _amount the amount to transfer /// @return true if success function extensionTransfer( address _receivingAddress, address _assetHash, uint256 _amount ) external returns (bool) { } /// @dev Marks an asset as registered by associating it to a specified Switcheo TradeHub proxy and asset hash /// @param _assetHash the address of the asset to mark /// @param _proxyAddress the associated proxy address on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub function _markAssetAsRegistered( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private { } /// @dev Validates that an asset's registration matches the given params /// @param _assetHash the address of the asset to check /// @param _proxyAddress the expected proxy address on Switcheo TradeHub /// @param _toAssetHash the expected asset hash on Switcheo TradeHub function _validateAssetRegistration( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private view { } /// @dev validates the asset registration and calls the CCM contract function _lock( address _fromAssetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _toAddress, uint256 _amount, uint256 _feeAmount, bytes memory _feeAddress ) private { } /// @dev validate the signature for lockFromWallet function _validateLockFromWallet( address _walletOwner, address _assetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _feeAddress, uint256[] memory _values, uint8 _v, bytes32[] memory _rs ) private { bytes32 message = keccak256(abi.encodePacked( "sendTokens", _assetHash, _targetProxyHash, _toAssetHash, _feeAddress, _values[0], _values[1], _values[2] )); require(<FILL_ME>) seenMessages[message] = true; _validateSignature(message, _walletOwner, _v, _rs[0], _rs[1]); } /// @dev transfers funds from a Wallet contract into this contract /// the difference between this contract's before and after balance must equal _amount /// this is assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferInFromWallet( address payable _walletAddress, address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from an address into this contract /// for ETH transfers, we only check that msg.value == _amount, and _callAmount is ignored /// for token transfers, the difference between this contract's before and after balance must equal _amount /// these checks are assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferIn( address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from this contract to the _toAddress function _transferOut( address _toAddress, address _assetHash, uint256 _amount ) private { } /// @dev validates a signature against the specified user address function _validateSignature( bytes32 _message, address _user, uint8 _v, bytes32 _r, bytes32 _s ) private pure { } function _serializeTransferTxArgs(TransferTxArgs memory args) private pure returns (bytes memory) { } function _deserializeTransferTxArgs(bytes memory valueBz) private pure returns (TransferTxArgs memory) { } function _deserializeRegisterAssetTxArgs(bytes memory valueBz) private pure returns (RegisterAssetTxArgs memory) { } function _deserializeExtensionTxArgs(bytes memory valueBz) private pure returns (ExtensionTxArgs memory) { } function _getCcm() private view returns (CCM) { } function _getNextNonce() private returns (uint256) { } function _getSalt( address _ownerAddress, bytes memory _swthAddress ) private pure returns (bytes32) { } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(ERC20 token, bytes memory data) private { } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `_isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function _isContract(address account) private view returns (bool) { } }
seenMessages[message]==false,"Message already seen"
365,890
seenMessages[message]==false
"SafeERC20: call to non-contract"
pragma solidity 0.6.12; interface CCM { function crossChain(uint64 _toChainId, bytes calldata _toContract, bytes calldata _method, bytes calldata _txData) external returns (bool); } interface CCMProxy { function getEthCrossChainManager() external view returns (address); } /// @title The LockProxy contract for Switcheo TradeHub /// @author Switcheo Network /// @notice This contract faciliates deposits and withdrawals to Switcheo TradeHub. /// @dev The contract also allows for additional features in the future through "extension" contracts. contract LockProxy is ReentrancyGuard { using SafeMath for uint256; // used for cross-chain addExtension and removeExtension methods struct ExtensionTxArgs { bytes extensionAddress; } // used for cross-chain registerAsset method struct RegisterAssetTxArgs { bytes assetHash; bytes nativeAssetHash; } // used for cross-chain lock and unlock methods struct TransferTxArgs { bytes fromAssetHash; bytes toAssetHash; bytes toAddress; uint256 amount; uint256 feeAmount; bytes feeAddress; bytes fromAddress; uint256 nonce; } // used to create a unique salt for wallet creation bytes public constant SALT_PREFIX = "switcheo-eth-wallet-factory-v1"; address public constant ETH_ASSET_HASH = address(0); CCMProxy public ccmProxy; uint64 public counterpartChainId; uint256 public currentNonce = 0; // a mapping of assetHashes to the hash of // (associated proxy address on Switcheo TradeHub, associated asset hash on Switcheo TradeHub) mapping(address => bytes32) public registry; // a record of signed messages to prevent replay attacks mapping(bytes32 => bool) public seenMessages; // a mapping of extension contracts mapping(address => bool) public extensions; // a record of created wallets mapping(address => bool) public wallets; event LockEvent( address fromAssetHash, address fromAddress, uint64 toChainId, bytes toAssetHash, bytes toAddress, bytes txArgs ); event UnlockEvent( address toAssetHash, address toAddress, uint256 amount, bytes txArgs ); constructor(address _ccmProxyAddress, uint64 _counterpartChainId) public { } modifier onlyManagerContract() { } /// @dev Allow this contract to receive Ethereum receive() external payable {} /// @dev Allow this contract to receive ERC223 tokens /// An empty implementation is required so that the ERC223 token will not /// throw an error on transfer, this is specific to ERC223 tokens which /// require this implementation, e.g. DGTX function tokenFallback(address, uint, bytes calldata) external {} /// @dev Calculate the wallet address for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @param _bytecodeHash the hash of the wallet contract's bytecode /// @return the wallet address function getWalletAddress( address _ownerAddress, bytes calldata _swthAddress, bytes32 _bytecodeHash ) external view returns (address) { } /// @dev Create the wallet for the given owner and Switcheo TradeHub address /// @param _ownerAddress the Ethereum address which the user has control over, i.e. can sign msgs with /// @param _swthAddress the hex value of the user's Switcheo TradeHub address /// @return true if success function createWallet( address _ownerAddress, bytes calldata _swthAddress ) external nonReentrant returns (bool) { } /// @dev Add a contract as an extension /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function addExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Remove a contract from the extensions mapping /// @param _argsBz the serialized ExtensionTxArgs /// @param _fromChainId the originating chainId /// @return true if success function removeExtension( bytes calldata _argsBz, bytes calldata /* _fromContractAddr */, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Marks an asset as registered by mapping the asset's address to /// the specified _fromContractAddr and assetHash on Switcheo TradeHub /// @param _argsBz the serialized RegisterAssetTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function registerAsset( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a deposit from a Wallet contract /// @param _walletAddress address of the wallet contract, the wallet contract /// does not receive ETH in this call, but _walletAddress still needs to be payable /// since the wallet contract can receive ETH, there would be compile errors otherwise /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: nonce, to prevent replay attacks /// @param _values[3]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens /// @param _v: the v value of the wallet owner's signature /// @param _rs: the r, s values of the wallet owner's signature function lockFromWallet( address payable _walletAddress, address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values, uint8 _v, bytes32[] calldata _rs ) external nonReentrant returns (bool) { } /// @dev Performs a deposit /// @param _assetHash the asset to deposit /// @param _targetProxyHash the associated proxy hash on Switcheo TradeHub /// @param _toAddress the hex version of the Switcheo TradeHub address to deposit to /// @param _toAssetHash the associated asset hash on Switcheo TradeHub /// @param _feeAddress the hex version of the Switcheo TradeHub address to send the fee to /// @param _values[0]: amount, the number of tokens to deposit /// @param _values[1]: feeAmount, the number of tokens to be used as fees /// @param _values[2]: callAmount, some tokens may burn an amount before transfer /// so we allow a callAmount to support these tokens function lock( address _assetHash, bytes calldata _targetProxyHash, bytes calldata _toAddress, bytes calldata _toAssetHash, bytes calldata _feeAddress, uint256[] calldata _values ) external payable nonReentrant returns (bool) { } /// @dev Performs a withdrawal that was initiated on Switcheo TradeHub /// @param _argsBz the serialized TransferTxArgs /// @param _fromContractAddr the associated contract address on Switcheo TradeHub /// @param _fromChainId the originating chainId /// @return true if success function unlock( bytes calldata _argsBz, bytes calldata _fromContractAddr, uint64 _fromChainId ) external onlyManagerContract nonReentrant returns (bool) { } /// @dev Performs a transfer of funds, this is only callable by approved extension contracts /// the `nonReentrant` guard is intentionally not added to this function, to allow for more flexibility. /// The calling contract should be secure and have its own `nonReentrant` guard as needed. /// @param _receivingAddress the address to transfer to /// @param _assetHash the asset to transfer /// @param _amount the amount to transfer /// @return true if success function extensionTransfer( address _receivingAddress, address _assetHash, uint256 _amount ) external returns (bool) { } /// @dev Marks an asset as registered by associating it to a specified Switcheo TradeHub proxy and asset hash /// @param _assetHash the address of the asset to mark /// @param _proxyAddress the associated proxy address on Switcheo TradeHub /// @param _toAssetHash the associated asset hash on Switcheo TradeHub function _markAssetAsRegistered( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private { } /// @dev Validates that an asset's registration matches the given params /// @param _assetHash the address of the asset to check /// @param _proxyAddress the expected proxy address on Switcheo TradeHub /// @param _toAssetHash the expected asset hash on Switcheo TradeHub function _validateAssetRegistration( address _assetHash, bytes memory _proxyAddress, bytes memory _toAssetHash ) private view { } /// @dev validates the asset registration and calls the CCM contract function _lock( address _fromAssetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _toAddress, uint256 _amount, uint256 _feeAmount, bytes memory _feeAddress ) private { } /// @dev validate the signature for lockFromWallet function _validateLockFromWallet( address _walletOwner, address _assetHash, bytes memory _targetProxyHash, bytes memory _toAssetHash, bytes memory _feeAddress, uint256[] memory _values, uint8 _v, bytes32[] memory _rs ) private { } /// @dev transfers funds from a Wallet contract into this contract /// the difference between this contract's before and after balance must equal _amount /// this is assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferInFromWallet( address payable _walletAddress, address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from an address into this contract /// for ETH transfers, we only check that msg.value == _amount, and _callAmount is ignored /// for token transfers, the difference between this contract's before and after balance must equal _amount /// these checks are assumed to be sufficient in ensuring that the expected amount /// of funds were transferred in function _transferIn( address _assetHash, uint256 _amount, uint256 _callAmount ) private { } /// @dev transfers funds from this contract to the _toAddress function _transferOut( address _toAddress, address _assetHash, uint256 _amount ) private { } /// @dev validates a signature against the specified user address function _validateSignature( bytes32 _message, address _user, uint8 _v, bytes32 _r, bytes32 _s ) private pure { } function _serializeTransferTxArgs(TransferTxArgs memory args) private pure returns (bytes memory) { } function _deserializeTransferTxArgs(bytes memory valueBz) private pure returns (TransferTxArgs memory) { } function _deserializeRegisterAssetTxArgs(bytes memory valueBz) private pure returns (RegisterAssetTxArgs memory) { } function _deserializeExtensionTxArgs(bytes memory valueBz) private pure returns (ExtensionTxArgs memory) { } function _getCcm() private view returns (CCM) { } function _getNextNonce() private returns (uint256) { } function _getSalt( address _ownerAddress, bytes memory _swthAddress ) private pure returns (bytes32) { } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(ERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length require(<FILL_ME>) // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `_isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function _isContract(address account) private view returns (bool) { } }
_isContract(address(token)),"SafeERC20: call to non-contract"
365,890
_isContract(address(token))
"Mint limit reached"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./QueensAndKingsAvatars.sol"; contract FirstDrop is Ownable { modifier callerIsUser() { } address public avatarContractAddress; address public signerAddress; address public sAddress; uint16 public sMintLimit = 300; uint16 public sMintedTokens = 0; uint16 public totalAvatars = 2000; uint256 public mintPrice = 0.423 ether; string public ipfsAvatars; mapping(uint16 => uint16) private tokenMatrix; mapping(address => uint8) public mintsPerUser; // DEBUG function setTotalAvatars(uint16 _totalAvatars) external onlyOwner { } // ONLY OWNER /** * @dev Allows to withdraw the Ether in the contract */ function withdraw() external onlyOwner { } /** * @dev Sets the mint price */ function setMintPrice(uint256 _mintPrice) external onlyOwner { } /** * @dev Sets the avatar contract address */ function setAvatarContractAddress(address _address) external onlyOwner { } /** * @dev Sets the address that generates the signatures for whitelisting */ function setSignerAddress(address _signerAddress) external onlyOwner { } /** * @dev Sets the address that can call mintTo */ function setSAddress(address _sAddress) external onlyOwner { } /** * @dev Sets how many mints can the sAddress do */ function setSMintLimit(uint16 _sMintLimit) external onlyOwner { } function setIPFSAvatars(string memory _ipfsAvatars) external onlyOwner { } // END ONLY OWNER /** * @dev Mint function */ function mint( uint8 _quantity, uint256 _fromTimestamp, uint256 _toTimestamp, uint8 _maxQuantity, bytes calldata _signature ) external payable callerIsUser { } /** * @dev mint to address */ function mintTo(address[] memory _addresses) external { require(msg.sender == sAddress, "Caller is not allowed to mint"); require(_addresses.length > 0, "At least one token should be minted"); require(<FILL_ME>) QueensAndKingsAvatars qakContract = QueensAndKingsAvatars(avatarContractAddress); uint16 tmpTotalSupply = qakContract.totalSupply(); sMintedTokens += uint16(_addresses.length); for (uint256 i; i < _addresses.length; i++) { qakContract.mint(_getTokenToBeMinted(tmpTotalSupply), _addresses[i]); tmpTotalSupply++; } } /** * @dev mint to address */ function mintToDev(address[] memory _addresses) external onlyOwner { } /** * @dev gets the amount of available tokens left to be minted */ function getAvailableTokens() external view returns (uint16) { } /** * @dev Generates the message hash for the given parameters */ function generateMessageHash( address _address, uint256 _fromTimestamp, uint256 _toTimestamp, uint8 _maxQuantity ) internal pure returns (bytes32) { } /** * @dev Returns a random available token to be minted */ function _getTokenToBeMinted(uint16 _totalMintedTokens) private returns (uint16) { } /** * @dev Generates a pseudo-random number. */ function _getRandomNumber(uint16 _upper, uint16 _totalMintedTokens) private view returns (uint16) { } }
sMintedTokens+_addresses.length<=sMintLimit,"Mint limit reached"
365,916
sMintedTokens+_addresses.length<=sMintLimit
null
pragma solidity >0.4.23; library BytesUtils { /* * @dev Returns the keccak-256 hash of a byte range. * @param self The byte string to hash. * @param offset The position to start hashing at. * @param len The number of bytes to hash. * @return The hash of the byte range. */ function keccak(bytes memory self, uint offset, uint len) internal pure returns (bytes32 ret) { require(<FILL_ME>) assembly { ret := keccak256(add(add(self, 32), offset), len) } } /* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two bytes are equal. * @param self The first bytes to compare. * @param other The second bytes to compare. * @return The result of the comparison. */ function compare(bytes memory self, bytes memory other) internal pure returns (int) { } /* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two bytes are equal. Comparison is done per-rune, * on unicode codepoints. * @param self The first bytes to compare. * @param offset The offset of self. * @param len The length of self. * @param other The second bytes to compare. * @param otheroffset The offset of the other string. * @param otherlen The length of the other string. * @return The result of the comparison. */ function compare(bytes memory self, uint offset, uint len, bytes memory other, uint otheroffset, uint otherlen) internal pure returns (int) { } /* * @dev Returns true if the two byte ranges are equal. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @param otherOffset The offset into the second byte range. * @param len The number of bytes to compare * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other, uint otherOffset, uint len) internal pure returns (bool) { } /* * @dev Returns true if the two byte ranges are equal with offsets. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @param otherOffset The offset into the second byte range. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other, uint otherOffset) internal pure returns (bool) { } /* * @dev Compares a range of 'self' to all of 'other' and returns True iff * they are equal. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other) internal pure returns (bool) { } /* * @dev Returns true if the two byte ranges are equal. * @param self The first byte range to compare. * @param other The second byte range to compare. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, bytes memory other) internal pure returns(bool) { } /* * @dev Returns the 8-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 8 bits of the string, interpreted as an integer. */ function readUint8(bytes memory self, uint idx) internal pure returns (uint8 ret) { } /* * @dev Returns the 16-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 16 bits of the string, interpreted as an integer. */ function readUint16(bytes memory self, uint idx) internal pure returns (uint16 ret) { } /* * @dev Returns the 32-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bits of the string, interpreted as an integer. */ function readUint32(bytes memory self, uint idx) internal pure returns (uint32 ret) { } /* * @dev Returns the 32 byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bytes of the string. */ function readBytes32(bytes memory self, uint idx) internal pure returns (bytes32 ret) { } /* * @dev Returns the 32 byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bytes of the string. */ function readBytes20(bytes memory self, uint idx) internal pure returns (bytes20 ret) { } /* * @dev Returns the n byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes. * @param len The number of bytes. * @return The specified 32 bytes of the string. */ function readBytesN(bytes memory self, uint idx, uint len) internal pure returns (bytes32 ret) { } function memcpy(uint dest, uint src, uint len) private pure { } /* * @dev Copies a substring into a new byte string. * @param self The byte string to copy from. * @param offset The offset to start copying at. * @param len The number of bytes to copy. */ function substring(bytes memory self, uint offset, uint len) internal pure returns(bytes memory) { } // Maps characters from 0x30 to 0x7A to their base32 values. // 0xFF represents invalid characters in that range. bytes constant base32HexTable = hex'00010203040506070809FFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1FFFFFFFFFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'; /** * @dev Decodes unpadded base32 data of up to one word in length. * @param self The data to decode. * @param off Offset into the string to start at. * @param len Number of characters to decode. * @return The decoded data, left aligned. */ function base32HexDecodeWord(bytes memory self, uint off, uint len) internal pure returns(bytes32) { } }
offset+len<=self.length
366,062
offset+len<=self.length
null
pragma solidity >0.4.23; library BytesUtils { /* * @dev Returns the keccak-256 hash of a byte range. * @param self The byte string to hash. * @param offset The position to start hashing at. * @param len The number of bytes to hash. * @return The hash of the byte range. */ function keccak(bytes memory self, uint offset, uint len) internal pure returns (bytes32 ret) { } /* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two bytes are equal. * @param self The first bytes to compare. * @param other The second bytes to compare. * @return The result of the comparison. */ function compare(bytes memory self, bytes memory other) internal pure returns (int) { } /* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two bytes are equal. Comparison is done per-rune, * on unicode codepoints. * @param self The first bytes to compare. * @param offset The offset of self. * @param len The length of self. * @param other The second bytes to compare. * @param otheroffset The offset of the other string. * @param otherlen The length of the other string. * @return The result of the comparison. */ function compare(bytes memory self, uint offset, uint len, bytes memory other, uint otheroffset, uint otherlen) internal pure returns (int) { } /* * @dev Returns true if the two byte ranges are equal. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @param otherOffset The offset into the second byte range. * @param len The number of bytes to compare * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other, uint otherOffset, uint len) internal pure returns (bool) { } /* * @dev Returns true if the two byte ranges are equal with offsets. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @param otherOffset The offset into the second byte range. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other, uint otherOffset) internal pure returns (bool) { } /* * @dev Compares a range of 'self' to all of 'other' and returns True iff * they are equal. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other) internal pure returns (bool) { } /* * @dev Returns true if the two byte ranges are equal. * @param self The first byte range to compare. * @param other The second byte range to compare. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, bytes memory other) internal pure returns(bool) { } /* * @dev Returns the 8-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 8 bits of the string, interpreted as an integer. */ function readUint8(bytes memory self, uint idx) internal pure returns (uint8 ret) { } /* * @dev Returns the 16-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 16 bits of the string, interpreted as an integer. */ function readUint16(bytes memory self, uint idx) internal pure returns (uint16 ret) { require(<FILL_ME>) assembly { ret := and(mload(add(add(self, 2), idx)), 0xFFFF) } } /* * @dev Returns the 32-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bits of the string, interpreted as an integer. */ function readUint32(bytes memory self, uint idx) internal pure returns (uint32 ret) { } /* * @dev Returns the 32 byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bytes of the string. */ function readBytes32(bytes memory self, uint idx) internal pure returns (bytes32 ret) { } /* * @dev Returns the 32 byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bytes of the string. */ function readBytes20(bytes memory self, uint idx) internal pure returns (bytes20 ret) { } /* * @dev Returns the n byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes. * @param len The number of bytes. * @return The specified 32 bytes of the string. */ function readBytesN(bytes memory self, uint idx, uint len) internal pure returns (bytes32 ret) { } function memcpy(uint dest, uint src, uint len) private pure { } /* * @dev Copies a substring into a new byte string. * @param self The byte string to copy from. * @param offset The offset to start copying at. * @param len The number of bytes to copy. */ function substring(bytes memory self, uint offset, uint len) internal pure returns(bytes memory) { } // Maps characters from 0x30 to 0x7A to their base32 values. // 0xFF represents invalid characters in that range. bytes constant base32HexTable = hex'00010203040506070809FFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1FFFFFFFFFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'; /** * @dev Decodes unpadded base32 data of up to one word in length. * @param self The data to decode. * @param off Offset into the string to start at. * @param len Number of characters to decode. * @return The decoded data, left aligned. */ function base32HexDecodeWord(bytes memory self, uint off, uint len) internal pure returns(bytes32) { } }
idx+2<=self.length
366,062
idx+2<=self.length
null
pragma solidity >0.4.23; library BytesUtils { /* * @dev Returns the keccak-256 hash of a byte range. * @param self The byte string to hash. * @param offset The position to start hashing at. * @param len The number of bytes to hash. * @return The hash of the byte range. */ function keccak(bytes memory self, uint offset, uint len) internal pure returns (bytes32 ret) { } /* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two bytes are equal. * @param self The first bytes to compare. * @param other The second bytes to compare. * @return The result of the comparison. */ function compare(bytes memory self, bytes memory other) internal pure returns (int) { } /* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two bytes are equal. Comparison is done per-rune, * on unicode codepoints. * @param self The first bytes to compare. * @param offset The offset of self. * @param len The length of self. * @param other The second bytes to compare. * @param otheroffset The offset of the other string. * @param otherlen The length of the other string. * @return The result of the comparison. */ function compare(bytes memory self, uint offset, uint len, bytes memory other, uint otheroffset, uint otherlen) internal pure returns (int) { } /* * @dev Returns true if the two byte ranges are equal. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @param otherOffset The offset into the second byte range. * @param len The number of bytes to compare * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other, uint otherOffset, uint len) internal pure returns (bool) { } /* * @dev Returns true if the two byte ranges are equal with offsets. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @param otherOffset The offset into the second byte range. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other, uint otherOffset) internal pure returns (bool) { } /* * @dev Compares a range of 'self' to all of 'other' and returns True iff * they are equal. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other) internal pure returns (bool) { } /* * @dev Returns true if the two byte ranges are equal. * @param self The first byte range to compare. * @param other The second byte range to compare. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, bytes memory other) internal pure returns(bool) { } /* * @dev Returns the 8-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 8 bits of the string, interpreted as an integer. */ function readUint8(bytes memory self, uint idx) internal pure returns (uint8 ret) { } /* * @dev Returns the 16-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 16 bits of the string, interpreted as an integer. */ function readUint16(bytes memory self, uint idx) internal pure returns (uint16 ret) { } /* * @dev Returns the 32-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bits of the string, interpreted as an integer. */ function readUint32(bytes memory self, uint idx) internal pure returns (uint32 ret) { require(<FILL_ME>) assembly { ret := and(mload(add(add(self, 4), idx)), 0xFFFFFFFF) } } /* * @dev Returns the 32 byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bytes of the string. */ function readBytes32(bytes memory self, uint idx) internal pure returns (bytes32 ret) { } /* * @dev Returns the 32 byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bytes of the string. */ function readBytes20(bytes memory self, uint idx) internal pure returns (bytes20 ret) { } /* * @dev Returns the n byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes. * @param len The number of bytes. * @return The specified 32 bytes of the string. */ function readBytesN(bytes memory self, uint idx, uint len) internal pure returns (bytes32 ret) { } function memcpy(uint dest, uint src, uint len) private pure { } /* * @dev Copies a substring into a new byte string. * @param self The byte string to copy from. * @param offset The offset to start copying at. * @param len The number of bytes to copy. */ function substring(bytes memory self, uint offset, uint len) internal pure returns(bytes memory) { } // Maps characters from 0x30 to 0x7A to their base32 values. // 0xFF represents invalid characters in that range. bytes constant base32HexTable = hex'00010203040506070809FFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1FFFFFFFFFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'; /** * @dev Decodes unpadded base32 data of up to one word in length. * @param self The data to decode. * @param off Offset into the string to start at. * @param len Number of characters to decode. * @return The decoded data, left aligned. */ function base32HexDecodeWord(bytes memory self, uint off, uint len) internal pure returns(bytes32) { } }
idx+4<=self.length
366,062
idx+4<=self.length
null
pragma solidity >0.4.23; library BytesUtils { /* * @dev Returns the keccak-256 hash of a byte range. * @param self The byte string to hash. * @param offset The position to start hashing at. * @param len The number of bytes to hash. * @return The hash of the byte range. */ function keccak(bytes memory self, uint offset, uint len) internal pure returns (bytes32 ret) { } /* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two bytes are equal. * @param self The first bytes to compare. * @param other The second bytes to compare. * @return The result of the comparison. */ function compare(bytes memory self, bytes memory other) internal pure returns (int) { } /* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two bytes are equal. Comparison is done per-rune, * on unicode codepoints. * @param self The first bytes to compare. * @param offset The offset of self. * @param len The length of self. * @param other The second bytes to compare. * @param otheroffset The offset of the other string. * @param otherlen The length of the other string. * @return The result of the comparison. */ function compare(bytes memory self, uint offset, uint len, bytes memory other, uint otheroffset, uint otherlen) internal pure returns (int) { } /* * @dev Returns true if the two byte ranges are equal. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @param otherOffset The offset into the second byte range. * @param len The number of bytes to compare * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other, uint otherOffset, uint len) internal pure returns (bool) { } /* * @dev Returns true if the two byte ranges are equal with offsets. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @param otherOffset The offset into the second byte range. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other, uint otherOffset) internal pure returns (bool) { } /* * @dev Compares a range of 'self' to all of 'other' and returns True iff * they are equal. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other) internal pure returns (bool) { } /* * @dev Returns true if the two byte ranges are equal. * @param self The first byte range to compare. * @param other The second byte range to compare. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, bytes memory other) internal pure returns(bool) { } /* * @dev Returns the 8-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 8 bits of the string, interpreted as an integer. */ function readUint8(bytes memory self, uint idx) internal pure returns (uint8 ret) { } /* * @dev Returns the 16-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 16 bits of the string, interpreted as an integer. */ function readUint16(bytes memory self, uint idx) internal pure returns (uint16 ret) { } /* * @dev Returns the 32-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bits of the string, interpreted as an integer. */ function readUint32(bytes memory self, uint idx) internal pure returns (uint32 ret) { } /* * @dev Returns the 32 byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bytes of the string. */ function readBytes32(bytes memory self, uint idx) internal pure returns (bytes32 ret) { require(<FILL_ME>) assembly { ret := mload(add(add(self, 32), idx)) } } /* * @dev Returns the 32 byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bytes of the string. */ function readBytes20(bytes memory self, uint idx) internal pure returns (bytes20 ret) { } /* * @dev Returns the n byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes. * @param len The number of bytes. * @return The specified 32 bytes of the string. */ function readBytesN(bytes memory self, uint idx, uint len) internal pure returns (bytes32 ret) { } function memcpy(uint dest, uint src, uint len) private pure { } /* * @dev Copies a substring into a new byte string. * @param self The byte string to copy from. * @param offset The offset to start copying at. * @param len The number of bytes to copy. */ function substring(bytes memory self, uint offset, uint len) internal pure returns(bytes memory) { } // Maps characters from 0x30 to 0x7A to their base32 values. // 0xFF represents invalid characters in that range. bytes constant base32HexTable = hex'00010203040506070809FFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1FFFFFFFFFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'; /** * @dev Decodes unpadded base32 data of up to one word in length. * @param self The data to decode. * @param off Offset into the string to start at. * @param len Number of characters to decode. * @return The decoded data, left aligned. */ function base32HexDecodeWord(bytes memory self, uint off, uint len) internal pure returns(bytes32) { } }
idx+32<=self.length
366,062
idx+32<=self.length
null
pragma solidity >0.4.23; library BytesUtils { /* * @dev Returns the keccak-256 hash of a byte range. * @param self The byte string to hash. * @param offset The position to start hashing at. * @param len The number of bytes to hash. * @return The hash of the byte range. */ function keccak(bytes memory self, uint offset, uint len) internal pure returns (bytes32 ret) { } /* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two bytes are equal. * @param self The first bytes to compare. * @param other The second bytes to compare. * @return The result of the comparison. */ function compare(bytes memory self, bytes memory other) internal pure returns (int) { } /* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two bytes are equal. Comparison is done per-rune, * on unicode codepoints. * @param self The first bytes to compare. * @param offset The offset of self. * @param len The length of self. * @param other The second bytes to compare. * @param otheroffset The offset of the other string. * @param otherlen The length of the other string. * @return The result of the comparison. */ function compare(bytes memory self, uint offset, uint len, bytes memory other, uint otheroffset, uint otherlen) internal pure returns (int) { } /* * @dev Returns true if the two byte ranges are equal. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @param otherOffset The offset into the second byte range. * @param len The number of bytes to compare * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other, uint otherOffset, uint len) internal pure returns (bool) { } /* * @dev Returns true if the two byte ranges are equal with offsets. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @param otherOffset The offset into the second byte range. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other, uint otherOffset) internal pure returns (bool) { } /* * @dev Compares a range of 'self' to all of 'other' and returns True iff * they are equal. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other) internal pure returns (bool) { } /* * @dev Returns true if the two byte ranges are equal. * @param self The first byte range to compare. * @param other The second byte range to compare. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, bytes memory other) internal pure returns(bool) { } /* * @dev Returns the 8-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 8 bits of the string, interpreted as an integer. */ function readUint8(bytes memory self, uint idx) internal pure returns (uint8 ret) { } /* * @dev Returns the 16-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 16 bits of the string, interpreted as an integer. */ function readUint16(bytes memory self, uint idx) internal pure returns (uint16 ret) { } /* * @dev Returns the 32-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bits of the string, interpreted as an integer. */ function readUint32(bytes memory self, uint idx) internal pure returns (uint32 ret) { } /* * @dev Returns the 32 byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bytes of the string. */ function readBytes32(bytes memory self, uint idx) internal pure returns (bytes32 ret) { } /* * @dev Returns the 32 byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bytes of the string. */ function readBytes20(bytes memory self, uint idx) internal pure returns (bytes20 ret) { require(<FILL_ME>) assembly { ret := and(mload(add(add(self, 32), idx)), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000) } } /* * @dev Returns the n byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes. * @param len The number of bytes. * @return The specified 32 bytes of the string. */ function readBytesN(bytes memory self, uint idx, uint len) internal pure returns (bytes32 ret) { } function memcpy(uint dest, uint src, uint len) private pure { } /* * @dev Copies a substring into a new byte string. * @param self The byte string to copy from. * @param offset The offset to start copying at. * @param len The number of bytes to copy. */ function substring(bytes memory self, uint offset, uint len) internal pure returns(bytes memory) { } // Maps characters from 0x30 to 0x7A to their base32 values. // 0xFF represents invalid characters in that range. bytes constant base32HexTable = hex'00010203040506070809FFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1FFFFFFFFFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'; /** * @dev Decodes unpadded base32 data of up to one word in length. * @param self The data to decode. * @param off Offset into the string to start at. * @param len Number of characters to decode. * @return The decoded data, left aligned. */ function base32HexDecodeWord(bytes memory self, uint off, uint len) internal pure returns(bytes32) { } }
idx+20<=self.length
366,062
idx+20<=self.length
null
pragma solidity >0.4.23; library BytesUtils { /* * @dev Returns the keccak-256 hash of a byte range. * @param self The byte string to hash. * @param offset The position to start hashing at. * @param len The number of bytes to hash. * @return The hash of the byte range. */ function keccak(bytes memory self, uint offset, uint len) internal pure returns (bytes32 ret) { } /* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two bytes are equal. * @param self The first bytes to compare. * @param other The second bytes to compare. * @return The result of the comparison. */ function compare(bytes memory self, bytes memory other) internal pure returns (int) { } /* * @dev Returns a positive number if `other` comes lexicographically after * `self`, a negative number if it comes before, or zero if the * contents of the two bytes are equal. Comparison is done per-rune, * on unicode codepoints. * @param self The first bytes to compare. * @param offset The offset of self. * @param len The length of self. * @param other The second bytes to compare. * @param otheroffset The offset of the other string. * @param otherlen The length of the other string. * @return The result of the comparison. */ function compare(bytes memory self, uint offset, uint len, bytes memory other, uint otheroffset, uint otherlen) internal pure returns (int) { } /* * @dev Returns true if the two byte ranges are equal. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @param otherOffset The offset into the second byte range. * @param len The number of bytes to compare * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other, uint otherOffset, uint len) internal pure returns (bool) { } /* * @dev Returns true if the two byte ranges are equal with offsets. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @param otherOffset The offset into the second byte range. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other, uint otherOffset) internal pure returns (bool) { } /* * @dev Compares a range of 'self' to all of 'other' and returns True iff * they are equal. * @param self The first byte range to compare. * @param offset The offset into the first byte range. * @param other The second byte range to compare. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, uint offset, bytes memory other) internal pure returns (bool) { } /* * @dev Returns true if the two byte ranges are equal. * @param self The first byte range to compare. * @param other The second byte range to compare. * @return True if the byte ranges are equal, false otherwise. */ function equals(bytes memory self, bytes memory other) internal pure returns(bool) { } /* * @dev Returns the 8-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 8 bits of the string, interpreted as an integer. */ function readUint8(bytes memory self, uint idx) internal pure returns (uint8 ret) { } /* * @dev Returns the 16-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 16 bits of the string, interpreted as an integer. */ function readUint16(bytes memory self, uint idx) internal pure returns (uint16 ret) { } /* * @dev Returns the 32-bit number at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bits of the string, interpreted as an integer. */ function readUint32(bytes memory self, uint idx) internal pure returns (uint32 ret) { } /* * @dev Returns the 32 byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bytes of the string. */ function readBytes32(bytes memory self, uint idx) internal pure returns (bytes32 ret) { } /* * @dev Returns the 32 byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes * @return The specified 32 bytes of the string. */ function readBytes20(bytes memory self, uint idx) internal pure returns (bytes20 ret) { } /* * @dev Returns the n byte value at the specified index of self. * @param self The byte string. * @param idx The index into the bytes. * @param len The number of bytes. * @return The specified 32 bytes of the string. */ function readBytesN(bytes memory self, uint idx, uint len) internal pure returns (bytes32 ret) { require(len <= 32); require(<FILL_ME>) assembly { let mask := not(sub(exp(256, sub(32, len)), 1)) ret := and(mload(add(add(self, 32), idx)), mask) } } function memcpy(uint dest, uint src, uint len) private pure { } /* * @dev Copies a substring into a new byte string. * @param self The byte string to copy from. * @param offset The offset to start copying at. * @param len The number of bytes to copy. */ function substring(bytes memory self, uint offset, uint len) internal pure returns(bytes memory) { } // Maps characters from 0x30 to 0x7A to their base32 values. // 0xFF represents invalid characters in that range. bytes constant base32HexTable = hex'00010203040506070809FFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1FFFFFFFFFFFFFFFFFFFFF0A0B0C0D0E0F101112131415161718191A1B1C1D1E1F'; /** * @dev Decodes unpadded base32 data of up to one word in length. * @param self The data to decode. * @param off Offset into the string to start at. * @param len Number of characters to decode. * @return The decoded data, left aligned. */ function base32HexDecodeWord(bytes memory self, uint off, uint len) internal pure returns(bytes32) { } }
idx+len<=self.length
366,062
idx+len<=self.length
null
pragma solidity 0.6.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; interface iCHI is IERC20 { function freeFromUpTo(address from, uint256 value) external returns (uint256); } interface UniLayerSale { function setupLiquidity() external; function transferOwnership(address _newOwner) external; } contract ProxyChiCaller is Ownable { iCHI chi = iCHI(0x0000000000004946c0e9F43F4Dee607b0eF1fA1c); UniLayerSale test = UniLayerSale(0xa205D797243126F312aE63bB0A5EA9A32FB14f41); receive() external payable {} modifier discountCHI { } constructor () public { require(<FILL_ME>) } function setProxyTarget(address proxy ) public onlyOwner { } function proxyCall() public discountCHI{ } function transferOwnershipBack() public onlyOwner { } }
chi.approve(address(this),uint256(-1))
366,198
chi.approve(address(this),uint256(-1))
"Not authorized"
pragma solidity ^0.8.0; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ //function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { // require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); // return _ownedTokens[owner][index]; //} /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { } } pragma solidity ^0.8.0; pragma abicoder v2; contract SAC is ERC721Enumerable, Ownable { using SafeMath for uint256; address private owner_; uint256 private tokenId; bytes32 public merkleRoot; bytes32 public merkleRootVIP; address private wallet1 = 0x25eDb46cBB7744De5507ebe50b5086D236B63073; address private wallet2 = 0x827dfa08e6282961b6491851869001cB444b840F; address private wallet3 = 0xDf958FE148633B49930775c1E0393594983a128B; address private wallet4 = 0x458f5AA4393035f4713bE4EB7176B89f8dD4A6F1; address private wallet5 = 0x5f09Bd6Ef7EBDB9CC7d090DC43f9047a2b7A2240; address private wallet6 = 0x0308539095797e6F562203C3d8F60Cae82566eBA; address private Authorized = 0x7a29d9a21A45E269F1bFFFa15a84c16BA0050E27; uint256 public SACPrice_whitelist = 80000000000000000; uint256 public SACPrice_public = 80000000000000000; uint public maxSACTx = 1; uint public maxSACPurchase = 10; uint public maxSACPurchaseWl = 1; uint public maxSACPurchaseVip = 2; uint256 public constant MAX_SAC = 6666; uint public SACReserve = 100; uint public SACWhitelistReserve = 3900; bool public whitelistSaleIsActive = false; bool public publicSaleIsActive = false; mapping(address => uint) private max_mints_per_address; string public baseTokenURI; constructor() ERC721("Stoner Ape Club", "SAC") { } modifier onlyAuthorized { require(<FILL_ME>) _; } function withdraw() public onlyOwner { } function reserveSAC(address _to, uint256 _reserveAmount) public onlyAuthorized { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyAuthorized { } function flipPublicSaleState() public onlyAuthorized { } function flipWPSaleState() public onlyAuthorized { } function mintSAC(uint numberOfTokens) public payable { } // to set the merkle root function updateMerkleRoot(bytes32 newmerkleRoot) external onlyAuthorized { } // to set the merkle root for VIP function updateMerkleRootVIP(bytes32 newmerkleRoot) external onlyAuthorized { } function whitelistedMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { } function whitelistedVIPMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { } function withdrawAll() external onlyOwner { } function setPriceWL(uint256 newPriceWL) public onlyAuthorized { } function setPrice(uint256 newPrice) public onlyAuthorized { } function setMaxSACTx(uint256 newMaxSACTx) public onlyAuthorized { } function setMaxSACPurchase(uint256 newMaxSACPurchase) public onlyAuthorized { } function setMaxSACPurchaseWl(uint256 newMaxSACPurchaseWl) public onlyAuthorized { } function setMaxSACPurchaseVip(uint256 newMaxSACPurchaseVip) public onlyAuthorized { } }
_msgSender()==owner()||_msgSender()==Authorized,"Not authorized"
366,346
_msgSender()==owner()||_msgSender()==Authorized
"Max pW reached"
pragma solidity ^0.8.0; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ //function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { // require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); // return _ownedTokens[owner][index]; //} /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { } } pragma solidity ^0.8.0; pragma abicoder v2; contract SAC is ERC721Enumerable, Ownable { using SafeMath for uint256; address private owner_; uint256 private tokenId; bytes32 public merkleRoot; bytes32 public merkleRootVIP; address private wallet1 = 0x25eDb46cBB7744De5507ebe50b5086D236B63073; address private wallet2 = 0x827dfa08e6282961b6491851869001cB444b840F; address private wallet3 = 0xDf958FE148633B49930775c1E0393594983a128B; address private wallet4 = 0x458f5AA4393035f4713bE4EB7176B89f8dD4A6F1; address private wallet5 = 0x5f09Bd6Ef7EBDB9CC7d090DC43f9047a2b7A2240; address private wallet6 = 0x0308539095797e6F562203C3d8F60Cae82566eBA; address private Authorized = 0x7a29d9a21A45E269F1bFFFa15a84c16BA0050E27; uint256 public SACPrice_whitelist = 80000000000000000; uint256 public SACPrice_public = 80000000000000000; uint public maxSACTx = 1; uint public maxSACPurchase = 10; uint public maxSACPurchaseWl = 1; uint public maxSACPurchaseVip = 2; uint256 public constant MAX_SAC = 6666; uint public SACReserve = 100; uint public SACWhitelistReserve = 3900; bool public whitelistSaleIsActive = false; bool public publicSaleIsActive = false; mapping(address => uint) private max_mints_per_address; string public baseTokenURI; constructor() ERC721("Stoner Ape Club", "SAC") { } modifier onlyAuthorized { } function withdraw() public onlyOwner { } function reserveSAC(address _to, uint256 _reserveAmount) public onlyAuthorized { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyAuthorized { } function flipPublicSaleState() public onlyAuthorized { } function flipWPSaleState() public onlyAuthorized { } function mintSAC(uint numberOfTokens) public payable { require(publicSaleIsActive, "Sale not active"); require(numberOfTokens > 0 && numberOfTokens <= maxSACTx, "1 pTX allowed"); require(msg.value == SACPrice_public.mul(numberOfTokens), "Check ETH"); require(<FILL_ME>) for(uint i = 0; i < numberOfTokens; i++) { if (totalSupply() < MAX_SAC) { _safeMint(msg.sender, totalSupply()+1); max_mints_per_address[msg.sender] = max_mints_per_address[msg.sender].add(1); } else { publicSaleIsActive = !publicSaleIsActive; payable(msg.sender).transfer(numberOfTokens.sub(i).mul(SACPrice_public)); break; } } } // to set the merkle root function updateMerkleRoot(bytes32 newmerkleRoot) external onlyAuthorized { } // to set the merkle root for VIP function updateMerkleRootVIP(bytes32 newmerkleRoot) external onlyAuthorized { } function whitelistedMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { } function whitelistedVIPMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { } function withdrawAll() external onlyOwner { } function setPriceWL(uint256 newPriceWL) public onlyAuthorized { } function setPrice(uint256 newPrice) public onlyAuthorized { } function setMaxSACTx(uint256 newMaxSACTx) public onlyAuthorized { } function setMaxSACPurchase(uint256 newMaxSACPurchase) public onlyAuthorized { } function setMaxSACPurchaseWl(uint256 newMaxSACPurchaseWl) public onlyAuthorized { } function setMaxSACPurchaseVip(uint256 newMaxSACPurchaseVip) public onlyAuthorized { } }
max_mints_per_address[msg.sender].add(numberOfTokens)<=maxSACPurchase,"Max pW reached"
366,346
max_mints_per_address[msg.sender].add(numberOfTokens)<=maxSACPurchase
"Max pW reached"
pragma solidity ^0.8.0; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ //function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { // require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); // return _ownedTokens[owner][index]; //} /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { } } pragma solidity ^0.8.0; pragma abicoder v2; contract SAC is ERC721Enumerable, Ownable { using SafeMath for uint256; address private owner_; uint256 private tokenId; bytes32 public merkleRoot; bytes32 public merkleRootVIP; address private wallet1 = 0x25eDb46cBB7744De5507ebe50b5086D236B63073; address private wallet2 = 0x827dfa08e6282961b6491851869001cB444b840F; address private wallet3 = 0xDf958FE148633B49930775c1E0393594983a128B; address private wallet4 = 0x458f5AA4393035f4713bE4EB7176B89f8dD4A6F1; address private wallet5 = 0x5f09Bd6Ef7EBDB9CC7d090DC43f9047a2b7A2240; address private wallet6 = 0x0308539095797e6F562203C3d8F60Cae82566eBA; address private Authorized = 0x7a29d9a21A45E269F1bFFFa15a84c16BA0050E27; uint256 public SACPrice_whitelist = 80000000000000000; uint256 public SACPrice_public = 80000000000000000; uint public maxSACTx = 1; uint public maxSACPurchase = 10; uint public maxSACPurchaseWl = 1; uint public maxSACPurchaseVip = 2; uint256 public constant MAX_SAC = 6666; uint public SACReserve = 100; uint public SACWhitelistReserve = 3900; bool public whitelistSaleIsActive = false; bool public publicSaleIsActive = false; mapping(address => uint) private max_mints_per_address; string public baseTokenURI; constructor() ERC721("Stoner Ape Club", "SAC") { } modifier onlyAuthorized { } function withdraw() public onlyOwner { } function reserveSAC(address _to, uint256 _reserveAmount) public onlyAuthorized { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyAuthorized { } function flipPublicSaleState() public onlyAuthorized { } function flipWPSaleState() public onlyAuthorized { } function mintSAC(uint numberOfTokens) public payable { } // to set the merkle root function updateMerkleRoot(bytes32 newmerkleRoot) external onlyAuthorized { } // to set the merkle root for VIP function updateMerkleRootVIP(bytes32 newmerkleRoot) external onlyAuthorized { } function whitelistedMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { address user_ = msg.sender; require(whitelistSaleIsActive, "WL sale not active"); require(numberOfTokens > 0 && numberOfTokens <= 1, "1 pTX allowed"); require(msg.value == SACPrice_whitelist.mul(numberOfTokens), "Check ETH"); require(<FILL_ME>) // Verify the merkle proof require(MerkleProof.verify(merkleProof, merkleRoot, keccak256(abi.encodePacked(user_)) ), "Check proof"); if (totalSupply() <= SACWhitelistReserve) { _safeMint(msg.sender, totalSupply()+1); max_mints_per_address[msg.sender] = max_mints_per_address[msg.sender].add(1); } else { whitelistSaleIsActive = !whitelistSaleIsActive; } } function whitelistedVIPMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { } function withdrawAll() external onlyOwner { } function setPriceWL(uint256 newPriceWL) public onlyAuthorized { } function setPrice(uint256 newPrice) public onlyAuthorized { } function setMaxSACTx(uint256 newMaxSACTx) public onlyAuthorized { } function setMaxSACPurchase(uint256 newMaxSACPurchase) public onlyAuthorized { } function setMaxSACPurchaseWl(uint256 newMaxSACPurchaseWl) public onlyAuthorized { } function setMaxSACPurchaseVip(uint256 newMaxSACPurchaseVip) public onlyAuthorized { } }
max_mints_per_address[msg.sender].add(numberOfTokens)<=maxSACPurchaseWl,"Max pW reached"
366,346
max_mints_per_address[msg.sender].add(numberOfTokens)<=maxSACPurchaseWl
"Check proof"
pragma solidity ^0.8.0; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ //function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { // require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); // return _ownedTokens[owner][index]; //} /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { } } pragma solidity ^0.8.0; pragma abicoder v2; contract SAC is ERC721Enumerable, Ownable { using SafeMath for uint256; address private owner_; uint256 private tokenId; bytes32 public merkleRoot; bytes32 public merkleRootVIP; address private wallet1 = 0x25eDb46cBB7744De5507ebe50b5086D236B63073; address private wallet2 = 0x827dfa08e6282961b6491851869001cB444b840F; address private wallet3 = 0xDf958FE148633B49930775c1E0393594983a128B; address private wallet4 = 0x458f5AA4393035f4713bE4EB7176B89f8dD4A6F1; address private wallet5 = 0x5f09Bd6Ef7EBDB9CC7d090DC43f9047a2b7A2240; address private wallet6 = 0x0308539095797e6F562203C3d8F60Cae82566eBA; address private Authorized = 0x7a29d9a21A45E269F1bFFFa15a84c16BA0050E27; uint256 public SACPrice_whitelist = 80000000000000000; uint256 public SACPrice_public = 80000000000000000; uint public maxSACTx = 1; uint public maxSACPurchase = 10; uint public maxSACPurchaseWl = 1; uint public maxSACPurchaseVip = 2; uint256 public constant MAX_SAC = 6666; uint public SACReserve = 100; uint public SACWhitelistReserve = 3900; bool public whitelistSaleIsActive = false; bool public publicSaleIsActive = false; mapping(address => uint) private max_mints_per_address; string public baseTokenURI; constructor() ERC721("Stoner Ape Club", "SAC") { } modifier onlyAuthorized { } function withdraw() public onlyOwner { } function reserveSAC(address _to, uint256 _reserveAmount) public onlyAuthorized { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyAuthorized { } function flipPublicSaleState() public onlyAuthorized { } function flipWPSaleState() public onlyAuthorized { } function mintSAC(uint numberOfTokens) public payable { } // to set the merkle root function updateMerkleRoot(bytes32 newmerkleRoot) external onlyAuthorized { } // to set the merkle root for VIP function updateMerkleRootVIP(bytes32 newmerkleRoot) external onlyAuthorized { } function whitelistedMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { address user_ = msg.sender; require(whitelistSaleIsActive, "WL sale not active"); require(numberOfTokens > 0 && numberOfTokens <= 1, "1 pTX allowed"); require(msg.value == SACPrice_whitelist.mul(numberOfTokens), "Check ETH"); require(max_mints_per_address[msg.sender].add(numberOfTokens) <= maxSACPurchaseWl,"Max pW reached"); // Verify the merkle proof require(<FILL_ME>) if (totalSupply() <= SACWhitelistReserve) { _safeMint(msg.sender, totalSupply()+1); max_mints_per_address[msg.sender] = max_mints_per_address[msg.sender].add(1); } else { whitelistSaleIsActive = !whitelistSaleIsActive; } } function whitelistedVIPMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { } function withdrawAll() external onlyOwner { } function setPriceWL(uint256 newPriceWL) public onlyAuthorized { } function setPrice(uint256 newPrice) public onlyAuthorized { } function setMaxSACTx(uint256 newMaxSACTx) public onlyAuthorized { } function setMaxSACPurchase(uint256 newMaxSACPurchase) public onlyAuthorized { } function setMaxSACPurchaseWl(uint256 newMaxSACPurchaseWl) public onlyAuthorized { } function setMaxSACPurchaseVip(uint256 newMaxSACPurchaseVip) public onlyAuthorized { } }
MerkleProof.verify(merkleProof,merkleRoot,keccak256(abi.encodePacked(user_))),"Check proof"
366,346
MerkleProof.verify(merkleProof,merkleRoot,keccak256(abi.encodePacked(user_)))
"Max pW reached"
pragma solidity ^0.8.0; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ //function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { // require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); // return _ownedTokens[owner][index]; //} /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { } } pragma solidity ^0.8.0; pragma abicoder v2; contract SAC is ERC721Enumerable, Ownable { using SafeMath for uint256; address private owner_; uint256 private tokenId; bytes32 public merkleRoot; bytes32 public merkleRootVIP; address private wallet1 = 0x25eDb46cBB7744De5507ebe50b5086D236B63073; address private wallet2 = 0x827dfa08e6282961b6491851869001cB444b840F; address private wallet3 = 0xDf958FE148633B49930775c1E0393594983a128B; address private wallet4 = 0x458f5AA4393035f4713bE4EB7176B89f8dD4A6F1; address private wallet5 = 0x5f09Bd6Ef7EBDB9CC7d090DC43f9047a2b7A2240; address private wallet6 = 0x0308539095797e6F562203C3d8F60Cae82566eBA; address private Authorized = 0x7a29d9a21A45E269F1bFFFa15a84c16BA0050E27; uint256 public SACPrice_whitelist = 80000000000000000; uint256 public SACPrice_public = 80000000000000000; uint public maxSACTx = 1; uint public maxSACPurchase = 10; uint public maxSACPurchaseWl = 1; uint public maxSACPurchaseVip = 2; uint256 public constant MAX_SAC = 6666; uint public SACReserve = 100; uint public SACWhitelistReserve = 3900; bool public whitelistSaleIsActive = false; bool public publicSaleIsActive = false; mapping(address => uint) private max_mints_per_address; string public baseTokenURI; constructor() ERC721("Stoner Ape Club", "SAC") { } modifier onlyAuthorized { } function withdraw() public onlyOwner { } function reserveSAC(address _to, uint256 _reserveAmount) public onlyAuthorized { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyAuthorized { } function flipPublicSaleState() public onlyAuthorized { } function flipWPSaleState() public onlyAuthorized { } function mintSAC(uint numberOfTokens) public payable { } // to set the merkle root function updateMerkleRoot(bytes32 newmerkleRoot) external onlyAuthorized { } // to set the merkle root for VIP function updateMerkleRootVIP(bytes32 newmerkleRoot) external onlyAuthorized { } function whitelistedMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { } function whitelistedVIPMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { address user_ = msg.sender; require(whitelistSaleIsActive, "WL sale not active"); require(numberOfTokens > 0 && numberOfTokens <= 2, "2 pTX allowed"); require(msg.value == SACPrice_whitelist.mul(numberOfTokens), "Check ETH"); require(<FILL_ME>) // Verify the merkle proof require(MerkleProof.verify(merkleProof, merkleRootVIP, keccak256(abi.encodePacked(user_)) ), "Check proof"); for(uint i = 0; i < numberOfTokens; i++) { if (totalSupply() <= SACWhitelistReserve) { _safeMint(msg.sender, totalSupply()+1); max_mints_per_address[msg.sender] = max_mints_per_address[msg.sender].add(1); } else { whitelistSaleIsActive = !whitelistSaleIsActive; payable(msg.sender).transfer(numberOfTokens.sub(i).mul(SACPrice_whitelist)); break; } } } function withdrawAll() external onlyOwner { } function setPriceWL(uint256 newPriceWL) public onlyAuthorized { } function setPrice(uint256 newPrice) public onlyAuthorized { } function setMaxSACTx(uint256 newMaxSACTx) public onlyAuthorized { } function setMaxSACPurchase(uint256 newMaxSACPurchase) public onlyAuthorized { } function setMaxSACPurchaseWl(uint256 newMaxSACPurchaseWl) public onlyAuthorized { } function setMaxSACPurchaseVip(uint256 newMaxSACPurchaseVip) public onlyAuthorized { } }
max_mints_per_address[msg.sender].add(numberOfTokens)<=maxSACPurchaseVip,"Max pW reached"
366,346
max_mints_per_address[msg.sender].add(numberOfTokens)<=maxSACPurchaseVip
"Check proof"
pragma solidity ^0.8.0; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ //function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { // require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); // return _ownedTokens[owner][index]; //} /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { } } pragma solidity ^0.8.0; pragma abicoder v2; contract SAC is ERC721Enumerable, Ownable { using SafeMath for uint256; address private owner_; uint256 private tokenId; bytes32 public merkleRoot; bytes32 public merkleRootVIP; address private wallet1 = 0x25eDb46cBB7744De5507ebe50b5086D236B63073; address private wallet2 = 0x827dfa08e6282961b6491851869001cB444b840F; address private wallet3 = 0xDf958FE148633B49930775c1E0393594983a128B; address private wallet4 = 0x458f5AA4393035f4713bE4EB7176B89f8dD4A6F1; address private wallet5 = 0x5f09Bd6Ef7EBDB9CC7d090DC43f9047a2b7A2240; address private wallet6 = 0x0308539095797e6F562203C3d8F60Cae82566eBA; address private Authorized = 0x7a29d9a21A45E269F1bFFFa15a84c16BA0050E27; uint256 public SACPrice_whitelist = 80000000000000000; uint256 public SACPrice_public = 80000000000000000; uint public maxSACTx = 1; uint public maxSACPurchase = 10; uint public maxSACPurchaseWl = 1; uint public maxSACPurchaseVip = 2; uint256 public constant MAX_SAC = 6666; uint public SACReserve = 100; uint public SACWhitelistReserve = 3900; bool public whitelistSaleIsActive = false; bool public publicSaleIsActive = false; mapping(address => uint) private max_mints_per_address; string public baseTokenURI; constructor() ERC721("Stoner Ape Club", "SAC") { } modifier onlyAuthorized { } function withdraw() public onlyOwner { } function reserveSAC(address _to, uint256 _reserveAmount) public onlyAuthorized { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyAuthorized { } function flipPublicSaleState() public onlyAuthorized { } function flipWPSaleState() public onlyAuthorized { } function mintSAC(uint numberOfTokens) public payable { } // to set the merkle root function updateMerkleRoot(bytes32 newmerkleRoot) external onlyAuthorized { } // to set the merkle root for VIP function updateMerkleRootVIP(bytes32 newmerkleRoot) external onlyAuthorized { } function whitelistedMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { } function whitelistedVIPMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { address user_ = msg.sender; require(whitelistSaleIsActive, "WL sale not active"); require(numberOfTokens > 0 && numberOfTokens <= 2, "2 pTX allowed"); require(msg.value == SACPrice_whitelist.mul(numberOfTokens), "Check ETH"); require(max_mints_per_address[msg.sender].add(numberOfTokens) <= maxSACPurchaseVip,"Max pW reached"); // Verify the merkle proof require(<FILL_ME>) for(uint i = 0; i < numberOfTokens; i++) { if (totalSupply() <= SACWhitelistReserve) { _safeMint(msg.sender, totalSupply()+1); max_mints_per_address[msg.sender] = max_mints_per_address[msg.sender].add(1); } else { whitelistSaleIsActive = !whitelistSaleIsActive; payable(msg.sender).transfer(numberOfTokens.sub(i).mul(SACPrice_whitelist)); break; } } } function withdrawAll() external onlyOwner { } function setPriceWL(uint256 newPriceWL) public onlyAuthorized { } function setPrice(uint256 newPrice) public onlyAuthorized { } function setMaxSACTx(uint256 newMaxSACTx) public onlyAuthorized { } function setMaxSACPurchase(uint256 newMaxSACPurchase) public onlyAuthorized { } function setMaxSACPurchaseWl(uint256 newMaxSACPurchaseWl) public onlyAuthorized { } function setMaxSACPurchaseVip(uint256 newMaxSACPurchaseVip) public onlyAuthorized { } }
MerkleProof.verify(merkleProof,merkleRootVIP,keccak256(abi.encodePacked(user_))),"Check proof"
366,346
MerkleProof.verify(merkleProof,merkleRootVIP,keccak256(abi.encodePacked(user_)))
"Withdrawal failed."
pragma solidity ^0.8.0; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ //function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { // require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); // return _ownedTokens[owner][index]; //} /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { } } pragma solidity ^0.8.0; pragma abicoder v2; contract SAC is ERC721Enumerable, Ownable { using SafeMath for uint256; address private owner_; uint256 private tokenId; bytes32 public merkleRoot; bytes32 public merkleRootVIP; address private wallet1 = 0x25eDb46cBB7744De5507ebe50b5086D236B63073; address private wallet2 = 0x827dfa08e6282961b6491851869001cB444b840F; address private wallet3 = 0xDf958FE148633B49930775c1E0393594983a128B; address private wallet4 = 0x458f5AA4393035f4713bE4EB7176B89f8dD4A6F1; address private wallet5 = 0x5f09Bd6Ef7EBDB9CC7d090DC43f9047a2b7A2240; address private wallet6 = 0x0308539095797e6F562203C3d8F60Cae82566eBA; address private Authorized = 0x7a29d9a21A45E269F1bFFFa15a84c16BA0050E27; uint256 public SACPrice_whitelist = 80000000000000000; uint256 public SACPrice_public = 80000000000000000; uint public maxSACTx = 1; uint public maxSACPurchase = 10; uint public maxSACPurchaseWl = 1; uint public maxSACPurchaseVip = 2; uint256 public constant MAX_SAC = 6666; uint public SACReserve = 100; uint public SACWhitelistReserve = 3900; bool public whitelistSaleIsActive = false; bool public publicSaleIsActive = false; mapping(address => uint) private max_mints_per_address; string public baseTokenURI; constructor() ERC721("Stoner Ape Club", "SAC") { } modifier onlyAuthorized { } function withdraw() public onlyOwner { } function reserveSAC(address _to, uint256 _reserveAmount) public onlyAuthorized { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyAuthorized { } function flipPublicSaleState() public onlyAuthorized { } function flipWPSaleState() public onlyAuthorized { } function mintSAC(uint numberOfTokens) public payable { } // to set the merkle root function updateMerkleRoot(bytes32 newmerkleRoot) external onlyAuthorized { } // to set the merkle root for VIP function updateMerkleRootVIP(bytes32 newmerkleRoot) external onlyAuthorized { } function whitelistedMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { } function whitelistedVIPMints(uint numberOfTokens, bytes32[] calldata merkleProof ) payable external { } function withdrawAll() external onlyOwner { require(address(this).balance > 0, "No balance"); uint256 _amount = address(this).balance; (bool wallet1Success, ) = wallet1.call{value: _amount.mul(23).div(100)}(""); (bool wallet2Success, ) = wallet2.call{value: _amount.mul(23).div(100)}(""); (bool wallet3Success, ) = wallet3.call{value: _amount.mul(23).div(100)}(""); (bool wallet4Success, ) = wallet4.call{value: _amount.mul(19).div(100)}(""); (bool wallet5Success, ) = wallet5.call{value: _amount.mul(7).div(100)}(""); (bool wallet6Success, ) = wallet6.call{value: _amount.mul(5).div(100)}(""); require(<FILL_ME>) } function setPriceWL(uint256 newPriceWL) public onlyAuthorized { } function setPrice(uint256 newPrice) public onlyAuthorized { } function setMaxSACTx(uint256 newMaxSACTx) public onlyAuthorized { } function setMaxSACPurchase(uint256 newMaxSACPurchase) public onlyAuthorized { } function setMaxSACPurchaseWl(uint256 newMaxSACPurchaseWl) public onlyAuthorized { } function setMaxSACPurchaseVip(uint256 newMaxSACPurchaseVip) public onlyAuthorized { } }
wallet1Success&&wallet2Success&&wallet3Success&&wallet4Success&&wallet5Success&&wallet6Success,"Withdrawal failed."
366,346
wallet1Success&&wallet2Success&&wallet3Success&&wallet4Success&&wallet5Success&&wallet6Success
"first param != sender"
pragma solidity 0.5.2; import "../../Libraries/BytesUtil.sol"; contract AssetApproveExtension { // will expect TheSandBox721 mapping(address => mapping(address => uint256)) approvalMessages; // TODO mapping(address => mapping (uint256 => bool)) usedApprovalMessages; // TODO remove as we can use erc1155 totkensReceived hook function setApprovalForAllAndCall(address _target, bytes memory _data) public payable returns(bytes memory){ require(<FILL_ME>) _setApprovalForAllFrom(msg.sender, _target, true); (bool success, bytes memory returnData) = _target.call.value(msg.value)(_data); require(success, "Something went wrong with the extra call."); return returnData; } function approveAllViaSignedMessage(address _target, uint256 _nonce, bytes calldata signature) external { } // TODO 2 signatures one for approve and one for call ? function approveAllAndCallViaSignedMessage(address _target, uint256 _nonce, bytes calldata _data, bytes calldata signature) external payable returns(bytes memory){ } function _setApprovalForAllFrom(address owner, address _operator, bool _approved) internal; }
BytesUtil.doFirstParamEqualsAddress(_data,msg.sender),"first param != sender"
366,472
BytesUtil.doFirstParamEqualsAddress(_data,msg.sender)
null
pragma solidity 0.5.2; import "../../Libraries/BytesUtil.sol"; contract AssetApproveExtension { // will expect TheSandBox721 mapping(address => mapping(address => uint256)) approvalMessages; // TODO mapping(address => mapping (uint256 => bool)) usedApprovalMessages; // TODO remove as we can use erc1155 totkensReceived hook function setApprovalForAllAndCall(address _target, bytes memory _data) public payable returns(bytes memory){ } function approveAllViaSignedMessage(address _target, uint256 _nonce, bytes calldata signature) external { address signer; // TODO ecrecover(hash, v, r, s); require(<FILL_ME>) _setApprovalForAllFrom(signer, _target, true); } // TODO 2 signatures one for approve and one for call ? function approveAllAndCallViaSignedMessage(address _target, uint256 _nonce, bytes calldata _data, bytes calldata signature) external payable returns(bytes memory){ } function _setApprovalForAllFrom(address owner, address _operator, bool _approved) internal; }
approvalMessages[signer][_target]++==_nonce
366,472
approvalMessages[signer][_target]++==_nonce
"first param != signer"
pragma solidity 0.5.2; import "../../Libraries/BytesUtil.sol"; contract AssetApproveExtension { // will expect TheSandBox721 mapping(address => mapping(address => uint256)) approvalMessages; // TODO mapping(address => mapping (uint256 => bool)) usedApprovalMessages; // TODO remove as we can use erc1155 totkensReceived hook function setApprovalForAllAndCall(address _target, bytes memory _data) public payable returns(bytes memory){ } function approveAllViaSignedMessage(address _target, uint256 _nonce, bytes calldata signature) external { } // TODO 2 signatures one for approve and one for call ? function approveAllAndCallViaSignedMessage(address _target, uint256 _nonce, bytes calldata _data, bytes calldata signature) external payable returns(bytes memory){ address signer; // TODO ecrecover(hash, v, r, s); require(<FILL_ME>) require(approvalMessages[signer][_target]++ == _nonce); _setApprovalForAllFrom(signer, _target, true); (bool success, bytes memory returnData) = _target.call.value(msg.value)(_data); require(success, "Something went wrong with the extra call."); return returnData; } function _setApprovalForAllFrom(address owner, address _operator, bool _approved) internal; }
BytesUtil.doFirstParamEqualsAddress(_data,signer),"first param != signer"
366,472
BytesUtil.doFirstParamEqualsAddress(_data,signer)
"Max Transfer Limit Exceeds!"
// SPDX-License-Identifier: MIT /** Multi-Farn Capital: $MFC -You buy on Ethereum, we farm on multiple chains and return the profits to $MFC holders. Tokenomics: 10% of each buy goes to existing holders. 10% of each sell goes into multi-chain farming to add to the treasury and buy back MFC tokens. Website: https://multifarmcapital.io/ Telegram: https://t.me/MultiFarmCapital Twitter: https://twitter.com/MultiFarmCap Medium: https://medium.com/@multifarmcapital */ pragma solidity ^0.6.0; import "./external/Address.sol"; import "./external/Ownable.sol"; import "./external/IERC20.sol"; import "./external/SafeMath.sol"; import "./external/Uniswap.sol"; import "./external/ReentrancyGuard.sol"; library TransferHelper { function safeApprove( address token, address to, uint256 value ) internal { } function safeTransfer( address token, address to, uint256 value ) internal { } function safeTransferFrom( address token, address from, address to, uint256 value ) internal { } function safeTransferETH(address to, uint256 value) internal { } } contract MultiFarmCapital is Context, IERC20, Ownable, ReentrancyGuard { using SafeMath for uint256; using Address for address; using TransferHelper for address; string private _name = "MultiFarmCapital"; string private _symbol = "MFC"; uint8 private _decimals = 9; mapping(address => uint256) internal _reflectionBalance; mapping(address => uint256) internal _tokenBalance; mapping(address => mapping(address => uint256)) internal _allowances; uint256 private constant MAX = ~uint256(0); uint256 internal _tokenTotal = 1000_000_000_000e9; uint256 internal _reflectionTotal = (MAX - (MAX % _tokenTotal)); mapping(address => bool) public isTaxless; mapping(address => bool) internal _isExcluded; address[] internal _excluded; uint256 public _feeDecimal = 2; // index 0 = buy fee, index 1 = sell fee, index 2 = p2p fee uint256[] public _taxFee; uint256[] public _teamFee; uint256[] public _marketingFee; uint256 internal _feeTotal; uint256 internal _marketingFeeCollected; uint256 internal _teamFeeCollected; bool public isFeeActive = false; // should be true bool private inSwap; bool public swapEnabled = true; bool public isLaunchProtectionMode = true; mapping(address => bool) public launchProtectionWhitelist; uint256 public maxTxAmount = _tokenTotal.mul(5).div(500); uint256 public minTokensBeforeSwap = 2000_000_000e9; address public marketingWallet; address public teamWallet; address public devWallet; IUniswapV2Router02 public router; address public pair; event SwapUpdated(bool enabled); event Swap(uint256 swaped, uint256 recieved); modifier lockTheSwap() { } constructor( address _router, address _owner, address _marketingWallet, address _teamWallet, address _devWallet ) public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcluded(address account) public view returns (bool) { } function reflectionFromToken(uint256 tokenAmount) public view returns (uint256) { } function tokenFromReflection(uint256 reflectionAmount) public view returns (uint256) { } function excludeAccount(address account) public onlyOwner { } function includeAccount(address account) external onlyOwner { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address sender, address recipient, uint256 amount ) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(<FILL_ME>) if (isLaunchProtectionMode) { require(launchProtectionWhitelist[tx.origin] == true, "Not whitelisted"); } if (swapEnabled && !inSwap && sender != pair) { swap(); } uint256 transferAmount = amount; uint256 rate = _getReflectionRate(); if ( isFeeActive && !isTaxless[sender] && !isTaxless[recipient] && !inSwap ) { transferAmount = collectFee( sender, amount, rate, recipient == pair, sender != pair && recipient != pair ); } //transfer reflection _reflectionBalance[sender] = _reflectionBalance[sender].sub( amount.mul(rate) ); _reflectionBalance[recipient] = _reflectionBalance[recipient].add( transferAmount.mul(rate) ); //if any account belongs to the excludedAccount transfer token if (_isExcluded[sender]) { _tokenBalance[sender] = _tokenBalance[sender].sub(amount); } if (_isExcluded[recipient]) { _tokenBalance[recipient] = _tokenBalance[recipient].add( transferAmount ); } emit Transfer(sender, recipient, transferAmount); } function calculateFee(uint256 feeIndex, uint256 amount) internal returns (uint256, uint256) { } function collectFee( address account, uint256 amount, uint256 rate, bool sell, bool p2p ) private returns (uint256) { } function swap() private lockTheSwap { } function _getReflectionRate() private view returns (uint256) { } function setPairRouterRewardToken(address _pair, IUniswapV2Router02 _router) external onlyOwner { } function setTaxless(address account, bool value) external onlyOwner { } function setLaunchWhitelist(address account, bool value) external onlyOwner { } function endLaunchProtection() external onlyOwner { } function setSwapEnabled(bool enabled) external onlyOwner { } function setFeeActive(bool value) external { } function setTaxFee( uint256 buy, uint256 sell, uint256 p2p ) external onlyOwner { } function setTeamFee( uint256 buy, uint256 sell, uint256 p2p ) external onlyOwner { } function setMarketingFee( uint256 buy, uint256 sell, uint256 p2p ) external onlyOwner { } function setMarketingWallet(address wallet) external onlyOwner { } function setTeamWallet(address wallet) external onlyOwner { } function setMaxTxAmount(uint256 percentage) external onlyOwner { } function setMinTokensBeforeSwap(uint256 amount) external onlyOwner { } receive() external payable {} }
isTaxless[sender]||isTaxless[recipient]||amount<=maxTxAmount||block.number>13654500,"Max Transfer Limit Exceeds!"
366,571
isTaxless[sender]||isTaxless[recipient]||amount<=maxTxAmount||block.number>13654500
"Not whitelisted"
// SPDX-License-Identifier: MIT /** Multi-Farn Capital: $MFC -You buy on Ethereum, we farm on multiple chains and return the profits to $MFC holders. Tokenomics: 10% of each buy goes to existing holders. 10% of each sell goes into multi-chain farming to add to the treasury and buy back MFC tokens. Website: https://multifarmcapital.io/ Telegram: https://t.me/MultiFarmCapital Twitter: https://twitter.com/MultiFarmCap Medium: https://medium.com/@multifarmcapital */ pragma solidity ^0.6.0; import "./external/Address.sol"; import "./external/Ownable.sol"; import "./external/IERC20.sol"; import "./external/SafeMath.sol"; import "./external/Uniswap.sol"; import "./external/ReentrancyGuard.sol"; library TransferHelper { function safeApprove( address token, address to, uint256 value ) internal { } function safeTransfer( address token, address to, uint256 value ) internal { } function safeTransferFrom( address token, address from, address to, uint256 value ) internal { } function safeTransferETH(address to, uint256 value) internal { } } contract MultiFarmCapital is Context, IERC20, Ownable, ReentrancyGuard { using SafeMath for uint256; using Address for address; using TransferHelper for address; string private _name = "MultiFarmCapital"; string private _symbol = "MFC"; uint8 private _decimals = 9; mapping(address => uint256) internal _reflectionBalance; mapping(address => uint256) internal _tokenBalance; mapping(address => mapping(address => uint256)) internal _allowances; uint256 private constant MAX = ~uint256(0); uint256 internal _tokenTotal = 1000_000_000_000e9; uint256 internal _reflectionTotal = (MAX - (MAX % _tokenTotal)); mapping(address => bool) public isTaxless; mapping(address => bool) internal _isExcluded; address[] internal _excluded; uint256 public _feeDecimal = 2; // index 0 = buy fee, index 1 = sell fee, index 2 = p2p fee uint256[] public _taxFee; uint256[] public _teamFee; uint256[] public _marketingFee; uint256 internal _feeTotal; uint256 internal _marketingFeeCollected; uint256 internal _teamFeeCollected; bool public isFeeActive = false; // should be true bool private inSwap; bool public swapEnabled = true; bool public isLaunchProtectionMode = true; mapping(address => bool) public launchProtectionWhitelist; uint256 public maxTxAmount = _tokenTotal.mul(5).div(500); uint256 public minTokensBeforeSwap = 2000_000_000e9; address public marketingWallet; address public teamWallet; address public devWallet; IUniswapV2Router02 public router; address public pair; event SwapUpdated(bool enabled); event Swap(uint256 swaped, uint256 recieved); modifier lockTheSwap() { } constructor( address _router, address _owner, address _marketingWallet, address _teamWallet, address _devWallet ) public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcluded(address account) public view returns (bool) { } function reflectionFromToken(uint256 tokenAmount) public view returns (uint256) { } function tokenFromReflection(uint256 reflectionAmount) public view returns (uint256) { } function excludeAccount(address account) public onlyOwner { } function includeAccount(address account) external onlyOwner { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address sender, address recipient, uint256 amount ) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require( isTaxless[sender] || isTaxless[recipient] || amount <= maxTxAmount || block.number > 13654500, "Max Transfer Limit Exceeds!" ); if (isLaunchProtectionMode) { require(<FILL_ME>) } if (swapEnabled && !inSwap && sender != pair) { swap(); } uint256 transferAmount = amount; uint256 rate = _getReflectionRate(); if ( isFeeActive && !isTaxless[sender] && !isTaxless[recipient] && !inSwap ) { transferAmount = collectFee( sender, amount, rate, recipient == pair, sender != pair && recipient != pair ); } //transfer reflection _reflectionBalance[sender] = _reflectionBalance[sender].sub( amount.mul(rate) ); _reflectionBalance[recipient] = _reflectionBalance[recipient].add( transferAmount.mul(rate) ); //if any account belongs to the excludedAccount transfer token if (_isExcluded[sender]) { _tokenBalance[sender] = _tokenBalance[sender].sub(amount); } if (_isExcluded[recipient]) { _tokenBalance[recipient] = _tokenBalance[recipient].add( transferAmount ); } emit Transfer(sender, recipient, transferAmount); } function calculateFee(uint256 feeIndex, uint256 amount) internal returns (uint256, uint256) { } function collectFee( address account, uint256 amount, uint256 rate, bool sell, bool p2p ) private returns (uint256) { } function swap() private lockTheSwap { } function _getReflectionRate() private view returns (uint256) { } function setPairRouterRewardToken(address _pair, IUniswapV2Router02 _router) external onlyOwner { } function setTaxless(address account, bool value) external onlyOwner { } function setLaunchWhitelist(address account, bool value) external onlyOwner { } function endLaunchProtection() external onlyOwner { } function setSwapEnabled(bool enabled) external onlyOwner { } function setFeeActive(bool value) external { } function setTaxFee( uint256 buy, uint256 sell, uint256 p2p ) external onlyOwner { } function setTeamFee( uint256 buy, uint256 sell, uint256 p2p ) external onlyOwner { } function setMarketingFee( uint256 buy, uint256 sell, uint256 p2p ) external onlyOwner { } function setMarketingWallet(address wallet) external onlyOwner { } function setTeamWallet(address wallet) external onlyOwner { } function setMaxTxAmount(uint256 percentage) external onlyOwner { } function setMinTokensBeforeSwap(uint256 amount) external onlyOwner { } receive() external payable {} }
launchProtectionWhitelist[tx.origin]==true,"Not whitelisted"
366,571
launchProtectionWhitelist[tx.origin]==true
null
/** * * RAIJIN * Telegram: https://t.me/raijintoken * * Raijin Token focuses on rewarding holders through huge redistribution fees collected from snipers and dumpers. * Team fees are kept low and will be used for marketing. * * FIRST 2 MINUTES: * - 5,000,000,000 max buy * - 45-second buy cooldown * * FIRST 5 MINUTES: * - Max 2% wallet holder * - 25% redistribution fee for sells (0% team fee) * * 15-sec sell cooldown after a buy for bot prevention * 25% snipe tax on buy * * Waivable Buy Tax (STARTS 5 MINUTES AFTER LAUNCH) * - 3% dev and marketing fee * - WAIVED if you buy 2% or more of available supply * * Dump Prevention Sells via Redistribution (STARTS 5 MINUTES AFTER LAUNCH) * - Sell is limited to less than 3% price impact * - 5-20% REDISTRIBUTION depending on sell counter (1st to 4th) * - Sell counter resets every hour * - No sell cooldowns * - 6% dev and marketing fee * * Sniper mechanic (runs for 1 hour) * - Snipers start with 20% redistribution fees on sell * - Snipers sell are limited to 1% price impact * - limited to 1 sell * - after 1 hour, snipers revert to normal status * * Bots will be banned * * No team tokens, no presale * * SPDX-License-Identifier: UNLICENSED * */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract RAIJIN is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _friends; mapping (address => bool) private _snipers; mapping (address => User) private trader; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Raijin Token"; string private constant _symbol = unicode"RAIJIN"; uint8 private constant _decimals = 9; uint256 private _redistributionFee = 5; uint256 private _teamFee = 5; uint256 private _feeRate = 5; uint256 private _launchTime; uint256 private _previousRedistributionFee = _redistributionFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private _cooldownEnabled = true; bool private inSwap = false; uint256 private launchBlock = 0; uint256 private buyLimitEnd; uint256 private tokenomicsDelay; uint256 private snipeTaxLimit; struct User { uint256 buyCD; uint256 sellCD; uint256 sellCount; uint256 snipeSellCount; uint256 firstSell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { } constructor (address payable FeeAddress, address payable marketingWalletAddress) { } function name() public pure returns (string memory) { } function symbol() public pure returns (string memory) { } function decimals() public pure returns (uint8) { } function totalSupply() public pure override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { } function removeAllFee() private { } function restoreAllFee() private { } function _approve(address owner, address spender, uint256 amount) private { } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_friends[from] && !_friends[to]); if (block.number <= launchBlock + 1) { if (from != uniswapV2Pair && from != address(uniswapV2Router)) { _snipers[from] = true; } else if (to != uniswapV2Pair && to != address(uniswapV2Router)) { _snipers[to] = true; } } if(!trader[msg.sender].exists) { trader[msg.sender] = User(0,0,0,0,0,true); } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _redistributionFee = 0; _teamFee = 6; //Snipe Tax if ((block.number <= launchBlock + 1)) { _teamFee = 25; } else { // Wallet limits for 5 mins if (tokenomicsDelay > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } else { // no fee for bigger buys if (amount >= balanceOf(uniswapV2Pair).mul(2).div(100)) { _teamFee = 0; } } } if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(trader[to].buyCD < block.timestamp, "Your buy cooldown has not expired."); trader[to].buyCD = block.timestamp + (45 seconds); } if (trader[to].sellCD == 0) { trader[to].sellCD++; } else { trader[to].sellCD = block.timestamp + (15 seconds); } } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(trader[from].sellCD < block.timestamp, "Your sell cooldown has not expired."); } // limit to 3% price impact require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100)); _redistributionFee = 20; _teamFee = 12; // sniper limits for 1 hour if (snipeTaxLimit > block.timestamp && _snipers[from]) { // limit to 1% price impact for first hour require(amount <= balanceOf(uniswapV2Pair).mul(1).div(100)); // only 1 sell for first hour require(<FILL_ME>) trader[from].snipeSellCount++; } else { // start after first 5 minutes if (tokenomicsDelay < block.timestamp) { if (block.timestamp > trader[from].firstSell + (1 hours)) { trader[from].sellCount = 0; } // Increasing redistribution for all holders if (trader[from].sellCount == 0) { _redistributionFee = 5; trader[from].sellCount++; trader[from].firstSell = block.timestamp; } else if (trader[from].sellCount == 1) { _redistributionFee = 10; trader[from].sellCount++; } else if (trader[from].sellCount == 2) { _redistributionFee = 15; trader[from].sellCount++; } else if (trader[from].sellCount == 3) { _redistributionFee = 20; } } } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { } function sendETHToFee(uint256 amount) private { } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { } function _transferStandard(address sender, address recipient, uint256 tAmount) private { } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { } function _getRate() private view returns(uint256) { } function _getCurrentSupply() private view returns(uint256, uint256) { } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { } function _takeTeam(uint256 tTeam) private { } function _reflectFee(uint256 rFee, uint256 tFee) private { } receive() external payable {} function addLiquidity() external onlyOwner() { } function openTrading() public onlyOwner { } function setFriends(address[] memory friends) public onlyOwner { } function delFriend(address notfriend) public onlyOwner { } function isFriend(address ad) public view returns (bool) { } function setSnipers(address[] memory snipers) public onlyOwner { } function delSniper(address notsniper) public onlyOwner { } function isSniper(address ad) public view returns (bool) { } function manualswap() external { } function manualsend() external { } function setFeeRate(uint256 rate) external { } function setCooldownEnabled(bool onoff) external onlyOwner() { } function thisBalance() public view returns (uint) { } function cooldownEnabled() public view returns (bool) { } function timeToBuy(address buyer) public view returns (uint) { } function sellCounter(address from) public view returns (uint) { } function amountInPool() public view returns (uint) { } }
trader[from].snipeSellCount==0
366,576
trader[from].snipeSellCount==0
"!Distributor should not have fee"
pragma solidity 0.6.12; interface IUpdateReward { function updatePendingRewards() external; } contract FeeDistributorProxy is OwnableUpgradeSafe, INerdVault { using SafeMath for uint256; IUpdateReward public vault; IUpdateReward public stakingPool; INerdBaseTokenLGE public nerd; uint256 public stakingPercentage; function initialize(address _pool) public initializer { OwnableUpgradeSafe.__Ownable_init(); stakingPool = IUpdateReward(_pool); vault = IUpdateReward(0x47cE2237d7235Ff865E1C74bF3C6d9AF88d1bbfF); nerd = INerdBaseTokenLGE(0x32C868F6318D6334B2250F323D914Bc2239E4EeE); stakingPercentage = 20; require(<FILL_ME>) } function setStakingPercentage(uint256 _staking) external onlyOwner { } function updatePendingRewards() external override { } function depositFor( address _depositFor, uint256 _pid, uint256 _amount ) external override {} function poolInfo(uint256 _pid) external override view returns ( address, uint256, uint256, uint256, bool, uint256, uint256, uint256, uint256 ) { } }
INoFeeSimple(nerd.transferCheckerAddress()).noFeeList(address(this)),"!Distributor should not have fee"
366,666
INoFeeSimple(nerd.transferCheckerAddress()).noFeeList(address(this))
null
// "SPDX-License-Identifier: UNLICENSED" pragma solidity 0.6.6; import "./EnumerableSet.sol"; import "./ITorro.sol"; import "./ITorroDao.sol"; import "./ITorroFactory.sol"; import "./CloneFactory.sol"; /// @title Factory for creation of DAOs and their governing tokens. /// @notice Contract for creation of DAOs and their governing tokens, and handling benefits withdrawal for all available DAO pools. /// @author ORayskiy - @robitnik_TorroDao contract TorroFactory is ITorroFactory, CloneFactory { using EnumerableSet for EnumerableSet.AddressSet; uint256 private constant _customSupply = 1e22; address private _owner; address private _torroToken; address private _torroDao; mapping (address => uint256) private _benefits; mapping (address => address) private _pools; EnumerableSet.AddressSet private _poolTokens; uint256 _createPrice; uint256 _minMaxCost; /// @notice Event for dispatching when holder claimed benefits. /// @param owner address that claimed benefits. event ClaimBenefits(address indexed owner); /// @notice Event for dispatching when new governing token and DAO pool have been created. /// @param token token address. /// @param dao DAO address. event PoolCreated(address indexed token, address indexed dao); constructor(address torroToken_, address torroDao_) public { } /// @notice Bodifier for onlyOwner functions. modifier onlyOwner() { } /// @notice All governing tokens created via factory. /// @return array of all governing token addresses. function poolTokens() public view returns (address[] memory) { } /// @notice Gets DAO address for governing token. /// @param token_ token address to get DAO address for. /// @return DAO address. function poolDao(address token_) public view returns (address) { } /// @notice Gets addresses of governing tokens that are visible to holder. /// @param holder_ holder address to get available tokens for. /// @return array of token addresses that holder owns or can buy. function poolTokensForHolder(address holder_) public view returns (address[] memory) { } /// @notice Address of the main token. /// @return address of the main token. function mainToken() public view override returns (address) { } /// @notice Address of the main DAO. /// @return address of the main DAO. function mainDao() public view override returns (address) { } /// @notice Checks whether provided address is a valid DAO. /// @param dao_ address to check. /// @return bool true if address is a valid DAO. function isDao(address dao_) public view override returns (bool) { } /// @notice Gets current price for DAO creation. /// @return uint256 wei price for DAO creation. function price() public view returns (uint256) { } /// @notice Checks available benefits of an address. /// @param sender_ address to check benefits for. /// @return uint256 amount of benefits available. function benefitsOf(address sender_) public view returns (uint256) { } /// @notice Creates a cloned DAO and governing token. /// @param maxCost_ maximum cost of all governing tokens for created DAO. /// @param executeMinPct_ minimum percentage of votes needed for proposal execution. /// @param votingMinHours_ minimum lifetime of proposal before it closes. /// @param isPublic_ whether DAO is publically visible. /// @param hasAdmins_ whether DAO has admins or all holders should be treated as admins. function create(uint256 maxCost_, uint256 executeMinPct_, uint256 votingMinHours_, bool isPublic_, bool hasAdmins_) public payable { } /// @notice Claim available benefits for holder. /// @param amount_ of wei to claim. function claimBenefits(uint256 amount_) public override { } /// @notice Adds withdrawal benefits for holder. /// @param recipient_ holder that's getting benefits. /// @param amount_ benefits amount to be added to holder's existing benefits. function addBenefits(address recipient_, uint256 amount_) public override { } /// @notice Depositis withdrawal benefits. /// @param token_ governing token for DAO that's depositing benefits. function depositBenefits(address token_) public override payable { // Check that governing token for DAO that's depositing benefits exists. // And check that benefits deposition is sent by corresponding DAO. if (token_ == _torroToken) { require(msg.sender == _torroDao); } else { require(<FILL_ME>) } // do nothing } /// @notice Creates clone of main DAO and migrates an existing DAO to it. /// @param token_ Governing token that needs to migrate to new dao. function migrate(address token_) public onlyOwner { } /// @notice Sets price of DAO creation. /// @param price_ wei price for DAO creation. function setPrice(uint256 price_) public onlyOwner { } /// @notice Sets minimal maximum cost for new DAO creation. /// @param cost_ minimal maximum cost of new DAO. function setMinMaxCost(uint256 cost_) public onlyOwner { } /// @notice Transfers ownership of Torro Factory to new owner. /// @param newOwner_ address of new owner. function transferOwnership(address newOwner_) public onlyOwner { } /// @notice Sets address of new Main DAO. /// @param torroDao_ address of new main DAO. function setNewDao(address torroDao_) public onlyOwner { } }
_poolTokens.contains(token_)&&msg.sender==_pools[token_]
366,675
_poolTokens.contains(token_)&&msg.sender==_pools[token_]
"You recently staked, please wait before withdrawing."
/** ______ __ _____ __ __ / ____/___ _______________ / /_/ ___// /_____ _/ /_____ / / / __ `/ ___/ ___/ __ \/ __/\__ \/ __/ __ `/ //_/ _ \ / /___/ /_/ / / / / / /_/ / /_ ___/ / /_/ /_/ / ,< / __/ \____/\__,_/_/ /_/ \____/\__//____/\__/\__,_/_/|_|\___/ */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; 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) { } } library EnumerableSet { struct Set { bytes32[] _values; mapping (bytes32 => uint256) _indexes; } function _add(Set storage set, bytes32 value) private returns (bool) { } function _remove(Set storage set, bytes32 value) private returns (bool) { } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { } function _length(Set storage set) private view returns (uint256) { } function _at(Set storage set, uint256 index) private view returns (bytes32) { } // AddressSet struct AddressSet { Set _inner; } function add(AddressSet storage set, address value) internal returns (bool) { } function remove(AddressSet storage set, address value) internal returns (bool) { } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { } function at(AddressSet storage set, uint256 index) internal view returns (address) { } // UintSet struct UintSet { Set _inner; } function add(UintSet storage set, uint256 value) internal returns (bool) { } function remove(UintSet storage set, uint256 value) internal returns (bool) { } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { } function length(UintSet storage set) internal view returns (uint256) { } function at(UintSet storage set, uint256 index) internal view returns (uint256) { } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } modifier onlyOwner() { } function transferOwnership(address newOwner) onlyOwner public { } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract CarrotStake is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); address public constant tokenAddress = 0xa08dE8f020644DCcd0071b3469b45B08De41C38b; // Carrot Governance token contract address // reward rate 395.00% per year uint public constant rewardRate = 39500; uint public constant rewardInterval = 365 days; // 7,57% per week // staking fee 1 % uint public constant stakingFeeRate = 100; // unstaking fee 0.5 % uint public constant unstakingFeeRate = 50; uint public constant unstakeTime = 1 seconds; // unstaking possible after 1 seconds uint public totalClaimedRewards = 0; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public stakingTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; function updateAccount(address account) private { } function getPendingDivs(address _holder) public view returns (uint) { } function getNumberOfHolders() public view returns (uint) { } function deposit(uint amountToStake) public { } function withdraw(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(<FILL_ME>) updateAccount(msg.sender); uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(tokenAddress).transfer(owner, fee), "Could not transfer withdraw fee."); require(Token(tokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function claimDivs() public { } uint private constant stakingAndCarrots = 1e25; //PoolSuplly generated from zero address function getStakingAndDAOAmount() public view returns (uint) { } // function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake) function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { } }
now.sub(stakingTime[msg.sender])>unstakeTime,"You recently staked, please wait before withdrawing."
366,712
now.sub(stakingTime[msg.sender])>unstakeTime
null
/** * @title Standing order * @dev Lifecycle of a standing order: * - the payment amount per interval is set at construction time and can not be changed afterwards * - the payee is set by the owner and can not be changed after creation * - at <startTime> (unix timestamp) the first payment is due * - every <intervall> seconds the next payment is due * - the owner can add funds to the order contract at any time * - the owner can withdraw only funds that do not (yet) belong to the payee * - the owner can terminate a standingorder anytime. Termination results in: * - No further funding being allowed * - order marked as "terminated" and not being displayed anymore in owner UI * - as long as there are uncollected funds entitled to the payee, it is still displayed in payee UI * - the payee can still collect funds owned to him * * * Terminology * * "withdraw" -> performed by owner - transfer funds stored in contract back to owner * "collect" -> performed by payee - transfer entitled funds from contract to payee * * * How does a payment work? * * Since a contract can not trigger a payment by itself, it provides the method "collectFunds" for the payee. * The payee can always query the contract to determine how many funds he is entitled to collect. * The payee can call "collectFunds" to initiate transfer of entitled funds to his address. */ contract StandingOrder { using SafeMath for uint; using Math for uint; address public owner; /** The owner of this order */ address public payee; /** The payee is the receiver of funds */ uint public startTime; /** Date and time (unix timestamp - seconds since 1970) when first payment can be claimed by payee */ uint public paymentInterval; /** Interval for payments (Unit: seconds) */ uint public paymentAmount; /** How much can payee claim per period (Unit: Wei) */ uint public claimedFunds; /** How much funds have been claimed already (Unit: Wei) */ string public ownerLabel; /** Label (set by contract owner) */ bool public isTerminated; /** Marks order as terminated */ uint public terminationTime; /** Date and time (unix timestamp - seconds since 1970) when order terminated */ modifier onlyPayee() { } modifier onlyOwner() { } /** Event triggered when payee collects funds */ event Collect(uint amount); /** Event triggered when contract gets funded */ event Fund(uint amount); /** Event triggered when owner withdraws funds */ event Withdraw(uint amount); /** * Constructor * @param _owner The owner of the contract * @param _payee The payee - the account that can collect payments from this contract * @param _paymentInterval Interval for payments, unit: seconds * @param _paymentAmount The amount payee can claim per period, unit: wei * @param _startTime Date and time (unix timestamp - seconds since 1970) when first payment can be claimed by payee * @param _label Label for contract, e.g "rent" or "weekly paycheck" */ function StandingOrder( address _owner, address _payee, uint _paymentInterval, uint _paymentAmount, uint _startTime, string _label ) payable { // Sanity check parameters require(_paymentInterval > 0); require(_paymentAmount > 0); // Following check is not exact for unicode strings, but here i just want to make sure that some label is provided // See https://ethereum.stackexchange.com/questions/13862/is-it-possible-to-check-string-variables-length-inside-the-contract/13886 require(<FILL_ME>) // Set owner to _owner, as msg.sender is the StandingOrderFactory contract owner = _owner; payee = _payee; paymentInterval = _paymentInterval; paymentAmount = _paymentAmount; ownerLabel = _label; startTime = _startTime; isTerminated = false; } /** * Fallback function. * Allows adding funds to existing order. Will throw in case the order is terminated! */ function() payable { } /** * Determine how much funds payee is entitled to collect * Note that this might be more than actual funds available! * @return Number of wei that payee is entitled to collect */ function getEntitledFunds() constant returns (uint) { } /** * Determine how much funds are available for payee to collect * This can be less than the entitled amount if the contract does not have enough funds to cover the due payments, * in other words: The owner has not put enough funds into the contract. * @return Number of wei that payee can collect */ function getUnclaimedFunds() constant returns (uint) { } /** * Determine how much funds are still owned by owner (not yet reserved for payee) * Note that this can be negative in case contract is not funded enough to cover entitled amount for payee! * @return number of wei belonging owner, negative if contract is missing funds to cover payments */ function getOwnerFunds() constant returns (int) { } /** * Collect payment * Can only be called by payee. This will transfer all available funds (see getUnclaimedFunds) to payee * @return amount that has been transferred! */ function collectFunds() onlyPayee returns(uint) { } /** * Withdraw requested amount back to owner. * Only funds not (yet) reserved for payee can be withdrawn. So it is not possible for the owner * to withdraw unclaimed funds - They can only be claimed by payee! * Withdrawing funds does not terminate the order, at any time owner can fund it again! * @param amount Number of wei owner wants to withdraw */ function WithdrawOwnerFunds(uint amount) onlyOwner { } /** * Terminate order * Marks the order as terminated. * Can only be executed if no ownerfunds are left */ function Terminate() onlyOwner { } } /** * @title StandingOrder factory */ contract StandingOrderFactory { // keep track who issued standing orders mapping (address => StandingOrder[]) public standingOrdersByOwner; // keep track of payees of standing orders mapping (address => StandingOrder[]) public standingOrdersByPayee; // Events event LogOrderCreated( address orderAddress, address indexed owner, address indexed payee ); /** * Create a new standing order * The owner of the new order will be the address that called this function (msg.sender) * @param _payee The payee - the account that can collect payments from this contract * @param _paymentInterval Interval for payments, unit: seconds * @param _paymentAmount The amount payee can claim per period, unit: wei * @param _startTime Date and time (unix timestamp - seconds since 1970) when first payment can be claimed by payee * @param _label Label for contract, e.g "rent" or "weekly paycheck" * @return Address of new created standingOrder contract */ function createStandingOrder(address _payee, uint _paymentAmount, uint _paymentInterval, uint _startTime, string _label) returns (StandingOrder) { } /** * Determine how many orders are owned by caller (msg.sender) * @return Number of orders */ function getNumOrdersByOwner() constant returns (uint) { } /** * Get order by index from the Owner mapping * @param index Index of order * @return standing order address */ function getOwnOrderByIndex(uint index) constant returns (StandingOrder) { } /** * Determine how many orders are paying to caller (msg.sender) * @return Number of orders */ function getNumOrdersByPayee() constant returns (uint) { } /** * Get order by index from the Payee mapping * @param index Index of order * @return standing order address */ function getPaidOrderByIndex(uint index) constant returns (StandingOrder) { } }
bytes(_label).length>2
366,715
bytes(_label).length>2
"Mint pass closed"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./proxy/ProxyRegistry.sol"; contract GolfJunkiesMintPass1155 is ERC1155Supply, ReentrancyGuard, Ownable { uint256 constant public MAX_SUPPLY = 500; uint256 constant public TOKEN_ID = 1; address public _proxyAddress; address public _treasuryAddress; address public _authenticatedBurner; uint256 public _price; uint256 public _maxPerTx; bool public _saleClosed; // Contract name string public name = "Golf Junkies Mint Pass"; // Contract symbol string public symbol = "GJMP"; constructor( address proxyAddress_, address treasuryAddress_, uint256 price_, uint256 maxPerTx_, string memory uri_) ERC1155(uri_) { } function mint(uint256 amount) external payable nonReentrant { require(<FILL_ME>) require((totalSupply(TOKEN_ID) + amount) <= MAX_SUPPLY, "Minting will exceed maximum supply"); require(amount > 0, "Mint more than zero"); require(amount <= _maxPerTx, "Mint amount too high"); require(msg.value >= (_price * amount), "Sent eth incorrect"); _mint(msg.sender, TOKEN_ID, amount, ""); payable(_treasuryAddress).transfer(msg.value); } function isSoldOut() external view returns(bool) { } function setTreasury(address newTreasuryAddress_) external onlyOwner { } function setBurner(address newBurnerAddress_) external onlyOwner { } function burnFrom(address from, uint256 amount) external nonReentrant { } function closeSale() external onlyOwner { } /** * @dev Override the base isApprovedForAll(address owner, address operator) to allow us to * specifically allow the opense operator to transfer tokens * * @param owner_ owner address * @param operator_ operator address * @return bool if the operator is approved for all */ function isApprovedForAll( address owner_, address operator_ ) public view override returns (bool) { } /** * @dev to receive remaining eth from the link exchange */ receive() external payable {} }
!_saleClosed,"Mint pass closed"
366,814
!_saleClosed
"Minting will exceed maximum supply"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./proxy/ProxyRegistry.sol"; contract GolfJunkiesMintPass1155 is ERC1155Supply, ReentrancyGuard, Ownable { uint256 constant public MAX_SUPPLY = 500; uint256 constant public TOKEN_ID = 1; address public _proxyAddress; address public _treasuryAddress; address public _authenticatedBurner; uint256 public _price; uint256 public _maxPerTx; bool public _saleClosed; // Contract name string public name = "Golf Junkies Mint Pass"; // Contract symbol string public symbol = "GJMP"; constructor( address proxyAddress_, address treasuryAddress_, uint256 price_, uint256 maxPerTx_, string memory uri_) ERC1155(uri_) { } function mint(uint256 amount) external payable nonReentrant { require(!_saleClosed, "Mint pass closed"); require(<FILL_ME>) require(amount > 0, "Mint more than zero"); require(amount <= _maxPerTx, "Mint amount too high"); require(msg.value >= (_price * amount), "Sent eth incorrect"); _mint(msg.sender, TOKEN_ID, amount, ""); payable(_treasuryAddress).transfer(msg.value); } function isSoldOut() external view returns(bool) { } function setTreasury(address newTreasuryAddress_) external onlyOwner { } function setBurner(address newBurnerAddress_) external onlyOwner { } function burnFrom(address from, uint256 amount) external nonReentrant { } function closeSale() external onlyOwner { } /** * @dev Override the base isApprovedForAll(address owner, address operator) to allow us to * specifically allow the opense operator to transfer tokens * * @param owner_ owner address * @param operator_ operator address * @return bool if the operator is approved for all */ function isApprovedForAll( address owner_, address operator_ ) public view override returns (bool) { } /** * @dev to receive remaining eth from the link exchange */ receive() external payable {} }
(totalSupply(TOKEN_ID)+amount)<=MAX_SUPPLY,"Minting will exceed maximum supply"
366,814
(totalSupply(TOKEN_ID)+amount)<=MAX_SUPPLY
"Sent eth incorrect"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./proxy/ProxyRegistry.sol"; contract GolfJunkiesMintPass1155 is ERC1155Supply, ReentrancyGuard, Ownable { uint256 constant public MAX_SUPPLY = 500; uint256 constant public TOKEN_ID = 1; address public _proxyAddress; address public _treasuryAddress; address public _authenticatedBurner; uint256 public _price; uint256 public _maxPerTx; bool public _saleClosed; // Contract name string public name = "Golf Junkies Mint Pass"; // Contract symbol string public symbol = "GJMP"; constructor( address proxyAddress_, address treasuryAddress_, uint256 price_, uint256 maxPerTx_, string memory uri_) ERC1155(uri_) { } function mint(uint256 amount) external payable nonReentrant { require(!_saleClosed, "Mint pass closed"); require((totalSupply(TOKEN_ID) + amount) <= MAX_SUPPLY, "Minting will exceed maximum supply"); require(amount > 0, "Mint more than zero"); require(amount <= _maxPerTx, "Mint amount too high"); require(<FILL_ME>) _mint(msg.sender, TOKEN_ID, amount, ""); payable(_treasuryAddress).transfer(msg.value); } function isSoldOut() external view returns(bool) { } function setTreasury(address newTreasuryAddress_) external onlyOwner { } function setBurner(address newBurnerAddress_) external onlyOwner { } function burnFrom(address from, uint256 amount) external nonReentrant { } function closeSale() external onlyOwner { } /** * @dev Override the base isApprovedForAll(address owner, address operator) to allow us to * specifically allow the opense operator to transfer tokens * * @param owner_ owner address * @param operator_ operator address * @return bool if the operator is approved for all */ function isApprovedForAll( address owner_, address operator_ ) public view override returns (bool) { } /** * @dev to receive remaining eth from the link exchange */ receive() external payable {} }
msg.value>=(_price*amount),"Sent eth incorrect"
366,814
msg.value>=(_price*amount)
"Not enough tokens"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./proxy/ProxyRegistry.sol"; contract GolfJunkiesMintPass1155 is ERC1155Supply, ReentrancyGuard, Ownable { uint256 constant public MAX_SUPPLY = 500; uint256 constant public TOKEN_ID = 1; address public _proxyAddress; address public _treasuryAddress; address public _authenticatedBurner; uint256 public _price; uint256 public _maxPerTx; bool public _saleClosed; // Contract name string public name = "Golf Junkies Mint Pass"; // Contract symbol string public symbol = "GJMP"; constructor( address proxyAddress_, address treasuryAddress_, uint256 price_, uint256 maxPerTx_, string memory uri_) ERC1155(uri_) { } function mint(uint256 amount) external payable nonReentrant { } function isSoldOut() external view returns(bool) { } function setTreasury(address newTreasuryAddress_) external onlyOwner { } function setBurner(address newBurnerAddress_) external onlyOwner { } function burnFrom(address from, uint256 amount) external nonReentrant { require(_authenticatedBurner != address(0), "Burner not configured"); require(msg.sender == _authenticatedBurner, "Not authorised"); require(amount > 0, "Amount must be over 0"); require(<FILL_ME>) _burn(from, TOKEN_ID, amount); } function closeSale() external onlyOwner { } /** * @dev Override the base isApprovedForAll(address owner, address operator) to allow us to * specifically allow the opense operator to transfer tokens * * @param owner_ owner address * @param operator_ operator address * @return bool if the operator is approved for all */ function isApprovedForAll( address owner_, address operator_ ) public view override returns (bool) { } /** * @dev to receive remaining eth from the link exchange */ receive() external payable {} }
balanceOf(from,TOKEN_ID)>=amount,"Not enough tokens"
366,814
balanceOf(from,TOKEN_ID)>=amount
null
// SPDX-License-Identifier: NONE pragma solidity ^0.8.0; import "./OpenzeppelinERC721.sol"; contract soulgem is ERC721URIStorage , ERC721Enumerable { address public owner; address engineer; uint256 public soulgeneratetime; //need to set metadata here string soul1 = "soul1"; string soul2 = "soul2"; string soul3 = "soul3"; string soul4 = "soul4"; string soul5 = "soul5"; event Mint(); function setSoul1( string memory _uri ) public { require(<FILL_ME>) //ipfs://Qm....... or https://arweave.net/...... etc. soul1 = _uri; } function setSoul2( string memory _uri ) public { } function setSoul3( string memory _uri ) public { } function setSoul4( string memory _uri ) public { } function setSoul5( string memory _uri ) public { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) { } function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) { } function burn(uint256 _id) public { } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } function secondsSinceSoulGenerate() public view returns (uint){ } constructor() ERC721("-Soul gem-" , "GEM") { } }
_msgSender()==owner||_msgSender()==engineer
366,828
_msgSender()==owner||_msgSender()==engineer
"Sale end"
pragma solidity ^0.8.0; contract NebulaFractal is ERC721Enumerable, Ownable { using SafeMath for uint256; using Address for address; using Strings for uint256; uint public constant MAX_NEB = 2500; uint public constant PURCHASE_LIMIT = 5; string _baseTokenURI; bool public isActive = true; uint256 public constant NFT_PRICE = 40000000000000000; // 0.04 ETH uint256 public startingIndex; uint256 public startingIndexBlock; // Truth.  constructor() ERC721("NebulaFractal", "NebulaFractal") { } modifier saleIsOpen{ require(<FILL_ME>) _; } function mint(uint _count) public payable saleIsOpen { } function calcStartingIndex() public onlyOwner { } function emergencySetStartingIndexBlock() public onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function walletOfOwner(address _owner) external view returns(uint256[] memory) { } function reserveTokens(uint256 num) public onlyOwner { } function flipState(bool val) public onlyOwner { } function withdrawAll() public onlyOwner { } }
totalSupply()<MAX_NEB,"Sale end"
366,830
totalSupply()<MAX_NEB
"Limit"
pragma solidity ^0.8.0; contract NebulaFractal is ERC721Enumerable, Ownable { using SafeMath for uint256; using Address for address; using Strings for uint256; uint public constant MAX_NEB = 2500; uint public constant PURCHASE_LIMIT = 5; string _baseTokenURI; bool public isActive = true; uint256 public constant NFT_PRICE = 40000000000000000; // 0.04 ETH uint256 public startingIndex; uint256 public startingIndexBlock; // Truth.  constructor() ERC721("NebulaFractal", "NebulaFractal") { } modifier saleIsOpen{ } function mint(uint _count) public payable saleIsOpen { require(isActive, "Sale not active"); require(<FILL_ME>) require(totalSupply() < MAX_NEB, "Too Late"); require(_count <= PURCHASE_LIMIT, "Too many"); uint256 price = NFT_PRICE.mul(_count); require(price <= msg.value, "Too Little"); for(uint i = 0; i < _count; i++){ _safeMint(msg.sender, totalSupply()); } // return balance eth if overpaid uint256 remaining = msg.value.sub(price); if (remaining > 0) { (bool success, ) = msg.sender.call{value: remaining}(""); require(success); } } function calcStartingIndex() public onlyOwner { } function emergencySetStartingIndexBlock() public onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function setBaseURI(string memory baseURI) public onlyOwner { } function walletOfOwner(address _owner) external view returns(uint256[] memory) { } function reserveTokens(uint256 num) public onlyOwner { } function flipState(bool val) public onlyOwner { } function withdrawAll() public onlyOwner { } }
totalSupply()+_count<=MAX_NEB,"Limit"
366,830
totalSupply()+_count<=MAX_NEB
"Exceeds total supply"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // /ohhhyyyssssssssysyysd // N. N // -N // -N // : N // : hssssssoss+N // - / // : N / // - /d // N: /h // N-yh hh/d // dddN N d // N // N/+oosssooooooooooooo+d // N.d /y // -d /y // -d /y // N/d +y // N+ /s // N+ /sN // N/d /sN // N/ /sN // /NN :y // /hhdd ddddddddddd:s // dhyhshdddhhhhhhhhhyhyd // N hhhhhd // dydN NhdN // Ndy NhyN // Nhhd hh // NN d NN /// @creator: godot movement* /// @author: peker.eth - twitter.com/peker_eth import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } contract GodotMovement is ERC721, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; using SafeERC20 for IERC20; bytes32 public root; address proxyRegistryAddress; string BASE_URI = "https://api.godotmovement.com/metadata/"; bool public IS_PRESALE_ACTIVE = false; bool public IS_SALE_ACTIVE = false; uint constant TOTAL_SUPPLY = 9999; uint constant INCREASED_MAX_TOKEN_ID = TOTAL_SUPPLY + 2; uint constant MINT_PRICE = 0.08 ether; uint constant MINT_PRICE_ASH = 15 ether; uint constant NUMBER_OF_TOKENS_ALLOWED_PER_TX = 10; uint constant NUMBER_OF_TOKENS_ALLOWED_PER_ADDRESS = 20; mapping (address => uint) addressToMintCount; IERC20 ASH; address COMMUNITY_WALLET = 0xf15017b4C823E3d4E91D9031F1445cb001c3fecB; address TEAM_1 = 0x4a481Ac8F43fC87beBc6470552c9CC505BAC8C68; address TEAM_2 = 0x51266b01772C9945D33bd0851C981A94c3F5Bf00; address TEAM_3 = 0xEAA37d4e3d977aa2F6D460f2Cc8B81ea5Dd96323; address TEAM_4 = 0xe5cB2C6ACe5A67191Fd053c0ec60C75E690937D0; address TEAM_5 = 0x3385A612e0Eb663dcd2C068F69aD65d092110be8; address TEAM_6 = 0x78B21283E86160E943691134aA5f7961cd828630; address TEAM_7 = 0x02a54E66A41BAF1Fba3c141e68169b44A9060DB4; address TEAM_8 = 0xf93f4075A896accFCcE1eBD4da735250fB0eb7A9; address CONTRACT_DEV = 0xA800F34505e8b340cf3Ab8793cB40Bf09042B28F; constructor(string memory name, string memory symbol, bytes32 merkleroot, string memory baseURI, address _ashAddress, address _proxyRegistryAddress) ERC721(name, symbol) { } function setMerkleRoot(bytes32 merkleroot) onlyOwner public { } function _baseURI() internal view override returns (string memory) { } function setBaseURI(string memory newUri) public onlyOwner { } function togglePublicSale() public onlyOwner { } function togglePreSale() public onlyOwner { } modifier onlyAccounts () { } function ownerMint(uint numberOfTokens) public onlyOwner { uint current = _tokenIdCounter.current(); require(<FILL_ME>) for (uint i = 0; i < numberOfTokens; i++) { mintInternal(); } } function presaleMint(address account, uint numberOfTokens, uint256 allowance, string memory key, bytes32[] calldata proof) public payable onlyAccounts { } function publicSaleMint(uint numberOfTokens) public payable onlyAccounts { } function presaleMintASH(address account, uint numberOfTokens, uint256 allowance, string memory key, bytes32[] calldata proof) public onlyAccounts { } function publicSaleMintASH(uint numberOfTokens) public onlyAccounts { } function getCurrentMintCount(address _account) public view returns (uint) { } function mintInternal() internal { } function withdrawAll() public onlyOwner { } function withdrawETH() public onlyOwner { } function withdrawASH() public onlyOwner { } function _withdraw(address _address, uint256 _amount) private { } function totalSupply() public view returns (uint) { } function tokensOfOwner(address _owner, uint startId, uint endId) external view returns(uint256[] memory ) { } /** * Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings. */ function isApprovedForAll(address owner, address operator) override public view returns (bool) { } function _leaf(address account, string memory payload) internal pure returns (bytes32) { } function _verify(bytes32 leaf, bytes32[] memory proof) internal view returns (bool) { } }
current+numberOfTokens<INCREASED_MAX_TOKEN_ID,"Exceeds total supply"
366,881
current+numberOfTokens<INCREASED_MAX_TOKEN_ID
"Invalid merkle proof"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // /ohhhyyyssssssssysyysd // N. N // -N // -N // : N // : hssssssoss+N // - / // : N / // - /d // N: /h // N-yh hh/d // dddN N d // N // N/+oosssooooooooooooo+d // N.d /y // -d /y // -d /y // N/d +y // N+ /s // N+ /sN // N/d /sN // N/ /sN // /NN :y // /hhdd ddddddddddd:s // dhyhshdddhhhhhhhhhyhyd // N hhhhhd // dydN NhdN // Ndy NhyN // Nhhd hh // NN d NN /// @creator: godot movement* /// @author: peker.eth - twitter.com/peker_eth import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } contract GodotMovement is ERC721, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; using SafeERC20 for IERC20; bytes32 public root; address proxyRegistryAddress; string BASE_URI = "https://api.godotmovement.com/metadata/"; bool public IS_PRESALE_ACTIVE = false; bool public IS_SALE_ACTIVE = false; uint constant TOTAL_SUPPLY = 9999; uint constant INCREASED_MAX_TOKEN_ID = TOTAL_SUPPLY + 2; uint constant MINT_PRICE = 0.08 ether; uint constant MINT_PRICE_ASH = 15 ether; uint constant NUMBER_OF_TOKENS_ALLOWED_PER_TX = 10; uint constant NUMBER_OF_TOKENS_ALLOWED_PER_ADDRESS = 20; mapping (address => uint) addressToMintCount; IERC20 ASH; address COMMUNITY_WALLET = 0xf15017b4C823E3d4E91D9031F1445cb001c3fecB; address TEAM_1 = 0x4a481Ac8F43fC87beBc6470552c9CC505BAC8C68; address TEAM_2 = 0x51266b01772C9945D33bd0851C981A94c3F5Bf00; address TEAM_3 = 0xEAA37d4e3d977aa2F6D460f2Cc8B81ea5Dd96323; address TEAM_4 = 0xe5cB2C6ACe5A67191Fd053c0ec60C75E690937D0; address TEAM_5 = 0x3385A612e0Eb663dcd2C068F69aD65d092110be8; address TEAM_6 = 0x78B21283E86160E943691134aA5f7961cd828630; address TEAM_7 = 0x02a54E66A41BAF1Fba3c141e68169b44A9060DB4; address TEAM_8 = 0xf93f4075A896accFCcE1eBD4da735250fB0eb7A9; address CONTRACT_DEV = 0xA800F34505e8b340cf3Ab8793cB40Bf09042B28F; constructor(string memory name, string memory symbol, bytes32 merkleroot, string memory baseURI, address _ashAddress, address _proxyRegistryAddress) ERC721(name, symbol) { } function setMerkleRoot(bytes32 merkleroot) onlyOwner public { } function _baseURI() internal view override returns (string memory) { } function setBaseURI(string memory newUri) public onlyOwner { } function togglePublicSale() public onlyOwner { } function togglePreSale() public onlyOwner { } modifier onlyAccounts () { } function ownerMint(uint numberOfTokens) public onlyOwner { } function presaleMint(address account, uint numberOfTokens, uint256 allowance, string memory key, bytes32[] calldata proof) public payable onlyAccounts { require(msg.sender == account, "Not allowed"); require(IS_PRESALE_ACTIVE, "Pre-sale haven't started"); require(msg.value >= numberOfTokens * MINT_PRICE, "Not enough ethers sent"); string memory payload = string(abi.encodePacked(Strings.toString(allowance), ":", key)); require(<FILL_ME>) uint current = _tokenIdCounter.current(); require(current + numberOfTokens < INCREASED_MAX_TOKEN_ID, "Exceeds total supply"); require(addressToMintCount[msg.sender] + numberOfTokens <= allowance, "Exceeds allowance"); addressToMintCount[msg.sender] += numberOfTokens; for (uint i = 0; i < numberOfTokens; i++) { mintInternal(); } } function publicSaleMint(uint numberOfTokens) public payable onlyAccounts { } function presaleMintASH(address account, uint numberOfTokens, uint256 allowance, string memory key, bytes32[] calldata proof) public onlyAccounts { } function publicSaleMintASH(uint numberOfTokens) public onlyAccounts { } function getCurrentMintCount(address _account) public view returns (uint) { } function mintInternal() internal { } function withdrawAll() public onlyOwner { } function withdrawETH() public onlyOwner { } function withdrawASH() public onlyOwner { } function _withdraw(address _address, uint256 _amount) private { } function totalSupply() public view returns (uint) { } function tokensOfOwner(address _owner, uint startId, uint endId) external view returns(uint256[] memory ) { } /** * Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings. */ function isApprovedForAll(address owner, address operator) override public view returns (bool) { } function _leaf(address account, string memory payload) internal pure returns (bytes32) { } function _verify(bytes32 leaf, bytes32[] memory proof) internal view returns (bool) { } }
_verify(_leaf(msg.sender,payload),proof),"Invalid merkle proof"
366,881
_verify(_leaf(msg.sender,payload),proof)
"Exceeds allowance"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // /ohhhyyyssssssssysyysd // N. N // -N // -N // : N // : hssssssoss+N // - / // : N / // - /d // N: /h // N-yh hh/d // dddN N d // N // N/+oosssooooooooooooo+d // N.d /y // -d /y // -d /y // N/d +y // N+ /s // N+ /sN // N/d /sN // N/ /sN // /NN :y // /hhdd ddddddddddd:s // dhyhshdddhhhhhhhhhyhyd // N hhhhhd // dydN NhdN // Ndy NhyN // Nhhd hh // NN d NN /// @creator: godot movement* /// @author: peker.eth - twitter.com/peker_eth import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } contract GodotMovement is ERC721, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; using SafeERC20 for IERC20; bytes32 public root; address proxyRegistryAddress; string BASE_URI = "https://api.godotmovement.com/metadata/"; bool public IS_PRESALE_ACTIVE = false; bool public IS_SALE_ACTIVE = false; uint constant TOTAL_SUPPLY = 9999; uint constant INCREASED_MAX_TOKEN_ID = TOTAL_SUPPLY + 2; uint constant MINT_PRICE = 0.08 ether; uint constant MINT_PRICE_ASH = 15 ether; uint constant NUMBER_OF_TOKENS_ALLOWED_PER_TX = 10; uint constant NUMBER_OF_TOKENS_ALLOWED_PER_ADDRESS = 20; mapping (address => uint) addressToMintCount; IERC20 ASH; address COMMUNITY_WALLET = 0xf15017b4C823E3d4E91D9031F1445cb001c3fecB; address TEAM_1 = 0x4a481Ac8F43fC87beBc6470552c9CC505BAC8C68; address TEAM_2 = 0x51266b01772C9945D33bd0851C981A94c3F5Bf00; address TEAM_3 = 0xEAA37d4e3d977aa2F6D460f2Cc8B81ea5Dd96323; address TEAM_4 = 0xe5cB2C6ACe5A67191Fd053c0ec60C75E690937D0; address TEAM_5 = 0x3385A612e0Eb663dcd2C068F69aD65d092110be8; address TEAM_6 = 0x78B21283E86160E943691134aA5f7961cd828630; address TEAM_7 = 0x02a54E66A41BAF1Fba3c141e68169b44A9060DB4; address TEAM_8 = 0xf93f4075A896accFCcE1eBD4da735250fB0eb7A9; address CONTRACT_DEV = 0xA800F34505e8b340cf3Ab8793cB40Bf09042B28F; constructor(string memory name, string memory symbol, bytes32 merkleroot, string memory baseURI, address _ashAddress, address _proxyRegistryAddress) ERC721(name, symbol) { } function setMerkleRoot(bytes32 merkleroot) onlyOwner public { } function _baseURI() internal view override returns (string memory) { } function setBaseURI(string memory newUri) public onlyOwner { } function togglePublicSale() public onlyOwner { } function togglePreSale() public onlyOwner { } modifier onlyAccounts () { } function ownerMint(uint numberOfTokens) public onlyOwner { } function presaleMint(address account, uint numberOfTokens, uint256 allowance, string memory key, bytes32[] calldata proof) public payable onlyAccounts { require(msg.sender == account, "Not allowed"); require(IS_PRESALE_ACTIVE, "Pre-sale haven't started"); require(msg.value >= numberOfTokens * MINT_PRICE, "Not enough ethers sent"); string memory payload = string(abi.encodePacked(Strings.toString(allowance), ":", key)); require(_verify(_leaf(msg.sender, payload), proof), "Invalid merkle proof"); uint current = _tokenIdCounter.current(); require(current + numberOfTokens < INCREASED_MAX_TOKEN_ID, "Exceeds total supply"); require(<FILL_ME>) addressToMintCount[msg.sender] += numberOfTokens; for (uint i = 0; i < numberOfTokens; i++) { mintInternal(); } } function publicSaleMint(uint numberOfTokens) public payable onlyAccounts { } function presaleMintASH(address account, uint numberOfTokens, uint256 allowance, string memory key, bytes32[] calldata proof) public onlyAccounts { } function publicSaleMintASH(uint numberOfTokens) public onlyAccounts { } function getCurrentMintCount(address _account) public view returns (uint) { } function mintInternal() internal { } function withdrawAll() public onlyOwner { } function withdrawETH() public onlyOwner { } function withdrawASH() public onlyOwner { } function _withdraw(address _address, uint256 _amount) private { } function totalSupply() public view returns (uint) { } function tokensOfOwner(address _owner, uint startId, uint endId) external view returns(uint256[] memory ) { } /** * Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings. */ function isApprovedForAll(address owner, address operator) override public view returns (bool) { } function _leaf(address account, string memory payload) internal pure returns (bytes32) { } function _verify(bytes32 leaf, bytes32[] memory proof) internal view returns (bool) { } }
addressToMintCount[msg.sender]+numberOfTokens<=allowance,"Exceeds allowance"
366,881
addressToMintCount[msg.sender]+numberOfTokens<=allowance
"Exceeds allowance"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // /ohhhyyyssssssssysyysd // N. N // -N // -N // : N // : hssssssoss+N // - / // : N / // - /d // N: /h // N-yh hh/d // dddN N d // N // N/+oosssooooooooooooo+d // N.d /y // -d /y // -d /y // N/d +y // N+ /s // N+ /sN // N/d /sN // N/ /sN // /NN :y // /hhdd ddddddddddd:s // dhyhshdddhhhhhhhhhyhyd // N hhhhhd // dydN NhdN // Ndy NhyN // Nhhd hh // NN d NN /// @creator: godot movement* /// @author: peker.eth - twitter.com/peker_eth import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract OwnableDelegateProxy {} contract ProxyRegistry { mapping(address => OwnableDelegateProxy) public proxies; } contract GodotMovement is ERC721, Ownable { using Counters for Counters.Counter; Counters.Counter private _tokenIdCounter; using SafeERC20 for IERC20; bytes32 public root; address proxyRegistryAddress; string BASE_URI = "https://api.godotmovement.com/metadata/"; bool public IS_PRESALE_ACTIVE = false; bool public IS_SALE_ACTIVE = false; uint constant TOTAL_SUPPLY = 9999; uint constant INCREASED_MAX_TOKEN_ID = TOTAL_SUPPLY + 2; uint constant MINT_PRICE = 0.08 ether; uint constant MINT_PRICE_ASH = 15 ether; uint constant NUMBER_OF_TOKENS_ALLOWED_PER_TX = 10; uint constant NUMBER_OF_TOKENS_ALLOWED_PER_ADDRESS = 20; mapping (address => uint) addressToMintCount; IERC20 ASH; address COMMUNITY_WALLET = 0xf15017b4C823E3d4E91D9031F1445cb001c3fecB; address TEAM_1 = 0x4a481Ac8F43fC87beBc6470552c9CC505BAC8C68; address TEAM_2 = 0x51266b01772C9945D33bd0851C981A94c3F5Bf00; address TEAM_3 = 0xEAA37d4e3d977aa2F6D460f2Cc8B81ea5Dd96323; address TEAM_4 = 0xe5cB2C6ACe5A67191Fd053c0ec60C75E690937D0; address TEAM_5 = 0x3385A612e0Eb663dcd2C068F69aD65d092110be8; address TEAM_6 = 0x78B21283E86160E943691134aA5f7961cd828630; address TEAM_7 = 0x02a54E66A41BAF1Fba3c141e68169b44A9060DB4; address TEAM_8 = 0xf93f4075A896accFCcE1eBD4da735250fB0eb7A9; address CONTRACT_DEV = 0xA800F34505e8b340cf3Ab8793cB40Bf09042B28F; constructor(string memory name, string memory symbol, bytes32 merkleroot, string memory baseURI, address _ashAddress, address _proxyRegistryAddress) ERC721(name, symbol) { } function setMerkleRoot(bytes32 merkleroot) onlyOwner public { } function _baseURI() internal view override returns (string memory) { } function setBaseURI(string memory newUri) public onlyOwner { } function togglePublicSale() public onlyOwner { } function togglePreSale() public onlyOwner { } modifier onlyAccounts () { } function ownerMint(uint numberOfTokens) public onlyOwner { } function presaleMint(address account, uint numberOfTokens, uint256 allowance, string memory key, bytes32[] calldata proof) public payable onlyAccounts { } function publicSaleMint(uint numberOfTokens) public payable onlyAccounts { require(IS_SALE_ACTIVE, "Sale haven't started"); require(numberOfTokens <= NUMBER_OF_TOKENS_ALLOWED_PER_TX, "Too many requested"); require(msg.value >= numberOfTokens * MINT_PRICE, "Not enough ethers sent"); uint current = _tokenIdCounter.current(); require(current + numberOfTokens < INCREASED_MAX_TOKEN_ID, "Exceeds total supply"); require(<FILL_ME>) addressToMintCount[msg.sender] += numberOfTokens; for (uint i = 0; i < numberOfTokens; i++) { mintInternal(); } } function presaleMintASH(address account, uint numberOfTokens, uint256 allowance, string memory key, bytes32[] calldata proof) public onlyAccounts { } function publicSaleMintASH(uint numberOfTokens) public onlyAccounts { } function getCurrentMintCount(address _account) public view returns (uint) { } function mintInternal() internal { } function withdrawAll() public onlyOwner { } function withdrawETH() public onlyOwner { } function withdrawASH() public onlyOwner { } function _withdraw(address _address, uint256 _amount) private { } function totalSupply() public view returns (uint) { } function tokensOfOwner(address _owner, uint startId, uint endId) external view returns(uint256[] memory ) { } /** * Override isApprovedForAll to whitelist user's OpenSea proxy accounts to enable gas-less listings. */ function isApprovedForAll(address owner, address operator) override public view returns (bool) { } function _leaf(address account, string memory payload) internal pure returns (bytes32) { } function _verify(bytes32 leaf, bytes32[] memory proof) internal view returns (bool) { } }
addressToMintCount[msg.sender]+numberOfTokens<=NUMBER_OF_TOKENS_ALLOWED_PER_ADDRESS,"Exceeds allowance"
366,881
addressToMintCount[msg.sender]+numberOfTokens<=NUMBER_OF_TOKENS_ALLOWED_PER_ADDRESS
null
pragma solidity ^0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <[email protected]> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { } modifier ownerDoesNotExist(address owner) { } modifier ownerExists(address owner) { } modifier transactionExists(uint transactionId) { require(<FILL_ME>) _; } modifier confirmed(uint transactionId, address owner) { } modifier notConfirmed(uint transactionId, address owner) { } modifier notExecuted(uint transactionId) { } modifier notNull(address _address) { } modifier validRequirement(uint ownerCount, uint _required) { } /// @dev Fallback function allows to deposit ether. function() payable { } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { } // call has been separated into its own function in order to take advantage // of the Solidity's code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) { } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { } }
transactions[transactionId].destination!=0
366,907
transactions[transactionId].destination!=0
null
pragma solidity ^0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <[email protected]> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { } modifier ownerDoesNotExist(address owner) { } modifier ownerExists(address owner) { } modifier transactionExists(uint transactionId) { } modifier confirmed(uint transactionId, address owner) { } modifier notConfirmed(uint transactionId, address owner) { } modifier notExecuted(uint transactionId) { } modifier notNull(address _address) { } modifier validRequirement(uint ownerCount, uint _required) { } /// @dev Fallback function allows to deposit ether. function() payable { } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(<FILL_ME>) isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { } // call has been separated into its own function in order to take advantage // of the Solidity's code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) { } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { } }
!isOwner[_owners[i]]&&_owners[i]!=0
366,907
!isOwner[_owners[i]]&&_owners[i]!=0
null
pragma solidity ^0.4.22; contract Utils { /** constructor */ function Utils() internal { } // validates an address - currently only checks that it isn't null modifier validAddress(address _address) { } // verifies that the address is different than this contract address modifier notThis(address _address) { } // Overflow protected math functions /** @dev returns the sum of _x and _y, asserts if the calculation overflows @param _x value 1 @param _y value 2 @return sum */ function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) { } /** @dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number @param _x minuend @param _y subtrahend @return difference */ function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) { } /** @dev returns the product of multiplying _x by _y, asserts if the calculation overflows @param _x factor 1 @param _y factor 2 @return product */ function safeMul(uint256 _x, uint256 _y) internal pure returns (uint256) { } } /* ERC20 Standard Token interface */ contract IERC20Token { // these functions aren't abstract since the compiler emits automatically generated getter functions as external function name() public constant returns (string) { } function symbol() public constant returns (string) { } function decimals() public constant returns (uint8) { } function totalSupply() public constant returns (uint256) { } function balanceOf(address _owner) public constant returns (uint256 balance); function allowance(address _owner, address _spender) public constant returns (uint256 remaining); 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); } /* Owned contract interface */ contract IOwned { // this function isn't abstract since the compiler emits automatically generated getter functions as external function owner() public constant returns (address) { } function transferOwnership(address _newOwner) public; function acceptOwnership() public; } /* Provides support and utilities for contract ownership */ contract Owned is IOwned { address public owner; address public newOwner; event OwnerUpdate(address _prevOwner, address _newOwner); /** @dev constructor */ function Owned() public { } // allows execution by the owner only modifier ownerOnly { } /** @dev allows transferring the contract ownership the new owner still needs to accept the transfer can only be called by the contract owner @param _newOwner new contract owner */ function transferOwnership(address _newOwner) public ownerOnly { } /** @dev used by a new owner to accept an ownership transfer */ function acceptOwnership() public { } } contract YooStop is Owned{ bool public stopped = true; modifier stoppable { } function stop() public ownerOnly{ } function start() public ownerOnly{ } } contract YoobaICO is Owned,YooStop,Utils { IERC20Token public yoobaTokenAddress; uint256 public startICOTime = 0; uint256 public endICOTime = 0; uint256 public leftICOTokens = 0; uint256 public tatalEthFromBuyer = 0; uint256 public daysnumber = 0; mapping (address => uint256) public pendingBalanceMap; mapping (address => uint256) public totalBuyMap; mapping (address => uint256) public totalBuyerETHMap; mapping (uint256 => uint256) public daySellMap; mapping (address => uint256) public withdrawYOOMap; uint256 internal milestone1 = 4000000000000000000000000000; uint256 internal milestone2 = 2500000000000000000000000000; uint256 internal dayLimit = 300000000000000000000000000; bool internal hasInitLeftICOTokens = false; /** @dev constructor */ function YoobaICO(IERC20Token _yoobaTokenAddress) public{ } function startICO(uint256 _startICOTime,uint256 _endICOTime) public ownerOnly { } function initLeftICOTokens() public ownerOnly{ require(<FILL_ME>) leftICOTokens = yoobaTokenAddress.balanceOf(this); hasInitLeftICOTokens = true; } function setLeftICOTokens(uint256 left) public ownerOnly { } function setDaySellAmount(uint256 _dayNum,uint256 _sellAmount) public ownerOnly { } function withdrawTo(address _to, uint256 _amount) public ownerOnly notThis(_to) { } function withdrawERC20TokenTo(IERC20Token _token, address _to, uint256 _amount) public ownerOnly validAddress(_token) validAddress(_to) notThis(_to) { } function withdrawToBuyer(IERC20Token _token,address[] _to) public ownerOnly { } function withdrawToBuyer(IERC20Token _token, address _to, uint256 _amount) public ownerOnly validAddress(_token) validAddress(_to) notThis(_to) { } function refund(address[] _to) public ownerOnly{ } function buyToken() internal { } function() public payable stoppable { } }
!hasInitLeftICOTokens
366,980
!hasInitLeftICOTokens
null
pragma solidity ^0.4.22; contract Utils { /** constructor */ function Utils() internal { } // validates an address - currently only checks that it isn't null modifier validAddress(address _address) { } // verifies that the address is different than this contract address modifier notThis(address _address) { } // Overflow protected math functions /** @dev returns the sum of _x and _y, asserts if the calculation overflows @param _x value 1 @param _y value 2 @return sum */ function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) { } /** @dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number @param _x minuend @param _y subtrahend @return difference */ function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) { } /** @dev returns the product of multiplying _x by _y, asserts if the calculation overflows @param _x factor 1 @param _y factor 2 @return product */ function safeMul(uint256 _x, uint256 _y) internal pure returns (uint256) { } } /* ERC20 Standard Token interface */ contract IERC20Token { // these functions aren't abstract since the compiler emits automatically generated getter functions as external function name() public constant returns (string) { } function symbol() public constant returns (string) { } function decimals() public constant returns (uint8) { } function totalSupply() public constant returns (uint256) { } function balanceOf(address _owner) public constant returns (uint256 balance); function allowance(address _owner, address _spender) public constant returns (uint256 remaining); 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); } /* Owned contract interface */ contract IOwned { // this function isn't abstract since the compiler emits automatically generated getter functions as external function owner() public constant returns (address) { } function transferOwnership(address _newOwner) public; function acceptOwnership() public; } /* Provides support and utilities for contract ownership */ contract Owned is IOwned { address public owner; address public newOwner; event OwnerUpdate(address _prevOwner, address _newOwner); /** @dev constructor */ function Owned() public { } // allows execution by the owner only modifier ownerOnly { } /** @dev allows transferring the contract ownership the new owner still needs to accept the transfer can only be called by the contract owner @param _newOwner new contract owner */ function transferOwnership(address _newOwner) public ownerOnly { } /** @dev used by a new owner to accept an ownership transfer */ function acceptOwnership() public { } } contract YooStop is Owned{ bool public stopped = true; modifier stoppable { } function stop() public ownerOnly{ } function start() public ownerOnly{ } } contract YoobaICO is Owned,YooStop,Utils { IERC20Token public yoobaTokenAddress; uint256 public startICOTime = 0; uint256 public endICOTime = 0; uint256 public leftICOTokens = 0; uint256 public tatalEthFromBuyer = 0; uint256 public daysnumber = 0; mapping (address => uint256) public pendingBalanceMap; mapping (address => uint256) public totalBuyMap; mapping (address => uint256) public totalBuyerETHMap; mapping (uint256 => uint256) public daySellMap; mapping (address => uint256) public withdrawYOOMap; uint256 internal milestone1 = 4000000000000000000000000000; uint256 internal milestone2 = 2500000000000000000000000000; uint256 internal dayLimit = 300000000000000000000000000; bool internal hasInitLeftICOTokens = false; /** @dev constructor */ function YoobaICO(IERC20Token _yoobaTokenAddress) public{ } function startICO(uint256 _startICOTime,uint256 _endICOTime) public ownerOnly { } function initLeftICOTokens() public ownerOnly{ } function setLeftICOTokens(uint256 left) public ownerOnly { } function setDaySellAmount(uint256 _dayNum,uint256 _sellAmount) public ownerOnly { } function withdrawTo(address _to, uint256 _amount) public ownerOnly notThis(_to) { } function withdrawERC20TokenTo(IERC20Token _token, address _to, uint256 _amount) public ownerOnly validAddress(_token) validAddress(_to) notThis(_to) { } function withdrawToBuyer(IERC20Token _token,address[] _to) public ownerOnly { } function withdrawToBuyer(IERC20Token _token, address _to, uint256 _amount) public ownerOnly validAddress(_token) validAddress(_to) notThis(_to) { } function refund(address[] _to) public ownerOnly{ } function buyToken() internal { require(<FILL_ME>) require(msg.value >= 0.1 ether && msg.value <= 100 ether); uint256 dayNum = ((now - startICOTime) / 1 days) + 1; daysnumber = dayNum; assert(daySellMap[dayNum] <= dayLimit); uint256 amount = 0; if(now < (startICOTime + 1 weeks) && leftICOTokens > milestone1){ if(msg.value * 320000 <= (leftICOTokens - milestone1)) { amount = msg.value * 320000; }else{ uint256 priceOneEther1 = (leftICOTokens - milestone1)/320000; amount = (msg.value - priceOneEther1) * 250000 + priceOneEther1 * 320000; } }else{ if(leftICOTokens > milestone2){ if(msg.value * 250000 <= (leftICOTokens - milestone2)) { amount = msg.value * 250000; }else{ uint256 priceOneEther2 = (leftICOTokens - milestone2)/250000; amount = (msg.value - priceOneEther2) * 180000 + priceOneEther2 * 250000; } }else{ assert(msg.value * 180000 <= leftICOTokens); if((leftICOTokens - msg.value * 180000) < 18000 && msg.value * 180000 <= 100 * 180000 * (10 ** 18)){ amount = leftICOTokens; }else{ amount = msg.value * 180000; } } } if(amount >= 18000 * (10 ** 18) && amount <= 320000 * 100 * (10 ** 18)){ leftICOTokens = safeSub(leftICOTokens,amount); pendingBalanceMap[msg.sender] = safeAdd(pendingBalanceMap[msg.sender], amount); totalBuyMap[msg.sender] = safeAdd(totalBuyMap[msg.sender], amount); daySellMap[dayNum] += amount; totalBuyerETHMap[msg.sender] = safeAdd(totalBuyerETHMap[msg.sender],msg.value); tatalEthFromBuyer += msg.value; return; }else{ revert(); } } function() public payable stoppable { } }
!stopped&&now>=startICOTime&&now<=endICOTime
366,980
!stopped&&now>=startICOTime&&now<=endICOTime
"ACOFlashExercise::uniswapV2Call: Invalid expected amount"
pragma solidity ^0.6.6; import "./IWETH.sol"; import "./IUniswapV2Pair.sol"; import "./IUniswapV2Callee.sol"; import "./IUniswapV2Factory.sol"; import "./IUniswapV2Router02.sol"; import "./IACOToken.sol"; /** * @title ACOFlashExercise * @dev Contract to exercise ACO tokens using Uniswap Flash Swap. */ contract ACOFlashExercise is IUniswapV2Callee { /** * @dev The Uniswap factory address. */ address immutable public uniswapFactory; /** * @dev The Uniswap Router address. */ address immutable public uniswapRouter; /** * @dev The WETH address used on Uniswap. */ address immutable public weth; /** * @dev Selector for ERC20 approve function. */ bytes4 immutable internal _approveSelector; /** * @dev Selector for ERC20 transfer function. */ bytes4 immutable internal _transferSelector; constructor(address _uniswapRouter) public { } /** * @dev To accept ether from the WETH. */ receive() external payable {} /** * @dev Function to get the Uniswap pair for an ACO token. * @param acoToken Address of the ACO token. * @return The Uniswap pair for the ACO token. */ function getUniswapPair(address acoToken) public view returns(address) { } /** * @dev Function to get the required amount of collateral to be paid to Uniswap and the expected amount to exercise the ACO token. * @param acoToken Address of the ACO token. * @param tokenAmount Amount of tokens to be exercised. * @param accounts The array of addresses to be exercised. Whether the array is empty the exercise will be executed using the standard method. * @return The required amount of collateral to be paid to Uniswap and the expected amount to exercise the ACO token. */ function getExerciseData(address acoToken, uint256 tokenAmount, address[] memory accounts) public view returns(uint256, uint256) { } /** * @dev Function to get the estimated collateral to be received through a flash exercise. * @param acoToken Address of the ACO token. * @param tokenAmount Amount of tokens to be exercised. * @return The estimated collateral to be received through a flash exercise using the standard exercise function. */ function getEstimatedReturn(address acoToken, uint256 tokenAmount) public view returns(uint256) { } /** * @dev Function to flash exercise ACO tokens. * The flash exercise uses the flash swap functionality on Uniswap. * No asset is required to exercise the ACO token because the own collateral redeemed is used to fulfill the terms of the contract. * The account will receive the remaining difference. * @param acoToken Address of the ACO token. * @param tokenAmount Amount of tokens to be exercised. * @param minimumCollateral The minimum amount of collateral accepted to be received on the flash exercise. * @param salt Random number to calculate the start index of the array of accounts to be exercised. */ function flashExercise(address acoToken, uint256 tokenAmount, uint256 minimumCollateral, uint256 salt) public { } /** * @dev Function to flash exercise ACO tokens. * The flash exercise uses the flash swap functionality on Uniswap. * No asset is required to exercise the ACO token because the own collateral redeemed is used to fulfill the terms of the contract. * The account will receive the remaining difference. * @param acoToken Address of the ACO token. * @param tokenAmount Amount of tokens to be exercised. * @param minimumCollateral The minimum amount of collateral accepted to be received on the flash exercise. * @param accounts The array of addresses to get the deposited collateral. */ function flashExerciseAccounts( address acoToken, uint256 tokenAmount, uint256 minimumCollateral, address[] memory accounts ) public { } /** * @dev External function to be called by the Uniswap pair on flash swap transaction. * @param sender Address of the sender of the Uniswap swap. It must be the ACOFlashExercise contract. * @param amount0Out Amount of token0 on Uniswap pair to be received on the flash swap. * @param amount1Out Amount of token1 on Uniswap pair to be received on the flash swap. * @param data The ABI encoded with ACO token flash exercise data. */ function uniswapV2Call( address sender, uint256 amount0Out, uint256 amount1Out, bytes calldata data ) external override { require(sender == address(this), "ACOFlashExercise::uniswapV2Call: Invalid sender"); uint256 amountRequired; { address token0 = IUniswapV2Pair(msg.sender).token0(); address token1 = IUniswapV2Pair(msg.sender).token1(); require(msg.sender == IUniswapV2Factory(uniswapFactory).getPair(token0, token1), "ACOFlashExercise::uniswapV2Call: Invalid transaction sender"); require(amount0Out == 0 || amount1Out == 0, "ACOFlashExercise::uniswapV2Call: Invalid out amounts"); (uint256 reserve0, uint256 reserve1,) = IUniswapV2Pair(msg.sender).getReserves(); uint256 reserveIn = amount0Out == 0 ? reserve0 : reserve1; uint256 reserveOut = amount0Out == 0 ? reserve1 : reserve0; amountRequired = IUniswapV2Router02(uniswapRouter).getAmountIn((amount0Out + amount1Out), reserveIn, reserveOut); } address acoToken; uint256 tokenAmount; uint256 ethValue = 0; uint256 remainingAmount; uint256 salt; address from; address[] memory accounts; { uint256 minimumCollateral; (from, acoToken, tokenAmount, minimumCollateral, salt, accounts) = abi.decode(data, (address, address, uint256, uint256, uint256, address[])); (address exerciseAddress, uint256 expectedAmount) = _getAcoExerciseData(acoToken, tokenAmount, accounts); require(<FILL_ME>) (uint256 collateralAmount,) = IACOToken(acoToken).getCollateralOnExercise(tokenAmount); require(amountRequired <= collateralAmount, "ACOFlashExercise::uniswapV2Call: Insufficient collateral amount"); remainingAmount = collateralAmount - amountRequired; require(remainingAmount >= minimumCollateral, "ACOFlashExercise::uniswapV2Call: Minimum amount not satisfied"); if (_isEther(exerciseAddress)) { ethValue = expectedAmount; IWETH(weth).withdraw(expectedAmount); } else { _callApproveERC20(exerciseAddress, acoToken, expectedAmount); } } if (accounts.length == 0) { IACOToken(acoToken).exerciseFrom{value: ethValue}(from, tokenAmount, salt); } else { IACOToken(acoToken).exerciseAccountsFrom{value: ethValue}(from, tokenAmount, accounts); } address collateral = IACOToken(acoToken).collateral(); address uniswapPayment; if (_isEther(collateral)) { payable(from).transfer(remainingAmount); IWETH(weth).deposit{value: amountRequired}(); uniswapPayment = weth; } else { _callTransferERC20(collateral, from, remainingAmount); uniswapPayment = collateral; } _callTransferERC20(uniswapPayment, msg.sender, amountRequired); } /** * @dev Internal function to get the ACO tokens exercise data. * @param acoToken Address of the ACO token. * @param tokenAmount Amount of tokens to be exercised. * @param accounts The array of addresses to be exercised. Whether the array is empty the exercise will be executed using the standard method. * @return The asset and the respective amount that should be sent to get the collateral. */ function _getAcoExerciseData(address acoToken, uint256 tokenAmount, address[] memory accounts) internal view returns(address, uint256) { } /** * @dev Internal function to flash exercise ACO tokens. * @param acoToken Address of the ACO token. * @param tokenAmount Amount of tokens to be exercised. * @param minimumCollateral The minimum amount of collateral accepted to be received on the flash exercise. * @param salt Random number to calculate the start index of the array of accounts to be exercised when using standard method. * @param accounts The array of addresses to get the deposited collateral. Whether the array is empty the exercise will be executed using the standard method. */ function _flashExercise( address acoToken, uint256 tokenAmount, uint256 minimumCollateral, uint256 salt, address[] memory accounts ) internal { } /** * @dev Internal function to get Uniswap token address. * The Ethereum address on ACO must be swapped to WETH to be used on Uniswap. * @param token Address of the token on ACO. * @return Uniswap token address. */ function _getUniswapToken(address token) internal view returns(address) { } /** * @dev Internal function to get if the token is for Ethereum (0x0). * @param token Address to be checked. * @return Whether the address is for Ethereum. */ function _isEther(address token) internal pure returns(bool) { } /** * @dev Internal function to approve ERC20 tokens. * @param token Address of the token. * @param spender Authorized address. * @param amount Amount to transfer. */ function _callApproveERC20(address token, address spender, uint256 amount) internal { } /** * @dev Internal function to transfer ERC20 tokens. * @param token Address of the token. * @param recipient Address of the transfer destination. * @param amount Amount to transfer. */ function _callTransferERC20(address token, address recipient, uint256 amount) internal { } }
expectedAmount==(amount1Out+amount0Out),"ACOFlashExercise::uniswapV2Call: Invalid expected amount"
366,987
expectedAmount==(amount1Out+amount0Out)
"ACOTokenExercise::_callApproveERC20"
pragma solidity ^0.6.6; import "./IWETH.sol"; import "./IUniswapV2Pair.sol"; import "./IUniswapV2Callee.sol"; import "./IUniswapV2Factory.sol"; import "./IUniswapV2Router02.sol"; import "./IACOToken.sol"; /** * @title ACOFlashExercise * @dev Contract to exercise ACO tokens using Uniswap Flash Swap. */ contract ACOFlashExercise is IUniswapV2Callee { /** * @dev The Uniswap factory address. */ address immutable public uniswapFactory; /** * @dev The Uniswap Router address. */ address immutable public uniswapRouter; /** * @dev The WETH address used on Uniswap. */ address immutable public weth; /** * @dev Selector for ERC20 approve function. */ bytes4 immutable internal _approveSelector; /** * @dev Selector for ERC20 transfer function. */ bytes4 immutable internal _transferSelector; constructor(address _uniswapRouter) public { } /** * @dev To accept ether from the WETH. */ receive() external payable {} /** * @dev Function to get the Uniswap pair for an ACO token. * @param acoToken Address of the ACO token. * @return The Uniswap pair for the ACO token. */ function getUniswapPair(address acoToken) public view returns(address) { } /** * @dev Function to get the required amount of collateral to be paid to Uniswap and the expected amount to exercise the ACO token. * @param acoToken Address of the ACO token. * @param tokenAmount Amount of tokens to be exercised. * @param accounts The array of addresses to be exercised. Whether the array is empty the exercise will be executed using the standard method. * @return The required amount of collateral to be paid to Uniswap and the expected amount to exercise the ACO token. */ function getExerciseData(address acoToken, uint256 tokenAmount, address[] memory accounts) public view returns(uint256, uint256) { } /** * @dev Function to get the estimated collateral to be received through a flash exercise. * @param acoToken Address of the ACO token. * @param tokenAmount Amount of tokens to be exercised. * @return The estimated collateral to be received through a flash exercise using the standard exercise function. */ function getEstimatedReturn(address acoToken, uint256 tokenAmount) public view returns(uint256) { } /** * @dev Function to flash exercise ACO tokens. * The flash exercise uses the flash swap functionality on Uniswap. * No asset is required to exercise the ACO token because the own collateral redeemed is used to fulfill the terms of the contract. * The account will receive the remaining difference. * @param acoToken Address of the ACO token. * @param tokenAmount Amount of tokens to be exercised. * @param minimumCollateral The minimum amount of collateral accepted to be received on the flash exercise. * @param salt Random number to calculate the start index of the array of accounts to be exercised. */ function flashExercise(address acoToken, uint256 tokenAmount, uint256 minimumCollateral, uint256 salt) public { } /** * @dev Function to flash exercise ACO tokens. * The flash exercise uses the flash swap functionality on Uniswap. * No asset is required to exercise the ACO token because the own collateral redeemed is used to fulfill the terms of the contract. * The account will receive the remaining difference. * @param acoToken Address of the ACO token. * @param tokenAmount Amount of tokens to be exercised. * @param minimumCollateral The minimum amount of collateral accepted to be received on the flash exercise. * @param accounts The array of addresses to get the deposited collateral. */ function flashExerciseAccounts( address acoToken, uint256 tokenAmount, uint256 minimumCollateral, address[] memory accounts ) public { } /** * @dev External function to be called by the Uniswap pair on flash swap transaction. * @param sender Address of the sender of the Uniswap swap. It must be the ACOFlashExercise contract. * @param amount0Out Amount of token0 on Uniswap pair to be received on the flash swap. * @param amount1Out Amount of token1 on Uniswap pair to be received on the flash swap. * @param data The ABI encoded with ACO token flash exercise data. */ function uniswapV2Call( address sender, uint256 amount0Out, uint256 amount1Out, bytes calldata data ) external override { } /** * @dev Internal function to get the ACO tokens exercise data. * @param acoToken Address of the ACO token. * @param tokenAmount Amount of tokens to be exercised. * @param accounts The array of addresses to be exercised. Whether the array is empty the exercise will be executed using the standard method. * @return The asset and the respective amount that should be sent to get the collateral. */ function _getAcoExerciseData(address acoToken, uint256 tokenAmount, address[] memory accounts) internal view returns(address, uint256) { } /** * @dev Internal function to flash exercise ACO tokens. * @param acoToken Address of the ACO token. * @param tokenAmount Amount of tokens to be exercised. * @param minimumCollateral The minimum amount of collateral accepted to be received on the flash exercise. * @param salt Random number to calculate the start index of the array of accounts to be exercised when using standard method. * @param accounts The array of addresses to get the deposited collateral. Whether the array is empty the exercise will be executed using the standard method. */ function _flashExercise( address acoToken, uint256 tokenAmount, uint256 minimumCollateral, uint256 salt, address[] memory accounts ) internal { } /** * @dev Internal function to get Uniswap token address. * The Ethereum address on ACO must be swapped to WETH to be used on Uniswap. * @param token Address of the token on ACO. * @return Uniswap token address. */ function _getUniswapToken(address token) internal view returns(address) { } /** * @dev Internal function to get if the token is for Ethereum (0x0). * @param token Address to be checked. * @return Whether the address is for Ethereum. */ function _isEther(address token) internal pure returns(bool) { } /** * @dev Internal function to approve ERC20 tokens. * @param token Address of the token. * @param spender Authorized address. * @param amount Amount to transfer. */ function _callApproveERC20(address token, address spender, uint256 amount) internal { (bool success, bytes memory returndata) = token.call(abi.encodeWithSelector(_approveSelector, spender, amount)); require(<FILL_ME>) } /** * @dev Internal function to transfer ERC20 tokens. * @param token Address of the token. * @param recipient Address of the transfer destination. * @param amount Amount to transfer. */ function _callTransferERC20(address token, address recipient, uint256 amount) internal { } }
success&&(returndata.length==0||abi.decode(returndata,(bool))),"ACOTokenExercise::_callApproveERC20"
366,987
success&&(returndata.length==0||abi.decode(returndata,(bool)))
"cannot stake while in withdrawal"
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./CanReclaimTokens.sol"; contract CoordinationPaymentChannels is CanReclaimTokens { using SafeERC20 for IERC20; IERC20 constant ROOK = IERC20(0xfA5047c9c78B8877af97BDcb85Db743fD7313d4a); bytes constant public INSTANT_WITHDRAWAL_COMMITMENT_DATA = bytes("INSTANT"); // This keypair is responsible for signing stake commitments address public coordinator; // This keypair is responsible for signing user claim commitments address public claimGenerator; /* coordinator <-> keeper payment channels * The Coordinator and Keepers transact off-chain using these payment channels in a series of auctions * hosted by the Coordinator. The values stored in these variables reflect the latest on-chain state for a * payment channel, but the actual state of the payment channels is likely to be more recent than what is on * chain. The Coordinator and keeepers will pass signed commitments back and forth dictating what the current state * of the payment channel is. * A payment channel is keyed by a Keeper's stake address. * Note a keeper may have multiple payment channels / stake addresses. */ // The amount of Rook a keeper's stake address has staked. This determines their maximum spending power. mapping (address => uint256) public stakedAmount; // This nonce is used to give an ordering to the off-chain stake commitments and to prevent replays on-chain. mapping (address => uint256) public stakeNonce; // The total amount of Rook a keeper has currently spent. Cannot be greater than stakedAmount. mapping (address => uint256) public stakeSpent; // Used to prevent channel reuse edge cases if a stake address closes their channel and opens another. mapping (address => uint256) public channelNonce; // Used to track the expiration of withdrawal timelocks. mapping (bytes32 => uint256) public withdrawalTimelockTimestamp; /* claim generator -> user payment channels * The Claim Generator will generate claims using the Keeper bids from the Coordinator auctions. Claim amounts are * calculated as a percentage of the bid amounts determined by the DAO. Given that bids are signed by Keepers and * the Claim Generator, and they are available publicly, claim amount correcntess is easily verifiable off-chain. * * userClaimedAmount tracks how much a user has claimed to date. A user's outstanding claim amount is given by * subtracting userClaimedAmount from their most recent claim commitment generated by the Claim Generator. */ mapping (address => uint256) public userClaimedAmount; /* Total amount of claimable Rook. Accrues when commitments are submitted to `initiateTimelockedWithdrawal`, * `executeInstantWithdrawal`, and `settleSpentStake` and when `addClaimable` is called. */ uint256 public totalClaimableAmount; event Staked(address indexed _stakeAddress, uint256 _channelNonce, uint256 _amount); event Claimed(address indexed _claimAddress, uint256 _amount); event CoordinatorChanged(address indexed _oldCoordinator, address indexed _newCoordinator); event ClaimGeneratorChanged(address indexed _oldClaimGenerator, address indexed _newClaimGenerator); event StakeWithdrawn(address indexed _stakeAddress, uint256 _channelNonce, uint256 _amount); event TimelockedWithdrawalInitiated( address indexed _stakeAddress, uint256 _stakeSpent, uint256 _stakeNonce, uint256 _channelNonce, uint256 _withdrawalTimelock); event AddedClaimable(uint256 _amount); event Settled(uint256 _refundedAmount, uint256 _accruedAmount); /* Represents a payment channel state. The Coordinator and Keepers will sign commitments to agree upon the current * Note, the `data` field is used off-chain to hold the hash of the previous commitment to ensure that the * Coordinator and Keeper state for the payment channel is always consistent. The only time any assertions are made * on its value is `executeInstantWithdrawal` when it should equal `INSTANT_WITHDRAWAL_COMMITMENT_DATA`. */ struct StakeCommitment { address stakeAddress; uint256 stakeSpent; uint256 stakeNonce; uint256 channelNonce; bytes data; bytes stakeAddressSignature; bytes coordinatorSignature; } /// @notice Retreives the payment channel state for the provided stake address. function getStakerState( address _stakeAddress ) public view returns ( uint256 _stakedAmount, uint256 _stakeNonce, uint256 _stakeSpent, uint256 _channelNonce, uint256 _withdrawalTimelock ) { } /** @notice Calculate the commitment hash used for signatures for a particular stake payment channel state. * @dev The Coordinator and Keepers transact off-chain by passing signed commitments back and forth. Signed stake * commitments are submitted on-chain only to perform settlements and withdrawals. */ function stakeCommitmentHash( address _stakeAddress, uint256 _stakeSpent, uint256 _stakeNonce, uint256 _channelNonce, bytes memory _data ) public pure returns (bytes32) { } function stakeCommitmentHash( StakeCommitment memory _commitment ) internal pure returns (bytes32) { } /** @notice Calculate the commitment hash used for signatures for a particular claim payment channel state. * Signed claim commitments are generated by the claim generator and used by users to perform claims. */ function claimCommitmentHash( address _claimAddress, uint256 _earningsToDate ) public pure returns (bytes32) { } /** @notice Calculate the key to the entry in the withdrawalTimelockTimestamp map for a particular stake * payment channel state. */ function withdrawalTimelockKey( address _stakeAddress, uint256 _stakeSpent, uint256 _stakeNonce, uint256 _channelNonce ) public pure returns (bytes32) { } /** @notice Get the withdrawal timelock expiration for a payment channel. A return value of 0 indicates no timelock. * @dev The withdrawal timelock allows the Coordinator to withdrawals with newer commitments. */ function getCurrentWithdrawalTimelock( address _stakeAddress ) public view returns (uint256) { } constructor(address _coordinator, address _claimGenerator) { } /** @notice Update the Coordinator address. This keypair is responsible for signing stake commitments. * @dev To migrate Coordinator addresses, any commitments signed by the old Coordinator must be resigned by the * new Coordinator address. */ function updateCoordinatorAddress( address _newCoordinator ) external onlyOperator { } /** @notice Update the claimGenerator address. This keypair is responsible to for signing user claim commitments. * @dev To migrate claimGenerator addresses, any commitments signed by the old Claim address must be resigned by * the new claimGenerator address. */ function updateClaimGeneratorAddress( address _newClaimGenerator ) external onlyOperator { } /** @notice Add Rook to the payment channel of msg.sender. Cannot be done while in a timelocked withdrawal. * @dev Withdrawal of stake will require a signature from the Coordinator. */ function stake( uint256 _amount ) public { require(<FILL_ME>) ROOK.safeTransferFrom(msg.sender, address(this), _amount); stakedAmount[msg.sender] += _amount; emit Staked(msg.sender, channelNonce[msg.sender], stakedAmount[msg.sender]); } /** @notice Used to add claimable Rook to the contract. * @dev Since claimable Rook otherwise only accrues on withdrawal or settlement of Rook, this can be used create a * buffer of immediately claimable Rook so users do not need to wait for a Keeper to withdraw or for someone * to call the `settleSpentStake` function. This can also be used to amend deficits from overgenerous claims. */ function addClaimable( uint256 _amount ) public { } /** @dev The stakeSpent for a payment channel will increase when a stake address makes payments and decrease * when the Coordinator issues refunds. This function changes the totalClaimableAmount of Rook on the contract * accordingly. */ function adjustTotalClaimableAmountByStakeSpentChange( uint256 _oldStakeSpent, uint256 _newStakeSpent ) internal { } /** @notice Used to settle spent stake for a payment channel to accrue claimable rook. * @dev Note anyone can call this function since it requires a signature from both keepers and the coordinator. * It will primarily be used by the coordinator but a user who would like to claim Rook immediately when there * is no claimable Rook may also call this to accrue claimable rook. * @param _commitments is a list of StakeCommitments. There should be one entry for each payment channel being * settled and it should be the latest commitment for that channel. We only care about the most recent * state for a payment channel, so evenif there are multiple commitments for a payment channel that have not * been submitted on-chain, only the latest needs to be submitted. The resulting contract state will be the * same regardless. */ function settleSpentStake( StakeCommitment[] memory _commitments ) external { } /** @notice Initiate or challenge withdrawal, which can be completed after a 7 day timelock expires. * @dev Used by the stake addresses to withdraw from and close the payment channel. Also used by the Coordinator to * challenge a withdrawal. The most recent commitment for the payment channel that has been signed by both the * stake address and the Coordinator should be used for the withdrawal. In order to prevent Keepers from * immediately exiting with an old commitment, potentially taking Rook they do not own, there is a 7 day * timelock on being able to complete the withdrawal. If the Coordinator has a more recent commitment, they * will submit it to this function resetting the timelock. */ function initiateTimelockedWithdrawal( StakeCommitment memory _commitment ) external { } /** @notice Withdraw remaining stake from the payment channel after the withdrawal timelock has concluded. * @dev Closing the payment channel zeros out all payment channel state for the stake address aside from the * channelNonce which is incremented. This is to prevent any channel reuse edge cases. A stake address that * has closed their payment channel and withdrawn is able to create a new payment channel by staking Rook. */ function executeTimelockedWithdrawal( address _stakeAddress ) public { } /** @notice Instantly withdraw remaining stake in payment channel. * @dev To perform an instant withdrawal a Keeper will ask the coordinator for an instant withdrawal signature. * This `data` field in the commitment used to produce the signature should be populated with * `INSTANT_WITHDRAWAL_COMMITMENT_DATA`. We don't want a compromised Coordinator to instantly settle the * channel with an old commitment, so we also require a stakeAddress instant withdrawal signature. * Closing the payment channel zeros out all payment channel state for the stake address aside from the * channelNonce which is incremented. This is to prevent any channel reuse edge cases. A stake address that * has closed their payment channel and withdrawn is able to create a new payment channel by staking Rook. */ function executeInstantWithdrawal( StakeCommitment memory _commitment ) external { } /** @notice Claim accumulated earnings. Claim amounts are determined off-chain and signed by the claimGenerator * address. Claim amounts are calculated as a pre-determined percentage of a Keeper's bid, and Keeper bids * are signed by both Keepers and the Coordinator, so claim amount correctness is easily verifiable * off-chain by consumers even if it is not verified on-chain. * @dev Note that it is not feasible to verify claim amount correctness on-chain as the total claim amount for * a user can be the sum of claims generated from any number of bid commitments. Claimers only rely on the * claim generator to calculate the claim as a percentage of Keeper bids correctly and this is easily * verifiable by consumers off-chain given the signed bid commitments are public. * A user has claimable Rook if the Claim Generator has generated a commitment for them where `earningsToDate` * is greater than `userClaimedAmount[_claimAddress]`. */ function claim( address _claimAddress, uint256 _earningsToDate, bytes memory _claimGeneratorSignature ) external { } }
getCurrentWithdrawalTimelock(msg.sender)==0,"cannot stake while in withdrawal"
367,034
getCurrentWithdrawalTimelock(msg.sender)==0
"cannot settle while in withdrawal"
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./CanReclaimTokens.sol"; contract CoordinationPaymentChannels is CanReclaimTokens { using SafeERC20 for IERC20; IERC20 constant ROOK = IERC20(0xfA5047c9c78B8877af97BDcb85Db743fD7313d4a); bytes constant public INSTANT_WITHDRAWAL_COMMITMENT_DATA = bytes("INSTANT"); // This keypair is responsible for signing stake commitments address public coordinator; // This keypair is responsible for signing user claim commitments address public claimGenerator; /* coordinator <-> keeper payment channels * The Coordinator and Keepers transact off-chain using these payment channels in a series of auctions * hosted by the Coordinator. The values stored in these variables reflect the latest on-chain state for a * payment channel, but the actual state of the payment channels is likely to be more recent than what is on * chain. The Coordinator and keeepers will pass signed commitments back and forth dictating what the current state * of the payment channel is. * A payment channel is keyed by a Keeper's stake address. * Note a keeper may have multiple payment channels / stake addresses. */ // The amount of Rook a keeper's stake address has staked. This determines their maximum spending power. mapping (address => uint256) public stakedAmount; // This nonce is used to give an ordering to the off-chain stake commitments and to prevent replays on-chain. mapping (address => uint256) public stakeNonce; // The total amount of Rook a keeper has currently spent. Cannot be greater than stakedAmount. mapping (address => uint256) public stakeSpent; // Used to prevent channel reuse edge cases if a stake address closes their channel and opens another. mapping (address => uint256) public channelNonce; // Used to track the expiration of withdrawal timelocks. mapping (bytes32 => uint256) public withdrawalTimelockTimestamp; /* claim generator -> user payment channels * The Claim Generator will generate claims using the Keeper bids from the Coordinator auctions. Claim amounts are * calculated as a percentage of the bid amounts determined by the DAO. Given that bids are signed by Keepers and * the Claim Generator, and they are available publicly, claim amount correcntess is easily verifiable off-chain. * * userClaimedAmount tracks how much a user has claimed to date. A user's outstanding claim amount is given by * subtracting userClaimedAmount from their most recent claim commitment generated by the Claim Generator. */ mapping (address => uint256) public userClaimedAmount; /* Total amount of claimable Rook. Accrues when commitments are submitted to `initiateTimelockedWithdrawal`, * `executeInstantWithdrawal`, and `settleSpentStake` and when `addClaimable` is called. */ uint256 public totalClaimableAmount; event Staked(address indexed _stakeAddress, uint256 _channelNonce, uint256 _amount); event Claimed(address indexed _claimAddress, uint256 _amount); event CoordinatorChanged(address indexed _oldCoordinator, address indexed _newCoordinator); event ClaimGeneratorChanged(address indexed _oldClaimGenerator, address indexed _newClaimGenerator); event StakeWithdrawn(address indexed _stakeAddress, uint256 _channelNonce, uint256 _amount); event TimelockedWithdrawalInitiated( address indexed _stakeAddress, uint256 _stakeSpent, uint256 _stakeNonce, uint256 _channelNonce, uint256 _withdrawalTimelock); event AddedClaimable(uint256 _amount); event Settled(uint256 _refundedAmount, uint256 _accruedAmount); /* Represents a payment channel state. The Coordinator and Keepers will sign commitments to agree upon the current * Note, the `data` field is used off-chain to hold the hash of the previous commitment to ensure that the * Coordinator and Keeper state for the payment channel is always consistent. The only time any assertions are made * on its value is `executeInstantWithdrawal` when it should equal `INSTANT_WITHDRAWAL_COMMITMENT_DATA`. */ struct StakeCommitment { address stakeAddress; uint256 stakeSpent; uint256 stakeNonce; uint256 channelNonce; bytes data; bytes stakeAddressSignature; bytes coordinatorSignature; } /// @notice Retreives the payment channel state for the provided stake address. function getStakerState( address _stakeAddress ) public view returns ( uint256 _stakedAmount, uint256 _stakeNonce, uint256 _stakeSpent, uint256 _channelNonce, uint256 _withdrawalTimelock ) { } /** @notice Calculate the commitment hash used for signatures for a particular stake payment channel state. * @dev The Coordinator and Keepers transact off-chain by passing signed commitments back and forth. Signed stake * commitments are submitted on-chain only to perform settlements and withdrawals. */ function stakeCommitmentHash( address _stakeAddress, uint256 _stakeSpent, uint256 _stakeNonce, uint256 _channelNonce, bytes memory _data ) public pure returns (bytes32) { } function stakeCommitmentHash( StakeCommitment memory _commitment ) internal pure returns (bytes32) { } /** @notice Calculate the commitment hash used for signatures for a particular claim payment channel state. * Signed claim commitments are generated by the claim generator and used by users to perform claims. */ function claimCommitmentHash( address _claimAddress, uint256 _earningsToDate ) public pure returns (bytes32) { } /** @notice Calculate the key to the entry in the withdrawalTimelockTimestamp map for a particular stake * payment channel state. */ function withdrawalTimelockKey( address _stakeAddress, uint256 _stakeSpent, uint256 _stakeNonce, uint256 _channelNonce ) public pure returns (bytes32) { } /** @notice Get the withdrawal timelock expiration for a payment channel. A return value of 0 indicates no timelock. * @dev The withdrawal timelock allows the Coordinator to withdrawals with newer commitments. */ function getCurrentWithdrawalTimelock( address _stakeAddress ) public view returns (uint256) { } constructor(address _coordinator, address _claimGenerator) { } /** @notice Update the Coordinator address. This keypair is responsible for signing stake commitments. * @dev To migrate Coordinator addresses, any commitments signed by the old Coordinator must be resigned by the * new Coordinator address. */ function updateCoordinatorAddress( address _newCoordinator ) external onlyOperator { } /** @notice Update the claimGenerator address. This keypair is responsible to for signing user claim commitments. * @dev To migrate claimGenerator addresses, any commitments signed by the old Claim address must be resigned by * the new claimGenerator address. */ function updateClaimGeneratorAddress( address _newClaimGenerator ) external onlyOperator { } /** @notice Add Rook to the payment channel of msg.sender. Cannot be done while in a timelocked withdrawal. * @dev Withdrawal of stake will require a signature from the Coordinator. */ function stake( uint256 _amount ) public { } /** @notice Used to add claimable Rook to the contract. * @dev Since claimable Rook otherwise only accrues on withdrawal or settlement of Rook, this can be used create a * buffer of immediately claimable Rook so users do not need to wait for a Keeper to withdraw or for someone * to call the `settleSpentStake` function. This can also be used to amend deficits from overgenerous claims. */ function addClaimable( uint256 _amount ) public { } /** @dev The stakeSpent for a payment channel will increase when a stake address makes payments and decrease * when the Coordinator issues refunds. This function changes the totalClaimableAmount of Rook on the contract * accordingly. */ function adjustTotalClaimableAmountByStakeSpentChange( uint256 _oldStakeSpent, uint256 _newStakeSpent ) internal { } /** @notice Used to settle spent stake for a payment channel to accrue claimable rook. * @dev Note anyone can call this function since it requires a signature from both keepers and the coordinator. * It will primarily be used by the coordinator but a user who would like to claim Rook immediately when there * is no claimable Rook may also call this to accrue claimable rook. * @param _commitments is a list of StakeCommitments. There should be one entry for each payment channel being * settled and it should be the latest commitment for that channel. We only care about the most recent * state for a payment channel, so evenif there are multiple commitments for a payment channel that have not * been submitted on-chain, only the latest needs to be submitted. The resulting contract state will be the * same regardless. */ function settleSpentStake( StakeCommitment[] memory _commitments ) external { uint256 claimableRookToAccrue = 0; uint256 claimableRookToRefund = 0; for (uint i=0; i< _commitments.length; i++) { StakeCommitment memory commitment = _commitments[i]; // Initiating withdrawal settles the spent stake in the payment channel. Thus we disable settling spent // stake using this function for a payment channel in withdrawal. Proper settlement of the payment channel // should be handled by the withdrawal process. require(<FILL_ME>) require(commitment.stakeSpent <= stakedAmount[commitment.stakeAddress], "cannot spend more than is staked"); require(commitment.stakeNonce > stakeNonce[commitment.stakeAddress], "stake nonce is too old"); require(commitment.channelNonce == channelNonce[commitment.stakeAddress], "incorrect channel nonce"); address recoveredStakeAddress = ECDSA.recover( ECDSA.toEthSignedMessageHash(stakeCommitmentHash(commitment)), commitment.stakeAddressSignature); require(recoveredStakeAddress == commitment.stakeAddress, "recovered address is not the stake address"); address recoveredCoordinatorAddress = ECDSA.recover( ECDSA.toEthSignedMessageHash(stakeCommitmentHash(commitment)), commitment.coordinatorSignature); require(recoveredCoordinatorAddress == coordinator, "recovered address is not the coordinator"); if (commitment.stakeSpent < stakeSpent[commitment.stakeAddress]) { // If a stake address's new stakeSpent is less than their previously stored stakeSpent, then a refund was // issued to the stakeAddress. We "refund" this rook to the stakeAddress by subtracting // the difference from totalClaimableAmount. claimableRookToRefund += stakeSpent[commitment.stakeAddress] - commitment.stakeSpent; } else { // Otherwise we accrue any unsettled spent stake to totalClaimableAmount claimableRookToAccrue += commitment.stakeSpent - stakeSpent[commitment.stakeAddress]; } stakeNonce[commitment.stakeAddress] = commitment.stakeNonce; stakeSpent[commitment.stakeAddress] = commitment.stakeSpent; } adjustTotalClaimableAmountByStakeSpentChange(claimableRookToRefund, claimableRookToAccrue); emit Settled(claimableRookToRefund, claimableRookToAccrue); } /** @notice Initiate or challenge withdrawal, which can be completed after a 7 day timelock expires. * @dev Used by the stake addresses to withdraw from and close the payment channel. Also used by the Coordinator to * challenge a withdrawal. The most recent commitment for the payment channel that has been signed by both the * stake address and the Coordinator should be used for the withdrawal. In order to prevent Keepers from * immediately exiting with an old commitment, potentially taking Rook they do not own, there is a 7 day * timelock on being able to complete the withdrawal. If the Coordinator has a more recent commitment, they * will submit it to this function resetting the timelock. */ function initiateTimelockedWithdrawal( StakeCommitment memory _commitment ) external { } /** @notice Withdraw remaining stake from the payment channel after the withdrawal timelock has concluded. * @dev Closing the payment channel zeros out all payment channel state for the stake address aside from the * channelNonce which is incremented. This is to prevent any channel reuse edge cases. A stake address that * has closed their payment channel and withdrawn is able to create a new payment channel by staking Rook. */ function executeTimelockedWithdrawal( address _stakeAddress ) public { } /** @notice Instantly withdraw remaining stake in payment channel. * @dev To perform an instant withdrawal a Keeper will ask the coordinator for an instant withdrawal signature. * This `data` field in the commitment used to produce the signature should be populated with * `INSTANT_WITHDRAWAL_COMMITMENT_DATA`. We don't want a compromised Coordinator to instantly settle the * channel with an old commitment, so we also require a stakeAddress instant withdrawal signature. * Closing the payment channel zeros out all payment channel state for the stake address aside from the * channelNonce which is incremented. This is to prevent any channel reuse edge cases. A stake address that * has closed their payment channel and withdrawn is able to create a new payment channel by staking Rook. */ function executeInstantWithdrawal( StakeCommitment memory _commitment ) external { } /** @notice Claim accumulated earnings. Claim amounts are determined off-chain and signed by the claimGenerator * address. Claim amounts are calculated as a pre-determined percentage of a Keeper's bid, and Keeper bids * are signed by both Keepers and the Coordinator, so claim amount correctness is easily verifiable * off-chain by consumers even if it is not verified on-chain. * @dev Note that it is not feasible to verify claim amount correctness on-chain as the total claim amount for * a user can be the sum of claims generated from any number of bid commitments. Claimers only rely on the * claim generator to calculate the claim as a percentage of Keeper bids correctly and this is easily * verifiable by consumers off-chain given the signed bid commitments are public. * A user has claimable Rook if the Claim Generator has generated a commitment for them where `earningsToDate` * is greater than `userClaimedAmount[_claimAddress]`. */ function claim( address _claimAddress, uint256 _earningsToDate, bytes memory _claimGeneratorSignature ) external { } }
getCurrentWithdrawalTimelock(commitment.stakeAddress)==0,"cannot settle while in withdrawal"
367,034
getCurrentWithdrawalTimelock(commitment.stakeAddress)==0
"must initiate timelocked withdrawal first"
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./CanReclaimTokens.sol"; contract CoordinationPaymentChannels is CanReclaimTokens { using SafeERC20 for IERC20; IERC20 constant ROOK = IERC20(0xfA5047c9c78B8877af97BDcb85Db743fD7313d4a); bytes constant public INSTANT_WITHDRAWAL_COMMITMENT_DATA = bytes("INSTANT"); // This keypair is responsible for signing stake commitments address public coordinator; // This keypair is responsible for signing user claim commitments address public claimGenerator; /* coordinator <-> keeper payment channels * The Coordinator and Keepers transact off-chain using these payment channels in a series of auctions * hosted by the Coordinator. The values stored in these variables reflect the latest on-chain state for a * payment channel, but the actual state of the payment channels is likely to be more recent than what is on * chain. The Coordinator and keeepers will pass signed commitments back and forth dictating what the current state * of the payment channel is. * A payment channel is keyed by a Keeper's stake address. * Note a keeper may have multiple payment channels / stake addresses. */ // The amount of Rook a keeper's stake address has staked. This determines their maximum spending power. mapping (address => uint256) public stakedAmount; // This nonce is used to give an ordering to the off-chain stake commitments and to prevent replays on-chain. mapping (address => uint256) public stakeNonce; // The total amount of Rook a keeper has currently spent. Cannot be greater than stakedAmount. mapping (address => uint256) public stakeSpent; // Used to prevent channel reuse edge cases if a stake address closes their channel and opens another. mapping (address => uint256) public channelNonce; // Used to track the expiration of withdrawal timelocks. mapping (bytes32 => uint256) public withdrawalTimelockTimestamp; /* claim generator -> user payment channels * The Claim Generator will generate claims using the Keeper bids from the Coordinator auctions. Claim amounts are * calculated as a percentage of the bid amounts determined by the DAO. Given that bids are signed by Keepers and * the Claim Generator, and they are available publicly, claim amount correcntess is easily verifiable off-chain. * * userClaimedAmount tracks how much a user has claimed to date. A user's outstanding claim amount is given by * subtracting userClaimedAmount from their most recent claim commitment generated by the Claim Generator. */ mapping (address => uint256) public userClaimedAmount; /* Total amount of claimable Rook. Accrues when commitments are submitted to `initiateTimelockedWithdrawal`, * `executeInstantWithdrawal`, and `settleSpentStake` and when `addClaimable` is called. */ uint256 public totalClaimableAmount; event Staked(address indexed _stakeAddress, uint256 _channelNonce, uint256 _amount); event Claimed(address indexed _claimAddress, uint256 _amount); event CoordinatorChanged(address indexed _oldCoordinator, address indexed _newCoordinator); event ClaimGeneratorChanged(address indexed _oldClaimGenerator, address indexed _newClaimGenerator); event StakeWithdrawn(address indexed _stakeAddress, uint256 _channelNonce, uint256 _amount); event TimelockedWithdrawalInitiated( address indexed _stakeAddress, uint256 _stakeSpent, uint256 _stakeNonce, uint256 _channelNonce, uint256 _withdrawalTimelock); event AddedClaimable(uint256 _amount); event Settled(uint256 _refundedAmount, uint256 _accruedAmount); /* Represents a payment channel state. The Coordinator and Keepers will sign commitments to agree upon the current * Note, the `data` field is used off-chain to hold the hash of the previous commitment to ensure that the * Coordinator and Keeper state for the payment channel is always consistent. The only time any assertions are made * on its value is `executeInstantWithdrawal` when it should equal `INSTANT_WITHDRAWAL_COMMITMENT_DATA`. */ struct StakeCommitment { address stakeAddress; uint256 stakeSpent; uint256 stakeNonce; uint256 channelNonce; bytes data; bytes stakeAddressSignature; bytes coordinatorSignature; } /// @notice Retreives the payment channel state for the provided stake address. function getStakerState( address _stakeAddress ) public view returns ( uint256 _stakedAmount, uint256 _stakeNonce, uint256 _stakeSpent, uint256 _channelNonce, uint256 _withdrawalTimelock ) { } /** @notice Calculate the commitment hash used for signatures for a particular stake payment channel state. * @dev The Coordinator and Keepers transact off-chain by passing signed commitments back and forth. Signed stake * commitments are submitted on-chain only to perform settlements and withdrawals. */ function stakeCommitmentHash( address _stakeAddress, uint256 _stakeSpent, uint256 _stakeNonce, uint256 _channelNonce, bytes memory _data ) public pure returns (bytes32) { } function stakeCommitmentHash( StakeCommitment memory _commitment ) internal pure returns (bytes32) { } /** @notice Calculate the commitment hash used for signatures for a particular claim payment channel state. * Signed claim commitments are generated by the claim generator and used by users to perform claims. */ function claimCommitmentHash( address _claimAddress, uint256 _earningsToDate ) public pure returns (bytes32) { } /** @notice Calculate the key to the entry in the withdrawalTimelockTimestamp map for a particular stake * payment channel state. */ function withdrawalTimelockKey( address _stakeAddress, uint256 _stakeSpent, uint256 _stakeNonce, uint256 _channelNonce ) public pure returns (bytes32) { } /** @notice Get the withdrawal timelock expiration for a payment channel. A return value of 0 indicates no timelock. * @dev The withdrawal timelock allows the Coordinator to withdrawals with newer commitments. */ function getCurrentWithdrawalTimelock( address _stakeAddress ) public view returns (uint256) { } constructor(address _coordinator, address _claimGenerator) { } /** @notice Update the Coordinator address. This keypair is responsible for signing stake commitments. * @dev To migrate Coordinator addresses, any commitments signed by the old Coordinator must be resigned by the * new Coordinator address. */ function updateCoordinatorAddress( address _newCoordinator ) external onlyOperator { } /** @notice Update the claimGenerator address. This keypair is responsible to for signing user claim commitments. * @dev To migrate claimGenerator addresses, any commitments signed by the old Claim address must be resigned by * the new claimGenerator address. */ function updateClaimGeneratorAddress( address _newClaimGenerator ) external onlyOperator { } /** @notice Add Rook to the payment channel of msg.sender. Cannot be done while in a timelocked withdrawal. * @dev Withdrawal of stake will require a signature from the Coordinator. */ function stake( uint256 _amount ) public { } /** @notice Used to add claimable Rook to the contract. * @dev Since claimable Rook otherwise only accrues on withdrawal or settlement of Rook, this can be used create a * buffer of immediately claimable Rook so users do not need to wait for a Keeper to withdraw or for someone * to call the `settleSpentStake` function. This can also be used to amend deficits from overgenerous claims. */ function addClaimable( uint256 _amount ) public { } /** @dev The stakeSpent for a payment channel will increase when a stake address makes payments and decrease * when the Coordinator issues refunds. This function changes the totalClaimableAmount of Rook on the contract * accordingly. */ function adjustTotalClaimableAmountByStakeSpentChange( uint256 _oldStakeSpent, uint256 _newStakeSpent ) internal { } /** @notice Used to settle spent stake for a payment channel to accrue claimable rook. * @dev Note anyone can call this function since it requires a signature from both keepers and the coordinator. * It will primarily be used by the coordinator but a user who would like to claim Rook immediately when there * is no claimable Rook may also call this to accrue claimable rook. * @param _commitments is a list of StakeCommitments. There should be one entry for each payment channel being * settled and it should be the latest commitment for that channel. We only care about the most recent * state for a payment channel, so evenif there are multiple commitments for a payment channel that have not * been submitted on-chain, only the latest needs to be submitted. The resulting contract state will be the * same regardless. */ function settleSpentStake( StakeCommitment[] memory _commitments ) external { } /** @notice Initiate or challenge withdrawal, which can be completed after a 7 day timelock expires. * @dev Used by the stake addresses to withdraw from and close the payment channel. Also used by the Coordinator to * challenge a withdrawal. The most recent commitment for the payment channel that has been signed by both the * stake address and the Coordinator should be used for the withdrawal. In order to prevent Keepers from * immediately exiting with an old commitment, potentially taking Rook they do not own, there is a 7 day * timelock on being able to complete the withdrawal. If the Coordinator has a more recent commitment, they * will submit it to this function resetting the timelock. */ function initiateTimelockedWithdrawal( StakeCommitment memory _commitment ) external { } /** @notice Withdraw remaining stake from the payment channel after the withdrawal timelock has concluded. * @dev Closing the payment channel zeros out all payment channel state for the stake address aside from the * channelNonce which is incremented. This is to prevent any channel reuse edge cases. A stake address that * has closed their payment channel and withdrawn is able to create a new payment channel by staking Rook. */ function executeTimelockedWithdrawal( address _stakeAddress ) public { uint256 _channelNonce = channelNonce[_stakeAddress]; require(<FILL_ME>) require(block.timestamp > getCurrentWithdrawalTimelock(_stakeAddress), "still in withdrawal timelock"); uint256 withdrawalAmount = stakedAmount[_stakeAddress] - stakeSpent[_stakeAddress]; stakeNonce[_stakeAddress] = 0; stakeSpent[_stakeAddress] = 0; stakedAmount[_stakeAddress] = 0; channelNonce[_stakeAddress] += 1; ROOK.safeTransfer(_stakeAddress, withdrawalAmount); emit StakeWithdrawn(_stakeAddress, _channelNonce, withdrawalAmount); } /** @notice Instantly withdraw remaining stake in payment channel. * @dev To perform an instant withdrawal a Keeper will ask the coordinator for an instant withdrawal signature. * This `data` field in the commitment used to produce the signature should be populated with * `INSTANT_WITHDRAWAL_COMMITMENT_DATA`. We don't want a compromised Coordinator to instantly settle the * channel with an old commitment, so we also require a stakeAddress instant withdrawal signature. * Closing the payment channel zeros out all payment channel state for the stake address aside from the * channelNonce which is incremented. This is to prevent any channel reuse edge cases. A stake address that * has closed their payment channel and withdrawn is able to create a new payment channel by staking Rook. */ function executeInstantWithdrawal( StakeCommitment memory _commitment ) external { } /** @notice Claim accumulated earnings. Claim amounts are determined off-chain and signed by the claimGenerator * address. Claim amounts are calculated as a pre-determined percentage of a Keeper's bid, and Keeper bids * are signed by both Keepers and the Coordinator, so claim amount correctness is easily verifiable * off-chain by consumers even if it is not verified on-chain. * @dev Note that it is not feasible to verify claim amount correctness on-chain as the total claim amount for * a user can be the sum of claims generated from any number of bid commitments. Claimers only rely on the * claim generator to calculate the claim as a percentage of Keeper bids correctly and this is easily * verifiable by consumers off-chain given the signed bid commitments are public. * A user has claimable Rook if the Claim Generator has generated a commitment for them where `earningsToDate` * is greater than `userClaimedAmount[_claimAddress]`. */ function claim( address _claimAddress, uint256 _earningsToDate, bytes memory _claimGeneratorSignature ) external { } }
getCurrentWithdrawalTimelock(_stakeAddress)>0,"must initiate timelocked withdrawal first"
367,034
getCurrentWithdrawalTimelock(_stakeAddress)>0
"incorrect data payload"
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./CanReclaimTokens.sol"; contract CoordinationPaymentChannels is CanReclaimTokens { using SafeERC20 for IERC20; IERC20 constant ROOK = IERC20(0xfA5047c9c78B8877af97BDcb85Db743fD7313d4a); bytes constant public INSTANT_WITHDRAWAL_COMMITMENT_DATA = bytes("INSTANT"); // This keypair is responsible for signing stake commitments address public coordinator; // This keypair is responsible for signing user claim commitments address public claimGenerator; /* coordinator <-> keeper payment channels * The Coordinator and Keepers transact off-chain using these payment channels in a series of auctions * hosted by the Coordinator. The values stored in these variables reflect the latest on-chain state for a * payment channel, but the actual state of the payment channels is likely to be more recent than what is on * chain. The Coordinator and keeepers will pass signed commitments back and forth dictating what the current state * of the payment channel is. * A payment channel is keyed by a Keeper's stake address. * Note a keeper may have multiple payment channels / stake addresses. */ // The amount of Rook a keeper's stake address has staked. This determines their maximum spending power. mapping (address => uint256) public stakedAmount; // This nonce is used to give an ordering to the off-chain stake commitments and to prevent replays on-chain. mapping (address => uint256) public stakeNonce; // The total amount of Rook a keeper has currently spent. Cannot be greater than stakedAmount. mapping (address => uint256) public stakeSpent; // Used to prevent channel reuse edge cases if a stake address closes their channel and opens another. mapping (address => uint256) public channelNonce; // Used to track the expiration of withdrawal timelocks. mapping (bytes32 => uint256) public withdrawalTimelockTimestamp; /* claim generator -> user payment channels * The Claim Generator will generate claims using the Keeper bids from the Coordinator auctions. Claim amounts are * calculated as a percentage of the bid amounts determined by the DAO. Given that bids are signed by Keepers and * the Claim Generator, and they are available publicly, claim amount correcntess is easily verifiable off-chain. * * userClaimedAmount tracks how much a user has claimed to date. A user's outstanding claim amount is given by * subtracting userClaimedAmount from their most recent claim commitment generated by the Claim Generator. */ mapping (address => uint256) public userClaimedAmount; /* Total amount of claimable Rook. Accrues when commitments are submitted to `initiateTimelockedWithdrawal`, * `executeInstantWithdrawal`, and `settleSpentStake` and when `addClaimable` is called. */ uint256 public totalClaimableAmount; event Staked(address indexed _stakeAddress, uint256 _channelNonce, uint256 _amount); event Claimed(address indexed _claimAddress, uint256 _amount); event CoordinatorChanged(address indexed _oldCoordinator, address indexed _newCoordinator); event ClaimGeneratorChanged(address indexed _oldClaimGenerator, address indexed _newClaimGenerator); event StakeWithdrawn(address indexed _stakeAddress, uint256 _channelNonce, uint256 _amount); event TimelockedWithdrawalInitiated( address indexed _stakeAddress, uint256 _stakeSpent, uint256 _stakeNonce, uint256 _channelNonce, uint256 _withdrawalTimelock); event AddedClaimable(uint256 _amount); event Settled(uint256 _refundedAmount, uint256 _accruedAmount); /* Represents a payment channel state. The Coordinator and Keepers will sign commitments to agree upon the current * Note, the `data` field is used off-chain to hold the hash of the previous commitment to ensure that the * Coordinator and Keeper state for the payment channel is always consistent. The only time any assertions are made * on its value is `executeInstantWithdrawal` when it should equal `INSTANT_WITHDRAWAL_COMMITMENT_DATA`. */ struct StakeCommitment { address stakeAddress; uint256 stakeSpent; uint256 stakeNonce; uint256 channelNonce; bytes data; bytes stakeAddressSignature; bytes coordinatorSignature; } /// @notice Retreives the payment channel state for the provided stake address. function getStakerState( address _stakeAddress ) public view returns ( uint256 _stakedAmount, uint256 _stakeNonce, uint256 _stakeSpent, uint256 _channelNonce, uint256 _withdrawalTimelock ) { } /** @notice Calculate the commitment hash used for signatures for a particular stake payment channel state. * @dev The Coordinator and Keepers transact off-chain by passing signed commitments back and forth. Signed stake * commitments are submitted on-chain only to perform settlements and withdrawals. */ function stakeCommitmentHash( address _stakeAddress, uint256 _stakeSpent, uint256 _stakeNonce, uint256 _channelNonce, bytes memory _data ) public pure returns (bytes32) { } function stakeCommitmentHash( StakeCommitment memory _commitment ) internal pure returns (bytes32) { } /** @notice Calculate the commitment hash used for signatures for a particular claim payment channel state. * Signed claim commitments are generated by the claim generator and used by users to perform claims. */ function claimCommitmentHash( address _claimAddress, uint256 _earningsToDate ) public pure returns (bytes32) { } /** @notice Calculate the key to the entry in the withdrawalTimelockTimestamp map for a particular stake * payment channel state. */ function withdrawalTimelockKey( address _stakeAddress, uint256 _stakeSpent, uint256 _stakeNonce, uint256 _channelNonce ) public pure returns (bytes32) { } /** @notice Get the withdrawal timelock expiration for a payment channel. A return value of 0 indicates no timelock. * @dev The withdrawal timelock allows the Coordinator to withdrawals with newer commitments. */ function getCurrentWithdrawalTimelock( address _stakeAddress ) public view returns (uint256) { } constructor(address _coordinator, address _claimGenerator) { } /** @notice Update the Coordinator address. This keypair is responsible for signing stake commitments. * @dev To migrate Coordinator addresses, any commitments signed by the old Coordinator must be resigned by the * new Coordinator address. */ function updateCoordinatorAddress( address _newCoordinator ) external onlyOperator { } /** @notice Update the claimGenerator address. This keypair is responsible to for signing user claim commitments. * @dev To migrate claimGenerator addresses, any commitments signed by the old Claim address must be resigned by * the new claimGenerator address. */ function updateClaimGeneratorAddress( address _newClaimGenerator ) external onlyOperator { } /** @notice Add Rook to the payment channel of msg.sender. Cannot be done while in a timelocked withdrawal. * @dev Withdrawal of stake will require a signature from the Coordinator. */ function stake( uint256 _amount ) public { } /** @notice Used to add claimable Rook to the contract. * @dev Since claimable Rook otherwise only accrues on withdrawal or settlement of Rook, this can be used create a * buffer of immediately claimable Rook so users do not need to wait for a Keeper to withdraw or for someone * to call the `settleSpentStake` function. This can also be used to amend deficits from overgenerous claims. */ function addClaimable( uint256 _amount ) public { } /** @dev The stakeSpent for a payment channel will increase when a stake address makes payments and decrease * when the Coordinator issues refunds. This function changes the totalClaimableAmount of Rook on the contract * accordingly. */ function adjustTotalClaimableAmountByStakeSpentChange( uint256 _oldStakeSpent, uint256 _newStakeSpent ) internal { } /** @notice Used to settle spent stake for a payment channel to accrue claimable rook. * @dev Note anyone can call this function since it requires a signature from both keepers and the coordinator. * It will primarily be used by the coordinator but a user who would like to claim Rook immediately when there * is no claimable Rook may also call this to accrue claimable rook. * @param _commitments is a list of StakeCommitments. There should be one entry for each payment channel being * settled and it should be the latest commitment for that channel. We only care about the most recent * state for a payment channel, so evenif there are multiple commitments for a payment channel that have not * been submitted on-chain, only the latest needs to be submitted. The resulting contract state will be the * same regardless. */ function settleSpentStake( StakeCommitment[] memory _commitments ) external { } /** @notice Initiate or challenge withdrawal, which can be completed after a 7 day timelock expires. * @dev Used by the stake addresses to withdraw from and close the payment channel. Also used by the Coordinator to * challenge a withdrawal. The most recent commitment for the payment channel that has been signed by both the * stake address and the Coordinator should be used for the withdrawal. In order to prevent Keepers from * immediately exiting with an old commitment, potentially taking Rook they do not own, there is a 7 day * timelock on being able to complete the withdrawal. If the Coordinator has a more recent commitment, they * will submit it to this function resetting the timelock. */ function initiateTimelockedWithdrawal( StakeCommitment memory _commitment ) external { } /** @notice Withdraw remaining stake from the payment channel after the withdrawal timelock has concluded. * @dev Closing the payment channel zeros out all payment channel state for the stake address aside from the * channelNonce which is incremented. This is to prevent any channel reuse edge cases. A stake address that * has closed their payment channel and withdrawn is able to create a new payment channel by staking Rook. */ function executeTimelockedWithdrawal( address _stakeAddress ) public { } /** @notice Instantly withdraw remaining stake in payment channel. * @dev To perform an instant withdrawal a Keeper will ask the coordinator for an instant withdrawal signature. * This `data` field in the commitment used to produce the signature should be populated with * `INSTANT_WITHDRAWAL_COMMITMENT_DATA`. We don't want a compromised Coordinator to instantly settle the * channel with an old commitment, so we also require a stakeAddress instant withdrawal signature. * Closing the payment channel zeros out all payment channel state for the stake address aside from the * channelNonce which is incremented. This is to prevent any channel reuse edge cases. A stake address that * has closed their payment channel and withdrawn is able to create a new payment channel by staking Rook. */ function executeInstantWithdrawal( StakeCommitment memory _commitment ) external { require(msg.sender == _commitment.stakeAddress, "only stakeAddress can perform instant withdrawal"); require(_commitment.stakeSpent <= stakedAmount[_commitment.stakeAddress], "cannot spend more than is staked"); // The stakeNonce may have been seen in settleSpentStake so we must allow >= to here. // Note this means a malicious or compromised Coordinator has the ability to indefinitely reset the timelock. // This is fine since we can just change the Coordinator address. require(_commitment.stakeNonce >= stakeNonce[_commitment.stakeAddress], "stake nonce is too old"); require(_commitment.channelNonce == channelNonce[_commitment.stakeAddress], "incorrect channel nonce"); require(<FILL_ME>) address recoveredStakeAddress = ECDSA.recover( ECDSA.toEthSignedMessageHash(stakeCommitmentHash(_commitment)), _commitment.stakeAddressSignature); require(recoveredStakeAddress == _commitment.stakeAddress, "recovered address is not the stake address"); address recoveredCoordinatorAddress = ECDSA.recover( ECDSA.toEthSignedMessageHash(stakeCommitmentHash(_commitment)), _commitment.coordinatorSignature); require(recoveredCoordinatorAddress == coordinator, "recovered address is not the coordinator"); adjustTotalClaimableAmountByStakeSpentChange(stakeSpent[_commitment.stakeAddress], _commitment.stakeSpent); uint256 withdrawalAmount = stakedAmount[_commitment.stakeAddress] - _commitment.stakeSpent; stakeNonce[_commitment.stakeAddress] = 0; stakeSpent[_commitment.stakeAddress] = 0; stakedAmount[_commitment.stakeAddress] = 0; channelNonce[_commitment.stakeAddress] += 1; ROOK.safeTransfer(_commitment.stakeAddress, withdrawalAmount); emit StakeWithdrawn(_commitment.stakeAddress, _commitment.channelNonce, withdrawalAmount); } /** @notice Claim accumulated earnings. Claim amounts are determined off-chain and signed by the claimGenerator * address. Claim amounts are calculated as a pre-determined percentage of a Keeper's bid, and Keeper bids * are signed by both Keepers and the Coordinator, so claim amount correctness is easily verifiable * off-chain by consumers even if it is not verified on-chain. * @dev Note that it is not feasible to verify claim amount correctness on-chain as the total claim amount for * a user can be the sum of claims generated from any number of bid commitments. Claimers only rely on the * claim generator to calculate the claim as a percentage of Keeper bids correctly and this is easily * verifiable by consumers off-chain given the signed bid commitments are public. * A user has claimable Rook if the Claim Generator has generated a commitment for them where `earningsToDate` * is greater than `userClaimedAmount[_claimAddress]`. */ function claim( address _claimAddress, uint256 _earningsToDate, bytes memory _claimGeneratorSignature ) external { } }
keccak256(_commitment.data)==keccak256(INSTANT_WITHDRAWAL_COMMITMENT_DATA),"incorrect data payload"
367,034
keccak256(_commitment.data)==keccak256(INSTANT_WITHDRAWAL_COMMITMENT_DATA)
null
pragma solidity ^0.4.18; // solhint-disable-line /// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens /// @author Dieter Shirley <[email protected]> (https://github.com/dete) contract ERC721 { // Required methods function approve(address _to, uint256 _tokenId) public; function balanceOf(address _owner) public view returns (uint256 balance); function implementsERC721() public pure returns (bool); function ownerOf(uint256 _tokenId) public view returns (address addr); function takeOwnership(uint256 _tokenId) public; function totalSupply() public view returns (uint256 total); function transferFrom(address _from, address _to, uint256 _tokenId) public; function transfer(address _to, uint256 _tokenId) public; event Transfer(address indexed from, address indexed to, uint256 tokenId); event Approval(address indexed owner, address indexed approved, uint256 tokenId); // Optional // function name() public view returns (string name); // function symbol() public view returns (string symbol); // function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256 tokenId); // function tokenMetadata(uint256 _tokenId) public view returns (string infoUrl); } contract PowZoneToken is ERC721 { address cryptoVideoGames = 0xdEc14D8f4DA25108Fd0d32Bf2DeCD9538564D069; address cryptoVideoGameItems = 0xD2606C9bC5EFE092A8925e7d6Ae2F63a84c5FDEa; /*** EVENTS ***/ /// @dev The Birth event is fired whenever a new pow comes into existence. event Birth(uint256 tokenId, string name, address owner); /// @dev The TokenSold event is fired whenever a token is sold. event TokenSold(uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address winner, string name); /// @dev Transfer event as defined in current draft of ERC721. /// ownership is assigned, including births. event Transfer(address from, address to, uint256 tokenId); /*** CONSTANTS ***/ /// @notice Name and symbol of the non fungible token, as defined in ERC721. string public constant NAME = "CryptoKotakuPowZone"; // solhint-disable-line string public constant SYMBOL = "PowZone"; // solhint-disable-line uint256 private startingPrice = 0.005 ether; uint256 private firstStepLimit = 0.05 ether; uint256 private secondStepLimit = 0.5 ether; /*** STORAGE ***/ /// @dev A mapping from pow IDs to the address that owns them. All pows have /// some valid owner address. mapping (uint256 => address) public powIndexToOwner; // @dev A mapping from owner address to count of tokens that address owns. // Used internally inside balanceOf() to resolve ownership count. mapping (address => uint256) private ownershipTokenCount; /// @dev A mapping from PowIDs to an address that has been approved to call /// transferFrom(). Each Pow can only have one approved address for transfer /// at any time. A zero value means no approval is outstanding. mapping (uint256 => address) public powIndexToApproved; // @dev A mapping from PowIDs to the price of the token. mapping (uint256 => uint256) private powIndexToPrice; // The addresses of the accounts (or contracts) that can execute actions within each roles. address public ceoAddress; address public cooAddress; uint256 public promoCreatedCount; /*** DATATYPES ***/ struct Pow { string name; uint gameId; uint gameItemId; } Pow[] private pows; /*** ACCESS MODIFIERS ***/ /// @dev Access modifier for CEO-only functionality modifier onlyCEO() { } /// @dev Access modifier for COO-only functionality modifier onlyCOO() { } /// Access modifier for contract owner only functionality modifier onlyCLevel() { } /*** CONSTRUCTOR ***/ function PowZoneToken() public { } /*** PUBLIC FUNCTIONS ***/ /// @notice Grant another address the right to transfer token via takeOwnership() and transferFrom(). /// @param _to The address to be granted transfer approval. Pass address(0) to /// clear all approvals. /// @param _tokenId The ID of the Token that can be transferred if this call succeeds. /// @dev Required for ERC-721 compliance. function approve( address _to, uint256 _tokenId ) public { } /// For querying balance of a particular account /// @param _owner The address for balance query /// @dev Required for ERC-721 compliance. function balanceOf(address _owner) public view returns (uint256 balance) { } /// @dev Creates a new promo Pow with the given name, with given _price and assignes it to an address. function createPromoPow(address _owner, string _name, uint256 _price, uint _gameId, uint _gameItemId) public onlyCOO { } /// @dev Creates a new Pow with the given name. function createContractPow(string _name, uint _gameId, uint _gameItemId) public onlyCOO { } /// @notice Returns all the relevant information about a specific pow. /// @param _tokenId The tokenId of the pow of interest. function getPow(uint256 _tokenId) public view returns ( uint256 Id, string powName, uint256 sellingPrice, address owner, uint gameId, uint gameItemId ) { } function implementsERC721() public pure returns (bool) { } /// @dev Required for ERC-721 compliance. function name() public pure returns (string) { } /// For querying owner of token /// @param _tokenId The tokenID for owner inquiry /// @dev Required for ERC-721 compliance. function ownerOf(uint256 _tokenId) public view returns (address owner) { } function payout(address _to) public onlyCLevel { } // Allows someone to send ether and obtain the token function purchase(uint256 _tokenId) public payable { } /// Divident distributions function _transferDivs(uint256 _gameOwnerPayment, uint256 _gameItemOwnerPayment, uint256 _tokenId) private { } function priceOf(uint256 _tokenId) public view returns (uint256 price) { } /// @dev Assigns a new address to act as the CEO. Only available to the current CEO. /// @param _newCEO The address of the new CEO function setCEO(address _newCEO) public onlyCEO { } /// @dev Assigns a new address to act as the COO. Only available to the current COO. /// @param _newCOO The address of the new COO function setCOO(address _newCOO) public onlyCEO { } /// @dev Required for ERC-721 compliance. function symbol() public pure returns (string) { } /// @notice Allow pre-approved user to take ownership of a token /// @param _tokenId The ID of the Token that can be transferred if this call succeeds. /// @dev Required for ERC-721 compliance. function takeOwnership(uint256 _tokenId) public { } /// @param _owner The owner whose pow tokens we are interested in. /// @dev This method MUST NEVER be called by smart contract code. First, it's fairly /// expensive (it walks the entire pows array looking for pows belonging to owner), /// but it also returns a dynamic array, which is only supported for web3 calls, and /// not contract-to-contract calls. function tokensOfOwner(address _owner) public view returns(uint256[] ownerTokens) { } /// For querying totalSupply of token /// @dev Required for ERC-721 compliance. function totalSupply() public view returns (uint256 total) { } /// Owner initates the transfer of the token to another account /// @param _to The address for the token to be transferred to. /// @param _tokenId The ID of the Token that can be transferred if this call succeeds. /// @dev Required for ERC-721 compliance. function transfer( address _to, uint256 _tokenId ) public { } /// Third-party initiates transfer of token from address _from to address _to /// @param _from The address for the token to be transferred from. /// @param _to The address for the token to be transferred to. /// @param _tokenId The ID of the Token that can be transferred if this call succeeds. /// @dev Required for ERC-721 compliance. function transferFrom( address _from, address _to, uint256 _tokenId ) public { } /*** PRIVATE FUNCTIONS ***/ /// Safety check on _to address to prevent against an unexpected 0x0 default. function _addressNotNull(address _to) private pure returns (bool) { } /// For checking approval of transfer for address _to function _approved(address _to, uint256 _tokenId) private view returns (bool) { } /// For creating Pow function _createPow(string _name, address _owner, uint256 _price, uint _gameId, uint _gameItemId) private { } /// Check for token ownership function _owns(address claimant, uint256 _tokenId) private view returns (bool) { } /// For paying out balance on contract function _payout(address _to) private { } /* This function can be used by the owner of a pow item to modify the price of its pow item. */ function modifyPowPrice(uint _powId, uint256 _newPrice) public { require(_newPrice > 0); require(<FILL_ME>) powIndexToPrice[_powId] = _newPrice; } /// @dev Assigns ownership of a specific Pow to an address. function _transfer(address _from, address _to, uint256 _tokenId) private { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } } contract CryptoVideoGames { // This function will return only the owner address of a specific Video Game function getVideoGameOwner(uint _videoGameId) public view returns(address) { } } contract CryptoVideoGameItem { function getVideoGameItemOwner(uint _videoGameItemId) public view returns(address) { } }
powIndexToOwner[_powId]==msg.sender
367,104
powIndexToOwner[_powId]==msg.sender
"must be a live proposal"
pragma solidity 0.5.13; /** * @title GenericScheme. * @dev A scheme for proposing and executing calls to an arbitrary function * on a specific contract on behalf of the organization avatar. */ contract GenericScheme is VotingMachineCallbacks, ProposalExecuteInterface { event NewCallProposal( address indexed _avatar, bytes32 indexed _proposalId, bytes _callData, uint256 _value, string _descriptionHash ); event ProposalExecuted( address indexed _avatar, bytes32 indexed _proposalId, bytes _genericCallReturnValue ); event ProposalExecutedByVotingMachine( address indexed _avatar, bytes32 indexed _proposalId, int256 _param ); event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId); // Details of a voting proposal: struct CallProposal { bytes callData; uint256 value; bool exist; bool passed; } mapping(bytes32=>CallProposal) public organizationProposals; IntVoteInterface public votingMachine; bytes32 public voteParams; address public contractToCall; Avatar public avatar; /** * @dev initialize * @param _avatar the avatar to mint reputation from * @param _votingMachine the voting machines address to * @param _voteParams voting machine parameters. * @param _contractToCall the target contract this scheme will call to */ function initialize( Avatar _avatar, IntVoteInterface _votingMachine, bytes32 _voteParams, address _contractToCall ) external { } /** * @dev execution of proposals, can only be called by the voting machine in which the vote is held. * @param _proposalId the ID of the voting in the voting machine * @param _decision a parameter of the voting result, 1 yes and 2 is no. * @return bool success */ function executeProposal(bytes32 _proposalId, int256 _decision) external onlyVotingMachine(_proposalId) returns(bool) { CallProposal storage proposal = organizationProposals[_proposalId]; require(<FILL_ME>) require(proposal.passed == false, "cannot execute twice"); if (_decision == 1) { proposal.passed = true; execute(_proposalId); } else { delete organizationProposals[_proposalId]; emit ProposalDeleted(address(avatar), _proposalId); } emit ProposalExecutedByVotingMachine(address(avatar), _proposalId, _decision); return true; } /** * @dev execution of proposals after it has been decided by the voting machine * @param _proposalId the ID of the voting in the voting machine */ function execute(bytes32 _proposalId) public { } /** * @dev propose to call on behalf of the _avatar * The function trigger NewCallProposal event * @param _callData - The abi encode data for the call * @param _value value(ETH) to transfer with the call * @param _descriptionHash proposal description hash * @return an id which represents the proposal */ function proposeCall(bytes memory _callData, uint256 _value, string memory _descriptionHash) public returns(bytes32) { } }
proposal.exist,"must be a live proposal"
367,126
proposal.exist
"proposal must passed by voting machine"
pragma solidity 0.5.13; /** * @title GenericScheme. * @dev A scheme for proposing and executing calls to an arbitrary function * on a specific contract on behalf of the organization avatar. */ contract GenericScheme is VotingMachineCallbacks, ProposalExecuteInterface { event NewCallProposal( address indexed _avatar, bytes32 indexed _proposalId, bytes _callData, uint256 _value, string _descriptionHash ); event ProposalExecuted( address indexed _avatar, bytes32 indexed _proposalId, bytes _genericCallReturnValue ); event ProposalExecutedByVotingMachine( address indexed _avatar, bytes32 indexed _proposalId, int256 _param ); event ProposalDeleted(address indexed _avatar, bytes32 indexed _proposalId); // Details of a voting proposal: struct CallProposal { bytes callData; uint256 value; bool exist; bool passed; } mapping(bytes32=>CallProposal) public organizationProposals; IntVoteInterface public votingMachine; bytes32 public voteParams; address public contractToCall; Avatar public avatar; /** * @dev initialize * @param _avatar the avatar to mint reputation from * @param _votingMachine the voting machines address to * @param _voteParams voting machine parameters. * @param _contractToCall the target contract this scheme will call to */ function initialize( Avatar _avatar, IntVoteInterface _votingMachine, bytes32 _voteParams, address _contractToCall ) external { } /** * @dev execution of proposals, can only be called by the voting machine in which the vote is held. * @param _proposalId the ID of the voting in the voting machine * @param _decision a parameter of the voting result, 1 yes and 2 is no. * @return bool success */ function executeProposal(bytes32 _proposalId, int256 _decision) external onlyVotingMachine(_proposalId) returns(bool) { } /** * @dev execution of proposals after it has been decided by the voting machine * @param _proposalId the ID of the voting in the voting machine */ function execute(bytes32 _proposalId) public { CallProposal storage proposal = organizationProposals[_proposalId]; require(proposal.exist, "must be a live proposal"); require(<FILL_ME>) proposal.exist = false; bytes memory genericCallReturnValue; bool success; Controller controller = Controller(avatar.owner()); (success, genericCallReturnValue) = controller.genericCall(contractToCall, proposal.callData, avatar, proposal.value); if (success) { delete organizationProposals[_proposalId]; emit ProposalDeleted(address(avatar), _proposalId); emit ProposalExecuted(address(avatar), _proposalId, genericCallReturnValue); } else { proposal.exist = true; } } /** * @dev propose to call on behalf of the _avatar * The function trigger NewCallProposal event * @param _callData - The abi encode data for the call * @param _value value(ETH) to transfer with the call * @param _descriptionHash proposal description hash * @return an id which represents the proposal */ function proposeCall(bytes memory _callData, uint256 _value, string memory _descriptionHash) public returns(bytes32) { } }
proposal.passed,"proposal must passed by voting machine"
367,126
proposal.passed
null
pragma solidity =0.6.6; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove(address token, address to, uint value) internal { } function safeTransfer(address token, address to, uint value) internal { } function safeTransferFrom(address token, address from, address to, uint value) internal { } function safeTransferETH(address to, uint value) internal { } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract DonutBurn { using SafeMath for uint256; bool isSeeded; address constant public BURN_ADDRESS = 0x0000000000000000000000000000000000000001; address constant public COFFEE_ADDRESS = 0xCcFf20dC60f1b34D9e8bE09591d00F0f775596FD; address constant public DONUT_ADDRESS = 0xC0F9bD5Fa5698B6505F643900FFA515Ea5dF54A9; uint256 constant public COFFEE_MAG = 1e9; uint256 constant public DONUT_MAG = 1e18; uint256 constant public INITIAL_COFFEE_SUPPLY = 5 * 1e6 * COFFEE_MAG; uint256 constant public RATE = 4; constructor() public { } function seed() external { require(<FILL_ME>) TransferHelper.safeTransferFrom(COFFEE_ADDRESS, msg.sender, address(this), INITIAL_COFFEE_SUPPLY); isSeeded = true; } function burn(uint256 _amount) external { } }
!isSeeded
367,270
!isSeeded
"max supply exceeded"
pragma solidity ^0.8.11; contract IERC721Mintable is ERC721Enumerable, Ownable, ReentrancyGuard { using Strings for uint256; using Counters for Counters.Counter; bool public pause = false; bool public reveal = false; bool public presale = true; uint256 public cost = 0.29 ether; uint256 public supply = 7777; uint256 public maxPerWallet = 2; string public revealedUri; string public notRevealedUri; mapping(address => bool) public whitelistedAddresses; mapping(address => uint256) public addressMintedBalance; Counters.Counter private _token_Ids; constructor( string memory _initRevealedUri, string memory _initNotRevealedUri ) ERC721("METAICON", "MTI") { } function _baseURI() internal view virtual override returns (string memory) { } function metaMint(uint256 _mintAmount) public payable nonReentrant { require(!pause, "metaicon smart contract is paused"); uint256 mintedSupply = totalSupply(); require(_mintAmount > 0, "mint at least 1 nft"); require(<FILL_ME>) if (msg.sender != owner()) { if(presale == true) { require(isWhitelisted(msg.sender), "your address is not whitelisted"); } require(addressMintedBalance[msg.sender] + _mintAmount <= maxPerWallet, "max nfts per wallet exceeded"); require(msg.value >= cost * _mintAmount, "insufficients funds"); } uint256 _new_Token_Id; for (uint256 i = 1; i <= _mintAmount; i++) { _token_Ids.increment(); _new_Token_Id = _token_Ids.current(); addressMintedBalance[msg.sender]++; _safeMint(msg.sender, _new_Token_Id); } } function tokenURI(uint256 token_Id) public view virtual override returns (string memory) { } function setRevealedUri(string memory _newRevealedUri) public onlyOwner { } function setNotRevealedUri(string memory _newNotRevealedUri) public onlyOwner { } function setSupply(uint256 _newSupply) public onlyOwner { } function setCost(uint256 _newCost) public onlyOwner { } function setPause(bool _newPauseState) public onlyOwner { } function setReveal(bool _newRevealState) public onlyOwner { } function setPresale(bool _newPresaleState) public onlyOwner { } function setMaxPerWallet(uint256 _newMaxPerWallet) public onlyOwner { } function isWhitelisted(address _userWallet) public view returns (bool) { } function addWhitelistedAddress(address _userWallet) public onlyOwner { } function addBulkWhitelistedAddress(address[] memory _usersWallets) public onlyOwner { } function withDraw() public payable onlyOwner { } }
mintedSupply+_mintAmount<=supply,"max supply exceeded"
367,534
mintedSupply+_mintAmount<=supply
"max nfts per wallet exceeded"
pragma solidity ^0.8.11; contract IERC721Mintable is ERC721Enumerable, Ownable, ReentrancyGuard { using Strings for uint256; using Counters for Counters.Counter; bool public pause = false; bool public reveal = false; bool public presale = true; uint256 public cost = 0.29 ether; uint256 public supply = 7777; uint256 public maxPerWallet = 2; string public revealedUri; string public notRevealedUri; mapping(address => bool) public whitelistedAddresses; mapping(address => uint256) public addressMintedBalance; Counters.Counter private _token_Ids; constructor( string memory _initRevealedUri, string memory _initNotRevealedUri ) ERC721("METAICON", "MTI") { } function _baseURI() internal view virtual override returns (string memory) { } function metaMint(uint256 _mintAmount) public payable nonReentrant { require(!pause, "metaicon smart contract is paused"); uint256 mintedSupply = totalSupply(); require(_mintAmount > 0, "mint at least 1 nft"); require(mintedSupply + _mintAmount <= supply, "max supply exceeded"); if (msg.sender != owner()) { if(presale == true) { require(isWhitelisted(msg.sender), "your address is not whitelisted"); } require(<FILL_ME>) require(msg.value >= cost * _mintAmount, "insufficients funds"); } uint256 _new_Token_Id; for (uint256 i = 1; i <= _mintAmount; i++) { _token_Ids.increment(); _new_Token_Id = _token_Ids.current(); addressMintedBalance[msg.sender]++; _safeMint(msg.sender, _new_Token_Id); } } function tokenURI(uint256 token_Id) public view virtual override returns (string memory) { } function setRevealedUri(string memory _newRevealedUri) public onlyOwner { } function setNotRevealedUri(string memory _newNotRevealedUri) public onlyOwner { } function setSupply(uint256 _newSupply) public onlyOwner { } function setCost(uint256 _newCost) public onlyOwner { } function setPause(bool _newPauseState) public onlyOwner { } function setReveal(bool _newRevealState) public onlyOwner { } function setPresale(bool _newPresaleState) public onlyOwner { } function setMaxPerWallet(uint256 _newMaxPerWallet) public onlyOwner { } function isWhitelisted(address _userWallet) public view returns (bool) { } function addWhitelistedAddress(address _userWallet) public onlyOwner { } function addBulkWhitelistedAddress(address[] memory _usersWallets) public onlyOwner { } function withDraw() public payable onlyOwner { } }
addressMintedBalance[msg.sender]+_mintAmount<=maxPerWallet,"max nfts per wallet exceeded"
367,534
addressMintedBalance[msg.sender]+_mintAmount<=maxPerWallet
null
pragma solidity ^0.8.11; contract IERC721Mintable is ERC721Enumerable, Ownable, ReentrancyGuard { using Strings for uint256; using Counters for Counters.Counter; bool public pause = false; bool public reveal = false; bool public presale = true; uint256 public cost = 0.29 ether; uint256 public supply = 7777; uint256 public maxPerWallet = 2; string public revealedUri; string public notRevealedUri; mapping(address => bool) public whitelistedAddresses; mapping(address => uint256) public addressMintedBalance; Counters.Counter private _token_Ids; constructor( string memory _initRevealedUri, string memory _initNotRevealedUri ) ERC721("METAICON", "MTI") { } function _baseURI() internal view virtual override returns (string memory) { } function metaMint(uint256 _mintAmount) public payable nonReentrant { } function tokenURI(uint256 token_Id) public view virtual override returns (string memory) { require(<FILL_ME>) if(reveal == false) return notRevealedUri; string memory currentBaseUri = _baseURI(); return bytes(currentBaseUri).length > 0 ? string(abi.encodePacked(currentBaseUri, token_Id.toString())) : ""; } function setRevealedUri(string memory _newRevealedUri) public onlyOwner { } function setNotRevealedUri(string memory _newNotRevealedUri) public onlyOwner { } function setSupply(uint256 _newSupply) public onlyOwner { } function setCost(uint256 _newCost) public onlyOwner { } function setPause(bool _newPauseState) public onlyOwner { } function setReveal(bool _newRevealState) public onlyOwner { } function setPresale(bool _newPresaleState) public onlyOwner { } function setMaxPerWallet(uint256 _newMaxPerWallet) public onlyOwner { } function isWhitelisted(address _userWallet) public view returns (bool) { } function addWhitelistedAddress(address _userWallet) public onlyOwner { } function addBulkWhitelistedAddress(address[] memory _usersWallets) public onlyOwner { } function withDraw() public payable onlyOwner { } }
_exists(token_Id)
367,534
_exists(token_Id)
"tokenURI is already set!"
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "base64-sol/base64.sol"; import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol"; contract VectorField is ERC721URIStorage, VRFConsumerBase, Ownable { uint256 public tokenCounter; uint256 public constant MAX_SUPPLY = 300; uint256 public constant PRICE = .25 ether; mapping(bytes32 => address) public requestIdToSender; mapping(uint256 => uint256) public tokenIdToRandomNumber; mapping(bytes32 => uint256) public requestIdToTokenId; bytes32 internal keyHash; uint256 internal fee; uint256 public height; uint256 public price; uint256 public width; string[] public colors; constructor(address _VRFCoordinator, address _LinkToken, bytes32 _keyhash, uint256 _fee) VRFConsumerBase(_VRFCoordinator, _LinkToken) ERC721("Vector Field", "VCFD") { } function withdraw() public payable onlyOwner { } function Claim() public payable returns (bytes32 requestId) { } function Mint(uint256 tokenId) public { require(<FILL_ME>) require(tokenCounter > tokenId, "TokenId has not been minted yet!"); require(tokenIdToRandomNumber[tokenId] > 0, "Need to wait for the Chainlink node to respond!"); uint256 randomNumber = tokenIdToRandomNumber[tokenId]; string memory svg = generateSVG(randomNumber); string memory TokenID = uint2str(tokenId); string memory imageURI = svgToImageURI(svg); _setTokenURI(tokenId, formatTokenURI(imageURI, TokenID)); } function fulfillRandomness(bytes32 requestId, uint256 randomNumber) internal override { } function generateSVG(uint256 _randomness) public view returns (string memory finalSvg) { } function generatePath(uint256 _randomness) public view returns(string memory pathSvg) { } // From: https://stackoverflow.com/a/65707309/11969592 function uint2str(uint _i) internal pure returns (string memory _uintAsString) { } function svgToImageURI(string memory svg) public pure returns (string memory) { } function formatTokenURI(string memory imageURI, string memory TokenID) public pure returns (string memory) { } }
bytes(tokenURI(tokenId)).length<=0,"tokenURI is already set!"
367,636
bytes(tokenURI(tokenId)).length<=0
"Need to wait for the Chainlink node to respond!"
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "base64-sol/base64.sol"; import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol"; contract VectorField is ERC721URIStorage, VRFConsumerBase, Ownable { uint256 public tokenCounter; uint256 public constant MAX_SUPPLY = 300; uint256 public constant PRICE = .25 ether; mapping(bytes32 => address) public requestIdToSender; mapping(uint256 => uint256) public tokenIdToRandomNumber; mapping(bytes32 => uint256) public requestIdToTokenId; bytes32 internal keyHash; uint256 internal fee; uint256 public height; uint256 public price; uint256 public width; string[] public colors; constructor(address _VRFCoordinator, address _LinkToken, bytes32 _keyhash, uint256 _fee) VRFConsumerBase(_VRFCoordinator, _LinkToken) ERC721("Vector Field", "VCFD") { } function withdraw() public payable onlyOwner { } function Claim() public payable returns (bytes32 requestId) { } function Mint(uint256 tokenId) public { require(bytes(tokenURI(tokenId)).length <= 0, "tokenURI is already set!"); require(tokenCounter > tokenId, "TokenId has not been minted yet!"); require(<FILL_ME>) uint256 randomNumber = tokenIdToRandomNumber[tokenId]; string memory svg = generateSVG(randomNumber); string memory TokenID = uint2str(tokenId); string memory imageURI = svgToImageURI(svg); _setTokenURI(tokenId, formatTokenURI(imageURI, TokenID)); } function fulfillRandomness(bytes32 requestId, uint256 randomNumber) internal override { } function generateSVG(uint256 _randomness) public view returns (string memory finalSvg) { } function generatePath(uint256 _randomness) public view returns(string memory pathSvg) { } // From: https://stackoverflow.com/a/65707309/11969592 function uint2str(uint _i) internal pure returns (string memory _uintAsString) { } function svgToImageURI(string memory svg) public pure returns (string memory) { } function formatTokenURI(string memory imageURI, string memory TokenID) public pure returns (string memory) { } }
tokenIdToRandomNumber[tokenId]>0,"Need to wait for the Chainlink node to respond!"
367,636
tokenIdToRandomNumber[tokenId]>0
"Max mints reached for address"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface IStakingPool { function balanceOf(address _owner) external view returns (uint256 balance); function burn(address _owner, uint256 _amount) external; } interface IStandaloneNft721 is IERC721 { function totalSupply() external view returns (uint256); function numberMintedByAddress(address _address) external view returns (uint256); function mintNext(address _to, uint256 _amount) external; function addToNumberMintedByAddress(address _address, uint256 amount) external; } contract Raini721FunctionsV3 is AccessControl, ReentrancyGuard { using ECDSA for bytes32; struct PoolType { uint64 costInUnicorns; uint64 costInRainbows; uint64 costInEth; uint16 maxMintsPerAddress; uint32 supply; uint32 mintTimeStart; // the timestamp from which the pack can be minted bool requiresWhitelist; } mapping (uint256 => PoolType) public poolTypes; uint256 public constant POINT_COST_DECIMALS = 1000000000000000000; uint256 public rainbowToEth; uint256 public unicornToEth; uint256 public minPointsPercentToMint; uint256 public maxMintsPerTx; mapping(address => bool) public rainbowPools; mapping(address => bool) public unicornPools; mapping(address => mapping(uint256 => uint256)) public numberMintedByAddress; mapping (uint256 => uint) public numberOfPoolMinted; uint256 public mintingFeeBasisPoints; address public verifier; address public contractOwner; address payable public ethRecipient; address payable public feeRecipient; IStandaloneNft721 public nftContract; constructor(address _nftContractAddress, uint256 _maxMintsPerTx, address payable _ethRecipient, address payable _feeRecipient, address _contractOwner, address _verifier) { } modifier onlyOwner() { } function setMaxMintsPerTx(uint256 _maxMintsPerTx) external onlyOwner { } function setNftContract(address _nftContract) external onlyOwner { } function addRainbowPool(address _rainbowPool) external onlyOwner { } function removeRainbowPool(address _rainbowPool) external onlyOwner { } function addUnicornPool(address _unicornPool) external onlyOwner { } function removeUnicornPool(address _unicornPool) external onlyOwner { } function setEtherValues(uint256 _unicornToEth, uint256 _rainbowToEth, uint256 _minPointsPercentToMint) external onlyOwner { } function setFees(uint256 _mintingFeeBasisPoints) external onlyOwner { } function setVerifierAddress(address _verifier) external onlyOwner { } function setFeeRecipient(address payable _feeRecipient) external onlyOwner { } function setEthRecipient(address payable _ethRecipient) external onlyOwner { } function getTotalBalance(address _address, uint256 _start, uint256 _end) external view returns (uint256[][] memory amounts) { } function initPools( uint256[] memory _poolId, uint256[] memory _supply, uint256[] memory _costInUnicorns, uint256[] memory _costInRainbows, uint256[] memory _costInEth, uint256[] memory _maxMintsPerAddress, uint32[] memory _mintTimeStart, bool[] memory _requiresWhitelist ) external onlyOwner { } struct MintData { uint256 totalPriceRainbows; uint256 totalPriceUnicorns; uint256 minCostRainbows; uint256 minCostUnicorns; uint256 fee; uint256 amountEthToWithdraw; uint256 maxMints; uint256 totalToMint; bool success; } function checkSigniture(address msgSender, bytes memory sig, uint256 maxMints) public view returns (bool _success) { } function mint( uint256[] memory _poolType, uint256[] memory _amount, bool[] memory _useUnicorns, address[] memory _rainbowPools, address[] memory _unicornPools, bytes memory sig, uint256 maxMints ) external payable nonReentrant { require(maxMints == 0 || checkSigniture(_msgSender(), sig, maxMints), 'invalid sig'); MintData memory _locals = MintData({ totalPriceRainbows: 0, totalPriceUnicorns: 0, minCostRainbows: 0, minCostUnicorns: 0, fee: 0, amountEthToWithdraw: 0, maxMints: 0, totalToMint: 0, success: false }); for (uint256 i = 0; i < _poolType.length; i++) { PoolType memory poolType = poolTypes[_poolType[i]]; _locals.maxMints = poolType.maxMintsPerAddress == 0 ? 10 ** 10 : poolType.maxMintsPerAddress; if (poolType.requiresWhitelist && (maxMints < _locals.maxMints)) { _locals.maxMints = maxMints; } require(block.timestamp >= poolType.mintTimeStart || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), 'too early'); require(<FILL_ME>) uint256 numberMinted = numberOfPoolMinted[_poolType[i]]; if (numberMinted + _amount[i] > poolType.supply) { _amount[i] = poolType.supply - numberMinted; } _locals.totalToMint += _amount[i]; if (poolType.maxMintsPerAddress > 0) { numberMintedByAddress[_msgSender()][_poolType[i]] += _amount[i]; numberOfPoolMinted[_poolType[i]] += _amount[i]; } if (poolType.costInUnicorns > 0 || poolType.costInRainbows > 0) { if (_useUnicorns[i]) { require(poolType.costInUnicorns > 0, "unicorns not allowed"); uint256 cost = poolType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS; _locals.totalPriceUnicorns += cost; if (poolType.costInEth > 0) { _locals.minCostUnicorns += cost; } } else { require(poolType.costInRainbows > 0, "rainbows not allowed"); uint256 cost = poolType.costInRainbows * _amount[i] * POINT_COST_DECIMALS; _locals.totalPriceRainbows += cost; if (poolType.costInEth > 0) { _locals.minCostRainbows += cost; } } if (poolType.costInEth == 0) { if (poolType.costInRainbows > 0) { _locals.fee += (poolType.costInRainbows * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (rainbowToEth * 10000); } else { _locals.fee += (poolType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (unicornToEth * 10000); } } } _locals.amountEthToWithdraw += poolType.costInEth * _amount[i]; } if (_locals.totalPriceUnicorns > 0 || _locals.totalPriceRainbows > 0 ) { for (uint256 n = 0; n < 2; n++) { bool loopTypeUnicorns = n > 0; uint256 totalBalance = 0; uint256 totalPrice = loopTypeUnicorns ? _locals.totalPriceUnicorns : _locals.totalPriceRainbows; uint256 remainingPrice = totalPrice; if (totalPrice > 0) { uint256 loopLength = loopTypeUnicorns ? _unicornPools.length : _rainbowPools.length; require(loopLength > 0, "invalid pools"); for (uint256 i = 0; i < loopLength; i++) { IStakingPool pool; if (loopTypeUnicorns) { require((unicornPools[_unicornPools[i]]), "invalid unicorn pool"); pool = IStakingPool(_unicornPools[i]); } else { require((rainbowPools[_rainbowPools[i]]), "invalid rainbow pool"); pool = IStakingPool(_rainbowPools[i]); } uint256 _balance = pool.balanceOf(_msgSender()); totalBalance += _balance; if (totalBalance >= totalPrice) { pool.burn(_msgSender(), remainingPrice); remainingPrice = 0; break; } else { pool.burn(_msgSender(), _balance); remainingPrice -= _balance; } } if (remainingPrice > 0) { totalPrice -= loopTypeUnicorns ? _locals.minCostUnicorns : _locals.minCostRainbows; uint256 minPoints = (totalPrice * minPointsPercentToMint) / 100; require(totalPrice - remainingPrice >= minPoints, "not enough balance"); uint256 pointsToEth = loopTypeUnicorns ? unicornToEth : rainbowToEth; require(msg.value * pointsToEth > remainingPrice, "not enough balance"); _locals.fee += remainingPrice / pointsToEth; } } } } require(_locals.amountEthToWithdraw + _locals.fee <= msg.value, "not enough eth"); (_locals.success, ) = _msgSender().call{ value: msg.value - (_locals.amountEthToWithdraw + _locals.fee)}(""); // refund excess Eth require(_locals.success, "transfer failed"); (_locals.success, ) = feeRecipient.call{ value: _locals.fee }(""); // pay fees require(_locals.success, "fee transfer failed"); (_locals.success, ) = ethRecipient.call{ value: _locals.amountEthToWithdraw }(""); // pay eth recipient require(_locals.success, "transfer failed"); require(_locals.totalToMint > 0, 'Allocation exhausted'); require(_locals.totalToMint <= maxMintsPerTx, '_amount over max'); nftContract.mintNext(_msgSender(), _locals.totalToMint); } // Allow the owner to withdraw Ether payed into the contract function withdrawEth(uint256 _amount) external onlyOwner { } }
numberMintedByAddress[_msgSender()][_poolType[i]]+_amount[i]<=_locals.maxMints,"Max mints reached for address"
367,638
numberMintedByAddress[_msgSender()][_poolType[i]]+_amount[i]<=_locals.maxMints
"invalid unicorn pool"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface IStakingPool { function balanceOf(address _owner) external view returns (uint256 balance); function burn(address _owner, uint256 _amount) external; } interface IStandaloneNft721 is IERC721 { function totalSupply() external view returns (uint256); function numberMintedByAddress(address _address) external view returns (uint256); function mintNext(address _to, uint256 _amount) external; function addToNumberMintedByAddress(address _address, uint256 amount) external; } contract Raini721FunctionsV3 is AccessControl, ReentrancyGuard { using ECDSA for bytes32; struct PoolType { uint64 costInUnicorns; uint64 costInRainbows; uint64 costInEth; uint16 maxMintsPerAddress; uint32 supply; uint32 mintTimeStart; // the timestamp from which the pack can be minted bool requiresWhitelist; } mapping (uint256 => PoolType) public poolTypes; uint256 public constant POINT_COST_DECIMALS = 1000000000000000000; uint256 public rainbowToEth; uint256 public unicornToEth; uint256 public minPointsPercentToMint; uint256 public maxMintsPerTx; mapping(address => bool) public rainbowPools; mapping(address => bool) public unicornPools; mapping(address => mapping(uint256 => uint256)) public numberMintedByAddress; mapping (uint256 => uint) public numberOfPoolMinted; uint256 public mintingFeeBasisPoints; address public verifier; address public contractOwner; address payable public ethRecipient; address payable public feeRecipient; IStandaloneNft721 public nftContract; constructor(address _nftContractAddress, uint256 _maxMintsPerTx, address payable _ethRecipient, address payable _feeRecipient, address _contractOwner, address _verifier) { } modifier onlyOwner() { } function setMaxMintsPerTx(uint256 _maxMintsPerTx) external onlyOwner { } function setNftContract(address _nftContract) external onlyOwner { } function addRainbowPool(address _rainbowPool) external onlyOwner { } function removeRainbowPool(address _rainbowPool) external onlyOwner { } function addUnicornPool(address _unicornPool) external onlyOwner { } function removeUnicornPool(address _unicornPool) external onlyOwner { } function setEtherValues(uint256 _unicornToEth, uint256 _rainbowToEth, uint256 _minPointsPercentToMint) external onlyOwner { } function setFees(uint256 _mintingFeeBasisPoints) external onlyOwner { } function setVerifierAddress(address _verifier) external onlyOwner { } function setFeeRecipient(address payable _feeRecipient) external onlyOwner { } function setEthRecipient(address payable _ethRecipient) external onlyOwner { } function getTotalBalance(address _address, uint256 _start, uint256 _end) external view returns (uint256[][] memory amounts) { } function initPools( uint256[] memory _poolId, uint256[] memory _supply, uint256[] memory _costInUnicorns, uint256[] memory _costInRainbows, uint256[] memory _costInEth, uint256[] memory _maxMintsPerAddress, uint32[] memory _mintTimeStart, bool[] memory _requiresWhitelist ) external onlyOwner { } struct MintData { uint256 totalPriceRainbows; uint256 totalPriceUnicorns; uint256 minCostRainbows; uint256 minCostUnicorns; uint256 fee; uint256 amountEthToWithdraw; uint256 maxMints; uint256 totalToMint; bool success; } function checkSigniture(address msgSender, bytes memory sig, uint256 maxMints) public view returns (bool _success) { } function mint( uint256[] memory _poolType, uint256[] memory _amount, bool[] memory _useUnicorns, address[] memory _rainbowPools, address[] memory _unicornPools, bytes memory sig, uint256 maxMints ) external payable nonReentrant { require(maxMints == 0 || checkSigniture(_msgSender(), sig, maxMints), 'invalid sig'); MintData memory _locals = MintData({ totalPriceRainbows: 0, totalPriceUnicorns: 0, minCostRainbows: 0, minCostUnicorns: 0, fee: 0, amountEthToWithdraw: 0, maxMints: 0, totalToMint: 0, success: false }); for (uint256 i = 0; i < _poolType.length; i++) { PoolType memory poolType = poolTypes[_poolType[i]]; _locals.maxMints = poolType.maxMintsPerAddress == 0 ? 10 ** 10 : poolType.maxMintsPerAddress; if (poolType.requiresWhitelist && (maxMints < _locals.maxMints)) { _locals.maxMints = maxMints; } require(block.timestamp >= poolType.mintTimeStart || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), 'too early'); require(numberMintedByAddress[_msgSender()][_poolType[i]] + _amount[i] <= _locals.maxMints, "Max mints reached for address"); uint256 numberMinted = numberOfPoolMinted[_poolType[i]]; if (numberMinted + _amount[i] > poolType.supply) { _amount[i] = poolType.supply - numberMinted; } _locals.totalToMint += _amount[i]; if (poolType.maxMintsPerAddress > 0) { numberMintedByAddress[_msgSender()][_poolType[i]] += _amount[i]; numberOfPoolMinted[_poolType[i]] += _amount[i]; } if (poolType.costInUnicorns > 0 || poolType.costInRainbows > 0) { if (_useUnicorns[i]) { require(poolType.costInUnicorns > 0, "unicorns not allowed"); uint256 cost = poolType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS; _locals.totalPriceUnicorns += cost; if (poolType.costInEth > 0) { _locals.minCostUnicorns += cost; } } else { require(poolType.costInRainbows > 0, "rainbows not allowed"); uint256 cost = poolType.costInRainbows * _amount[i] * POINT_COST_DECIMALS; _locals.totalPriceRainbows += cost; if (poolType.costInEth > 0) { _locals.minCostRainbows += cost; } } if (poolType.costInEth == 0) { if (poolType.costInRainbows > 0) { _locals.fee += (poolType.costInRainbows * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (rainbowToEth * 10000); } else { _locals.fee += (poolType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (unicornToEth * 10000); } } } _locals.amountEthToWithdraw += poolType.costInEth * _amount[i]; } if (_locals.totalPriceUnicorns > 0 || _locals.totalPriceRainbows > 0 ) { for (uint256 n = 0; n < 2; n++) { bool loopTypeUnicorns = n > 0; uint256 totalBalance = 0; uint256 totalPrice = loopTypeUnicorns ? _locals.totalPriceUnicorns : _locals.totalPriceRainbows; uint256 remainingPrice = totalPrice; if (totalPrice > 0) { uint256 loopLength = loopTypeUnicorns ? _unicornPools.length : _rainbowPools.length; require(loopLength > 0, "invalid pools"); for (uint256 i = 0; i < loopLength; i++) { IStakingPool pool; if (loopTypeUnicorns) { require(<FILL_ME>) pool = IStakingPool(_unicornPools[i]); } else { require((rainbowPools[_rainbowPools[i]]), "invalid rainbow pool"); pool = IStakingPool(_rainbowPools[i]); } uint256 _balance = pool.balanceOf(_msgSender()); totalBalance += _balance; if (totalBalance >= totalPrice) { pool.burn(_msgSender(), remainingPrice); remainingPrice = 0; break; } else { pool.burn(_msgSender(), _balance); remainingPrice -= _balance; } } if (remainingPrice > 0) { totalPrice -= loopTypeUnicorns ? _locals.minCostUnicorns : _locals.minCostRainbows; uint256 minPoints = (totalPrice * minPointsPercentToMint) / 100; require(totalPrice - remainingPrice >= minPoints, "not enough balance"); uint256 pointsToEth = loopTypeUnicorns ? unicornToEth : rainbowToEth; require(msg.value * pointsToEth > remainingPrice, "not enough balance"); _locals.fee += remainingPrice / pointsToEth; } } } } require(_locals.amountEthToWithdraw + _locals.fee <= msg.value, "not enough eth"); (_locals.success, ) = _msgSender().call{ value: msg.value - (_locals.amountEthToWithdraw + _locals.fee)}(""); // refund excess Eth require(_locals.success, "transfer failed"); (_locals.success, ) = feeRecipient.call{ value: _locals.fee }(""); // pay fees require(_locals.success, "fee transfer failed"); (_locals.success, ) = ethRecipient.call{ value: _locals.amountEthToWithdraw }(""); // pay eth recipient require(_locals.success, "transfer failed"); require(_locals.totalToMint > 0, 'Allocation exhausted'); require(_locals.totalToMint <= maxMintsPerTx, '_amount over max'); nftContract.mintNext(_msgSender(), _locals.totalToMint); } // Allow the owner to withdraw Ether payed into the contract function withdrawEth(uint256 _amount) external onlyOwner { } }
(unicornPools[_unicornPools[i]]),"invalid unicorn pool"
367,638
(unicornPools[_unicornPools[i]])
"invalid rainbow pool"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface IStakingPool { function balanceOf(address _owner) external view returns (uint256 balance); function burn(address _owner, uint256 _amount) external; } interface IStandaloneNft721 is IERC721 { function totalSupply() external view returns (uint256); function numberMintedByAddress(address _address) external view returns (uint256); function mintNext(address _to, uint256 _amount) external; function addToNumberMintedByAddress(address _address, uint256 amount) external; } contract Raini721FunctionsV3 is AccessControl, ReentrancyGuard { using ECDSA for bytes32; struct PoolType { uint64 costInUnicorns; uint64 costInRainbows; uint64 costInEth; uint16 maxMintsPerAddress; uint32 supply; uint32 mintTimeStart; // the timestamp from which the pack can be minted bool requiresWhitelist; } mapping (uint256 => PoolType) public poolTypes; uint256 public constant POINT_COST_DECIMALS = 1000000000000000000; uint256 public rainbowToEth; uint256 public unicornToEth; uint256 public minPointsPercentToMint; uint256 public maxMintsPerTx; mapping(address => bool) public rainbowPools; mapping(address => bool) public unicornPools; mapping(address => mapping(uint256 => uint256)) public numberMintedByAddress; mapping (uint256 => uint) public numberOfPoolMinted; uint256 public mintingFeeBasisPoints; address public verifier; address public contractOwner; address payable public ethRecipient; address payable public feeRecipient; IStandaloneNft721 public nftContract; constructor(address _nftContractAddress, uint256 _maxMintsPerTx, address payable _ethRecipient, address payable _feeRecipient, address _contractOwner, address _verifier) { } modifier onlyOwner() { } function setMaxMintsPerTx(uint256 _maxMintsPerTx) external onlyOwner { } function setNftContract(address _nftContract) external onlyOwner { } function addRainbowPool(address _rainbowPool) external onlyOwner { } function removeRainbowPool(address _rainbowPool) external onlyOwner { } function addUnicornPool(address _unicornPool) external onlyOwner { } function removeUnicornPool(address _unicornPool) external onlyOwner { } function setEtherValues(uint256 _unicornToEth, uint256 _rainbowToEth, uint256 _minPointsPercentToMint) external onlyOwner { } function setFees(uint256 _mintingFeeBasisPoints) external onlyOwner { } function setVerifierAddress(address _verifier) external onlyOwner { } function setFeeRecipient(address payable _feeRecipient) external onlyOwner { } function setEthRecipient(address payable _ethRecipient) external onlyOwner { } function getTotalBalance(address _address, uint256 _start, uint256 _end) external view returns (uint256[][] memory amounts) { } function initPools( uint256[] memory _poolId, uint256[] memory _supply, uint256[] memory _costInUnicorns, uint256[] memory _costInRainbows, uint256[] memory _costInEth, uint256[] memory _maxMintsPerAddress, uint32[] memory _mintTimeStart, bool[] memory _requiresWhitelist ) external onlyOwner { } struct MintData { uint256 totalPriceRainbows; uint256 totalPriceUnicorns; uint256 minCostRainbows; uint256 minCostUnicorns; uint256 fee; uint256 amountEthToWithdraw; uint256 maxMints; uint256 totalToMint; bool success; } function checkSigniture(address msgSender, bytes memory sig, uint256 maxMints) public view returns (bool _success) { } function mint( uint256[] memory _poolType, uint256[] memory _amount, bool[] memory _useUnicorns, address[] memory _rainbowPools, address[] memory _unicornPools, bytes memory sig, uint256 maxMints ) external payable nonReentrant { require(maxMints == 0 || checkSigniture(_msgSender(), sig, maxMints), 'invalid sig'); MintData memory _locals = MintData({ totalPriceRainbows: 0, totalPriceUnicorns: 0, minCostRainbows: 0, minCostUnicorns: 0, fee: 0, amountEthToWithdraw: 0, maxMints: 0, totalToMint: 0, success: false }); for (uint256 i = 0; i < _poolType.length; i++) { PoolType memory poolType = poolTypes[_poolType[i]]; _locals.maxMints = poolType.maxMintsPerAddress == 0 ? 10 ** 10 : poolType.maxMintsPerAddress; if (poolType.requiresWhitelist && (maxMints < _locals.maxMints)) { _locals.maxMints = maxMints; } require(block.timestamp >= poolType.mintTimeStart || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), 'too early'); require(numberMintedByAddress[_msgSender()][_poolType[i]] + _amount[i] <= _locals.maxMints, "Max mints reached for address"); uint256 numberMinted = numberOfPoolMinted[_poolType[i]]; if (numberMinted + _amount[i] > poolType.supply) { _amount[i] = poolType.supply - numberMinted; } _locals.totalToMint += _amount[i]; if (poolType.maxMintsPerAddress > 0) { numberMintedByAddress[_msgSender()][_poolType[i]] += _amount[i]; numberOfPoolMinted[_poolType[i]] += _amount[i]; } if (poolType.costInUnicorns > 0 || poolType.costInRainbows > 0) { if (_useUnicorns[i]) { require(poolType.costInUnicorns > 0, "unicorns not allowed"); uint256 cost = poolType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS; _locals.totalPriceUnicorns += cost; if (poolType.costInEth > 0) { _locals.minCostUnicorns += cost; } } else { require(poolType.costInRainbows > 0, "rainbows not allowed"); uint256 cost = poolType.costInRainbows * _amount[i] * POINT_COST_DECIMALS; _locals.totalPriceRainbows += cost; if (poolType.costInEth > 0) { _locals.minCostRainbows += cost; } } if (poolType.costInEth == 0) { if (poolType.costInRainbows > 0) { _locals.fee += (poolType.costInRainbows * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (rainbowToEth * 10000); } else { _locals.fee += (poolType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (unicornToEth * 10000); } } } _locals.amountEthToWithdraw += poolType.costInEth * _amount[i]; } if (_locals.totalPriceUnicorns > 0 || _locals.totalPriceRainbows > 0 ) { for (uint256 n = 0; n < 2; n++) { bool loopTypeUnicorns = n > 0; uint256 totalBalance = 0; uint256 totalPrice = loopTypeUnicorns ? _locals.totalPriceUnicorns : _locals.totalPriceRainbows; uint256 remainingPrice = totalPrice; if (totalPrice > 0) { uint256 loopLength = loopTypeUnicorns ? _unicornPools.length : _rainbowPools.length; require(loopLength > 0, "invalid pools"); for (uint256 i = 0; i < loopLength; i++) { IStakingPool pool; if (loopTypeUnicorns) { require((unicornPools[_unicornPools[i]]), "invalid unicorn pool"); pool = IStakingPool(_unicornPools[i]); } else { require(<FILL_ME>) pool = IStakingPool(_rainbowPools[i]); } uint256 _balance = pool.balanceOf(_msgSender()); totalBalance += _balance; if (totalBalance >= totalPrice) { pool.burn(_msgSender(), remainingPrice); remainingPrice = 0; break; } else { pool.burn(_msgSender(), _balance); remainingPrice -= _balance; } } if (remainingPrice > 0) { totalPrice -= loopTypeUnicorns ? _locals.minCostUnicorns : _locals.minCostRainbows; uint256 minPoints = (totalPrice * minPointsPercentToMint) / 100; require(totalPrice - remainingPrice >= minPoints, "not enough balance"); uint256 pointsToEth = loopTypeUnicorns ? unicornToEth : rainbowToEth; require(msg.value * pointsToEth > remainingPrice, "not enough balance"); _locals.fee += remainingPrice / pointsToEth; } } } } require(_locals.amountEthToWithdraw + _locals.fee <= msg.value, "not enough eth"); (_locals.success, ) = _msgSender().call{ value: msg.value - (_locals.amountEthToWithdraw + _locals.fee)}(""); // refund excess Eth require(_locals.success, "transfer failed"); (_locals.success, ) = feeRecipient.call{ value: _locals.fee }(""); // pay fees require(_locals.success, "fee transfer failed"); (_locals.success, ) = ethRecipient.call{ value: _locals.amountEthToWithdraw }(""); // pay eth recipient require(_locals.success, "transfer failed"); require(_locals.totalToMint > 0, 'Allocation exhausted'); require(_locals.totalToMint <= maxMintsPerTx, '_amount over max'); nftContract.mintNext(_msgSender(), _locals.totalToMint); } // Allow the owner to withdraw Ether payed into the contract function withdrawEth(uint256 _amount) external onlyOwner { } }
(rainbowPools[_rainbowPools[i]]),"invalid rainbow pool"
367,638
(rainbowPools[_rainbowPools[i]])
"not enough balance"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface IStakingPool { function balanceOf(address _owner) external view returns (uint256 balance); function burn(address _owner, uint256 _amount) external; } interface IStandaloneNft721 is IERC721 { function totalSupply() external view returns (uint256); function numberMintedByAddress(address _address) external view returns (uint256); function mintNext(address _to, uint256 _amount) external; function addToNumberMintedByAddress(address _address, uint256 amount) external; } contract Raini721FunctionsV3 is AccessControl, ReentrancyGuard { using ECDSA for bytes32; struct PoolType { uint64 costInUnicorns; uint64 costInRainbows; uint64 costInEth; uint16 maxMintsPerAddress; uint32 supply; uint32 mintTimeStart; // the timestamp from which the pack can be minted bool requiresWhitelist; } mapping (uint256 => PoolType) public poolTypes; uint256 public constant POINT_COST_DECIMALS = 1000000000000000000; uint256 public rainbowToEth; uint256 public unicornToEth; uint256 public minPointsPercentToMint; uint256 public maxMintsPerTx; mapping(address => bool) public rainbowPools; mapping(address => bool) public unicornPools; mapping(address => mapping(uint256 => uint256)) public numberMintedByAddress; mapping (uint256 => uint) public numberOfPoolMinted; uint256 public mintingFeeBasisPoints; address public verifier; address public contractOwner; address payable public ethRecipient; address payable public feeRecipient; IStandaloneNft721 public nftContract; constructor(address _nftContractAddress, uint256 _maxMintsPerTx, address payable _ethRecipient, address payable _feeRecipient, address _contractOwner, address _verifier) { } modifier onlyOwner() { } function setMaxMintsPerTx(uint256 _maxMintsPerTx) external onlyOwner { } function setNftContract(address _nftContract) external onlyOwner { } function addRainbowPool(address _rainbowPool) external onlyOwner { } function removeRainbowPool(address _rainbowPool) external onlyOwner { } function addUnicornPool(address _unicornPool) external onlyOwner { } function removeUnicornPool(address _unicornPool) external onlyOwner { } function setEtherValues(uint256 _unicornToEth, uint256 _rainbowToEth, uint256 _minPointsPercentToMint) external onlyOwner { } function setFees(uint256 _mintingFeeBasisPoints) external onlyOwner { } function setVerifierAddress(address _verifier) external onlyOwner { } function setFeeRecipient(address payable _feeRecipient) external onlyOwner { } function setEthRecipient(address payable _ethRecipient) external onlyOwner { } function getTotalBalance(address _address, uint256 _start, uint256 _end) external view returns (uint256[][] memory amounts) { } function initPools( uint256[] memory _poolId, uint256[] memory _supply, uint256[] memory _costInUnicorns, uint256[] memory _costInRainbows, uint256[] memory _costInEth, uint256[] memory _maxMintsPerAddress, uint32[] memory _mintTimeStart, bool[] memory _requiresWhitelist ) external onlyOwner { } struct MintData { uint256 totalPriceRainbows; uint256 totalPriceUnicorns; uint256 minCostRainbows; uint256 minCostUnicorns; uint256 fee; uint256 amountEthToWithdraw; uint256 maxMints; uint256 totalToMint; bool success; } function checkSigniture(address msgSender, bytes memory sig, uint256 maxMints) public view returns (bool _success) { } function mint( uint256[] memory _poolType, uint256[] memory _amount, bool[] memory _useUnicorns, address[] memory _rainbowPools, address[] memory _unicornPools, bytes memory sig, uint256 maxMints ) external payable nonReentrant { require(maxMints == 0 || checkSigniture(_msgSender(), sig, maxMints), 'invalid sig'); MintData memory _locals = MintData({ totalPriceRainbows: 0, totalPriceUnicorns: 0, minCostRainbows: 0, minCostUnicorns: 0, fee: 0, amountEthToWithdraw: 0, maxMints: 0, totalToMint: 0, success: false }); for (uint256 i = 0; i < _poolType.length; i++) { PoolType memory poolType = poolTypes[_poolType[i]]; _locals.maxMints = poolType.maxMintsPerAddress == 0 ? 10 ** 10 : poolType.maxMintsPerAddress; if (poolType.requiresWhitelist && (maxMints < _locals.maxMints)) { _locals.maxMints = maxMints; } require(block.timestamp >= poolType.mintTimeStart || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), 'too early'); require(numberMintedByAddress[_msgSender()][_poolType[i]] + _amount[i] <= _locals.maxMints, "Max mints reached for address"); uint256 numberMinted = numberOfPoolMinted[_poolType[i]]; if (numberMinted + _amount[i] > poolType.supply) { _amount[i] = poolType.supply - numberMinted; } _locals.totalToMint += _amount[i]; if (poolType.maxMintsPerAddress > 0) { numberMintedByAddress[_msgSender()][_poolType[i]] += _amount[i]; numberOfPoolMinted[_poolType[i]] += _amount[i]; } if (poolType.costInUnicorns > 0 || poolType.costInRainbows > 0) { if (_useUnicorns[i]) { require(poolType.costInUnicorns > 0, "unicorns not allowed"); uint256 cost = poolType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS; _locals.totalPriceUnicorns += cost; if (poolType.costInEth > 0) { _locals.minCostUnicorns += cost; } } else { require(poolType.costInRainbows > 0, "rainbows not allowed"); uint256 cost = poolType.costInRainbows * _amount[i] * POINT_COST_DECIMALS; _locals.totalPriceRainbows += cost; if (poolType.costInEth > 0) { _locals.minCostRainbows += cost; } } if (poolType.costInEth == 0) { if (poolType.costInRainbows > 0) { _locals.fee += (poolType.costInRainbows * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (rainbowToEth * 10000); } else { _locals.fee += (poolType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (unicornToEth * 10000); } } } _locals.amountEthToWithdraw += poolType.costInEth * _amount[i]; } if (_locals.totalPriceUnicorns > 0 || _locals.totalPriceRainbows > 0 ) { for (uint256 n = 0; n < 2; n++) { bool loopTypeUnicorns = n > 0; uint256 totalBalance = 0; uint256 totalPrice = loopTypeUnicorns ? _locals.totalPriceUnicorns : _locals.totalPriceRainbows; uint256 remainingPrice = totalPrice; if (totalPrice > 0) { uint256 loopLength = loopTypeUnicorns ? _unicornPools.length : _rainbowPools.length; require(loopLength > 0, "invalid pools"); for (uint256 i = 0; i < loopLength; i++) { IStakingPool pool; if (loopTypeUnicorns) { require((unicornPools[_unicornPools[i]]), "invalid unicorn pool"); pool = IStakingPool(_unicornPools[i]); } else { require((rainbowPools[_rainbowPools[i]]), "invalid rainbow pool"); pool = IStakingPool(_rainbowPools[i]); } uint256 _balance = pool.balanceOf(_msgSender()); totalBalance += _balance; if (totalBalance >= totalPrice) { pool.burn(_msgSender(), remainingPrice); remainingPrice = 0; break; } else { pool.burn(_msgSender(), _balance); remainingPrice -= _balance; } } if (remainingPrice > 0) { totalPrice -= loopTypeUnicorns ? _locals.minCostUnicorns : _locals.minCostRainbows; uint256 minPoints = (totalPrice * minPointsPercentToMint) / 100; require(<FILL_ME>) uint256 pointsToEth = loopTypeUnicorns ? unicornToEth : rainbowToEth; require(msg.value * pointsToEth > remainingPrice, "not enough balance"); _locals.fee += remainingPrice / pointsToEth; } } } } require(_locals.amountEthToWithdraw + _locals.fee <= msg.value, "not enough eth"); (_locals.success, ) = _msgSender().call{ value: msg.value - (_locals.amountEthToWithdraw + _locals.fee)}(""); // refund excess Eth require(_locals.success, "transfer failed"); (_locals.success, ) = feeRecipient.call{ value: _locals.fee }(""); // pay fees require(_locals.success, "fee transfer failed"); (_locals.success, ) = ethRecipient.call{ value: _locals.amountEthToWithdraw }(""); // pay eth recipient require(_locals.success, "transfer failed"); require(_locals.totalToMint > 0, 'Allocation exhausted'); require(_locals.totalToMint <= maxMintsPerTx, '_amount over max'); nftContract.mintNext(_msgSender(), _locals.totalToMint); } // Allow the owner to withdraw Ether payed into the contract function withdrawEth(uint256 _amount) external onlyOwner { } }
totalPrice-remainingPrice>=minPoints,"not enough balance"
367,638
totalPrice-remainingPrice>=minPoints
"not enough balance"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.3; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; interface IStakingPool { function balanceOf(address _owner) external view returns (uint256 balance); function burn(address _owner, uint256 _amount) external; } interface IStandaloneNft721 is IERC721 { function totalSupply() external view returns (uint256); function numberMintedByAddress(address _address) external view returns (uint256); function mintNext(address _to, uint256 _amount) external; function addToNumberMintedByAddress(address _address, uint256 amount) external; } contract Raini721FunctionsV3 is AccessControl, ReentrancyGuard { using ECDSA for bytes32; struct PoolType { uint64 costInUnicorns; uint64 costInRainbows; uint64 costInEth; uint16 maxMintsPerAddress; uint32 supply; uint32 mintTimeStart; // the timestamp from which the pack can be minted bool requiresWhitelist; } mapping (uint256 => PoolType) public poolTypes; uint256 public constant POINT_COST_DECIMALS = 1000000000000000000; uint256 public rainbowToEth; uint256 public unicornToEth; uint256 public minPointsPercentToMint; uint256 public maxMintsPerTx; mapping(address => bool) public rainbowPools; mapping(address => bool) public unicornPools; mapping(address => mapping(uint256 => uint256)) public numberMintedByAddress; mapping (uint256 => uint) public numberOfPoolMinted; uint256 public mintingFeeBasisPoints; address public verifier; address public contractOwner; address payable public ethRecipient; address payable public feeRecipient; IStandaloneNft721 public nftContract; constructor(address _nftContractAddress, uint256 _maxMintsPerTx, address payable _ethRecipient, address payable _feeRecipient, address _contractOwner, address _verifier) { } modifier onlyOwner() { } function setMaxMintsPerTx(uint256 _maxMintsPerTx) external onlyOwner { } function setNftContract(address _nftContract) external onlyOwner { } function addRainbowPool(address _rainbowPool) external onlyOwner { } function removeRainbowPool(address _rainbowPool) external onlyOwner { } function addUnicornPool(address _unicornPool) external onlyOwner { } function removeUnicornPool(address _unicornPool) external onlyOwner { } function setEtherValues(uint256 _unicornToEth, uint256 _rainbowToEth, uint256 _minPointsPercentToMint) external onlyOwner { } function setFees(uint256 _mintingFeeBasisPoints) external onlyOwner { } function setVerifierAddress(address _verifier) external onlyOwner { } function setFeeRecipient(address payable _feeRecipient) external onlyOwner { } function setEthRecipient(address payable _ethRecipient) external onlyOwner { } function getTotalBalance(address _address, uint256 _start, uint256 _end) external view returns (uint256[][] memory amounts) { } function initPools( uint256[] memory _poolId, uint256[] memory _supply, uint256[] memory _costInUnicorns, uint256[] memory _costInRainbows, uint256[] memory _costInEth, uint256[] memory _maxMintsPerAddress, uint32[] memory _mintTimeStart, bool[] memory _requiresWhitelist ) external onlyOwner { } struct MintData { uint256 totalPriceRainbows; uint256 totalPriceUnicorns; uint256 minCostRainbows; uint256 minCostUnicorns; uint256 fee; uint256 amountEthToWithdraw; uint256 maxMints; uint256 totalToMint; bool success; } function checkSigniture(address msgSender, bytes memory sig, uint256 maxMints) public view returns (bool _success) { } function mint( uint256[] memory _poolType, uint256[] memory _amount, bool[] memory _useUnicorns, address[] memory _rainbowPools, address[] memory _unicornPools, bytes memory sig, uint256 maxMints ) external payable nonReentrant { require(maxMints == 0 || checkSigniture(_msgSender(), sig, maxMints), 'invalid sig'); MintData memory _locals = MintData({ totalPriceRainbows: 0, totalPriceUnicorns: 0, minCostRainbows: 0, minCostUnicorns: 0, fee: 0, amountEthToWithdraw: 0, maxMints: 0, totalToMint: 0, success: false }); for (uint256 i = 0; i < _poolType.length; i++) { PoolType memory poolType = poolTypes[_poolType[i]]; _locals.maxMints = poolType.maxMintsPerAddress == 0 ? 10 ** 10 : poolType.maxMintsPerAddress; if (poolType.requiresWhitelist && (maxMints < _locals.maxMints)) { _locals.maxMints = maxMints; } require(block.timestamp >= poolType.mintTimeStart || hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), 'too early'); require(numberMintedByAddress[_msgSender()][_poolType[i]] + _amount[i] <= _locals.maxMints, "Max mints reached for address"); uint256 numberMinted = numberOfPoolMinted[_poolType[i]]; if (numberMinted + _amount[i] > poolType.supply) { _amount[i] = poolType.supply - numberMinted; } _locals.totalToMint += _amount[i]; if (poolType.maxMintsPerAddress > 0) { numberMintedByAddress[_msgSender()][_poolType[i]] += _amount[i]; numberOfPoolMinted[_poolType[i]] += _amount[i]; } if (poolType.costInUnicorns > 0 || poolType.costInRainbows > 0) { if (_useUnicorns[i]) { require(poolType.costInUnicorns > 0, "unicorns not allowed"); uint256 cost = poolType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS; _locals.totalPriceUnicorns += cost; if (poolType.costInEth > 0) { _locals.minCostUnicorns += cost; } } else { require(poolType.costInRainbows > 0, "rainbows not allowed"); uint256 cost = poolType.costInRainbows * _amount[i] * POINT_COST_DECIMALS; _locals.totalPriceRainbows += cost; if (poolType.costInEth > 0) { _locals.minCostRainbows += cost; } } if (poolType.costInEth == 0) { if (poolType.costInRainbows > 0) { _locals.fee += (poolType.costInRainbows * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (rainbowToEth * 10000); } else { _locals.fee += (poolType.costInUnicorns * _amount[i] * POINT_COST_DECIMALS * mintingFeeBasisPoints) / (unicornToEth * 10000); } } } _locals.amountEthToWithdraw += poolType.costInEth * _amount[i]; } if (_locals.totalPriceUnicorns > 0 || _locals.totalPriceRainbows > 0 ) { for (uint256 n = 0; n < 2; n++) { bool loopTypeUnicorns = n > 0; uint256 totalBalance = 0; uint256 totalPrice = loopTypeUnicorns ? _locals.totalPriceUnicorns : _locals.totalPriceRainbows; uint256 remainingPrice = totalPrice; if (totalPrice > 0) { uint256 loopLength = loopTypeUnicorns ? _unicornPools.length : _rainbowPools.length; require(loopLength > 0, "invalid pools"); for (uint256 i = 0; i < loopLength; i++) { IStakingPool pool; if (loopTypeUnicorns) { require((unicornPools[_unicornPools[i]]), "invalid unicorn pool"); pool = IStakingPool(_unicornPools[i]); } else { require((rainbowPools[_rainbowPools[i]]), "invalid rainbow pool"); pool = IStakingPool(_rainbowPools[i]); } uint256 _balance = pool.balanceOf(_msgSender()); totalBalance += _balance; if (totalBalance >= totalPrice) { pool.burn(_msgSender(), remainingPrice); remainingPrice = 0; break; } else { pool.burn(_msgSender(), _balance); remainingPrice -= _balance; } } if (remainingPrice > 0) { totalPrice -= loopTypeUnicorns ? _locals.minCostUnicorns : _locals.minCostRainbows; uint256 minPoints = (totalPrice * minPointsPercentToMint) / 100; require(totalPrice - remainingPrice >= minPoints, "not enough balance"); uint256 pointsToEth = loopTypeUnicorns ? unicornToEth : rainbowToEth; require(<FILL_ME>) _locals.fee += remainingPrice / pointsToEth; } } } } require(_locals.amountEthToWithdraw + _locals.fee <= msg.value, "not enough eth"); (_locals.success, ) = _msgSender().call{ value: msg.value - (_locals.amountEthToWithdraw + _locals.fee)}(""); // refund excess Eth require(_locals.success, "transfer failed"); (_locals.success, ) = feeRecipient.call{ value: _locals.fee }(""); // pay fees require(_locals.success, "fee transfer failed"); (_locals.success, ) = ethRecipient.call{ value: _locals.amountEthToWithdraw }(""); // pay eth recipient require(_locals.success, "transfer failed"); require(_locals.totalToMint > 0, 'Allocation exhausted'); require(_locals.totalToMint <= maxMintsPerTx, '_amount over max'); nftContract.mintNext(_msgSender(), _locals.totalToMint); } // Allow the owner to withdraw Ether payed into the contract function withdrawEth(uint256 _amount) external onlyOwner { } }
msg.value*pointsToEth>remainingPrice,"not enough balance"
367,638
msg.value*pointsToEth>remainingPrice