Address Contract Partially Verified
Address
0x2F2Bf605a92cB450740985611bb9414fB4aA7E2d
Balance
0 ETH
Nonce
1
Code Size
14822 bytes
Creator
0x6297A69E...8263 at tx 0xbe7d966a...cf30f6
Indexed Transactions
0
Contract Bytecode
14822 bytes
0x60806040526004361061023b5760003560e01c806370a082311161012e578063b88d4fde116100ab578063e268e4d31161006f578063e268e4d31461080a578063e985e9c514610833578063efbd73f414610870578063f2fde38b14610899578063f676308a146108c25761023b565b8063b88d4fde14610720578063c87b56dd1461073c578063d5abeb0114610779578063e0a80853146107a4578063e0ec7c36146107cd5761023b565b806395d89b41116100f257806395d89b411461065c578063a0712d6814610687578063a22cb465146106a3578063a45ba8e7146106cc578063b071401b146106f75761023b565b806370a0823114610589578063715018a6146105c65780637ec4a659146105dd5780638da5cb5b1461060657806394354fd0146106315761023b565b80633ccfd60b116101bc578063518302271161018057806351830227146104a05780635503a0e8146104cb5780635c975abb146104f657806362b99ad4146105215780636352211e1461054c5761023b565b80633ccfd60b146103f057806342842e0e1461040757806344a0d68a14610423578063453c23101461044c5780634fdd43cb146104775761023b565b806316ba10e01161020357806316ba10e01461032c57806316c38b3c1461035557806318160ddd1461037e57806323b872dd146103a957806324a6ab0c146103c55761023b565b806301ffc9a71461024057806306fdde031461027d578063081812fc146102a8578063095ea7b3146102e557806313faede614610301575b600080fd5b34801561024c57600080fd5b506102676004803603810190610262919061271e565b6108eb565b6040516102749190612766565b60405180910390f35b34801561028957600080fd5b5061029261097d565b60405161029f9190612811565b60405180910390f35b3480156102b457600080fd5b506102cf60048036038101906102ca9190612869565b610a0f565b6040516102dc91906128d7565b60405180910390f35b6102ff60048036038101906102fa919061291e565b610a8e565b005b34801561030d57600080fd5b50610316610bd2565b604051610323919061296d565b60405180910390f35b34801561033857600080fd5b50610353600480360381019061034e9190612abd565b610bd8565b005b34801561036157600080fd5b5061037c60048036038101906103779190612b32565b610bf3565b005b34801561038a57600080fd5b50610393610c18565b6040516103a0919061296d565b60405180910390f35b6103c360048036038101906103be9190612b5f565b610c2f565b005b3480156103d157600080fd5b506103da610f51565b6040516103e7919061296d565b60405180910390f35b3480156103fc57600080fd5b50610405610f57565b005b610421600480360381019061041c9190612b5f565b610fef565b005b34801561042f57600080fd5b5061044a60048036038101906104459190612869565b61100f565b005b34801561045857600080fd5b50610461611021565b60405161046e919061296d565b60405180910390f35b34801561048357600080fd5b5061049e60048036038101906104999190612abd565b611027565b005b3480156104ac57600080fd5b506104b5611042565b6040516104c29190612766565b60405180910390f35b3480156104d757600080fd5b506104e0611055565b6040516104ed9190612811565b60405180910390f35b34801561050257600080fd5b5061050b6110e3565b6040516105189190612766565b60405180910390f35b34801561052d57600080fd5b506105366110f6565b6040516105439190612811565b60405180910390f35b34801561055857600080fd5b50610573600480360381019061056e9190612869565b611184565b60405161058091906128d7565b60405180910390f35b34801561059557600080fd5b506105b060048036038101906105ab9190612bb2565b611196565b6040516105bd919061296d565b60405180910390f35b3480156105d257600080fd5b506105db61124e565b005b3480156105e957600080fd5b5061060460048036038101906105ff9190612abd565b611262565b005b34801561061257600080fd5b5061061b61127d565b60405161062891906128d7565b60405180910390f35b34801561063d57600080fd5b506106466112a7565b604051610653919061296d565b60405180910390f35b34801561066857600080fd5b506106716112ad565b60405161067e9190612811565b60405180910390f35b6106a1600480360381019061069c9190612869565b61133f565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612bdf565b611607565b005b3480156106d857600080fd5b506106e1611712565b6040516106ee9190612811565b60405180910390f35b34801561070357600080fd5b5061071e60048036038101906107199190612869565b6117a0565b005b61073a60048036038101906107359190612cc0565b6117b2565b005b34801561074857600080fd5b50610763600480360381019061075e9190612869565b611825565b6040516107709190612811565b60405180910390f35b34801561078557600080fd5b5061078e61197d565b60405161079b919061296d565b60405180910390f35b3480156107b057600080fd5b506107cb60048036038101906107c69190612b32565b611983565b005b3480156107d957600080fd5b506107f460048036038101906107ef9190612bb2565b6119a8565b6040516108019190612766565b60405180910390f35b34801561081657600080fd5b50610831600480360381019061082c9190612869565b6119c8565b005b34801561083f57600080fd5b5061085a60048036038101906108559190612d43565b6119da565b6040516108679190612766565b60405180910390f35b34801561087c57600080fd5b5061089760048036038101906108929190612d83565b611a6e565b005b3480156108a557600080fd5b506108c060048036038101906108bb9190612bb2565b611b8d565b005b3480156108ce57600080fd5b506108e960048036038101906108e49190612869565b611c10565b005b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061094657506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806109765750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b60606002805461098c90612df2565b80601f01602080910402602001604051908101604052809291908181526020018280546109b890612df2565b8015610a055780601f106109da57610100808354040283529160200191610a05565b820191906000526020600020905b8154815290600101906020018083116109e857829003601f168201915b5050505050905090565b6000610a1a82611c22565b610a50576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610a9982611184565b90508073ffffffffffffffffffffffffffffffffffffffff16610aba611c81565b73ffffffffffffffffffffffffffffffffffffffff1614610b1d57610ae681610ae1611c81565b6119da565b610b1c576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b826006600084815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b600d5481565b610be0611c89565b80600b9081610bef9190612fcf565b5050565b610bfb611c89565b80601260006101000a81548160ff02191690831515021790555050565b6000610c22611d07565b6001546000540303905090565b6000610c3a82611d0c565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610ca1576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080610cad84611dd8565b91509150610cc38187610cbe611c81565b611dff565b610d0f57610cd886610cd3611c81565b6119da565b610d0e576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603610d75576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d828686866001611e43565b8015610d8d57600082555b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001900391905081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815460010191905081905550610e5b85610e37888887611e49565b7c020000000000000000000000000000000000000000000000000000000017611e71565b600460008681526020019081526020016000208190555060007c0200000000000000000000000000000000000000000000000000000000841603610ee15760006001850190506000600460008381526020019081526020016000205403610edf576000548114610ede578360046000838152602001908152602001600020819055505b5b505b838573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4610f498686866001611e9c565b505050505050565b600f5481565b610f5f611c89565b610f67611ea2565b6000610f7161127d565b73ffffffffffffffffffffffffffffffffffffffff1647604051610f94906130d2565b60006040518083038185875af1925050503d8060008114610fd1576040519150601f19603f3d011682016040523d82523d6000602084013e610fd6565b606091505b5050905080610fe457600080fd5b50610fed611ef1565b565b61100a838383604051806020016040528060008152506117b2565b505050565b611017611c89565b80600d8190555050565b60105481565b61102f611c89565b80600c908161103e9190612fcf565b5050565b601260019054906101000a900460ff1681565b600b805461106290612df2565b80601f016020809104026020016040519081016040528092919081815260200182805461108e90612df2565b80156110db5780601f106110b0576101008083540402835291602001916110db565b820191906000526020600020905b8154815290600101906020018083116110be57829003601f168201915b505050505081565b601260009054906101000a900460ff1681565b600a805461110390612df2565b80601f016020809104026020016040519081016040528092919081815260200182805461112f90612df2565b801561117c5780601f106111515761010080835404028352916020019161117c565b820191906000526020600020905b81548152906001019060200180831161115f57829003601f168201915b505050505081565b600061118f82611d0c565b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111fd576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054169050919050565b611256611c89565b6112606000611efb565b565b61126a611c89565b80600a90816112799190612fcf565b5050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60115481565b6060600380546112bc90612df2565b80601f01602080910402602001604051908101604052809291908181526020018280546112e890612df2565b80156113355780601f1061130a57610100808354040283529160200191611335565b820191906000526020600020905b81548152906001019060200180831161131857829003601f168201915b5050505050905090565b601260009054906101000a900460ff161561138f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138690613133565b60405180910390fd5b600e548161139b610c18565b6113a59190613182565b11156113e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113dd90613202565b60405180910390fd5b60006113f133611fc1565b905060105482826114029190613182565b1115611443576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143a90613294565b60405180910390fd5b60008082036114f35760018361145991906132b4565b90506000831161149e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149590613334565b60405180910390fd5b80600d546114ac9190613354565b3410156114ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e5906133e2565b60405180910390fd5b6115f8565b82905060008311611539576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153090613334565b60405180910390fd5b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159e9061344e565b60405180910390fd5b80600d546115b59190613354565b3410156115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906133e2565b60405180910390fd5b5b6116023384612018565b505050565b8060076000611614611c81565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff166116c1611c81565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516117069190612766565b60405180910390a35050565b600c805461171f90612df2565b80601f016020809104026020016040519081016040528092919081815260200182805461174b90612df2565b80156117985780601f1061176d57610100808354040283529160200191611798565b820191906000526020600020905b81548152906001019060200180831161177b57829003601f168201915b505050505081565b6117a8611c89565b8060118190555050565b6117bd848484610c2f565b60008373ffffffffffffffffffffffffffffffffffffffff163b1461181f576117e884848484612036565b61181e576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b50505050565b606061183082611c22565b61186f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611866906134e0565b60405180910390fd5b60001515601260019054906101000a900460ff1615150361191c57600c805461189790612df2565b80601f01602080910402602001604051908101604052809291908181526020018280546118c390612df2565b80156119105780601f106118e557610100808354040283529160200191611910565b820191906000526020600020905b8154815290600101906020018083116118f357829003601f168201915b50505050509050611978565b6000611926612186565b905060008151116119465760405180602001604052806000815250611974565b8061195084612218565b600b604051602001611964939291906135bf565b6040516020818303038152906040525b9150505b919050565b600e5481565b61198b611c89565b80601260016101000a81548160ff02191690831515021790555050565b60136020528060005260406000206000915054906101000a900460ff1681565b6119d0611c89565b8060108190555050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b81600081118015611a8157506011548111155b611ac0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab79061363c565b60405180910390fd5b601054611ad3611ace6122e6565b611196565b82611ade9190613182565b1115611b1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b16906136a8565b60405180910390fd5b600e5481611b2b610c18565b611b359190613182565b1115611b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6d90613714565b60405180910390fd5b611b7e611c89565b611b888284612018565b505050565b611b95611c89565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611c04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfb906137a6565b60405180910390fd5b611c0d81611efb565b50565b611c18611c89565b80600f8190555050565b600081611c2d611d07565b11158015611c3c575060005482105b8015611c7a575060007c0100000000000000000000000000000000000000000000000000000000600460008581526020019081526020016000205416145b9050919050565b600033905090565b611c916122e6565b73ffffffffffffffffffffffffffffffffffffffff16611caf61127d565b73ffffffffffffffffffffffffffffffffffffffff1614611d05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cfc90613812565b60405180910390fd5b565b600090565b60008082905080611d1b611d07565b11611da157600054811015611da05760006004600083815260200190815260200160002054905060007c0100000000000000000000000000000000000000000000000000000000821603611d9e575b60008103611d94576004600083600190039350838152602001908152602001600020549050611d6a565b8092505050611dd3565b505b5b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b60008060006006600085815260200190815260200160002090508092508254915050915091565b600073ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b60008060e883901c905060e8611e608686846122ee565b62ffffff16901b9150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b600260095403611ee7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ede9061387e565b60405180910390fd5b6002600981905550565b6001600981905550565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600067ffffffffffffffff6040600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054901c169050919050565b6120328282604051806020016040528060008152506122f7565b5050565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a0261205c611c81565b8786866040518563ffffffff1660e01b815260040161207e94939291906138f3565b6020604051808303816000875af19250505080156120ba57506040513d601f19601f820116820180604052508101906120b79190613954565b60015b612133573d80600081146120ea576040519150601f19603f3d011682016040523d82523d6000602084013e6120ef565b606091505b50600081510361212b576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b6060600a805461219590612df2565b80601f01602080910402602001604051908101604052809291908181526020018280546121c190612df2565b801561220e5780601f106121e35761010080835404028352916020019161220e565b820191906000526020600020905b8154815290600101906020018083116121f157829003601f168201915b5050505050905090565b60606000600161222784612394565b01905060008167ffffffffffffffff81111561224657612245612992565b5b6040519080825280601f01601f1916602001820160405280156122785781602001600182028036833780820191505090505b509050600082602001820190505b6001156122db578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85816122cf576122ce613981565b5b04945060008503612286575b819350505050919050565b600033905090565b60009392505050565b61230183836124e7565b60008373ffffffffffffffffffffffffffffffffffffffff163b1461238f57600080549050600083820390505b6123416000868380600101945086612036565b612377576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81811061232e57816000541461238c57600080fd5b50505b505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106123f2577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816123e8576123e7613981565b5b0492506040810190505b6d04ee2d6d415b85acef8100000000831061242f576d04ee2d6d415b85acef8100000000838161242557612424613981565b5b0492506020810190505b662386f26fc10000831061245e57662386f26fc10000838161245457612453613981565b5b0492506010810190505b6305f5e1008310612487576305f5e100838161247d5761247c613981565b5b0492506008810190505b61271083106124ac5761271083816124a2576124a1613981565b5b0492506004810190505b606483106124cf57606483816124c5576124c4613981565b5b0492506002810190505b600a83106124de576001810190505b80915050919050565b60008054905060008203612527576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6125346000848385611e43565b600160406001901b178202600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506125ab8361259c6000866000611e49565b6125a5856126a2565b17611e71565b6004600083815260200190815260200160002081905550600080838301905073ffffffffffffffffffffffffffffffffffffffff85169150828260007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600183015b81811461264c57808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600181019050612611565b5060008203612687576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600081905550505061269d6000848385611e9c565b505050565b60006001821460e11b9050919050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6126fb816126c6565b811461270657600080fd5b50565b600081359050612718816126f2565b92915050565b600060208284031215612734576127336126bc565b5b600061274284828501612709565b91505092915050565b60008115159050919050565b6127608161274b565b82525050565b600060208201905061277b6000830184612757565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156127bb5780820151818401526020810190506127a0565b60008484015250505050565b6000601f19601f8301169050919050565b60006127e382612781565b6127ed818561278c565b93506127fd81856020860161279d565b612806816127c7565b840191505092915050565b6000602082019050818103600083015261282b81846127d8565b905092915050565b6000819050919050565b61284681612833565b811461285157600080fd5b50565b6000813590506128638161283d565b92915050565b60006020828403121561287f5761287e6126bc565b5b600061288d84828501612854565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006128c182612896565b9050919050565b6128d1816128b6565b82525050565b60006020820190506128ec60008301846128c8565b92915050565b6128fb816128b6565b811461290657600080fd5b50565b600081359050612918816128f2565b92915050565b60008060408385031215612935576129346126bc565b5b600061294385828601612909565b925050602061295485828601612854565b9150509250929050565b61296781612833565b82525050565b6000602082019050612982600083018461295e565b92915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6129ca826127c7565b810181811067ffffffffffffffff821117156129e9576129e8612992565b5b80604052505050565b60006129fc6126b2565b9050612a0882826129c1565b919050565b600067ffffffffffffffff821115612a2857612a27612992565b5b612a31826127c7565b9050602081019050919050565b82818337600083830152505050565b6000612a60612a5b84612a0d565b6129f2565b905082815260208101848484011115612a7c57612a7b61298d565b5b612a87848285612a3e565b509392505050565b600082601f830112612aa457612aa3612988565b5b8135612ab4848260208601612a4d565b91505092915050565b600060208284031215612ad357612ad26126bc565b5b600082013567ffffffffffffffff811115612af157612af06126c1565b5b612afd84828501612a8f565b91505092915050565b612b0f8161274b565b8114612b1a57600080fd5b50565b600081359050612b2c81612b06565b92915050565b600060208284031215612b4857612b476126bc565b5b6000612b5684828501612b1d565b91505092915050565b600080600060608486031215612b7857612b776126bc565b5b6000612b8686828701612909565b9350506020612b9786828701612909565b9250506040612ba886828701612854565b9150509250925092565b600060208284031215612bc857612bc76126bc565b5b6000612bd684828501612909565b91505092915050565b60008060408385031215612bf657612bf56126bc565b5b6000612c0485828601612909565b9250506020612c1585828601612b1d565b9150509250929050565b600067ffffffffffffffff821115612c3a57612c39612992565b5b612c43826127c7565b9050602081019050919050565b6000612c63612c5e84612c1f565b6129f2565b905082815260208101848484011115612c7f57612c7e61298d565b5b612c8a848285612a3e565b509392505050565b600082601f830112612ca757612ca6612988565b5b8135612cb7848260208601612c50565b91505092915050565b60008060008060808587031215612cda57612cd96126bc565b5b6000612ce887828801612909565b9450506020612cf987828801612909565b9350506040612d0a87828801612854565b925050606085013567ffffffffffffffff811115612d2b57612d2a6126c1565b5b612d3787828801612c92565b91505092959194509250565b60008060408385031215612d5a57612d596126bc565b5b6000612d6885828601612909565b9250506020612d7985828601612909565b9150509250929050565b60008060408385031215612d9a57612d996126bc565b5b6000612da885828601612854565b9250506020612db985828601612909565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680612e0a57607f821691505b602082108103612e1d57612e1c612dc3565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302612e857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82612e48565b612e8f8683612e48565b95508019841693508086168417925050509392505050565b6000819050919050565b6000612ecc612ec7612ec284612833565b612ea7565b612833565b9050919050565b6000819050919050565b612ee683612eb1565b612efa612ef282612ed3565b848454612e55565b825550505050565b600090565b612f0f612f02565b612f1a818484612edd565b505050565b5b81811015612f3e57612f33600082612f07565b600181019050612f20565b5050565b601f821115612f8357612f5481612e23565b612f5d84612e38565b81016020851015612f6c578190505b612f80612f7885612e38565b830182612f1f565b50505b505050565b600082821c905092915050565b6000612fa660001984600802612f88565b1980831691505092915050565b6000612fbf8383612f95565b9150826002028217905092915050565b612fd882612781565b67ffffffffffffffff811115612ff157612ff0612992565b5b612ffb8254612df2565b613006828285612f42565b600060209050601f8311600181146130395760008415613027578287015190505b6130318582612fb3565b865550613099565b601f19841661304786612e23565b60005b8281101561306f5784890151825560018201915060208501945060208101905061304a565b8683101561308c5784890151613088601f891682612f95565b8355505b6001600288020188555050505b505050505050565b600081905092915050565b50565b60006130bc6000836130a1565b91506130c7826130ac565b600082019050919050565b60006130dd826130af565b9150819050919050565b7f636f6e7472616374206973207061757365640000000000000000000000000000600082015250565b600061311d60128361278c565b9150613128826130e7565b602082019050919050565b6000602082019050818103600083015261314c81613110565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061318d82612833565b915061319883612833565b92508282019050808211156131b0576131af613153565b5b92915050565b7f6d617820737570706c7920776f756c6420626520657863656564656400000000600082015250565b60006131ec601c8361278c565b91506131f7826131b6565b602082019050919050565b6000602082019050818103600083015261321b816131df565b9050919050565b7f6d6178206d696e74207065722077616c6c657420776f756c642062652065786360008201527f6565646564000000000000000000000000000000000000000000000000000000602082015250565b600061327e60258361278c565b915061328982613222565b604082019050919050565b600060208201905081810360008301526132ad81613271565b9050919050565b60006132bf82612833565b91506132ca83612833565b92508282039050818111156132e2576132e1613153565b5b92915050565b7f616d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b600061331e601d8361278c565b9150613329826132e8565b602082019050919050565b6000602082019050818103600083015261334d81613311565b9050919050565b600061335f82612833565b915061336a83612833565b925082820261337881612833565b9150828204841483151761338f5761338e613153565b5b5092915050565b7f76616c7565206e6f74206d657400000000000000000000000000000000000000600082015250565b60006133cc600d8361278c565b91506133d782613396565b602082019050919050565b600060208201905081810360008301526133fb816133bf565b9050919050565b7f6e6f20736d61727420636f6e7472616374730000000000000000000000000000600082015250565b600061343860128361278c565b915061344382613402565b602082019050919050565b600060208201905081810360008301526134678161342b565b9050919050565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b60006134ca602f8361278c565b91506134d58261346e565b604082019050919050565b600060208201905081810360008301526134f9816134bd565b9050919050565b600081905092915050565b600061351682612781565b6135208185613500565b935061353081856020860161279d565b80840191505092915050565b6000815461354981612df2565b6135538186613500565b9450600182166000811461356e5760018114613583576135b6565b60ff19831686528115158202860193506135b6565b61358c85612e23565b60005b838110156135ae5781548189015260018201915060208101905061358f565b838801955050505b50505092915050565b60006135cb828661350b565b91506135d7828561350b565b91506135e3828461353c565b9150819050949350505050565b7f496e76616c6964206d696e7420616d6f756e7421000000000000000000000000600082015250565b600061362660148361278c565b9150613631826135f0565b602082019050919050565b6000602082019050818103600083015261365581613619565b9050919050565b7f4f6e6c79206669766520616c6c6f776564207065722077616c6c657421000000600082015250565b6000613692601d8361278c565b915061369d8261365c565b602082019050919050565b600060208201905081810360008301526136c181613685565b9050919050565b7f4d617820737570706c7920657863656564656421000000000000000000000000600082015250565b60006136fe60148361278c565b9150613709826136c8565b602082019050919050565b6000602082019050818103600083015261372d816136f1565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061379060268361278c565b915061379b82613734565b604082019050919050565b600060208201905081810360008301526137bf81613783565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006137fc60208361278c565b9150613807826137c6565b602082019050919050565b6000602082019050818103600083015261382b816137ef565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000613868601f8361278c565b915061387382613832565b602082019050919050565b600060208201905081810360008301526138978161385b565b9050919050565b600081519050919050565b600082825260208201905092915050565b60006138c58261389e565b6138cf81856138a9565b93506138df81856020860161279d565b6138e8816127c7565b840191505092915050565b600060808201905061390860008301876128c8565b61391560208301866128c8565b613922604083018561295e565b818103606083015261393481846138ba565b905095945050505050565b60008151905061394e816126f2565b92915050565b60006020828403121561396a576139696126bc565b5b60006139788482850161393f565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea26469706673582212205795a2e1cef0cdc40d8beb31a544239e7d23c62f792b5ff3d828ea371d76eec764736f6c63430008110033
Verified Source Code Partial Match
Compiler: v0.8.17+commit.8df45f5f
EVM: london
Optimization: No
Piratez.sol 2292 lines
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// 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);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
/**
* @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`.
*
* 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;
/**
* @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 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* 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 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 the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @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);
}
// File: @openzeppelin/contracts/security/ReentrancyGuard.sol
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
// File: @openzeppelin/contracts/utils/math/Math.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @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] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// 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;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
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);
}
}
// File: erc721a/contracts/IERC721A.sol
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of ERC721A.
*/
interface IERC721A {
/**
* The caller must own the token or be an approved operator.
*/
error ApprovalCallerNotOwnerNorApproved();
/**
* The token does not exist.
*/
error ApprovalQueryForNonexistentToken();
/**
* Cannot query the balance for the zero address.
*/
error BalanceQueryForZeroAddress();
/**
* Cannot mint to the zero address.
*/
error MintToZeroAddress();
/**
* The quantity of tokens minted must be more than zero.
*/
error MintZeroQuantity();
/**
* The token does not exist.
*/
error OwnerQueryForNonexistentToken();
/**
* The caller must own the token or be an approved operator.
*/
error TransferCallerNotOwnerNorApproved();
/**
* The token must be owned by `from`.
*/
error TransferFromIncorrectOwner();
/**
* Cannot safely transfer to a contract that does not implement the
* ERC721Receiver interface.
*/
error TransferToNonERC721ReceiverImplementer();
/**
* Cannot transfer to the zero address.
*/
error TransferToZeroAddress();
/**
* The token does not exist.
*/
error URIQueryForNonexistentToken();
/**
* The `quantity` minted with ERC2309 exceeds the safety limit.
*/
error MintERC2309QuantityExceedsLimit();
/**
* The `extraData` cannot be set on an unintialized ownership slot.
*/
error OwnershipNotInitializedForExtraData();
// =============================================================
// STRUCTS
// =============================================================
struct TokenOwnership {
// The address of the owner.
address addr;
// Stores the start time of ownership with minimal overhead for tokenomics.
uint64 startTimestamp;
// Whether the token has been burned.
bool burned;
// Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
uint24 extraData;
}
// =============================================================
// TOKEN COUNTERS
// =============================================================
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see {_totalMinted}.
*/
function totalSupply() external view returns (uint256);
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
// =============================================================
// IERC721
// =============================================================
/**
* @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,
bytes calldata data
) external payable;
/**
* @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
/**
* @dev Transfers `tokenId` 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 payable;
/**
* @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 payable;
/**
* @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 the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @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);
// =============================================================
// IERC721Metadata
// =============================================================
/**
* @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);
// =============================================================
// IERC2309
// =============================================================
/**
* @dev Emitted when tokens in `fromTokenId` to `toTokenId`
* (inclusive) is transferred from `from` to `to`, as defined in the
* [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
*
* See {_mintERC2309} for more details.
*/
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}
// File: erc721a/contracts/ERC721A.sol
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of ERC721 token receiver.
*/
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
/**
* @title ERC721A
*
* @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
* Non-Fungible Token Standard, including the Metadata extension.
* Optimized for lower gas during batch mints.
*
* Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
* starting from `_startTokenId()`.
*
* Assumptions:
*
* - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
* - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
*/
contract ERC721A is IERC721A {
// Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
struct TokenApprovalRef {
address value;
}
// =============================================================
// CONSTANTS
// =============================================================
// Mask of an entry in packed address data.
uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
// The bit position of `numberMinted` in packed address data.
uint256 private constant _BITPOS_NUMBER_MINTED = 64;
// The bit position of `numberBurned` in packed address data.
uint256 private constant _BITPOS_NUMBER_BURNED = 128;
// The bit position of `aux` in packed address data.
uint256 private constant _BITPOS_AUX = 192;
// Mask of all 256 bits in packed address data except the 64 bits for `aux`.
uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
// The bit position of `startTimestamp` in packed ownership.
uint256 private constant _BITPOS_START_TIMESTAMP = 160;
// The bit mask of the `burned` bit in packed ownership.
uint256 private constant _BITMASK_BURNED = 1 << 224;
// The bit position of the `nextInitialized` bit in packed ownership.
uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;
// The bit mask of the `nextInitialized` bit in packed ownership.
uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;
// The bit position of `extraData` in packed ownership.
uint256 private constant _BITPOS_EXTRA_DATA = 232;
// Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
// The mask of the lower 160 bits for addresses.
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
// The maximum `quantity` that can be minted with {_mintERC2309}.
// This limit is to prevent overflows on the address data entries.
// For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
// is required to cause an overflow, which is unrealistic.
uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
// The `Transfer` event signature is given by:
// `keccak256(bytes("Transfer(address,address,uint256)"))`.
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
// =============================================================
// STORAGE
// =============================================================
// The next token ID to be minted.
uint256 private _currentIndex;
// The number of tokens burned.
uint256 private _burnCounter;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to ownership details
// An empty struct value does not necessarily mean the token is unowned.
// See {_packedOwnershipOf} implementation for details.
//
// Bits Layout:
// - [0..159] `addr`
// - [160..223] `startTimestamp`
// - [224] `burned`
// - [225] `nextInitialized`
// - [232..255] `extraData`
mapping(uint256 => uint256) private _packedOwnerships;
// Mapping owner address to address data.
//
// Bits Layout:
// - [0..63] `balance`
// - [64..127] `numberMinted`
// - [128..191] `numberBurned`
// - [192..255] `aux`
mapping(address => uint256) private _packedAddressData;
// Mapping from token ID to approved address.
mapping(uint256 => TokenApprovalRef) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// =============================================================
// CONSTRUCTOR
// =============================================================
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
}
// =============================================================
// TOKEN COUNTING OPERATIONS
// =============================================================
/**
* @dev Returns the starting token ID.
* To change the starting token ID, please override this function.
*/
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev Returns the next token ID to be minted.
*/
function _nextTokenId() internal view virtual returns (uint256) {
return _currentIndex;
}
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see {_totalMinted}.
*/
function totalSupply() public view virtual override returns (uint256) {
// Counter underflow is impossible as _burnCounter cannot be incremented
// more than `_currentIndex - _startTokenId()` times.
unchecked {
return _currentIndex - _burnCounter - _startTokenId();
}
}
/**
* @dev Returns the total amount of tokens minted in the contract.
*/
function _totalMinted() internal view virtual returns (uint256) {
// Counter underflow is impossible as `_currentIndex` does not decrement,
// and it is initialized to `_startTokenId()`.
unchecked {
return _currentIndex - _startTokenId();
}
}
/**
* @dev Returns the total number of tokens burned.
*/
function _totalBurned() internal view virtual returns (uint256) {
return _burnCounter;
}
// =============================================================
// ADDRESS DATA OPERATIONS
// =============================================================
/**
* @dev Returns the number of tokens in `owner`'s account.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens minted by `owner`.
*/
function _numberMinted(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens burned by or on behalf of `owner`.
*/
function _numberBurned(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
*/
function _getAux(address owner) internal view returns (uint64) {
return uint64(_packedAddressData[owner] >> _BITPOS_AUX);
}
/**
* Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
* If there are multiple variables, please pack them into a uint64.
*/
function _setAux(address owner, uint64 aux) internal virtual {
uint256 packed = _packedAddressData[owner];
uint256 auxCasted;
// Cast `aux` with assembly to avoid redundant masking.
assembly {
auxCasted := aux
}
packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
_packedAddressData[owner] = packed;
}
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 gas.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
// The interface IDs are constants representing the first 4 bytes
// of the XOR of all function selectors in the interface.
// See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
// (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
return
interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
}
// =============================================================
// IERC721Metadata
// =============================================================
/**
* @dev Returns the token collection name.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the token collection symbol.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
}
/**
* @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, it can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return '';
}
// =============================================================
// OWNERSHIPS OPERATIONS
// =============================================================
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
return address(uint160(_packedOwnershipOf(tokenId)));
}
/**
* @dev Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around over time.
*/
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(tokenId));
}
/**
* @dev Returns the unpacked `TokenOwnership` struct at `index`.
*/
function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnerships[index]);
}
/**
* @dev Initializes the ownership slot minted at `index` for efficiency purposes.
*/
function _initializeOwnershipAt(uint256 index) internal virtual {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
/**
* Returns the packed ownership data of `tokenId`.
*/
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
uint256 curr = tokenId;
unchecked {
if (_startTokenId() <= curr)
if (curr < _currentIndex) {
uint256 packed = _packedOwnerships[curr];
// If not burned.
if (packed & _BITMASK_BURNED == 0) {
...
// [truncated — 83157 bytes total]
Read Contract
balanceOf 0x70a08231 → uint256
cost 0x13faede6 → uint256
freeMintClaimed 0xe0ec7c36 → bool
freeSupply 0x24a6ab0c → uint256
getApproved 0x081812fc → address
hiddenMetadataUri 0xa45ba8e7 → string
isApprovedForAll 0xe985e9c5 → bool
maxMintAmountPerTx 0x94354fd0 → uint256
maxPerWallet 0x453c2310 → uint256
maxSupply 0xd5abeb01 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
revealed 0x51830227 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
uriPrefix 0x62b99ad4 → string
uriSuffix 0x5503a0e8 → string
Write Contract 19 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
mint 0xa0712d68
uint256 amount
mintForAddress 0xefbd73f4
uint256 _mintAmount
address _receiver
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
setCost 0x44a0d68a
uint256 _cost
setFreeSupply 0xf676308a
uint256 _freeQty
setHiddenMetadataUri 0x4fdd43cb
string _hiddenMetadataUri
setMaxMintAmountPerTx 0xb071401b
uint256 _maxMintAmountPerTx
setMaxPerWallet 0xe268e4d3
uint256 _maxPerWallet
setPaused 0x16c38b3c
bool _state
setRevealed 0xe0a80853
bool _state
setUriPrefix 0x7ec4a659
string _uriPrefix
setUriSuffix 0x16ba10e0
string _uriSuffix
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address