Address Contract Verified
Address
0x1880A647cfA183033995694E4B2eDFC47B5F605f
Balance
0 ETH
Nonce
1
Code Size
22314 bytes
Creator
0xfbBAD863...fbF8 at tx 0x782374c1...97174e
Indexed Transactions
0
Contract Bytecode
22314 bytes
0x6080604052600436106102255760003560e01c80637362377b11610123578063b85d43d0116100ab578063c87b56dd1161006f578063c87b56dd146107c6578063de7fcb1d14610803578063e985e9c51461082e578063ea4795bf1461086b578063f2fde38b1461089457610225565b8063b85d43d0146106f1578063b88d4fde1461071c578063bdb4b84814610745578063c428189c14610770578063c467201e1461079b57610225565b8063913c01b2116100f2578063913c01b21461063f57806395d89b411461066a5780639a8cbafa14610695578063a0712d68146106ac578063a22cb465146106c857610225565b80637362377b146105bb5780637805862f146105d25780638d87f84a146105e95780638da5cb5b1461061457610225565b8063409a9724116101b15780635c975abb116101755780635c975abb146104d65780636352211e146105015780636985a0221461053e5780636f03e2601461055557806370a082311461057e57610225565b8063409a9724146103dd57806342842e0e14610408578063438b6300146104315780634f6ccce71461046e5780635a8a188e146104ab57610225565b80630bb5140d116101f85780630bb5140d146102f857806318160ddd1461032357806323b872dd1461034e5780632f745c591461037757806330176e13146103b457610225565b806301ffc9a71461022a57806306fdde0314610267578063081812fc14610292578063095ea7b3146102cf575b600080fd5b34801561023657600080fd5b50610251600480360381019061024c919061406e565b6108bd565b60405161025e9190614da9565b60405180910390f35b34801561027357600080fd5b5061027c610937565b6040516102899190614dc4565b60405180910390f35b34801561029e57600080fd5b506102b960048036038101906102b49190614101565b6109c9565b6040516102c69190614cf7565b60405180910390f35b3480156102db57600080fd5b506102f660048036038101906102f19190614032565b610a4e565b005b34801561030457600080fd5b5061030d610b66565b60405161031a9190615166565b60405180910390f35b34801561032f57600080fd5b50610338610b97565b6040516103459190615166565b60405180910390f35b34801561035a57600080fd5b5061037560048036038101906103709190613f2c565b610ba4565b005b34801561038357600080fd5b5061039e60048036038101906103999190614032565b610c5a565b6040516103ab9190615166565b60405180910390f35b3480156103c057600080fd5b506103db60048036038101906103d691906140c0565b610dc6565b005b3480156103e957600080fd5b506103f2610e70565b6040516103ff9190615166565b60405180910390f35b34801561041457600080fd5b5061042f600480360381019061042a9190613f2c565b610e7e565b005b34801561043d57600080fd5b5061045860048036038101906104539190613e9e565b610e9e565b6040516104659190614d87565b60405180910390f35b34801561047a57600080fd5b5061049560048036038101906104909190614101565b61106f565b6040516104a29190615166565b60405180910390f35b3480156104b757600080fd5b506104c0611106565b6040516104cd9190615166565b60405180910390f35b3480156104e257600080fd5b506104eb6111e7565b6040516104f89190614da9565b60405180910390f35b34801561050d57600080fd5b5061052860048036038101906105239190614101565b6111fe565b6040516105359190614cf7565b60405180910390f35b34801561054a57600080fd5b5061055361136e565b005b34801561056157600080fd5b5061057c60048036038101906105779190613e9e565b611408565b005b34801561058a57600080fd5b506105a560048036038101906105a09190613e9e565b6114dc565b6040516105b29190615166565b60405180910390f35b3480156105c757600080fd5b506105d0611668565b005b3480156105de57600080fd5b506105e76117ea565b005b3480156105f557600080fd5b506105fe611884565b60405161060b9190615166565b60405180910390f35b34801561062057600080fd5b50610629611965565b6040516106369190614cf7565b60405180910390f35b34801561064b57600080fd5b5061065461198b565b6040516106619190615166565b60405180910390f35b34801561067657600080fd5b5061067f611a6c565b60405161068c9190614dc4565b60405180910390f35b3480156106a157600080fd5b506106aa611afe565b005b6106c660048036038101906106c19190614101565b611bba565b005b3480156106d457600080fd5b506106ef60048036038101906106ea9190613ff6565b6122a4565b005b3480156106fd57600080fd5b50610706612425565b6040516107139190615166565b60405180910390f35b34801561072857600080fd5b50610743600480360381019061073e9190613f7b565b612506565b005b34801561075157600080fd5b5061075a612568565b6040516107679190615166565b60405180910390f35b34801561077c57600080fd5b50610785612573565b6040516107929190615166565b60405180910390f35b3480156107a757600080fd5b506107b0612579565b6040516107bd9190614da9565b60405180910390f35b3480156107d257600080fd5b506107ed60048036038101906107e89190614101565b61258c565b6040516107fa9190614dc4565b60405180910390f35b34801561080f57600080fd5b506108186126df565b6040516108259190615166565b60405180910390f35b34801561083a57600080fd5b5061085560048036038101906108509190613ef0565b6126e4565b6040516108629190614da9565b60405180910390f35b34801561087757600080fd5b50610892600480360381019061088d9190613e9e565b612778565b005b3480156108a057600080fd5b506108bb60048036038101906108b69190613e9e565b61284c565b005b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610930575061092f82612920565b5b9050919050565b606060008054610946906154c8565b80601f0160208091040260200160405190810160405280929190818152602001828054610972906154c8565b80156109bf5780601f10610994576101008083540402835291602001916109bf565b820191906000526020600020905b8154815290600101906020018083116109a257829003601f168201915b5050505050905090565b60006109d482612a02565b610a13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0a90615006565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610a5982612a6e565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac190615066565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610ae9612b20565b73ffffffffffffffffffffffffffffffffffffffff161480610b185750610b1781610b12612b20565b6126e4565b5b610b57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4e90614f66565b60405180910390fd5b610b618383612b28565b505050565b600069054b40b1f852bda00000611388610b7e610b97565b610b889190615337565b610b929190615368565b905090565b6000600880549050905090565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c4a57610c0a610c04612b20565b82612be1565b610c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c40906150a6565b60405180910390fd5b5b610c55838383612cbf565b505050565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d335743601960003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d29906150c6565b60405180910390fd5b5b43601960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610db4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dab906150c6565b60405180910390fd5b610dbe8383612f1b565b905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4d90614e06565b60405180910390fd5b80600e9080519060200190610e6c929190613cad565b5050565b69054b40b1f852bda0000081565b610e9983838360405180602001604052806000815250612506565b505050565b6060601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f775743601960003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610f76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6d906150c6565b60405180910390fd5b5b6000610f82836114dc565b905060008167ffffffffffffffff811115610fc6577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015610ff45781602001602082028036833780820191505090505b50905060005b828110156110645761100c8582610c5a565b828281518110611045577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018181525050808061105c906154fa565b915050610ffa565b508092505050919050565b6000611079610b97565b82106110ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b190615126565b60405180910390fd5b600882815481106110f4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050919050565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111df5743601960003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106111de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d5906150c6565b60405180910390fd5b5b601654905090565b6000600a60009054906101000a900460ff16905090565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112d75743601960003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106112d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cd906150c6565b60405180910390fd5b5b60006112e283612a6e565b905043601960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611365576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135c906150c6565b60405180910390fd5b80915050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f590614e06565b60405180910390fd5b611406612fc0565b565b3373ffffffffffffffffffffffffffffffffffffffff16600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611498576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148f90614e06565b60405180910390fd5b80601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115b55743601960003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106115b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ab906150c6565b60405180910390fd5b5b43601960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162d906150c6565b60405180910390fd5b611661600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16613063565b9050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ef90614e06565b60405180910390fd5b600060646014476117099190615368565b6117139190615337565b9050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561177d573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156117e6573d6000803e3d6000fd5b5050565b3373ffffffffffffffffffffffffffffffffffffffff16600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461187a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187190614e06565b60405180910390fd5b61188261311b565b565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461195d5743601960003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061195c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611953906150c6565b60405180910390fd5b5b601754905090565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a645743601960003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5a906150c6565b60405180910390fd5b5b601454905090565b606060018054611a7b906154c8565b80601f0160208091040260200160405190810160405280929190818152602001828054611aa7906154c8565b8015611af45780601f10611ac957610100808354040283529160200191611af4565b820191906000526020600020905b815481529060010190602001808311611ad757829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8590614e06565b60405180910390fd5b601860009054906101000a900460ff1615601860006101000a81548160ff021916908315150217905550565b600080339050803b91503273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2990615026565b60405180910390fd5b60008214611c75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6c90615026565b60405180910390fd5b601860009054906101000a900460ff16611cc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cbb90615086565b60405180910390fd5b6002600b541415611d0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0190615146565b60405180910390fd5b6002600b81905550611d1a6111e7565b15611d5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5190614f46565b60405180910390fd5b6161a883611d66610b97565b611d7091906152e1565b1115611db1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da8906150e6565b60405180910390fd5b600083118015611dc25750600a8311155b611e01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df890615106565b60405180910390fd5b611388611e0c610b97565b1015611ec25761138883611e1e610b97565b611e2891906152e1565b1115611e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6090614ec6565b60405180910390fd5b3466b1a2bc2ec5000084611e7d9190615368565b14611ebd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb490614ea6565b60405180910390fd5b611f06565b60003414611f05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611efc90614fc6565b60405180910390fd5b5b60005b838110156122675760003390506000611388611f23610b97565b1015611f4557601560008154611f38906154fa565b9190508190559050612248565b43601960003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000611f93610b66565b90506000612710611fe1611fa56131bd565b6040518060400160405280600c81526020017f6372656174757265547970650000000000000000000000000000000000000000815250886131f8565b611feb919061558d565b90506103e881101561202057600d54601460008154612009906154fa565b91905081905561201991906152e1565b9250612038565b60156000815461202f906154fa565b91905081905592505b6127106120826120466131bd565b6040518060400160405280600681526020017f73746f6c656e0000000000000000000000000000000000000000000000000000815250866131f8565b61208c919061558d565b90506103e88110156121b6576000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630fdc29386040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561210457600080fd5b505af1158015612118573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061213c9190613ec7565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146121b457809450600d54841161219a5760176000815480929190612191906154fa565b919050556121b2565b601660008154809291906121ad906154fa565b919050555b505b505b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166379cc679033846040518363ffffffff1660e01b8152600401612213929190614d5e565b600060405180830381600087803b15801561222d57600080fd5b505af1158015612241573d6000803e3d6000fd5b5050505050505b6122528282613231565b5050808061225f906154fa565b915050611f09565b506001600b819055508041604051602001612283929190614c48565b60405160208183030381529060405280519060200120600c81905550505050565b6122ac612b20565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561231a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231190614f06565b60405180910390fd5b8060056000612327612b20565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff166123d4612b20565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516124199190614da9565b60405180910390a35050565b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146124fe5743601960003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106124fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f4906150c6565b60405180910390fd5b5b601554905090565b612517612511612b20565b83612be1565b612556576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254d906150a6565b60405180910390fd5b612562848484846133ff565b50505050565b66b1a2bc2ec5000081565b61138881565b601860009054906101000a900460ff1681565b6060601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146126655743601960003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410612664576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161265b906150c6565b60405180910390fd5b5b61266e82612a02565b6126ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126a490614e66565b60405180910390fd5b600e6126b88361345b565b6040516020016126c9929190614cd3565b6040516020818303038152906040529050919050565b600a81565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612808576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127ff90614e06565b60405180910390fd5b80601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff16600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146128dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128d390614e06565b60405180910390fd5b80600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806129eb57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806129fb57506129fa82613608565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b0e90614fa6565b60405180910390fd5b80915050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16612b9b83612a6e565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000612bec82612a02565b612c2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c2290614f26565b60405180910390fd5b6000612c3683612a6e565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612ca557508373ffffffffffffffffffffffffffffffffffffffff16612c8d846109c9565b73ffffffffffffffffffffffffffffffffffffffff16145b80612cb65750612cb581856126e4565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612cdf82612a6e565b73ffffffffffffffffffffffffffffffffffffffff1614612d35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d2c90615046565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612da5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d9c90614ee6565b60405180910390fd5b612db0838383613672565b612dbb600082612b28565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612e0b91906153c2565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612e6291906152e1565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000612f2683613063565b8210612f67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f5e90614e26565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b612fc86111e7565b15613008576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fff90614f46565b60405180910390fd5b6001600a60006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861304c612b20565b6040516130599190614cf7565b60405180910390a1565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156130d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130cb90614f86565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6131236111e7565b613162576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161315990614de6565b60405180910390fd5b6000600a60006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6131a6612b20565b6040516131b39190614cf7565b60405180910390a1565b600033424442600c546040516020016131da959493929190614c74565b6040516020818303038152906040528051906020012060001c905090565b600083838360405160200161320f93929190615181565b6040516020818303038152906040528051906020012060001c90509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156132a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161329890614fe6565b60405180910390fd5b6132aa81612a02565b156132ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132e190614e86565b60405180910390fd5b6132f660008383613672565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461334691906152e1565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b61340a848484612cbf565b61341684848484613786565b613455576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161344c90614e46565b60405180910390fd5b50505050565b606060008214156134a3576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050613603565b600082905060005b600082146134d55780806134be906154fa565b915050600a826134ce9190615337565b91506134ab565b60008167ffffffffffffffff811115613517577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156135495781602001600182028036833780820191505090505b5090505b600085146135fc5760018261356291906153c2565b9150600a85613571919061558d565b603061357d91906152e1565b60f81b8183815181106135b9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856135f59190615337565b945061354d565b8093505050505b919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61367d83838361391d565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156136c0576136bb81613922565b6136ff565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146136fe576136fd838261396b565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156137425761373d81613ad8565b613781565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146137805761377f8282613c1b565b5b5b505050565b60006137a78473ffffffffffffffffffffffffffffffffffffffff16613c9a565b15613910578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026137d0612b20565b8786866040518563ffffffff1660e01b81526004016137f29493929190614d12565b602060405180830381600087803b15801561380c57600080fd5b505af192505050801561383d57506040513d601f19601f8201168201806040525081019061383a9190614097565b60015b6138c0573d806000811461386d576040519150601f19603f3d011682016040523d82523d6000602084013e613872565b606091505b506000815114156138b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016138af90614e46565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050613915565b600190505b949350505050565b505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b6000600161397884613063565b61398291906153c2565b9050600060076000848152602001908152602001600020549050818114613a67576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b60006001600880549050613aec91906153c2565b9050600060096000848152602001908152602001600020549050600060088381548110613b42577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015490508060088381548110613b8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020018190555081600960008381526020019081526020016000208190555060096000858152602001908152602001600020600090556008805480613bff577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000613c2683613063565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b600080823b905060008111915050919050565b828054613cb9906154c8565b90600052602060002090601f016020900481019282613cdb5760008555613d22565b82601f10613cf457805160ff1916838001178555613d22565b82800160010185558215613d22579182015b82811115613d21578251825591602001919060010190613d06565b5b509050613d2f9190613d33565b5090565b5b80821115613d4c576000816000905550600101613d34565b5090565b6000613d63613d5e846151f0565b6151bf565b905082815260208101848484011115613d7b57600080fd5b613d86848285615486565b509392505050565b6000613da1613d9c84615220565b6151bf565b905082815260208101848484011115613db957600080fd5b613dc4848285615486565b509392505050565b600081359050613ddb81615698565b92915050565b600081519050613df081615698565b92915050565b600081359050613e05816156af565b92915050565b600081359050613e1a816156c6565b92915050565b600081519050613e2f816156c6565b92915050565b600082601f830112613e4657600080fd5b8135613e56848260208601613d50565b91505092915050565b600082601f830112613e7057600080fd5b8135613e80848260208601613d8e565b91505092915050565b600081359050613e98816156dd565b92915050565b600060208284031215613eb057600080fd5b6000613ebe84828501613dcc565b91505092915050565b600060208284031215613ed957600080fd5b6000613ee784828501613de1565b91505092915050565b60008060408385031215613f0357600080fd5b6000613f1185828601613dcc565b9250506020613f2285828601613dcc565b9150509250929050565b600080600060608486031215613f4157600080fd5b6000613f4f86828701613dcc565b9350506020613f6086828701613dcc565b9250506040613f7186828701613e89565b9150509250925092565b60008060008060808587031215613f9157600080fd5b6000613f9f87828801613dcc565b9450506020613fb087828801613dcc565b9350506040613fc187828801613e89565b925050606085013567ffffffffffffffff811115613fde57600080fd5b613fea87828801613e35565b91505092959194509250565b6000806040838503121561400957600080fd5b600061401785828601613dcc565b925050602061402885828601613df6565b9150509250929050565b6000806040838503121561404557600080fd5b600061405385828601613dcc565b925050602061406485828601613e89565b9150509250929050565b60006020828403121561408057600080fd5b600061408e84828501613e0b565b91505092915050565b6000602082840312156140a957600080fd5b60006140b784828501613e20565b91505092915050565b6000602082840312156140d257600080fd5b600082013567ffffffffffffffff8111156140ec57600080fd5b6140f884828501613e5f565b91505092915050565b60006020828403121561411357600080fd5b600061412184828501613e89565b91505092915050565b60006141368383614c13565b60208301905092915050565b61415361414e82615408565b615555565b82525050565b614162816153f6565b82525050565b614179614174826153f6565b615543565b82525050565b600061418a82615275565b61419481856152a3565b935061419f83615250565b8060005b838110156141d05781516141b7888261412a565b97506141c283615296565b9250506001810190506141a3565b5085935050505092915050565b6141e68161541a565b82525050565b6141fd6141f882615426565b615567565b82525050565b600061420e82615280565b61421881856152b4565b9350614228818560208601615495565b6142318161567a565b840191505092915050565b60006142478261528b565b61425181856152c5565b9350614261818560208601615495565b61426a8161567a565b840191505092915050565b60006142808261528b565b61428a81856152d6565b935061429a818560208601615495565b80840191505092915050565b600081546142b3816154c8565b6142bd81866152d6565b945060018216600081146142d857600181146142e95761431c565b60ff1983168652818601935061431c565b6142f285615260565b60005b83811015614314578154818901526001820191506020810190506142f5565b838801955050505b50505092915050565b60006143326014836152c5565b91507f5061757361626c653a206e6f74207061757365640000000000000000000000006000830152602082019050919050565b60006143726017836152c5565b91507f43616c6c6572206973206e6f7420746865206f776e65720000000000000000006000830152602082019050919050565b60006143b2602b836152c5565b91507f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008301527f74206f6620626f756e64730000000000000000000000000000000000000000006020830152604082019050919050565b60006144186032836152c5565b91507f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008301527f63656976657220696d706c656d656e74657200000000000000000000000000006020830152604082019050919050565b600061447e600e836152c5565b91507f4e6f74206d696e746564207965740000000000000000000000000000000000006000830152602082019050919050565b60006144be601c836152c5565b91507f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006000830152602082019050919050565b60006144fe6016836152c5565b91507f496e76616c6964207061796d656e7420616d6f756e74000000000000000000006000830152602082019050919050565b600061453e6022836152c5565b91507f4e6f7420656e6f75676820455448207061696420746f6b656e732072656d616960008301527f6e730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006145a46024836152c5565b91507f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061460a6019836152c5565b91507f4552433732313a20617070726f766520746f2063616c6c6572000000000000006000830152602082019050919050565b600061464a602c836152c5565b91507f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008301527f697374656e7420746f6b656e00000000000000000000000000000000000000006020830152604082019050919050565b60006146b06010836152c5565b91507f5061757361626c653a20706175736564000000000000000000000000000000006000830152602082019050919050565b60006146f06038836152c5565b91507f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008301527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006020830152604082019050919050565b6000614756602a836152c5565b91507f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008301527f726f2061646472657373000000000000000000000000000000000000000000006020830152604082019050919050565b60006147bc6029836152c5565b91507f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008301527f656e7420746f6b656e00000000000000000000000000000000000000000000006020830152604082019050919050565b6000614822601e836152c5565b91507f43616e206265206d696e74656420666f7220544144504f4c45206f6e6c7900006000830152602082019050919050565b60006148626020836152c5565b91507f4552433732313a206d696e7420746f20746865207a65726f20616464726573736000830152602082019050919050565b60006148a2602c836152c5565b91507f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008301527f697374656e7420746f6b656e00000000000000000000000000000000000000006020830152604082019050919050565b60006149086017836152c5565b91507f596f7527726520747279696e6720746f2063686561743f0000000000000000006000830152602082019050919050565b60006149486029836152c5565b91507f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008301527f73206e6f74206f776e00000000000000000000000000000000000000000000006020830152604082019050919050565b60006149ae6021836152c5565b91507f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008301527f72000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614a146010836152c5565b91507f4d696e74206e6f7420616c6c6f776564000000000000000000000000000000006000830152602082019050919050565b6000614a546031836152c5565b91507f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008301527f776e6572206e6f7220617070726f7665640000000000000000000000000000006020830152604082019050919050565b6000614aba601e836152c5565b91507f506c656173652074727920616761696e206f6e206e65787420626c6f636b00006000830152602082019050919050565b6000614afa6012836152c5565b91507f4d617820737570706c79207265616368656400000000000000000000000000006000830152602082019050919050565b6000614b3a6013836152c5565b91507f496e76616c6964206d696e7420616d6f756e74000000000000000000000000006000830152602082019050919050565b6000614b7a602c836152c5565b91507f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008301527f7574206f6620626f756e647300000000000000000000000000000000000000006020830152604082019050919050565b6000614be0601f836152c5565b91507f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006000830152602082019050919050565b614c1c8161547c565b82525050565b614c2b8161547c565b82525050565b614c42614c3d8261547c565b615583565b82525050565b6000614c548285614168565b601482019150614c648284614142565b6014820191508190509392505050565b6000614c808288614168565b601482019150614c908287614c31565b602082019150614ca08286614c31565b602082019150614cb08285614c31565b602082019150614cc082846141ec565b6020820191508190509695505050505050565b6000614cdf82856142a6565b9150614ceb8284614275565b91508190509392505050565b6000602082019050614d0c6000830184614159565b92915050565b6000608082019050614d276000830187614159565b614d346020830186614159565b614d416040830185614c22565b8181036060830152614d538184614203565b905095945050505050565b6000604082019050614d736000830185614159565b614d806020830184614c22565b9392505050565b60006020820190508181036000830152614da1818461417f565b905092915050565b6000602082019050614dbe60008301846141dd565b92915050565b60006020820190508181036000830152614dde818461423c565b905092915050565b60006020820190508181036000830152614dff81614325565b9050919050565b60006020820190508181036000830152614e1f81614365565b9050919050565b60006020820190508181036000830152614e3f816143a5565b9050919050565b60006020820190508181036000830152614e5f8161440b565b9050919050565b60006020820190508181036000830152614e7f81614471565b9050919050565b60006020820190508181036000830152614e9f816144b1565b9050919050565b60006020820190508181036000830152614ebf816144f1565b9050919050565b60006020820190508181036000830152614edf81614531565b9050919050565b60006020820190508181036000830152614eff81614597565b9050919050565b60006020820190508181036000830152614f1f816145fd565b9050919050565b60006020820190508181036000830152614f3f8161463d565b9050919050565b60006020820190508181036000830152614f5f816146a3565b9050919050565b60006020820190508181036000830152614f7f816146e3565b9050919050565b60006020820190508181036000830152614f9f81614749565b9050919050565b60006020820190508181036000830152614fbf816147af565b9050919050565b60006020820190508181036000830152614fdf81614815565b9050919050565b60006020820190508181036000830152614fff81614855565b9050919050565b6000602082019050818103600083015261501f81614895565b9050919050565b6000602082019050818103600083015261503f816148fb565b9050919050565b6000602082019050818103600083015261505f8161493b565b9050919050565b6000602082019050818103600083015261507f816149a1565b9050919050565b6000602082019050818103600083015261509f81614a07565b9050919050565b600060208201905081810360008301526150bf81614a47565b9050919050565b600060208201905081810360008301526150df81614aad565b9050919050565b600060208201905081810360008301526150ff81614aed565b9050919050565b6000602082019050818103600083015261511f81614b2d565b9050919050565b6000602082019050818103600083015261513f81614b6d565b9050919050565b6000602082019050818103600083015261515f81614bd3565b9050919050565b600060208201905061517b6000830184614c22565b92915050565b60006060820190506151966000830186614c22565b81810360208301526151a8818561423c565b90506151b76040830184614c22565b949350505050565b6000604051905081810181811067ffffffffffffffff821117156151e6576151e561564b565b5b8060405250919050565b600067ffffffffffffffff82111561520b5761520a61564b565b5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff82111561523b5761523a61564b565b5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006152ec8261547c565b91506152f78361547c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561532c5761532b6155be565b5b828201905092915050565b60006153428261547c565b915061534d8361547c565b92508261535d5761535c6155ed565b5b828204905092915050565b60006153738261547c565b915061537e8361547c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156153b7576153b66155be565b5b828202905092915050565b60006153cd8261547c565b91506153d88361547c565b9250828210156153eb576153ea6155be565b5b828203905092915050565b60006154018261545c565b9050919050565b60006154138261545c565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b838110156154b3578082015181840152602081019050615498565b838111156154c2576000848401525b50505050565b600060028204905060018216806154e057607f821691505b602082108114156154f4576154f361561c565b5b50919050565b60006155058261547c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415615538576155376155be565b5b600182019050919050565b600061554e82615571565b9050919050565b600061556082615571565b9050919050565b6000819050919050565b600061557c8261568b565b9050919050565b6000819050919050565b60006155988261547c565b91506155a38361547c565b9250826155b3576155b26155ed565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b6156a1816153f6565b81146156ac57600080fd5b50565b6156b88161541a565b81146156c357600080fd5b50565b6156cf81615430565b81146156da57600080fd5b50565b6156e68161547c565b81146156f157600080fd5b5056fea26469706673582212201b552bfc1530a863fae803ff2012121d0043c959005c3abbb9a908e441f466cb64736f6c63430008000033
Verified Source Code Full Match
Compiler: v0.8.0+commit.c7dfd78e
EVM: istanbul
Optimization: No
frog_game.sol 298 lines
// contracts/frog_game.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
//Interfaces
interface ITadpole {
function updateOriginActionBlockTime() external;
function burnFrom(address owner, uint amount) external;
function balanceOf(address _owner) external view returns (uint256);
}
interface IPond {
function getRandomSnakeOwner() external returns(address);
}
//Contract
contract FrogGame is ERC721Enumerable, Pausable, ReentrancyGuard {
bytes32 internal entropySauce;
uint typeShift = 69000;
string _baseTokenURI;
address public owner;
address internal commissionWallet = 0xdA00D453F87db473BC84221063f4a27298F7FCca;
address internal fundingWallet = 0x8672b0EBC3Ec7525e3a973BE338298E28C273FC2;
address constant internal nullAddress = address(0x0);
ITadpole internal tadpoleContract;
IPond internal pondContract;
uint constant MAX_SUPPLY = 25000;
uint constant ETH_MINT_SUPPLY = 5000;
uint constant public mintCost = 0.05 ether;
uint constant public tadpolePhasePriceIncrease = 25000 ether;
uint constant public mintPhaseStep = 5000;
uint constant public maxMintPerTx = 10;
uint internal _snakesTotal;
uint internal _frogsTotal;
uint internal _snakesStolen;
uint internal _frogsStolen;
bool public mintAllowed;
enum creatureType {
FROG,
SNAKE
}
mapping(address => uint) callerToLastActionBlock;
/// @dev Constructor
constructor() ERC721("FrogGame", "FGame") {
owner=msg.sender;
}
/// @dev Return API endpoint with metadata
function tokenURI(uint _tokenId) public view override noSameBlockAsAction returns (string memory) {
require(_exists(_tokenId),"Not minted yet");
return string(abi.encodePacked(_baseTokenURI, Strings.toString(_tokenId)));
}
// _ _ __ _
// | | (_)/ _| | |
// | | _| |_ ___ ___ _ _ ___| | ___
// | | | | _/ _ \/ __| | | |/ __| |/ _ \
// | |____| | || __/ (__| |_| | (__| | __/
// |______|_|_| \___|\___|\__, |\___|_|\___|
// __/ |
// |___/
/// @dev Mint new token
function mint(uint amount) external payable noCheaters onlyMintAllowed nonReentrant whenNotPaused {
require(totalSupply() + amount <= MAX_SUPPLY, 'Max supply reached');
require(amount > 0 && amount <= maxMintPerTx, "Invalid mint amount");
if (totalSupply() < ETH_MINT_SUPPLY) {
require(totalSupply() + amount <= ETH_MINT_SUPPLY, "Not enough ETH paid tokens remains");
require(amount * mintCost == msg.value, "Invalid payment amount");
} else {
require(msg.value == 0, "Can be minted for TADPOLE only");
}
for (uint i = 0; i< amount;i++) {
address tokenReceiver = msg.sender;
uint newTokenId;
// Phase 0 - mint for ETH, frogs only, can not be stolen
if (totalSupply() < ETH_MINT_SUPPLY) {
newTokenId = ++_frogsTotal;
// Phase 1-4 - mint for $TADPOLE, frogs and snakes, can be stolen
} else {
callerToLastActionBlock[tx.origin] = block.number;
uint tadpolePrice = mintPriceTadpole();
uint random = _randomize(_rand(), "creatureType", i) % 10000;
// 10% chance to mint snake
if (random < 1000) {
newTokenId=++_snakesTotal + typeShift;
} else {
newTokenId=++_frogsTotal;
}
random = _randomize(_rand(), "stolen", newTokenId) % 10000;
// 10% chance for token to be stolen
if (random < 1000) {
address randomSnakeOwner=pondContract.getRandomSnakeOwner();
// randomSnakeOwner == nullAddress if no snakes staked in Pond
if (randomSnakeOwner!=nullAddress) {
tokenReceiver=randomSnakeOwner;
newTokenId>typeShift?_snakesStolen++:_frogsStolen++;
}
}
tadpoleContract.burnFrom(msg.sender, tadpolePrice);
}
_mint(tokenReceiver, newTokenId);
}
}
// _ _ _ _ _ _ _
// | | | | | (_) (_) |
// | | | | |_ _| |_| |_ _ _
// | | | | __| | | | __| | | |
// | |__| | |_| | | | |_| |_| |
// \____/ \__|_|_|_|\__|\__, |
// __/ |
// |___/
/// @dev Create a bit more of randomness
function _randomize(uint256 rand, string memory val, uint256 spicy) internal pure returns (uint256) {
return uint256(keccak256(abi.encode(rand, val, spicy)));
}
/// @dev Get random uint
function _rand() internal view returns (uint256) {
return uint256(keccak256(abi.encodePacked(msg.sender, block.timestamp, block.difficulty, block.timestamp, entropySauce)));
}
/// @dev Return current $TADPOLE mint price
function mintPriceTadpole() public view returns (uint) {
return (totalSupply()/mintPhaseStep)*tadpolePhasePriceIncrease;
}
// ____ __ _ _
// / __ \ / _| | | (_)
// | | | |_ ___ __ ___ _ __ | |_ _ _ _ __ ___| |_ _ ___ _ __ ___
// | | | \ \ /\ / / '_ \ / _ \ '__| | _| | | | '_ \ / __| __| |/ _ \| '_ \/ __|
// | |__| |\ V V /| | | | __/ | | | | |_| | | | | (__| |_| | (_) | | | \__ \
// \____/ \_/\_/ |_| |_|\___|_| |_| \__,_|_| |_|\___|\__|_|\___/|_| |_|___/
function Pause() external onlyOwner {
_pause();
}
function Unpause() external onlyOwner {
_unpause();
}
/// @dev Set tadpole contract address and init interface with it
function setTadpoleAddress(address _tadpoleAddress) external onlyOwner {
tadpoleContract=ITadpole(_tadpoleAddress);
}
/// @dev Set pond contract address and init interface with it
function setPondAddress(address _pondAddress) external onlyOwner {
pondContract=IPond(_pondAddress);
}
/// @dev Set base address for Token URI, should end with leading slash
function setBaseTokenURI(string memory baseURI_) external onlyOwner {
_baseTokenURI=baseURI_;
}
/// @dev Switch mint allowed flag
function switchMintAllowed() external onlyOwner {
mintAllowed=!mintAllowed;
}
/// @dev Withdraw all ETH accumulated on contract
function withdrawEther() external onlyOwner {
uint commission = address(this).balance*20/100;
payable(commissionWallet).transfer(commission);
payable(fundingWallet).transfer(address(this).balance);
}
// __ __ _ _ __ _
// | \/ | | (_)/ _(_)
// | \ / | ___ __| |_| |_ _ ___ _ __ ___
// | |\/| |/ _ \ / _` | | _| |/ _ \ '__/ __|
// | | | | (_) | (_| | | | | | __/ | \__ \
// |_| |_|\___/ \__,_|_|_| |_|\___|_| |___/
/// @dev Execute if mintAllowed flag set to True
modifier onlyMintAllowed() {
require(mintAllowed, 'Mint not allowed');
_;
}
/// @dev Execute if msg.sender = owner
modifier onlyOwner() {
require(owner == msg.sender, "Caller is not the owner");
_;
}
/// @dev Execute if tx.origin == msg.sender and caller is not a contract
modifier noCheaters() {
uint256 size = 0;
address acc = msg.sender;
assembly { size := extcodesize(acc)}
require(msg.sender == tx.origin , "You're trying to cheat?");
require(size == 0, "You're trying to cheat?");
_;
// We'll use the last caller hash to add entropy to next caller
entropySauce = keccak256(abi.encodePacked(acc, block.coinbase));
}
/// @dev don't allow view functions in same block as action that changed the state
modifier noSameBlockAsAction() {
if (msg.sender!=address(pondContract)) {
require(callerToLastActionBlock[tx.origin] < block.number, "Please try again on next block");
}
_;
}
function snakesTotal() external view noSameBlockAsAction returns(uint) {
return _snakesTotal;
}
function frogsTotal() external view noSameBlockAsAction returns(uint) {
return _frogsTotal;
}
function snakesStolen() external view noSameBlockAsAction returns(uint) {
return _snakesStolen;
}
function frogsStolen() external view noSameBlockAsAction returns(uint) {
return _frogsStolen;
}
function tokenOfOwnerByIndex(address _owner, uint256 index) public view virtual override(ERC721Enumerable) noSameBlockAsAction returns (uint256) {
require(callerToLastActionBlock[_owner] < block.number, "Please try again on next block");
return super.tokenOfOwnerByIndex(_owner, index);
}
function balanceOf(address _owner) public view virtual override(ERC721) noSameBlockAsAction returns (uint256) {
require(callerToLastActionBlock[_owner] < block.number, "Please try again on next block");
return super.balanceOf(owner);
}
function ownerOf(uint256 tokenId) public view virtual override(ERC721) noSameBlockAsAction returns (address) {
address addr = super.ownerOf(tokenId);
require(callerToLastActionBlock[addr] < block.number, "Please try again on next block");
return addr;
}
function walletOfOwner(address _wallet)
public
view
noSameBlockAsAction
returns (uint256[] memory)
{
uint256 tokenCount = balanceOf(_wallet);
uint256[] memory tokensId = new uint256[](tokenCount);
for (uint256 i; i < tokenCount; i++) {
tokensId[i] = tokenOfOwnerByIndex(_wallet, i);
}
return tokensId;
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
if (msg.sender != address(pondContract)) {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
}
_transfer(from, to, tokenId);
}
function transferOwnership(address newOwner) external onlyOwner {
owner = newOwner;
}
}
Address.sol 216 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @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) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
Context.sol 23 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Strings.sol 66 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
Pausable.sol 90 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
ERC721.sol 411 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @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` and `to` are never both zero.
*
* 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 {}
}
IERC721.sol 142 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
ReentrancyGuard.sol 62 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
ERC165.sol 28 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERC165.sol 24 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
IERC721Receiver.sol 26 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
IERC721Metadata.sol 26 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
ERC721Enumerable.sol 162 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "./IERC721Enumerable.sol";
/**
* @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) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @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) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @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 {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @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 {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @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 {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @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 {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @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 {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}
IERC721Enumerable.sol 28 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
Read Contract
balanceOf 0x70a08231 → uint256
frogsStolen 0x8d87f84a → uint256
frogsTotal 0xb85d43d0 → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
maxMintPerTx 0xde7fcb1d → uint256
mintAllowed 0xc467201e → bool
mintCost 0xbdb4b848 → uint256
mintPhaseStep 0xc428189c → uint256
mintPriceTadpole 0x0bb5140d → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
snakesStolen 0x5a8a188e → uint256
snakesTotal 0x913c01b2 → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tadpolePhasePriceIncrease 0x409a9724 → uint256
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
walletOfOwner 0x438b6300 → uint256[]
Write Contract 14 functions
These functions modify contract state and require a wallet transaction to execute.
Pause 0x6985a022
No parameters
Unpause 0x7805862f
No parameters
approve 0x095ea7b3
address to
uint256 tokenId
mint 0xa0712d68
uint256 amount
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseTokenURI 0x30176e13
string baseURI_
setPondAddress 0xea4795bf
address _pondAddress
setTadpoleAddress 0x6f03e260
address _tadpoleAddress
switchMintAllowed 0x9a8cbafa
No parameters
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdrawEther 0x7362377b
No parameters
Recent Transactions
No transactions found for this address