Address Contract Verified
Address
0x66fCA7555CD481545A5e66bA9a2bEC1e256F98e7
Balance
0 ETH
Nonce
1
Code Size
22689 bytes
Creator
0x5be29Bdf...F94E at tx 0xa145fa9e...b8727f
Indexed Transactions
0
Contract Bytecode
22689 bytes
0x6080604052600436106102675760003560e01c80636de9f32b11610144578063b488b636116100b6578063e6a72acf1161007a578063e6a72acf14610907578063e985e9c514610944578063efb3d00814610981578063f2fde38b146109aa578063f47c84c5146109d3578063fbec6f21146109fe57610267565b8063b488b6361461080e578063b88d4fde14610839578063c87b56dd14610862578063c9150a9e1461089f578063cb7e93d2146108dc57610267565b806386b854c81161010857806386b854c8146107125780638da5cb5b1461073b57806392b242291461076657806395d89b411461078f578063a22cb465146107ba578063b1c9fe6e146107e357610267565b80636de9f32b14610641578063703731731461066c57806370a0823114610695578063715018a6146106d25780637e603d42146106e957610267565b80632c12395b116101dd5780634efc09f5116101a15780634efc09f51461054257806351cff8d91461056b57806355f804b3146105945780635c975abb146105bd5780636352211e146105e857806367f68fac1461062557610267565b80632c12395b1461045d5780633d4729371461049a57806340ce8d8a146104c357806342842e0e146104ee57806345d510071461051757610267565b806316c38b3c1161022f57806316c38b3c1461036357806318160ddd1461038c5780631adbc550146103b757806323b872dd146103e0578063261d3b2114610409578063268e00a31461043257610267565b806301ffc9a71461026c5780630520b708146102a957806306fdde03146102d2578063081812fc146102fd578063095ea7b31461033a575b600080fd5b34801561027857600080fd5b50610293600480360381019061028e9190613a6f565b610a29565b6040516102a09190613ab7565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190613b30565b610b0b565b005b3480156102de57600080fd5b506102e7610bcb565b6040516102f49190613bf6565b60405180910390f35b34801561030957600080fd5b50610324600480360381019061031f9190613c4e565b610c5d565b6040516103319190613c8a565b60405180910390f35b34801561034657600080fd5b50610361600480360381019061035c9190613ca5565b610ce2565b005b34801561036f57600080fd5b5061038a60048036038101906103859190613d11565b610dfa565b005b34801561039857600080fd5b506103a1610e93565b6040516103ae9190613d4d565b60405180910390f35b3480156103c357600080fd5b506103de60048036038101906103d99190613da2565b610e9d565b005b3480156103ec57600080fd5b5061040760048036038101906104029190613de2565b610f50565b005b34801561041557600080fd5b50610430600480360381019061042b9190613e35565b61100d565b005b34801561043e57600080fd5b50610447611161565b6040516104549190613e84565b60405180910390f35b34801561046957600080fd5b50610484600480360381019061047f9190613e9f565b611175565b6040516104919190613ab7565b60405180910390f35b3480156104a657600080fd5b506104c160048036038101906104bc9190613da2565b6111a7565b005b3480156104cf57600080fd5b506104d861130d565b6040516104e59190613f2b565b60405180910390f35b3480156104fa57600080fd5b5061051560048036038101906105109190613de2565b611333565b005b34801561052357600080fd5b5061052c611353565b6040516105399190613d4d565b60405180910390f35b34801561054e57600080fd5b5061056960048036038101906105649190613f46565b611358565b005b34801561057757600080fd5b50610592600480360381019061058d9190613b30565b6113f8565b005b3480156105a057600080fd5b506105bb60048036038101906105b691906140bb565b611548565b005b3480156105c957600080fd5b506105d26115de565b6040516105df9190613ab7565b60405180910390f35b3480156105f457600080fd5b5061060f600480360381019061060a9190613c4e565b6115f5565b60405161061c9190613c8a565b60405180910390f35b61063f600480360381019061063a9190614104565b6116a7565b005b34801561064d57600080fd5b50610656611e29565b6040516106639190613d4d565b60405180910390f35b34801561067857600080fd5b50610693600480360381019061068e91906141a4565b611e2f565b005b3480156106a157600080fd5b506106bc60048036038101906106b79190613b30565b611f2c565b6040516106c99190613d4d565b60405180910390f35b3480156106de57600080fd5b506106e7611fe4565b005b3480156106f557600080fd5b50610710600480360381019061070b9190613b30565b61206c565b005b34801561071e57600080fd5b50610739600480360381019061073491906141f1565b61212c565b005b34801561074757600080fd5b50610750612206565b60405161075d9190613c8a565b60405180910390f35b34801561077257600080fd5b5061078d60048036038101906107889190614231565b612230565b005b34801561079b57600080fd5b506107a4612307565b6040516107b19190613bf6565b60405180910390f35b3480156107c657600080fd5b506107e160048036038101906107dc9190614271565b612399565b005b3480156107ef57600080fd5b506107f861251a565b6040516108059190613e84565b60405180910390f35b34801561081a57600080fd5b5061082361252e565b6040516108309190613e84565b60405180910390f35b34801561084557600080fd5b50610860600480360381019061085b9190614352565b612542565b005b34801561086e57600080fd5b5061088960048036038101906108849190613c4e565b6125a4565b6040516108969190613bf6565b60405180910390f35b3480156108ab57600080fd5b506108c660048036038101906108c19190613e9f565b61264b565b6040516108d39190613d4d565b60405180910390f35b3480156108e857600080fd5b506108f1612663565b6040516108fe9190613e84565b60405180910390f35b34801561091357600080fd5b5061092e60048036038101906109299190613c4e565b612677565b60405161093b9190613d4d565b60405180910390f35b34801561095057600080fd5b5061096b600480360381019061096691906143d5565b6126b7565b6040516109789190613ab7565b60405180910390f35b34801561098d57600080fd5b506109a860048036038101906109a39190614415565b61274b565b005b3480156109b657600080fd5b506109d160048036038101906109cc9190613b30565b6127d5565b005b3480156109df57600080fd5b506109e86128cd565b6040516109f59190613d4d565b60405180910390f35b348015610a0a57600080fd5b50610a136128d3565b604051610a209190614476565b60405180910390f35b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610af457507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610b045750610b038261290c565b5b9050919050565b610b13612976565b73ffffffffffffffffffffffffffffffffffffffff16610b31612206565b73ffffffffffffffffffffffffffffffffffffffff1614610b87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7e906144dd565b60405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060008054610bda9061452c565b80601f0160208091040260200160405190810160405280929190818152602001828054610c069061452c565b8015610c535780601f10610c2857610100808354040283529160200191610c53565b820191906000526020600020905b815481529060010190602001808311610c3657829003601f168201915b5050505050905090565b6000610c688261297e565b610ca7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9e906145d0565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610ced826115f5565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5590614662565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610d7d612976565b73ffffffffffffffffffffffffffffffffffffffff161480610dac5750610dab81610da6612976565b6126b7565b5b610deb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de2906146f4565b60405180910390fd5b610df583836129ea565b505050565b610e02612976565b73ffffffffffffffffffffffffffffffffffffffff16610e20612206565b73ffffffffffffffffffffffffffffffffffffffff1614610e76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6d906144dd565b60405180910390fd5b80600960086101000a81548160ff02191690831515021790555050565b6000600854905090565b610ea5612976565b73ffffffffffffffffffffffffffffffffffffffff16610ec3612206565b73ffffffffffffffffffffffffffffffffffffffff1614610f19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f10906144dd565b60405180910390fd5b80600e60008461ffff1661ffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f91612976565b73ffffffffffffffffffffffffffffffffffffffff1614610ffd57610fbd610fb7612976565b82612aa3565b610ffc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ff390614786565b60405180910390fd5b5b611008838383612b81565b505050565b611015612976565b73ffffffffffffffffffffffffffffffffffffffff16611033612206565b73ffffffffffffffffffffffffffffffffffffffff1614611089576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611080906144dd565b60405180910390fd5b6007548260085461109a91906147d5565b11156110db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d290614877565b60405180910390fd5b6000600f8054905011611123576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111a90614909565b60405180910390fd5b60005b8281101561115c576000611138612ddd565b9050611148838261ffff16612f0a565b50808061115490614929565b915050611126565b505050565b600960049054906101000a900461ffff1681565b6000600e60008361ffff1661ffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6111af612976565b73ffffffffffffffffffffffffffffffffffffffff166111cd612206565b73ffffffffffffffffffffffffffffffffffffffff1614611223576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161121a906144dd565b60405180910390fd5b81600960006101000a81548161ffff021916908361ffff1602179055508061124a57611309565b6001600960009054906101000a900461ffff1661ffff16141561127957611274600161270f612f28565b611308565b6002600960009054906101000a900461ffff1661ffff1614156112a9576112a4612710614e20612f28565b611307565b6003600960009054906101000a900461ffff1661ffff1614156112d9576112d4614e21619c40612f28565b611306565b6004600960009054906101000a900461ffff1661ffff16141561130557611304619c4161c34f612f28565b5b5b5b5b5b5050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61134e83838360405180602001604052806000815250612542565b505050565b601481565b611360612976565b73ffffffffffffffffffffffffffffffffffffffff1661137e612206565b73ffffffffffffffffffffffffffffffffffffffff16146113d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113cb906144dd565b60405180910390fd5b80600a60008461ffff1661ffff168152602001908152602001600020819055505050565b611400612976565b73ffffffffffffffffffffffffffffffffffffffff1661141e612206565b73ffffffffffffffffffffffffffffffffffffffff1614611474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146b906144dd565b60405180910390fd5b60004790506000606460148361148a9190614972565b61149491906149fb565b905073ca305c7bbe3f54650fb4aeecc57255e1dd020f2a73ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156114f0573d6000803e3d6000fd5b508273ffffffffffffffffffffffffffffffffffffffff166108fc82846115179190614a2c565b9081150290604051600060405180830381858888f19350505050158015611542573d6000803e3d6000fd5b50505050565b611550612976565b73ffffffffffffffffffffffffffffffffffffffff1661156e612206565b73ffffffffffffffffffffffffffffffffffffffff16146115c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115bb906144dd565b60405180910390fd5b80600d90805190602001906115da929190613960565b5050565b6000600960089054906101000a900460ff16905090565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561169e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169590614ad2565b60405180910390fd5b80915050919050565b6116af6115de565b156116ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e690614b3e565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff161461175d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175490614baa565b60405180910390fd5b6007548260085461176e91906147d5565b11156117af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a690614877565b60405180910390fd5b6000821180156117c0575060148211155b6117ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f690614c16565b60405180910390fd5b6000600f8054905011611847576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183e90614909565b60405180910390fd5b60006001600960009054906101000a900461ffff1661ffff1614156118b5573461187084612677565b146118b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a790614c82565b60405180910390fd5b6119f1565b600034146118f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ef90614cee565b60405180910390fd5b61190183612677565b905080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b815260040161195f9190613c8a565b60206040518083038186803b15801561197757600080fd5b505afa15801561198b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119af9190614d23565b10156119f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e790614d9c565b60405180910390fd5b5b6000811115611a8a57600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac33836040518363ffffffff1660e01b8152600401611a57929190614dbc565b600060405180830381600087803b158015611a7157600080fd5b505af1158015611a85573d6000803e3d6000fd5b505050505b8260086000828254611a9c91906147d5565b92505081905550600082611af957600067ffffffffffffffff811115611ac557611ac4613f90565b5b604051908082528060200260200182016040528015611af35781602001602082028036833780820191505090505b50611b43565b8367ffffffffffffffff811115611b1357611b12613f90565b5b604051908082528060200260200182016040528015611b415781602001602082028036833780820191505090505b505b905060005b84811015611d8c576000611b5a612f9f565b90506001600960009054906101000a900461ffff1661ffff1614611b8157611b806130e4565b5b6000611b8b612ddd565b9050611b9681611175565b15611bd6576001600960068282829054906101000a900461ffff16611bbb9190614de5565b92506101000a81548161ffff021916908361ffff1602179055505b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611ccb57611c1281611175565b611c54576001600960048282829054906101000a900461ffff16611c369190614de5565b92506101000a81548161ffff021916908361ffff1602179055611c8e565b6001600960028282829054906101000a900461ffff16611c749190614de5565b92506101000a81548161ffff021916908361ffff16021790555b507f5c8f955114cce6fe18920ee4bb38271b9a0f5579589f3767ccf22eb6484e0610338284604051611cc293929190614e1d565b60405180910390a15b851580611d0457503373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d1c57611d17828261ffff16612f0a565b611d77565b611d4c600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168261ffff16612f0a565b80848481518110611d6057611d5f614e54565b5b602002602001019061ffff16908161ffff16815250505b50508080611d8490614929565b915050611b48565b508215611e2357600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e21f4cbe33836040518363ffffffff1660e01b8152600401611df0929190614f41565b600060405180830381600087803b158015611e0a57600080fd5b505af1158015611e1e573d6000803e3d6000fd5b505050505b50505050565b60085481565b611e37612976565b73ffffffffffffffffffffffffffffffffffffffff16611e55612206565b73ffffffffffffffffffffffffffffffffffffffff1614611eab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea2906144dd565b60405180910390fd5b60005b82829050811015611f27576001600e6000858585818110611ed257611ed1614e54565b5b9050602002016020810190611ee79190613e9f565b61ffff1661ffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611f1f90614929565b915050611eae565b505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f9490614fe3565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611fec612976565b73ffffffffffffffffffffffffffffffffffffffff1661200a612206565b73ffffffffffffffffffffffffffffffffffffffff1614612060576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612057906144dd565b60405180910390fd5b61206a6000613176565b565b612074612976565b73ffffffffffffffffffffffffffffffffffffffff16612092612206565b73ffffffffffffffffffffffffffffffffffffffff16146120e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120df906144dd565b60405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b612134612976565b73ffffffffffffffffffffffffffffffffffffffff16612152612206565b73ffffffffffffffffffffffffffffffffffffffff16146121a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161219f906144dd565b60405180910390fd5b80601260008461ffff1661ffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b612238612976565b73ffffffffffffffffffffffffffffffffffffffff16612256612206565b73ffffffffffffffffffffffffffffffffffffffff16146122ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122a3906144dd565b60405180910390fd5b60006122b8838361323c565b61ffff16905080601060006101000a81548161ffff021916908361ffff16021790555060005b81811015612301576122ee6130e4565b80806122f990614929565b9150506122de565b50505050565b6060600180546123169061452c565b80601f01602080910402602001604051908101604052809291908181526020018280546123429061452c565b801561238f5780601f106123645761010080835404028352916020019161238f565b820191906000526020600020905b81548152906001019060200180831161237257829003601f168201915b5050505050905090565b6123a1612976565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561240f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124069061504f565b60405180910390fd5b806005600061241c612976565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff166124c9612976565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c318360405161250e9190613ab7565b60405180910390a35050565b600960009054906101000a900461ffff1681565b600960069054906101000a900461ffff1681565b61255361254d612976565b83612aa3565b612592576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161258990614786565b60405180910390fd5b61259e8484848461334c565b50505050565b60606125af8261297e565b6125ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e5906150e1565b60405180910390fd5b60006125f86133a8565b905060008151116126185760405180602001604052806000815250612643565b806126228461343a565b60405160200161263392919061513d565b6040516020818303038152906040525b915050919050565b600a6020528060005260406000206000915090505481565b600960029054906101000a900461ffff1681565b6000600a6000600960009054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002054826126b09190614972565b9050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b612753612976565b73ffffffffffffffffffffffffffffffffffffffff16612771612206565b73ffffffffffffffffffffffffffffffffffffffff16146127c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127be906144dd565b60405180910390fd5b6127d18282612f28565b5050565b6127dd612976565b73ffffffffffffffffffffffffffffffffffffffff166127fb612206565b73ffffffffffffffffffffffffffffffffffffffff1614612851576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612848906144dd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156128c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128b8906151d3565b60405180910390fd5b6128ca81613176565b50565b60075481565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080823b905060008111915050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16612a5d836115f5565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000612aae8261297e565b612aed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ae490615265565b60405180910390fd5b6000612af8836115f5565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612b6757508373ffffffffffffffffffffffffffffffffffffffff16612b4f84610c5d565b73ffffffffffffffffffffffffffffffffffffffff16145b80612b785750612b7781856126b7565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612ba1826115f5565b73ffffffffffffffffffffffffffffffffffffffff1614612bf7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bee906152f7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612c67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c5e90615389565b60405180910390fd5b612c7283838361359b565b612c7d6000826129ea565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612ccd9190614a2c565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612d2491906147d5565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b600080612df4600f80549050600f8054905061323c565b61ffff1690506000600f8281548110612e1057612e0f614e54565b5b90600052602060002090601091828204019190066002029054906101000a900461ffff169050600f6001600f80549050612e4a9190614a2c565b81548110612e5b57612e5a614e54565b5b90600052602060002090601091828204019190066002029054906101000a900461ffff16600f8381548110612e9357612e92614e54565b5b90600052602060002090601091828204019190066002026101000a81548161ffff021916908361ffff160217905550600f805480612ed457612ed36153a9565b5b60019003818190600052602060002090601091828204019190066002026101000a81549061ffff02191690559055809250505090565b612f248282604051806020016040528060008152506135a0565b5050565b60008290505b8161ffff168161ffff1611612f9a57600f8190806001815401808255809150506001900390600052602060002090601091828204019190066002029091909190916101000a81548161ffff021916908361ffff1602179055508080612f92906153d8565b915050612f2e565b505050565b60006001600960009054906101000a900461ffff1661ffff161415612fc6573390506130e1565b600a612fe7600960069054906101000a900461ffff1661ffff16606461323c565b61ffff1610612ff8573390506130e1565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634cabaab86040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561306457600080fd5b505af1158015613078573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061309c9190615418565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156130dc57339150506130e1565b809150505b90565b6001601060008282829054906101000a900461ffff166131049190614de5565b92506101000a81548161ffff021916908361ffff16021790555060016011600082825461313191906147d5565b925050819055506006601060009054906101000a900461ffff1661ffff161115613174576000601060006101000a81548161ffff021916908361ffff1602179055505b565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000806000905060005b60078161ffff1610156132d65760126000601060009054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631826132c191906147d5565b915080806132ce906153d8565b915050613246565b506000846001436132e79190614a2c565b4041443360085487601154601060009054906101000a900461ffff1660405160200161331b9998979695949392919061554a565b6040516020818303038152906040528051906020012060001c9050838161334291906155ed565b9250505092915050565b613357848484612b81565b613363848484846135fb565b6133a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161339990615690565b60405180910390fd5b50505050565b6060600d80546133b79061452c565b80601f01602080910402602001604051908101604052809291908181526020018280546133e39061452c565b80156134305780601f1061340557610100808354040283529160200191613430565b820191906000526020600020905b81548152906001019060200180831161341357829003601f168201915b5050505050905090565b60606000821415613482576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050613596565b600082905060005b600082146134b457808061349d90614929565b915050600a826134ad91906149fb565b915061348a565b60008167ffffffffffffffff8111156134d0576134cf613f90565b5b6040519080825280601f01601f1916602001820160405280156135025781602001600182028036833780820191505090505b5090505b6000851461358f5760018261351b9190614a2c565b9150600a8561352a91906155ed565b603061353691906147d5565b60f81b81838151811061354c5761354b614e54565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561358891906149fb565b9450613506565b8093505050505b919050565b505050565b6135aa8383613792565b6135b760008484846135fb565b6135f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016135ed90615690565b60405180910390fd5b505050565b600061361c8473ffffffffffffffffffffffffffffffffffffffff166128f9565b15613785578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02613645612976565b8786866040518563ffffffff1660e01b81526004016136679493929190615705565b602060405180830381600087803b15801561368157600080fd5b505af19250505080156136b257506040513d601f19601f820116820180604052508101906136af9190615766565b60015b613735573d80600081146136e2576040519150601f19603f3d011682016040523d82523d6000602084013e6136e7565b606091505b5060008151141561372d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161372490615690565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161491505061378a565b600190505b949350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613802576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016137f9906157df565b60405180910390fd5b61380b8161297e565b1561384b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016138429061584b565b60405180910390fd5b6138576000838361359b565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546138a791906147d5565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b82805461396c9061452c565b90600052602060002090601f01602090048101928261398e57600085556139d5565b82601f106139a757805160ff19168380011785556139d5565b828001600101855582156139d5579182015b828111156139d45782518255916020019190600101906139b9565b5b5090506139e291906139e6565b5090565b5b808211156139ff5760008160009055506001016139e7565b5090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613a4c81613a17565b8114613a5757600080fd5b50565b600081359050613a6981613a43565b92915050565b600060208284031215613a8557613a84613a0d565b5b6000613a9384828501613a5a565b91505092915050565b60008115159050919050565b613ab181613a9c565b82525050565b6000602082019050613acc6000830184613aa8565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613afd82613ad2565b9050919050565b613b0d81613af2565b8114613b1857600080fd5b50565b600081359050613b2a81613b04565b92915050565b600060208284031215613b4657613b45613a0d565b5b6000613b5484828501613b1b565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613b97578082015181840152602081019050613b7c565b83811115613ba6576000848401525b50505050565b6000601f19601f8301169050919050565b6000613bc882613b5d565b613bd28185613b68565b9350613be2818560208601613b79565b613beb81613bac565b840191505092915050565b60006020820190508181036000830152613c108184613bbd565b905092915050565b6000819050919050565b613c2b81613c18565b8114613c3657600080fd5b50565b600081359050613c4881613c22565b92915050565b600060208284031215613c6457613c63613a0d565b5b6000613c7284828501613c39565b91505092915050565b613c8481613af2565b82525050565b6000602082019050613c9f6000830184613c7b565b92915050565b60008060408385031215613cbc57613cbb613a0d565b5b6000613cca85828601613b1b565b9250506020613cdb85828601613c39565b9150509250929050565b613cee81613a9c565b8114613cf957600080fd5b50565b600081359050613d0b81613ce5565b92915050565b600060208284031215613d2757613d26613a0d565b5b6000613d3584828501613cfc565b91505092915050565b613d4781613c18565b82525050565b6000602082019050613d626000830184613d3e565b92915050565b600061ffff82169050919050565b613d7f81613d68565b8114613d8a57600080fd5b50565b600081359050613d9c81613d76565b92915050565b60008060408385031215613db957613db8613a0d565b5b6000613dc785828601613d8d565b9250506020613dd885828601613cfc565b9150509250929050565b600080600060608486031215613dfb57613dfa613a0d565b5b6000613e0986828701613b1b565b9350506020613e1a86828701613b1b565b9250506040613e2b86828701613c39565b9150509250925092565b60008060408385031215613e4c57613e4b613a0d565b5b6000613e5a85828601613c39565b9250506020613e6b85828601613b1b565b9150509250929050565b613e7e81613d68565b82525050565b6000602082019050613e996000830184613e75565b92915050565b600060208284031215613eb557613eb4613a0d565b5b6000613ec384828501613d8d565b91505092915050565b6000819050919050565b6000613ef1613eec613ee784613ad2565b613ecc565b613ad2565b9050919050565b6000613f0382613ed6565b9050919050565b6000613f1582613ef8565b9050919050565b613f2581613f0a565b82525050565b6000602082019050613f406000830184613f1c565b92915050565b60008060408385031215613f5d57613f5c613a0d565b5b6000613f6b85828601613d8d565b9250506020613f7c85828601613c39565b9150509250929050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613fc882613bac565b810181811067ffffffffffffffff82111715613fe757613fe6613f90565b5b80604052505050565b6000613ffa613a03565b90506140068282613fbf565b919050565b600067ffffffffffffffff82111561402657614025613f90565b5b61402f82613bac565b9050602081019050919050565b82818337600083830152505050565b600061405e6140598461400b565b613ff0565b90508281526020810184848401111561407a57614079613f8b565b5b61408584828561403c565b509392505050565b600082601f8301126140a2576140a1613f86565b5b81356140b284826020860161404b565b91505092915050565b6000602082840312156140d1576140d0613a0d565b5b600082013567ffffffffffffffff8111156140ef576140ee613a12565b5b6140fb8482850161408d565b91505092915050565b6000806040838503121561411b5761411a613a0d565b5b600061412985828601613c39565b925050602061413a85828601613cfc565b9150509250929050565b600080fd5b600080fd5b60008083601f84011261416457614163613f86565b5b8235905067ffffffffffffffff81111561418157614180614144565b5b60208301915083602082028301111561419d5761419c614149565b5b9250929050565b600080602083850312156141bb576141ba613a0d565b5b600083013567ffffffffffffffff8111156141d9576141d8613a12565b5b6141e58582860161414e565b92509250509250929050565b6000806040838503121561420857614207613a0d565b5b600061421685828601613d8d565b925050602061422785828601613b1b565b9150509250929050565b6000806040838503121561424857614247613a0d565b5b600061425685828601613c39565b925050602061426785828601613c39565b9150509250929050565b6000806040838503121561428857614287613a0d565b5b600061429685828601613b1b565b92505060206142a785828601613cfc565b9150509250929050565b600067ffffffffffffffff8211156142cc576142cb613f90565b5b6142d582613bac565b9050602081019050919050565b60006142f56142f0846142b1565b613ff0565b90508281526020810184848401111561431157614310613f8b565b5b61431c84828561403c565b509392505050565b600082601f83011261433957614338613f86565b5b81356143498482602086016142e2565b91505092915050565b6000806000806080858703121561436c5761436b613a0d565b5b600061437a87828801613b1b565b945050602061438b87828801613b1b565b935050604061439c87828801613c39565b925050606085013567ffffffffffffffff8111156143bd576143bc613a12565b5b6143c987828801614324565b91505092959194509250565b600080604083850312156143ec576143eb613a0d565b5b60006143fa85828601613b1b565b925050602061440b85828601613b1b565b9150509250929050565b6000806040838503121561442c5761442b613a0d565b5b600061443a85828601613d8d565b925050602061444b85828601613d8d565b9150509250929050565b600061446082613ef8565b9050919050565b61447081614455565b82525050565b600060208201905061448b6000830184614467565b92915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006144c7602083613b68565b91506144d282614491565b602082019050919050565b600060208201905081810360008301526144f6816144ba565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061454457607f821691505b60208210811415614558576145576144fd565b5b50919050565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b60006145ba602c83613b68565b91506145c58261455e565b604082019050919050565b600060208201905081810360008301526145e9816145ad565b9050919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b600061464c602183613b68565b9150614657826145f0565b604082019050919050565b6000602082019050818103600083015261467b8161463f565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b60006146de603883613b68565b91506146e982614682565b604082019050919050565b6000602082019050818103600083015261470d816146d1565b9050919050565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b6000614770603183613b68565b915061477b82614714565b604082019050919050565b6000602082019050818103600083015261479f81614763565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006147e082613c18565b91506147eb83613c18565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156148205761481f6147a6565b5b828201905092915050565b7f416c6c20746f6b656e73206d696e746564000000000000000000000000000000600082015250565b6000614861601183613b68565b915061486c8261482b565b602082019050919050565b6000602082019050818103600083015261489081614854565b9050919050565b7f416c6c20746f6b656e7320666f7220746869732050686173652061726520616c60008201527f726561647920736f6c6400000000000000000000000000000000000000000000602082015250565b60006148f3602a83613b68565b91506148fe82614897565b604082019050919050565b60006020820190508181036000830152614922816148e6565b9050919050565b600061493482613c18565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614967576149666147a6565b5b600182019050919050565b600061497d82613c18565b915061498883613c18565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156149c1576149c06147a6565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614a0682613c18565b9150614a1183613c18565b925082614a2157614a206149cc565b5b828204905092915050565b6000614a3782613c18565b9150614a4283613c18565b925082821015614a5557614a546147a6565b5b828203905092915050565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b6000614abc602983613b68565b9150614ac782614a60565b604082019050919050565b60006020820190508181036000830152614aeb81614aaf565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000614b28601083613b68565b9150614b3382614af2565b602082019050919050565b60006020820190508181036000830152614b5781614b1b565b9050919050565b7f4f6e6c7920454f41000000000000000000000000000000000000000000000000600082015250565b6000614b94600883613b68565b9150614b9f82614b5e565b602082019050919050565b60006020820190508181036000830152614bc381614b87565b9050919050565b7f496e76616c6964206d696e7420616d6f756e7400000000000000000000000000600082015250565b6000614c00601383613b68565b9150614c0b82614bca565b602082019050919050565b60006020820190508181036000830152614c2f81614bf3565b9050919050565b7f496e76616c6964207061796d656e7420616d6f756e7400000000000000000000600082015250565b6000614c6c601683613b68565b9150614c7782614c36565b602082019050919050565b60006020820190508181036000830152614c9b81614c5f565b9050919050565b7f4e6f77206d696e74696e6720697320646f6e65207669612050656e6e79000000600082015250565b6000614cd8601d83613b68565b9150614ce382614ca2565b602082019050919050565b60006020820190508181036000830152614d0781614ccb565b9050919050565b600081519050614d1d81613c22565b92915050565b600060208284031215614d3957614d38613a0d565b5b6000614d4784828501614d0e565b91505092915050565b7f4e6f7420656e6f7567682050656e6e7900000000000000000000000000000000600082015250565b6000614d86601083613b68565b9150614d9182614d50565b602082019050919050565b60006020820190508181036000830152614db581614d79565b9050919050565b6000604082019050614dd16000830185613c7b565b614dde6020830184613d3e565b9392505050565b6000614df082613d68565b9150614dfb83613d68565b92508261ffff03821115614e1257614e116147a6565b5b828201905092915050565b6000606082019050614e326000830186613c7b565b614e3f6020830185613e75565b614e4c6040830184613c7b565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b614eb881613d68565b82525050565b6000614eca8383614eaf565b60208301905092915050565b6000602082019050919050565b6000614eee82614e83565b614ef88185614e8e565b9350614f0383614e9f565b8060005b83811015614f34578151614f1b8882614ebe565b9750614f2683614ed6565b925050600181019050614f07565b5085935050505092915050565b6000604082019050614f566000830185613c7b565b8181036020830152614f688184614ee3565b90509392505050565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b6000614fcd602a83613b68565b9150614fd882614f71565b604082019050919050565b60006020820190508181036000830152614ffc81614fc0565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b6000615039601983613b68565b915061504482615003565b602082019050919050565b600060208201905081810360008301526150688161502c565b9050919050565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b60006150cb602f83613b68565b91506150d68261506f565b604082019050919050565b600060208201905081810360008301526150fa816150be565b9050919050565b600081905092915050565b600061511782613b5d565b6151218185615101565b9350615131818560208601613b79565b80840191505092915050565b6000615149828561510c565b9150615155828461510c565b91508190509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006151bd602683613b68565b91506151c882615161565b604082019050919050565b600060208201905081810360008301526151ec816151b0565b9050919050565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b600061524f602c83613b68565b915061525a826151f3565b604082019050919050565b6000602082019050818103600083015261527e81615242565b9050919050565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b60006152e1602983613b68565b91506152ec82615285565b604082019050919050565b60006020820190508181036000830152615310816152d4565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000615373602483613b68565b915061537e82615317565b604082019050919050565b600060208201905081810360008301526153a281615366565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60006153e382613d68565b915061ffff8214156153f8576153f76147a6565b5b600182019050919050565b60008151905061541281613b04565b92915050565b60006020828403121561542e5761542d613a0d565b5b600061543c84828501615403565b91505092915050565b6000819050919050565b61546061545b82613c18565b615445565b82525050565b6000819050919050565b6000819050919050565b61548b61548682615466565b615470565b82525050565b600061549c82613ad2565b9050919050565b60008160601b9050919050565b60006154bb826154a3565b9050919050565b60006154cd826154b0565b9050919050565b6154e56154e082615491565b6154c2565b82525050565b60006154f6826154b0565b9050919050565b61550e61550982613af2565b6154eb565b82525050565b60008160f01b9050919050565b600061552c82615514565b9050919050565b61554461553f82613d68565b615521565b82525050565b6000615556828c61544f565b602082019150615566828b61547a565b602082019150615576828a6154d4565b601482019150615586828961544f565b60208201915061559682886154fd565b6014820191506155a6828761544f565b6020820191506155b6828661544f565b6020820191506155c6828561544f565b6020820191506155d68284615533565b6002820191508190509a9950505050505050505050565b60006155f882613c18565b915061560383613c18565b925082615613576156126149cc565b5b828206905092915050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b600061567a603283613b68565b91506156858261561e565b604082019050919050565b600060208201905081810360008301526156a98161566d565b9050919050565b600081519050919050565b600082825260208201905092915050565b60006156d7826156b0565b6156e181856156bb565b93506156f1818560208601613b79565b6156fa81613bac565b840191505092915050565b600060808201905061571a6000830187613c7b565b6157276020830186613c7b565b6157346040830185613d3e565b818103606083015261574681846156cc565b905095945050505050565b60008151905061576081613a43565b92915050565b60006020828403121561577c5761577b613a0d565b5b600061578a84828501615751565b91505092915050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b60006157c9602083613b68565b91506157d482615793565b602082019050919050565b600060208201905081810360008301526157f8816157bc565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b6000615835601c83613b68565b9150615840826157ff565b602082019050919050565b6000602082019050818103600083015261586481615828565b905091905056fea2646970667358221220b30172eba7f66a6c7aee3cea8dd48c181a37c7590ee04ec015f55446143dd19764736f6c63430008090033
Verified Source Code Full Match
Compiler: v0.8.9+commit.e5eed63a
EVM: london
Optimization: No
GoldHunter.sol 303 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
interface IGGold {
function balanceOf(address owner) external view returns (uint);
function burn(address account, uint amount) external;
}
interface ITreasureIsland {
function randomPirateOwner() external returns (address);
function addTokensToStake(address account, uint16[] calldata tokenIds) external;
}
contract GoldHunter is ERC721, Ownable {
uint public MAX_TOKENS = 50000;
uint constant public MINT_PER_TX_LIMIT = 20;
uint public tokensMinted = 0;
uint16 public phase = 1;
uint16 public pirateStolen = 0;
uint16 public goldMinerStolen = 0;
uint16 public pirateMinted = 0;
bool private _paused = true;
mapping(uint16 => uint) public phasePrice;
ITreasureIsland public treasureIsland;
IGGold public gold;
string private _apiURI = "https://gold-hunt.herokuapp.com/token/";
mapping(uint16 => bool) private _isPirate;
uint16[] private _availableTokens;
uint16 private _randomIndex = 0;
uint private _randomCalls = 0;
mapping(uint16 => address) private _randomSource;
event TokenStolen(address owner, uint16 tokenId, address thief);
constructor() ERC721("GoldHunter", "GOLDH") {
_safeMint(msg.sender, 0);
tokensMinted += 1;
// Phase 1 is available in the beginning
switchToSalePhase(1, true);
// Set default price for each phase
phasePrice[1] = 0.07 ether;
phasePrice[2] = 20000 ether;
phasePrice[3] = 40000 ether;
phasePrice[4] = 80000 ether;
// Fill random source addresses
_randomSource[0] = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
_randomSource[1] = 0x3cD751E6b0078Be393132286c442345e5DC49699;
_randomSource[2] = 0xb5d85CBf7cB3EE0D56b3bB207D5Fc4B82f43F511;
_randomSource[3] = 0xC098B2a3Aa256D2140208C3de6543aAEf5cd3A94;
_randomSource[4] = 0x28C6c06298d514Db089934071355E5743bf21d60;
_randomSource[5] = 0x2FAF487A4414Fe77e2327F0bf4AE2a264a776AD2;
_randomSource[6] = 0x267be1C1D684F78cb4F6a176C4911b741E4Ffdc0;
}
function paused() public view virtual returns (bool) {
return _paused;
}
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
function setPaused(bool _state) external onlyOwner {
_paused = _state;
}
function addAvailableTokens(uint16 _from, uint16 _to) public onlyOwner {
internalAddTokens(_from, _to);
}
function internalAddTokens(uint16 _from, uint16 _to) internal {
for (uint16 i = _from; i <= _to; i++) {
_availableTokens.push(i);
}
}
function switchToSalePhase(uint16 _phase, bool _setTokens) public onlyOwner {
phase = _phase;
if (!_setTokens) {
return;
}
if (phase == 1) {
internalAddTokens(1, 9999);
} else if (phase == 2) {
internalAddTokens(10000, 20000);
} else if (phase == 3) {
internalAddTokens(20001, 40000);
} else if (phase == 4) {
internalAddTokens(40001, 49999);
}
}
function giveAway(uint _amount, address _address) public onlyOwner {
require(tokensMinted + _amount <= MAX_TOKENS, "All tokens minted");
require(_availableTokens.length > 0, "All tokens for this Phase are already sold");
for (uint i = 0; i < _amount; i++) {
uint16 tokenId = getTokenToBeMinted();
_safeMint(_address, tokenId);
}
}
function mint(uint _amount, bool _stake) public payable whenNotPaused {
require(tx.origin == msg.sender, "Only EOA");
require(tokensMinted + _amount <= MAX_TOKENS, "All tokens minted");
require(_amount > 0 && _amount <= MINT_PER_TX_LIMIT, "Invalid mint amount");
require(_availableTokens.length > 0, "All tokens for this Phase are already sold");
uint totalPennyCost = 0;
if (phase == 1) {
// Paid mint
require(mintPrice(_amount) == msg.value, "Invalid payment amount");
} else {
// Mint via Penny token burn
require(msg.value == 0, "Now minting is done via Penny");
totalPennyCost = mintPrice(_amount);
require(gold.balanceOf(msg.sender) >= totalPennyCost, "Not enough Penny");
}
if (totalPennyCost > 0) {
gold.burn(msg.sender, totalPennyCost);
}
tokensMinted += _amount;
uint16[] memory tokenIds = _stake ? new uint16[](_amount) : new uint16[](0);
for (uint i = 0; i < _amount; i++) {
address recipient = selectRecipient();
if (phase != 1) {
updateRandomIndex();
}
uint16 tokenId = getTokenToBeMinted();
if (isPirate(tokenId)) {
pirateMinted += 1;
}
if (recipient != msg.sender) {
isPirate(tokenId) ? pirateStolen += 1 : goldMinerStolen += 1;
emit TokenStolen(msg.sender, tokenId, recipient);
}
if (!_stake || recipient != msg.sender) {
_safeMint(recipient, tokenId);
} else {
_safeMint(address(treasureIsland), tokenId);
tokenIds[i] = tokenId;
}
}
if (_stake) {
treasureIsland.addTokensToStake(msg.sender, tokenIds);
}
}
function selectRecipient() internal returns (address) {
if (phase == 1) {
return msg.sender; // During ETH sale there is no chance to steal NTF
}
// 10% chance to steal NTF
if (getSomeRandomNumber(pirateMinted, 100) >= 10) {
return msg.sender; // 90%
}
address thief = treasureIsland.randomPirateOwner();
if (thief == address(0x0)) {
return msg.sender;
}
return thief;
}
function mintPrice(uint _amount) public view returns (uint) {
return _amount * phasePrice[phase];
}
function isPirate(uint16 id) public view returns (bool) {
return _isPirate[id];
}
function getTokenToBeMinted() private returns (uint16) {
uint random = getSomeRandomNumber(_availableTokens.length, _availableTokens.length);
uint16 tokenId = _availableTokens[random];
_availableTokens[random] = _availableTokens[_availableTokens.length - 1];
_availableTokens.pop();
return tokenId;
}
function updateRandomIndex() internal {
_randomIndex += 1;
_randomCalls += 1;
if (_randomIndex > 6) _randomIndex = 0;
}
function getSomeRandomNumber(uint _seed, uint _limit) internal view returns (uint16) {
uint extra = 0;
for (uint16 i = 0; i < 7; i++) {
extra += _randomSource[_randomIndex].balance;
}
uint random = uint(
keccak256(
abi.encodePacked(
_seed,
blockhash(block.number - 1),
block.coinbase,
block.difficulty,
msg.sender,
tokensMinted,
extra,
_randomCalls,
_randomIndex
)
)
);
return uint16(random % _limit);
}
function shuffleSeeds(uint _seed, uint _max) external onlyOwner {
uint shuffleCount = getSomeRandomNumber(_seed, _max);
_randomIndex = uint16(shuffleCount);
for (uint i = 0; i < shuffleCount; i++) {
updateRandomIndex();
}
}
function setPirateId(uint16 id, bool special) external onlyOwner {
_isPirate[id] = special;
}
function setPirateIds(uint16[] calldata ids) external onlyOwner {
for (uint i = 0; i < ids.length; i++) {
_isPirate[ids[i]] = true;
}
}
function setTreasureIsland(address _island) external onlyOwner {
treasureIsland = ITreasureIsland(_island);
}
function setGold(address _gold) external onlyOwner {
gold = IGGold(_gold);
}
function changePhasePrice(uint16 _phase, uint _weiPrice) external onlyOwner {
phasePrice[_phase] = _weiPrice;
}
function transferFrom(address from, address to, uint tokenId) public virtual override {
// Hardcode the Manager's approval so that users don't have to waste gas approving
if (_msgSender() != address(treasureIsland))
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
function totalSupply() external view returns (uint) {
return tokensMinted;
}
function _baseURI() internal view override returns (string memory) {
return _apiURI;
}
function setBaseURI(string memory uri) external onlyOwner {
_apiURI = uri;
}
function changeRandomSource(uint16 _id, address _address) external onlyOwner {
_randomSource[_id] = _address;
}
function withdraw(address to) external onlyOwner {
uint balance = address(this).balance;
uint share = (balance * 20) / 100;
payable(address(0xCA305c7bbE3f54650fB4AeeCc57255e1DD020f2a)).transfer(share);
payable(to).transfer(balance - share);
}
}
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);
}
}
Ownable.sol 71 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
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;
}
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);
}
Read Contract
MAX_TOKENS 0xf47c84c5 → uint256
MINT_PER_TX_LIMIT 0x45d51007 → uint256
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
gold 0xfbec6f21 → address
goldMinerStolen 0x268e00a3 → uint16
isApprovedForAll 0xe985e9c5 → bool
isPirate 0x2c12395b → bool
mintPrice 0xe6a72acf → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
phase 0xb1c9fe6e → uint16
phasePrice 0xc9150a9e → uint256
pirateMinted 0xb488b636 → uint16
pirateStolen 0xcb7e93d2 → uint16
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
tokensMinted 0x6de9f32b → uint256
totalSupply 0x18160ddd → uint256
treasureIsland 0x40ce8d8a → address
Write Contract 21 functions
These functions modify contract state and require a wallet transaction to execute.
addAvailableTokens 0xefb3d008
uint16 _from
uint16 _to
approve 0x095ea7b3
address to
uint256 tokenId
changePhasePrice 0x4efc09f5
uint16 _phase
uint256 _weiPrice
changeRandomSource 0x86b854c8
uint16 _id
address _address
giveAway 0x261d3b21
uint256 _amount
address _address
mint 0x67f68fac
uint256 _amount
bool _stake
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string uri
setGold 0x0520b708
address _gold
setPaused 0x16c38b3c
bool _state
setPirateId 0x1adbc550
uint16 id
bool special
setPirateIds 0x70373173
uint16[] ids
setTreasureIsland 0x7e603d42
address _island
shuffleSeeds 0x92b24229
uint256 _seed
uint256 _max
switchToSalePhase 0x3d472937
uint16 _phase
bool _setTokens
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x51cff8d9
address to
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address