Address Contract Partially Verified
Address
0xdcd9BE0FdFC70fc24ddcF5a4A0EF281EC730AF8E
Balance
0 ETH
Nonce
1
Code Size
16149 bytes
Creator
0x2278C18f...4409 at tx 0xab99d84a...ac8674
Indexed Transactions
0
Contract Bytecode
16149 bytes
0x60806040526004361061033f5760003560e01c806372132870116101b0578063baa551ee116100ec578063cfc86f7b11610095578063ea5cb5321161006f578063ea5cb53214610a0b578063ee40494614610a21578063f2fde38b14610a37578063fdfbe10a14610a5757600080fd5b8063cfc86f7b14610973578063d3b90b3014610988578063e985e9c5146109b557600080fd5b8063c87b56dd116100c6578063c87b56dd14610906578063cad96cca14610926578063cbce4c971461095357600080fd5b8063baa551ee14610869578063c21d0e6e146108ac578063c56597ba146108d957600080fd5b806391b7f5ed11610159578063a22cb46511610133578063a22cb465146107e9578063acec338a14610809578063b88d4fde14610829578063b96502cb1461084957600080fd5b806391b7f5ed146107a157806395d89b41146107c1578063a0712d68146107d657600080fd5b80638be3a8971161018a5780638be3a897146107295780638da5cb5b146107565780638dba521e1461078157600080fd5b8063721328701461069a5780637cb64759146106b05780638924af74146106d057600080fd5b80632f745c591161027f5780634d615d23116102285780636352211e116102025780636352211e146106265780636b0a11761461064657806370a0823114610665578063715018a61461068557600080fd5b80634d615d23146105cc5780634f6ccce7146105e657806355f804b31461060657600080fd5b80633e672ea0116102595780633e672ea0146105765780633f8121a21461058c57806342842e0e146105ac57600080fd5b80632f745c59146105385780632fc37ab2146105585780633ccfd60b1461056e57600080fd5b8063143094db116102ec578063235b6ea1116102c6578063235b6ea1146104a357806323b872dd146104b957806327ed3dce146104d95780632a55205a146104ec57600080fd5b8063143094db1461044f57806318160ddd1461046f5780631c9073601461048e57600080fd5b8063081812fc1161031d578063081812fc146103bd578063095ea7b3146104025780630be702bf1461042257600080fd5b806301ffc9a71461034457806304db5eed1461037957806306fdde031461039b575b600080fd5b34801561035057600080fd5b5061036461035f36600461370e565b610a6d565b60405190151581526020015b60405180910390f35b34801561038557600080fd5b5061039961039436600461372b565b610b22565b005b3480156103a757600080fd5b506103b0610b93565b60405161037091906137ba565b3480156103c957600080fd5b506103dd6103d836600461372b565b610c25565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610370565b34801561040e57600080fd5b5061039961041d3660046137ef565b610ce5565b34801561042e57600080fd5b506018546103dd9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561045b57600080fd5b5061039961046a36600461381b565b610e3e565b34801561047b57600080fd5b506008545b604051908152602001610370565b34801561049a57600080fd5b50610480600a81565b3480156104af57600080fd5b5061048060105481565b3480156104c557600080fd5b506103996104d436600461386e565b610f70565b6103996104e73660046138af565b610ff7565b3480156104f857600080fd5b5061050c61050736600461392a565b6112bb565b6040805173ffffffffffffffffffffffffffffffffffffffff9093168352602083019190915201610370565b34801561054457600080fd5b506104806105533660046137ef565b6113e9565b34801561056457600080fd5b50610480600e5481565b61039961149e565b34801561058257600080fd5b5061048060115481565b34801561059857600080fd5b506103996105a7366004613961565b61166c565b3480156105b857600080fd5b506103996105c736600461386e565b61170a565b3480156105d857600080fd5b50600d546103649060ff1681565b3480156105f257600080fd5b5061048061060136600461372b565b611725565b34801561061257600080fd5b50610399610621366004613a3f565b6117c9565b34801561063257600080fd5b506103dd61064136600461372b565b611847565b34801561065257600080fd5b50600d5461036490610100900460ff1681565b34801561067157600080fd5b50610480610680366004613a88565b6118df565b34801561069157600080fd5b50610399611993565b3480156106a657600080fd5b5061048060125481565b3480156106bc57600080fd5b506103996106cb36600461372b565b611a06565b3480156106dc57600080fd5b506106f06106eb36600461392a565b611a72565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526bffffffffffffffffffffffff909116602083015201610370565b34801561073557600080fd5b506017546103dd9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561076257600080fd5b50600a5473ffffffffffffffffffffffffffffffffffffffff166103dd565b34801561078d57600080fd5b5061039961079c36600461372b565b611ade565b3480156107ad57600080fd5b506103996107bc36600461372b565b611b4a565b3480156107cd57600080fd5b506103b0611bb6565b6103996107e436600461372b565b611bc5565b3480156107f557600080fd5b50610399610804366004613aa5565b611d59565b34801561081557600080fd5b50610399610824366004613961565b611d64565b34801561083557600080fd5b50610399610844366004613ada565b611dfc565b34801561085557600080fd5b5061039961086436600461372b565b611e84565b34801561087557600080fd5b50610480610884366004613a88565b73ffffffffffffffffffffffffffffffffffffffff1660009081526014602052604090205490565b3480156108b857600080fd5b506015546103dd9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156108e557600080fd5b506016546103dd9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561091257600080fd5b506103b061092136600461372b565b611ef0565b34801561093257600080fd5b5061094661094136600461372b565b611fe6565b6040516103709190613bc4565b34801561095f57600080fd5b5061039961096e3660046137ef565b612098565b34801561097f57600080fd5b506103b06121cc565b34801561099457600080fd5b506109a86109a3366004613a88565b61225a565b6040516103709190613bd7565b3480156109c157600080fd5b506103646109d0366004613c1b565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610a1757600080fd5b5061048061271081565b348015610a2d57600080fd5b50610480600f5481565b348015610a4357600080fd5b50610399610a52366004613a88565b6122fc565b348015610a6357600080fd5b5061048060135481565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f44c74bcc000000000000000000000000000000000000000000000000000000001415610ac157506001919050565b7fffffffff0000000000000000000000000000000000000000000000000000000082167f2a55205a000000000000000000000000000000000000000000000000000000001415610b1357506001919050565b610b1c826123f8565b92915050565b600a5473ffffffffffffffffffffffffffffffffffffffff163314610b8e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b601255565b606060008054610ba290613c54565b80601f0160208091040260200160405190810160405280929190818152602001828054610bce90613c54565b8015610c1b5780601f10610bf057610100808354040283529160200191610c1b565b820191906000526020600020905b815481529060010190602001808311610bfe57829003601f168201915b5050505050905090565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff16610cbc5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610b85565b5060009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b6000610cf082611847565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d945760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610b85565b3373ffffffffffffffffffffffffffffffffffffffff82161480610dbd5750610dbd81336109d0565b610e2f5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610b85565b610e39838361244e565b505050565b600a5473ffffffffffffffffffffffffffffffffffffffff163314610ea55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b604080516001808252818301909252600091816020015b6040805180820190915260008082526020820152815260200190600190039081610ebc5790505090508181600081518110610ef957610ef9613ca8565b6020026020010151602001906bffffffffffffffffffffffff1690816bffffffffffffffffffffffff16815250508281600081518110610f3b57610f3b613ca8565b602090810291909101015173ffffffffffffffffffffffffffffffffffffffff9091169052610f6a84826124ee565b50505050565b610f7a33826126b4565b610fec5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610b85565b610e3983838361280a565b600061100260085490565b6040517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b166020820152909150600090603401604051602081830303815290604052805190602001209050600d60019054906101000a900460ff166110ad5760405162461bcd60e51b815260206004820152600a60248201527f4e6f7420616374697665000000000000000000000000000000000000000000006044820152606401610b85565b601154336000908152601460205260409020546110ca9085613d06565b11156111185760405162461bcd60e51b815260206004820152600d60248201527f416d6f756e742064656e696564000000000000000000000000000000000000006044820152606401610b85565b61115985858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600e549150849050612a48565b6111a55760405162461bcd60e51b815260206004820152600f60248201527f496e76616c6964204164647265737300000000000000000000000000000000006044820152606401610b85565b826010546111b39190613d1e565b3410156112025760405162461bcd60e51b815260206004820152601260248201527f496e73756666696369656e7420657468657200000000000000000000000000006044820152606401610b85565b60135461120f8484613d06565b111561125d5760405162461bcd60e51b815260206004820152600d60248201527f537570706c792064656e696564000000000000000000000000000000000000006044820152606401610b85565b60005b838110156112b35761127b336112768386613d06565b612a5e565b33600090815260146020526040812080546001929061129b908490613d06565b909155508190506112ab81613d5b565b915050611260565b505050505050565b6000828152600b60209081526040808320805482518185028101850190935280835284938493929190849084015b8282101561135b576000848152602090819020604080518082019091529084015473ffffffffffffffffffffffffffffffffffffffff811682527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff16818301528252600190920191016112e9565b5050505090506000815111156113d9578060008151811061137e5761137e613ca8565b602002602001015160000151611d4c826000815181106113a0576113a0613ca8565b6020026020010151602001516bffffffffffffffffffffffff16866113c59190613d1e565b6113cf9190613dc3565b92509250506113e2565b60008092509250505b9250929050565b60006113f4836118df565b82106114685760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610b85565b5073ffffffffffffffffffffffffffffffffffffffff919091166000908152600660209081526040808320938352929052205490565b600a5473ffffffffffffffffffffffffffffffffffffffff1633146115055760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b60006005611514476002613d1e565b61151e9190613dc3565b90506000600a61152f476002613d1e565b6115399190613dc3565b90506000600a61154a476002613d1e565b6115549190613dc3565b90506000600a611565476002613d1e565b61156f9190613dc3565b60155460405191925073ffffffffffffffffffffffffffffffffffffffff169085156108fc029086906000818181858888f193505050506115af57600080fd5b60165460405173ffffffffffffffffffffffffffffffffffffffff9091169084156108fc029085906000818181858888f193505050506115ee57600080fd5b60175460405173ffffffffffffffffffffffffffffffffffffffff9091169083156108fc029084906000818181858888f1935050505061162d57600080fd5b60185460405173ffffffffffffffffffffffffffffffffffffffff9091169082156108fc029083906000818181858888f19350505050610f6a57600080fd5b600a5473ffffffffffffffffffffffffffffffffffffffff1633146116d35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b600d8054911515610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909216919091179055565b610e3983838360405180602001604052806000815250611dfc565b600061173060085490565b82106117a45760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610b85565b600882815481106117b7576117b7613ca8565b90600052602060002001549050919050565b600a5473ffffffffffffffffffffffffffffffffffffffff1633146118305760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b805161184390600c906020840190613647565b5050565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff1680610b1c5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610b85565b600073ffffffffffffffffffffffffffffffffffffffff821661196a5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610b85565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b600a5473ffffffffffffffffffffffffffffffffffffffff1633146119fa5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b611a046000612a78565b565b600a5473ffffffffffffffffffffffffffffffffffffffff163314611a6d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b600e55565b600b6020528160005260406000208181548110611a8e57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff811692507401000000000000000000000000000000000000000090046bffffffffffffffffffffffff16905082565b600a5473ffffffffffffffffffffffffffffffffffffffff163314611b455760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b601155565b600a5473ffffffffffffffffffffffffffffffffffffffff163314611bb15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b601055565b606060018054610ba290613c54565b6000611bd060085490565b600d5490915060ff16611c255760405162461bcd60e51b815260206004820152600a60248201527f4e6f7420616374697665000000000000000000000000000000000000000000006044820152606401610b85565b600a821115611c765760405162461bcd60e51b815260206004820152600d60248201527f416d6f756e742064656e696564000000000000000000000000000000000000006044820152606401610b85565b81601054611c849190613d1e565b341015611cd35760405162461bcd60e51b815260206004820152601260248201527f496e73756666696369656e7420657468657200000000000000000000000000006044820152606401610b85565b601254611ce08383613d06565b1115611d2e5760405162461bcd60e51b815260206004820152600d60248201527f537570706c792064656e696564000000000000000000000000000000000000006044820152606401610b85565b60005b82811015610e3957611d47336112768385613d06565b80611d5181613d5b565b915050611d31565b611843338383612aef565b600a5473ffffffffffffffffffffffffffffffffffffffff163314611dcb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b600d80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b611e0633836126b4565b611e785760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610b85565b610f6a84848484612c03565b600a5473ffffffffffffffffffffffffffffffffffffffff163314611eeb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b601355565b60008181526002602052604090205460609073ffffffffffffffffffffffffffffffffffffffff16611f8a5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610b85565b6000611f94612c8c565b90506000815111611fb45760405180602001604052806000815250611fdf565b80611fbe84612c9b565b604051602001611fcf929190613dd7565b6040516020818303038152906040525b9392505050565b6060600b6000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561208d576000848152602090819020604080518082019091529084015473ffffffffffffffffffffffffffffffffffffffff811682527401000000000000000000000000000000000000000090046bffffffffffffffffffffffff168183015282526001909201910161201b565b505050509050919050565b600a5473ffffffffffffffffffffffffffffffffffffffff1633146120ff5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b600061210a60085490565b9050600f548211156121845760405162461bcd60e51b815260206004820152602b60248201527f47696674207265736572766520657863656564656420776974682070726f766960448201527f64656420616d6f756e742e0000000000000000000000000000000000000000006064820152608401610b85565b60005b828110156121af5761219d846112768385613d06565b806121a781613d5b565b915050612187565b5081600f60008282546121c29190613e06565b9091555050505050565b600c80546121d990613c54565b80601f016020809104026020016040519081016040528092919081815260200182805461220590613c54565b80156122525780601f1061222757610100808354040283529160200191612252565b820191906000526020600020905b81548152906001019060200180831161223557829003601f168201915b505050505081565b60606000612267836118df565b905060008167ffffffffffffffff8111156122845761228461397c565b6040519080825280602002602001820160405280156122ad578160200160208202803683370190505b50905060005b828110156122f4576122c585826113e9565b8282815181106122d7576122d7613ca8565b6020908102919091010152806122ec81613d5b565b9150506122b3565b509392505050565b600a5473ffffffffffffffffffffffffffffffffffffffff1633146123635760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610b85565b73ffffffffffffffffffffffffffffffffffffffff81166123ec5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610b85565b6123f581612a78565b50565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d63000000000000000000000000000000000000000000000000000000001480610b1c5750610b1c82612dcd565b600081815260046020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841690811790915581906124a882611847565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60005b81518110156126a957600073ffffffffffffffffffffffffffffffffffffffff1682828151811061252457612524613ca8565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1614156125945760405162461bcd60e51b815260206004820152601b60248201527f526563697069656e742073686f756c642062652070726573656e7400000000006044820152606401610b85565b8181815181106125a6576125a6613ca8565b6020026020010151602001516bffffffffffffffffffffffff16600014156126105760405162461bcd60e51b815260206004820181905260248201527f526f79616c74792076616c75652073686f756c6420626520706f7369746976656044820152606401610b85565b6000838152600b60205260409020825183908390811061263257612632613ca8565b6020908102919091018101518254600181018455600093845292829020815191909201516bffffffffffffffffffffffff16740100000000000000000000000000000000000000000273ffffffffffffffffffffffffffffffffffffffff90911617910155806126a181613d5b565b9150506124f1565b506118438282612eb0565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff1661274b5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610b85565b600061275683611847565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806127c557508373ffffffffffffffffffffffffffffffffffffffff166127ad84610c25565b73ffffffffffffffffffffffffffffffffffffffff16145b80612802575073ffffffffffffffffffffffffffffffffffffffff80821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b8273ffffffffffffffffffffffffffffffffffffffff1661282a82611847565b73ffffffffffffffffffffffffffffffffffffffff16146128b35760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610b85565b73ffffffffffffffffffffffffffffffffffffffff821661293b5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610b85565b612946838383612eed565b61295160008261244e565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120805460019290612987908490613e06565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526003602052604081208054600192906129c2908490613d06565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600082612a558584612ff3565b14949350505050565b611843828260405180602001604052806000815250613097565b600a805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612b6b5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b85565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526005602090815260408083209487168084529482529182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612c0e84848461280a565b612c1a84848484613120565b610f6a5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610b85565b6060600c8054610ba290613c54565b606081612cdb57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115612d055780612cef81613d5b565b9150612cfe9050600a83613dc3565b9150612cdf565b60008167ffffffffffffffff811115612d2057612d2061397c565b6040519080825280601f01601f191660200182016040528015612d4a576020820181803683370190505b5090505b841561280257612d5f600183613e06565b9150612d6c600a86613e1d565b612d77906030613d06565b60f81b818381518110612d8c57612d8c613ca8565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612dc6600a86613dc3565b9450612d4e565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480612e6057507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610b1c57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610b1c565b7f3fa96d7b6bcbfe71ef171666d84db3cf52fa2d1c8afdb1cc8e486177f208b7df8282604051612ee1929190613e31565b60405180910390a15050565b73ffffffffffffffffffffffffffffffffffffffff8316612f5557612f5081600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612f92565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612f9257612f9283826132f6565b73ffffffffffffffffffffffffffffffffffffffff8216612fb657610e39816133ad565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610e3957610e39828261345c565b600081815b84518110156122f457600085828151811061301557613015613ca8565b60200260200101519050808311613057576040805160208101859052908101829052606001604051602081830303815290604052805190602001209250613084565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061308f81613d5b565b915050612ff8565b6130a183836134ad565b6130ae6000848484613120565b610e395760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610b85565b600073ffffffffffffffffffffffffffffffffffffffff84163b156132eb576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a0290613197903390899088908890600401613e4a565b6020604051808303816000875af19250505080156131f0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526131ed91810190613e93565b60015b6132a0573d80801561321e576040519150601f19603f3d011682016040523d82523d6000602084013e613223565b606091505b5080516132985760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610b85565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050612802565b506001949350505050565b60006001613303846118df565b61330d9190613e06565b60008381526007602052604090205490915080821461336d5773ffffffffffffffffffffffffffffffffffffffff841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b50600091825260076020908152604080842084905573ffffffffffffffffffffffffffffffffffffffff9094168352600681528383209183525290812055565b6008546000906133bf90600190613e06565b600083815260096020526040812054600880549394509092849081106133e7576133e7613ca8565b90600052602060002001549050806008838154811061340857613408613ca8565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061344057613440613eb0565b6001900381819060005260206000200160009055905550505050565b6000613467836118df565b73ffffffffffffffffffffffffffffffffffffffff9093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b73ffffffffffffffffffffffffffffffffffffffff82166135105760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b85565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16156135825760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b85565b61358e60008383612eed565b73ffffffffffffffffffffffffffffffffffffffff821660009081526003602052604081208054600192906135c4908490613d06565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805461365390613c54565b90600052602060002090601f01602090048101928261367557600085556136bb565b82601f1061368e57805160ff19168380011785556136bb565b828001600101855582156136bb579182015b828111156136bb5782518255916020019190600101906136a0565b506136c79291506136cb565b5090565b5b808211156136c757600081556001016136cc565b7fffffffff00000000000000000000000000000000000000000000000000000000811681146123f557600080fd5b60006020828403121561372057600080fd5b8135611fdf816136e0565b60006020828403121561373d57600080fd5b5035919050565b60005b8381101561375f578181015183820152602001613747565b83811115610f6a5750506000910152565b60008151808452613788816020860160208601613744565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000611fdf6020830184613770565b73ffffffffffffffffffffffffffffffffffffffff811681146123f557600080fd5b6000806040838503121561380257600080fd5b823561380d816137cd565b946020939093013593505050565b60008060006060848603121561383057600080fd5b833592506020840135613842816137cd565b915060408401356bffffffffffffffffffffffff8116811461386357600080fd5b809150509250925092565b60008060006060848603121561388357600080fd5b833561388e816137cd565b9250602084013561389e816137cd565b929592945050506040919091013590565b6000806000604084860312156138c457600080fd5b833567ffffffffffffffff808211156138dc57600080fd5b818601915086601f8301126138f057600080fd5b8135818111156138ff57600080fd5b8760208260051b850101111561391457600080fd5b6020928301989097509590910135949350505050565b6000806040838503121561393d57600080fd5b50508035926020909101359150565b8035801515811461395c57600080fd5b919050565b60006020828403121561397357600080fd5b611fdf8261394c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600067ffffffffffffffff808411156139c6576139c661397c565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715613a0c57613a0c61397c565b81604052809350858152868686011115613a2557600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215613a5157600080fd5b813567ffffffffffffffff811115613a6857600080fd5b8201601f81018413613a7957600080fd5b612802848235602084016139ab565b600060208284031215613a9a57600080fd5b8135611fdf816137cd565b60008060408385031215613ab857600080fd5b8235613ac3816137cd565b9150613ad16020840161394c565b90509250929050565b60008060008060808587031215613af057600080fd5b8435613afb816137cd565b93506020850135613b0b816137cd565b925060408501359150606085013567ffffffffffffffff811115613b2e57600080fd5b8501601f81018713613b3f57600080fd5b613b4e878235602084016139ab565b91505092959194509250565b600081518084526020808501945080840160005b83811015613bb9578151805173ffffffffffffffffffffffffffffffffffffffff1688528301516bffffffffffffffffffffffff168388015260409096019590820190600101613b6e565b509495945050505050565b602081526000611fdf6020830184613b5a565b6020808252825182820181905260009190848201906040850190845b81811015613c0f57835183529284019291840191600101613bf3565b50909695505050505050565b60008060408385031215613c2e57600080fd5b8235613c39816137cd565b91506020830135613c49816137cd565b809150509250929050565b600181811c90821680613c6857607f821691505b60208210811415613ca2577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115613d1957613d19613cd7565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613d5657613d56613cd7565b500290565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613d8d57613d8d613cd7565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600082613dd257613dd2613d94565b500490565b60008351613de9818460208801613744565b835190830190613dfd818360208801613744565b01949350505050565b600082821015613e1857613e18613cd7565b500390565b600082613e2c57613e2c613d94565b500690565b8281526040602082015260006128026040830184613b5a565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015260806060830152613e896080830184613770565b9695505050505050565b600060208284031215613ea557600080fd5b8151611fdf816136e0565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea2646970667358221220b8a0ca5883a6638237aa2f8b1ac1b878d34e6433b4e10a055f870a8cd37c32d064736f6c634300080c0033
Verified Source Code Partial Match
Compiler: v0.8.12+commit.f00d7308
EVM: london
Optimization: Yes (20000 runs)
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
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;
}
}
ERC721.sol 424 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./IERC721Metadata.sol";
import "./Address.sol";
import "./Context.sol";
import "./Strings.sol";
import "./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 {
_setApprovalForAll(_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 Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @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 {}
}
Address.sol 217 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)
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 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
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;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
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);
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "./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;
}
LibPart.sol 16 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library LibPart {
bytes32 public constant TYPE_HASH = keccak256("Part(address account,uint96 value)");
struct Part {
address payable account;
uint96 value;
}
function hash(Part memory part) internal pure returns (bytes32) {
return keccak256(abi.encode(TYPE_HASH, part.account, part.value));
}
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "./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() {
_transferOwnership(_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 {
_transferOwnership(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");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
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);
}
}
MerkleProof.sol 52 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}
return computedHash;
}
}
RoyaltiesV2.sol 11 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./LibPart.sol";
interface RoyaltiesV2 {
event RoyaltiesSet(uint256 tokenId, LibPart.Part[] royalties);
function getRaribleV2Royalties(uint256 id) external view returns (LibPart.Part[] memory);
}
toksinvasion.sol 168 lines
// SPDX-License-Identifier: MIT
// Contract by TOKS
pragma solidity ^0.8.7;
import "./ERC721Enumerable.sol";
import "./Ownable.sol";
import "./MerkleProof.sol";
import "./RoyaltiesV2Impl.sol";
import "./LibPart.sol";
import "./LibRoyaltiesV2.sol";
contract toksinvasion is ERC721Enumerable, Ownable, RoyaltiesV2Impl {
using Strings for uint256;
string public _baseTokenURI;
bool public _active = false;
bool public _presaleActive = false;
bytes32 public _merkleRoot = 0x3454ba2028cca49223166a1b2b5f75c59cfeaa353eced6a39bd596a31a5fe29e;
uint256 public _gifts = 300;
uint256 public _price = 0.05 ether;
uint256 public _presaleMintLimit = 2;
uint256 public constant _MINT_LIMIT = 10;
uint256 public constant _SUPPLY = 10000;
uint256 public _SALE_SUPPLY = 3200;
uint256 public _PRESALE_SUPPLY = 6500;
mapping(address => uint256) private _claimed;
address public _v1 = 0xB72b8e32860fEB870553D00F421311008a93236C;
address public _v2 = 0x0d35F889C276b8566DB407fB6BD240388Fb3EdeB;
address public _v3 = 0x0dB9a71032A1573a0C8ecfC18E99333Bc2e8503E;
address public _v4 = 0xa28A7bBa6d373805C0E7afC9044F17EAbF3C066E;
bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a;
constructor() ERC721("TOKS ATTACK!", "TOKS") {}
function _baseURI() internal view virtual override returns (string memory) {
return _baseTokenURI;
}
function setBaseURI(string memory baseURI) public onlyOwner {
_baseTokenURI = baseURI;
}
function setActive(bool active) public onlyOwner {
_active = active;
}
function setPresaleActive(bool presaleActive) public onlyOwner {
_presaleActive = presaleActive;
}
function setSaleSupply(uint256 saleSupply) public onlyOwner {
_SALE_SUPPLY= saleSupply;
}
function setPresaleSupply(uint256 presaleSupply) public onlyOwner {
_PRESALE_SUPPLY= presaleSupply;
}
function setPresaleMintLimit(uint256 presaleMintLimit) public onlyOwner {
_presaleMintLimit = presaleMintLimit;
}
function setMerkleRoot(bytes32 merkleRoot) public onlyOwner {
_merkleRoot = merkleRoot;
}
function setPrice(uint256 price) public onlyOwner {
_price = price;
}
function setRoyalties(uint _tokenId, address payable _royaltiesReceipientAddress, uint96 _percentageBasisPoints) public onlyOwner {
LibPart.Part[] memory _royalties = new LibPart.Part[](1);
_royalties[0].value = _percentageBasisPoints;
_royalties[0].account = _royaltiesReceipientAddress;
_saveRoyalties(_tokenId, _royalties);
}
function royaltyInfo(uint256 _tokenId, uint256 _secndprice) external view returns (address receiver, uint256 royaltyAmount) {
LibPart.Part[] memory _royalties = royalties[_tokenId];
if(_royalties.length > 0) {
return (_royalties[0].account, (_secndprice * _royalties[0].value)/7500);
}
return (address(0), 0);
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Enumerable) returns (bool) {
if(interfaceId == LibRoyaltiesV2._INTERFACE_ID_ROYALTIES) {
return true;
}
if(interfaceId == _INTERFACE_ID_ERC2981) {
return true;
}
return super.supportsInterface(interfaceId);
}
function getTokensByWallet(address _owner) public view returns(uint256[] memory) {
uint256 tokenCount = balanceOf(_owner);
uint256[] memory tokensId = new uint256[](tokenCount);
for(uint256 i; i < tokenCount; i++){
tokensId[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokensId;
}
function getPresaleMints(address owner) public view returns (uint256){
return _claimed[owner];
}
function gift(address _to, uint256 _amount) public onlyOwner {
uint256 supply = totalSupply();
require(_amount <= _gifts, "Gift reserve exceeded with provided amount.");
for(uint256 i; i < _amount; i++){
_safeMint( _to, supply + i );
}
_gifts -= _amount;
}
function mint(uint256 _amount) public payable {
uint256 supply = totalSupply();
require( _active, "Not active");
require( _amount <= _MINT_LIMIT, "Amount denied");
require( msg.value >= _price * _amount, "Insufficient ether");
require( supply + _amount <= _SALE_SUPPLY, "Supply denied");
for(uint256 i; i < _amount; i++){
_safeMint( msg.sender, supply + i );
}
}
function presale(bytes32[] calldata _merkleProof, uint256 _amount) public payable {
uint256 supply = totalSupply();
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require( _presaleActive, "Not active");
require( _amount + _claimed[msg.sender] <= _presaleMintLimit, "Amount denied");
require( MerkleProof.verify(_merkleProof, _merkleRoot, leaf), "Invalid Address");
require( msg.value >= _price * _amount, "Insufficient ether");
require( supply + _amount <= _PRESALE_SUPPLY, "Supply denied");
for(uint256 i; i < _amount; i++){
_safeMint( msg.sender, supply + i );
_claimed[msg.sender] += 1;
}
}
function withdraw() public payable onlyOwner {
uint256 _p1 = address(this).balance * 2 / 5;
uint256 _p2 = address(this).balance * 2 / 10;
uint256 _p3 = address(this).balance * 2 / 10;
uint256 _p4 = address(this).balance * 2 / 10;
require(payable(_v1).send(_p1));
require(payable(_v2).send(_p2));
require(payable(_v3).send(_p3));
require(payable(_v4).send(_p4));
}
}
LibRoyaltiesV2.sol 10 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library LibRoyaltiesV2 {
/*
* bytes4(keccak256('getRoyalties(LibAsset.AssetType)')) == 0x44c74bcc
*/
bytes4 constant _INTERFACE_ID_ROYALTIES = 0x44c74bcc;
}
IERC721Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
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);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)
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);
}
RoyaltiesV2Impl.sol 16 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./AbstractRoyalties.sol";
import "./RoyaltiesV2.sol";
contract RoyaltiesV2Impl is AbstractRoyalties, RoyaltiesV2 {
function getRaribleV2Royalties(uint256 id) override external view returns (LibPart.Part[] memory) {
return royalties[id];
}
function _onRoyaltiesSet(uint256 _id, LibPart.Part[] memory _royalties) override internal {
emit RoyaltiesSet(_id, _royalties);
}
}
ERC721Enumerable.sol 163 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)
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();
}
}
AbstractRoyalties.sol 29 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./LibPart.sol";
abstract contract AbstractRoyalties {
mapping (uint256 => LibPart.Part[]) public royalties;
function _saveRoyalties(uint256 _id, LibPart.Part[] memory _royalties) internal {
for (uint i = 0; i < _royalties.length; i++) {
require(_royalties[i].account != address(0x0), "Recipient should be present");
require(_royalties[i].value != 0, "Royalty value should be positive");
royalties[_id].push(_royalties[i]);
}
_onRoyaltiesSet(_id, _royalties);
}
function _updateAccount(uint256 _id, address _from, address _to) internal {
uint length = royalties[_id].length;
for(uint i = 0; i < length; i++) {
if (royalties[_id][i].account == _from) {
royalties[_id][i].account = payable(address(uint160(_to)));
}
}
}
function _onRoyaltiesSet(uint256 _id, LibPart.Part[] memory _royalties) virtual internal;
}
IERC721Enumerable.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol)
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
_MINT_LIMIT 0x1c907360 → uint256
_PRESALE_SUPPLY 0xfdfbe10a → uint256
_SALE_SUPPLY 0x72132870 → uint256
_SUPPLY 0xea5cb532 → uint256
_active 0x4d615d23 → bool
_baseTokenURI 0xcfc86f7b → string
_gifts 0xee404946 → uint256
_merkleRoot 0x2fc37ab2 → bytes32
_presaleActive 0x6b0a1176 → bool
_presaleMintLimit 0x3e672ea0 → uint256
_price 0x235b6ea1 → uint256
_v1 0xc21d0e6e → address
_v2 0xc56597ba → address
_v3 0x8be3a897 → address
_v4 0x0be702bf → address
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
getPresaleMints 0xbaa551ee → uint256
getRaribleV2Royalties 0xcad96cca → tuple[]
getTokensByWallet 0xd3b90b30 → uint256[]
isApprovedForAll 0xe985e9c5 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
royalties 0x8924af74 → address, uint96
royaltyInfo 0x2a55205a → address, uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 20 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
gift 0xcbce4c97
address _to
uint256 _amount
mint 0xa0712d68
uint256 _amount
presale 0x27ed3dce
bytes32[] _merkleProof
uint256 _amount
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setActive 0xacec338a
bool active
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string baseURI
setMerkleRoot 0x7cb64759
bytes32 merkleRoot
setPresaleActive 0x3f8121a2
bool presaleActive
setPresaleMintLimit 0x8dba521e
uint256 presaleMintLimit
setPresaleSupply 0xb96502cb
uint256 presaleSupply
setPrice 0x91b7f5ed
uint256 price
setRoyalties 0x143094db
uint256 _tokenId
address _royaltiesReceipientAddress
uint96 _percentageBasisPoints
setSaleSupply 0x04db5eed
uint256 saleSupply
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address