Forkchoice Ethereum Mainnet

Address Contract Partially Verified

Address 0x2FEb0F83e42140293CEa1cFcAa75B163fB2eea16
Balance 0 ETH
Nonce 1
Code Size 16694 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

16694 bytes
0x6080604052600436106102675760003560e01c80635b8ad4291161014457806395d89b41116100b6578063c87b56dd1161007a578063c87b56dd146108b4578063d3d21d2f146108f1578063e222c7f91461091c578063e985e9c514610933578063f2fde38b14610970578063fa0470311461099957610267565b806395d89b41146107f2578063a0712d681461081d578063a22cb46514610846578063b0962c531461086f578063b88d4fde1461089857610267565b806373b2e80e1161010857806373b2e80e146106f45780637cb64759146107315780638456cb591461075a57806386a173ee146107855780638bb64a8c146107b05780638da5cb5b146107c757610267565b80635b8ad429146106235780636352211e1461063a5780636f8b44b01461067757806370a08231146106a0578063715018a6146106dd57610267565b80632904e6d9116101dd5780633ccfd60b116101a15780633ccfd60b1461054457806341f434341461055b57806342842e0e1461058657806349590657146105a25780634cf5f7a4146105cd57806354214f69146105f857610267565b80632904e6d91461046b5780632a55205a146104875780632fbba115146104c557806332cb6b0c146104ee57806333bc1c5c1461051957610267565b806306fdde031161022f57806306fdde0314610363578063081812fc1461038e578063095ea7b3146103cb57806318160ddd146103e75780631c16521c1461041257806323b872dd1461044f57610267565b80630109c52e1461026c57806301ffc9a7146102975780630345e3cb146102d4578063062d807f146103115780630675b7c61461033a575b600080fd5b34801561027857600080fd5b506102816109c4565b60405161028e9190612be9565b60405180910390f35b3480156102a357600080fd5b506102be60048036038101906102b99190612c70565b6109ca565b6040516102cb9190612cb8565b60405180910390f35b3480156102e057600080fd5b506102fb60048036038101906102f69190612d31565b6109dc565b6040516103089190612be9565b60405180910390f35b34801561031d57600080fd5b5061033860048036038101906103339190612d31565b6109f4565b005b34801561034657600080fd5b50610361600480360381019061035c9190612dc3565b610a40565b005b34801561036f57600080fd5b50610378610a5e565b6040516103859190612ea0565b60405180910390f35b34801561039a57600080fd5b506103b560048036038101906103b09190612eee565b610af0565b6040516103c29190612f2a565b60405180910390f35b6103e560048036038101906103e09190612f45565b610b6f565b005b3480156103f357600080fd5b506103fc610b88565b6040516104099190612be9565b60405180910390f35b34801561041e57600080fd5b5061043960048036038101906104349190612d31565b610b9f565b6040516104469190612be9565b60405180910390f35b61046960048036038101906104649190612f85565b610bb7565b005b6104856004803603810190610480919061314c565b610c06565b005b34801561049357600080fd5b506104ae60048036038101906104a991906131a8565b610e85565b6040516104bc9291906131e8565b60405180910390f35b3480156104d157600080fd5b506104ec60048036038101906104e79190612eee565b610f15565b005b3480156104fa57600080fd5b50610503610f81565b6040516105109190612be9565b60405180910390f35b34801561052557600080fd5b5061052e610f87565b60405161053b9190612cb8565b60405180910390f35b34801561055057600080fd5b50610559610f9a565b005b34801561056757600080fd5b50610570610feb565b60405161057d9190613270565b60405180910390f35b6105a0600480360381019061059b9190612f85565b610ffd565b005b3480156105ae57600080fd5b506105b761104c565b6040516105c4919061329a565b60405180910390f35b3480156105d957600080fd5b506105e2611056565b6040516105ef9190612ea0565b60405180910390f35b34801561060457600080fd5b5061060d6110e4565b60405161061a9190612cb8565b60405180910390f35b34801561062f57600080fd5b506106386110f7565b005b34801561064657600080fd5b50610661600480360381019061065c9190612eee565b61112b565b60405161066e9190612f2a565b60405180910390f35b34801561068357600080fd5b5061069e60048036038101906106999190612eee565b61113d565b005b3480156106ac57600080fd5b506106c760048036038101906106c29190612d31565b61114f565b6040516106d49190612be9565b60405180910390f35b3480156106e957600080fd5b506106f2611207565b005b34801561070057600080fd5b5061071b60048036038101906107169190612d31565b61121b565b6040516107289190612cb8565b60405180910390f35b34801561073d57600080fd5b50610758600480360381019061075391906132b5565b61123b565b005b34801561076657600080fd5b5061076f61124d565b60405161077c9190612cb8565b60405180910390f35b34801561079157600080fd5b5061079a611260565b6040516107a79190612cb8565b60405180910390f35b3480156107bc57600080fd5b506107c5611273565b005b3480156107d357600080fd5b506107dc6112a7565b6040516107e99190612f2a565b60405180910390f35b3480156107fe57600080fd5b506108076112d1565b6040516108149190612ea0565b60405180910390f35b34801561082957600080fd5b50610844600480360381019061083f9190612eee565b611363565b005b34801561085257600080fd5b5061086d6004803603810190610868919061330e565b611569565b005b34801561087b57600080fd5b5061089660048036038101906108919190612dc3565b611582565b005b6108b260048036038101906108ad9190613403565b6115a0565b005b3480156108c057600080fd5b506108db60048036038101906108d69190612eee565b6115f1565b6040516108e89190612ea0565b60405180910390f35b3480156108fd57600080fd5b50610906611753565b6040516109139190612be9565b60405180910390f35b34801561092857600080fd5b50610931611759565b005b34801561093f57600080fd5b5061095a60048036038101906109559190613486565b61178d565b6040516109679190612cb8565b60405180910390f35b34801561097c57600080fd5b5061099760048036038101906109929190612d31565b611821565b005b3480156109a557600080fd5b506109ae6118a4565b6040516109bb9190612f2a565b60405180910390f35b600b5481565b60006109d5826118ca565b9050919050565b60136020528060005260406000206000915090505481565b6109fc611a14565b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610a48611a14565b8181600d9182610a599291906136d3565b505050565b606060028054610a6d90613500565b80601f0160208091040260200160405190810160405280929190818152602001828054610a9990613500565b8015610ae65780601f10610abb57610100808354040283529160200191610ae6565b820191906000526020600020905b815481529060010190602001808311610ac957829003601f168201915b5050505050905090565b6000610afb82611a92565b610b31576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6006600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b81610b7981611af1565b610b838383611bee565b505050565b6000610b92611d32565b6001546000540303905090565b60126020528060005260406000206000915090505481565b823373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610bf557610bf433611af1565b5b610c00848484611d37565b50505050565b3373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610c74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6b90613815565b60405180910390fd5b601060029054906101000a900460ff16610cc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cba90613881565b60405180910390fd5b60095481610ccf610b88565b610cd991906138d0565b1115610d1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1190613950565b60405180910390fd5b600b5481601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d6891906138d0565b1115610da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da0906139bc565b60405180910390fd5b600033604051602001610dbc9190613a24565b604051602081830303815290604052805190602001209050610de18360115483612059565b610e20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1790613ab1565b60405180910390fd5b81601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e6f91906138d0565b92505081905550610e803383612070565b505050565b600080610e9184611a92565b610ed257836040517fc927e5bf000000000000000000000000000000000000000000000000000000008152600401610ec99190612be9565b60405180910390fd5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610f0a610f0385600561222b565b6064612241565b915091509250929050565b610f1d611a14565b60095481610f29610b88565b610f3391906138d0565b1115610f74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6b90613950565b60405180910390fd5b610f7e3382612257565b50565b60095481565b601060019054906101000a900460ff1681565b610fa2611a14565b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610fe8573d6000803e3d6000fd5b50565b6daaeb6d7670e522a718067333cd4e81565b823373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461103b5761103a33611af1565b5b611046848484612275565b50505050565b6000601154905090565b600e805461106390613500565b80601f016020809104026020016040519081016040528092919081815260200182805461108f90613500565b80156110dc5780601f106110b1576101008083540402835291602001916110dc565b820191906000526020600020905b8154815290600101906020018083116110bf57829003601f168201915b505050505081565b601060009054906101000a900460ff1681565b6110ff611a14565b601060009054906101000a900460ff1615601060006101000a81548160ff021916908315150217905550565b600061113682612295565b9050919050565b611145611a14565b8060098190555050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111b6576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b67ffffffffffffffff600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054169050919050565b61120f611a14565b6112196000612361565b565b600f6020528060005260406000206000915054906101000a900460ff1681565b611243611a14565b8060118190555050565b601060039054906101000a900460ff1681565b601060029054906101000a900460ff1681565b61127b611a14565b601060029054906101000a900460ff1615601060026101000a81548160ff021916908315150217905550565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600380546112e090613500565b80601f016020809104026020016040519081016040528092919081815260200182805461130c90613500565b80156113595780601f1061132e57610100808354040283529160200191611359565b820191906000526020600020905b81548152906001019060200180831161133c57829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16146113d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c890613815565b60405180910390fd5b601060019054906101000a900460ff16611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141790613b1d565b60405180910390fd5b6009548161142c610b88565b61143691906138d0565b1115611477576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146e90613950565b60405180910390fd5b600a5481601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114c591906138d0565b1115611506576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114fd90613baf565b60405180910390fd5b80601260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461155591906138d0565b925050819055506115663382612070565b50565b8161157381611af1565b61157d8383612427565b505050565b61158a611a14565b8181600e918261159b9291906136d3565b505050565b833373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146115de576115dd33611af1565b5b6115ea85858585612532565b5050505050565b60606115fc82611a92565b61163b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163290613c41565b60405180910390fd5b600060018361164a91906138d0565b9050601060009054906101000a900460ff166116f357600e805461166d90613500565b80601f016020809104026020016040519081016040528092919081815260200182805461169990613500565b80156116e65780601f106116bb576101008083540402835291602001916116e6565b820191906000526020600020905b8154815290600101906020018083116116c957829003601f168201915b505050505091505061174e565b6000600d805461170290613500565b90501161171e576040518060200160405280600081525061174a565b600d611729826125a5565b60405160200161173a929190613d6c565b6040516020818303038152906040525b9150505b919050565b600a5481565b611761611a14565b601060019054906101000a900460ff1615601060016101000a81548160ff021916908315150217905550565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611829611a14565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611898576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188f90613e0d565b60405180910390fd5b6118a181612361565b50565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061199557507f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806119fd57507f0e083076000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80611a0d5750611a0c82612673565b5b9050919050565b611a1c612705565b73ffffffffffffffffffffffffffffffffffffffff16611a3a6112a7565b73ffffffffffffffffffffffffffffffffffffffff1614611a90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8790613e79565b60405180910390fd5b565b600081611a9d611d32565b11158015611aac575060005482105b8015611aea575060007c0100000000000000000000000000000000000000000000000000000000600460008581526020019081526020016000205416145b9050919050565b60006daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff163b1115611beb576daaeb6d7670e522a718067333cd4e73ffffffffffffffffffffffffffffffffffffffff1663c617113430836040518363ffffffff1660e01b8152600401611b68929190613e99565b602060405180830381865afa158015611b85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ba99190613ed7565b611bea57806040517fede71dcc000000000000000000000000000000000000000000000000000000008152600401611be19190612f2a565b60405180910390fd5b5b50565b6000611bf98261112b565b90508073ffffffffffffffffffffffffffffffffffffffff16611c1a61270d565b73ffffffffffffffffffffffffffffffffffffffff1614611c7d57611c4681611c4161270d565b61178d565b611c7c576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b826006600084815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b600090565b6000611d4282612295565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611da9576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080611db584612715565b91509150611dcb8187611dc661270d565b61273c565b611e1757611de086611ddb61270d565b61178d565b611e16576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603611e7d576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e8a8686866001612780565b8015611e9557600082555b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081546001900391905081905550600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815460010191905081905550611f6385611f3f888887612786565b7c0200000000000000000000000000000000000000000000000000000000176127ae565b600460008681526020019081526020016000208190555060007c0200000000000000000000000000000000000000000000000000000000841603611fe95760006001850190506000600460008381526020019081526020016000205403611fe7576000548114611fe6578360046000838152602001908152602001600020819055505b5b505b838573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461205186868660016127d9565b505050505050565b60008261206685846127df565b1490509392505050565b600080549050600082036120b0576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6120bd6000848385612780565b600160406001901b178202600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550612134836121256000866000612786565b61212e85612835565b176127ae565b6004600083815260200190815260200160002081905550600080838301905073ffffffffffffffffffffffffffffffffffffffff85169150828260007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600183015b8181146121d557808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a460018101905061219a565b5060008203612210576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80600081905550505061222660008483856127d9565b505050565b600081836122399190613f04565b905092915050565b6000818361224f9190613f75565b905092915050565b612271828260405180602001604052806000815250612845565b5050565b612290838383604051806020016040528060008152506115a0565b505050565b600080829050806122a4611d32565b1161232a576000548110156123295760006004600083815260200190815260200160002054905060007c0100000000000000000000000000000000000000000000000000000000821603612327575b6000810361231d5760046000836001900393508381526020019081526020016000205490506122f3565b809250505061235c565b505b5b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b806007600061243461270d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff166124e161270d565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516125269190612cb8565b60405180910390a35050565b61253d848484610bb7565b60008373ffffffffffffffffffffffffffffffffffffffff163b1461259f57612568848484846128e2565b61259e576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b50505050565b6060600060016125b484612a32565b01905060008167ffffffffffffffff8111156125d3576125d2612fd8565b5b6040519080825280601f01601f1916602001820160405280156126055781602001600182028036833780820191505090505b509050600082602001820190505b600115612668578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161265c5761265b613f46565b5b04945060008503612613575b819350505050919050565b60006301ffc9a760e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806126ce57506380ac58cd60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806126fe5750635b5e139f60e01b827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b600033905090565b600033905090565b60008060006006600085815260200190815260200160002090508092508254915050915091565b600073ffffffffffffffffffffffffffffffffffffffff8316925073ffffffffffffffffffffffffffffffffffffffff821691508382148383141790509392505050565b50505050565b60008060e883901c905060e861279d868684612b85565b62ffffff16901b9150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff83169250814260a01b178317905092915050565b50505050565b60008082905060005b845181101561282a576128158286838151811061280857612807613fa6565b5b6020026020010151612b8e565b9150808061282290613fd5565b9150506127e8565b508091505092915050565b60006001821460e11b9050919050565b61284f8383612070565b60008373ffffffffffffffffffffffffffffffffffffffff163b146128dd57600080549050600083820390505b61288f60008683806001019450866128e2565b6128c5576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81811061287c5781600054146128da57600080fd5b50505b505050565b60008373ffffffffffffffffffffffffffffffffffffffff1663150b7a0261290861270d565b8786866040518563ffffffff1660e01b815260040161292a9493929190614072565b6020604051808303816000875af192505050801561296657506040513d601f19601f8201168201806040525081019061296391906140d3565b60015b6129df573d8060008114612996576040519150601f19603f3d011682016040523d82523d6000602084013e61299b565b606091505b5060008151036129d7576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050949350505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612a90577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381612a8657612a85613f46565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310612acd576d04ee2d6d415b85acef81000000008381612ac357612ac2613f46565b5b0492506020810190505b662386f26fc100008310612afc57662386f26fc100008381612af257612af1613f46565b5b0492506010810190505b6305f5e1008310612b25576305f5e1008381612b1b57612b1a613f46565b5b0492506008810190505b6127108310612b4a576127108381612b4057612b3f613f46565b5b0492506004810190505b60648310612b6d5760648381612b6357612b62613f46565b5b0492506002810190505b600a8310612b7c576001810190505b80915050919050565b60009392505050565b6000818310612ba657612ba18284612bb9565b612bb1565b612bb08383612bb9565b5b905092915050565b600082600052816020526040600020905092915050565b6000819050919050565b612be381612bd0565b82525050565b6000602082019050612bfe6000830184612bda565b92915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b612c4d81612c18565b8114612c5857600080fd5b50565b600081359050612c6a81612c44565b92915050565b600060208284031215612c8657612c85612c0e565b5b6000612c9484828501612c5b565b91505092915050565b60008115159050919050565b612cb281612c9d565b82525050565b6000602082019050612ccd6000830184612ca9565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612cfe82612cd3565b9050919050565b612d0e81612cf3565b8114612d1957600080fd5b50565b600081359050612d2b81612d05565b92915050565b600060208284031215612d4757612d46612c0e565b5b6000612d5584828501612d1c565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083601f840112612d8357612d82612d5e565b5b8235905067ffffffffffffffff811115612da057612d9f612d63565b5b602083019150836001820283011115612dbc57612dbb612d68565b5b9250929050565b60008060208385031215612dda57612dd9612c0e565b5b600083013567ffffffffffffffff811115612df857612df7612c13565b5b612e0485828601612d6d565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612e4a578082015181840152602081019050612e2f565b60008484015250505050565b6000601f19601f8301169050919050565b6000612e7282612e10565b612e7c8185612e1b565b9350612e8c818560208601612e2c565b612e9581612e56565b840191505092915050565b60006020820190508181036000830152612eba8184612e67565b905092915050565b612ecb81612bd0565b8114612ed657600080fd5b50565b600081359050612ee881612ec2565b92915050565b600060208284031215612f0457612f03612c0e565b5b6000612f1284828501612ed9565b91505092915050565b612f2481612cf3565b82525050565b6000602082019050612f3f6000830184612f1b565b92915050565b60008060408385031215612f5c57612f5b612c0e565b5b6000612f6a85828601612d1c565b9250506020612f7b85828601612ed9565b9150509250929050565b600080600060608486031215612f9e57612f9d612c0e565b5b6000612fac86828701612d1c565b9350506020612fbd86828701612d1c565b9250506040612fce86828701612ed9565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61301082612e56565b810181811067ffffffffffffffff8211171561302f5761302e612fd8565b5b80604052505050565b6000613042612c04565b905061304e8282613007565b919050565b600067ffffffffffffffff82111561306e5761306d612fd8565b5b602082029050602081019050919050565b6000819050919050565b6130928161307f565b811461309d57600080fd5b50565b6000813590506130af81613089565b92915050565b60006130c86130c384613053565b613038565b905080838252602082019050602084028301858111156130eb576130ea612d68565b5b835b81811015613114578061310088826130a0565b8452602084019350506020810190506130ed565b5050509392505050565b600082601f83011261313357613132612d5e565b5b81356131438482602086016130b5565b91505092915050565b6000806040838503121561316357613162612c0e565b5b600083013567ffffffffffffffff81111561318157613180612c13565b5b61318d8582860161311e565b925050602061319e85828601612ed9565b9150509250929050565b600080604083850312156131bf576131be612c0e565b5b60006131cd85828601612ed9565b92505060206131de85828601612ed9565b9150509250929050565b60006040820190506131fd6000830185612f1b565b61320a6020830184612bda565b9392505050565b6000819050919050565b600061323661323161322c84612cd3565b613211565b612cd3565b9050919050565b60006132488261321b565b9050919050565b600061325a8261323d565b9050919050565b61326a8161324f565b82525050565b60006020820190506132856000830184613261565b92915050565b6132948161307f565b82525050565b60006020820190506132af600083018461328b565b92915050565b6000602082840312156132cb576132ca612c0e565b5b60006132d9848285016130a0565b91505092915050565b6132eb81612c9d565b81146132f657600080fd5b50565b600081359050613308816132e2565b92915050565b6000806040838503121561332557613324612c0e565b5b600061333385828601612d1c565b9250506020613344858286016132f9565b9150509250929050565b600080fd5b600067ffffffffffffffff82111561336e5761336d612fd8565b5b61337782612e56565b9050602081019050919050565b82818337600083830152505050565b60006133a66133a184613353565b613038565b9050828152602081018484840111156133c2576133c161334e565b5b6133cd848285613384565b509392505050565b600082601f8301126133ea576133e9612d5e565b5b81356133fa848260208601613393565b91505092915050565b6000806000806080858703121561341d5761341c612c0e565b5b600061342b87828801612d1c565b945050602061343c87828801612d1c565b935050604061344d87828801612ed9565b925050606085013567ffffffffffffffff81111561346e5761346d612c13565b5b61347a878288016133d5565b91505092959194509250565b6000806040838503121561349d5761349c612c0e565b5b60006134ab85828601612d1c565b92505060206134bc85828601612d1c565b9150509250929050565b600082905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061351857607f821691505b60208210810361352b5761352a6134d1565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026135937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82613556565b61359d8683613556565b95508019841693508086168417925050509392505050565b60006135d06135cb6135c684612bd0565b613211565b612bd0565b9050919050565b6000819050919050565b6135ea836135b5565b6135fe6135f6826135d7565b848454613563565b825550505050565b600090565b613613613606565b61361e8184846135e1565b505050565b5b818110156136425761363760008261360b565b600181019050613624565b5050565b601f8211156136875761365881613531565b61366184613546565b81016020851015613670578190505b61368461367c85613546565b830182613623565b50505b505050565b600082821c905092915050565b60006136aa6000198460080261368c565b1980831691505092915050565b60006136c38383613699565b9150826002028217905092915050565b6136dd83836134c6565b67ffffffffffffffff8111156136f6576136f5612fd8565b5b6137008254613500565b61370b828285613646565b6000601f83116001811461373a5760008415613728578287013590505b61373285826136b7565b86555061379a565b601f19841661374886613531565b60005b828110156137705784890135825560018201915060208501945060208101905061374b565b8683101561378d5784890135613789601f891682613699565b8355505b6001600288020188555050505b50505050505050565b7f6f6464424f69203a3a2043616e6e6f742062652063616c6c656420627920612060008201527f636f6e7472616374000000000000000000000000000000000000000000000000602082015250565b60006137ff602883612e1b565b915061380a826137a3565b604082019050919050565b6000602082019050818103600083015261382e816137f2565b9050919050565b7f6f6464424f69203a3a204d696e74696e67206973206f6e205061757365000000600082015250565b600061386b601d83612e1b565b915061387682613835565b602082019050919050565b6000602082019050818103600083015261389a8161385e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006138db82612bd0565b91506138e683612bd0565b92508282019050808211156138fe576138fd6138a1565b5b92915050565b7f6f6464424f69203a3a205055424c494320534f4c444f55540000000000000000600082015250565b600061393a601883612e1b565b915061394582613904565b602082019050919050565b600060208201905081810360008301526139698161392d565b9050919050565b7f796f752063616e206f6e6c79206d696e742031206f6e20574c00000000000000600082015250565b60006139a6601983612e1b565b91506139b182613970565b602082019050919050565b600060208201905081810360008301526139d581613999565b9050919050565b60008160601b9050919050565b60006139f4826139dc565b9050919050565b6000613a06826139e9565b9050919050565b613a1e613a1982612cf3565b6139fb565b82525050565b6000613a308284613a0d565b60148201915081905092915050565b7f6f6464424f69203a3a20596f7520617265206e6f742077686974656c6973746560008201527f6400000000000000000000000000000000000000000000000000000000000000602082015250565b6000613a9b602183612e1b565b9150613aa682613a3f565b604082019050919050565b60006020820190508181036000830152613aca81613a8e565b9050919050565b7f6f6464424f69203a3a204e6f7420596574204163746976652e00000000000000600082015250565b6000613b07601983612e1b565b9150613b1282613ad1565b602082019050919050565b60006020820190508181036000830152613b3681613afa565b9050919050565b7f6f6464424f69203a3a204d696e74696e672074686973206d616e7920776f756c60008201527f642070757420796f75206f766572203520696e207075626c6963206d696e7421602082015250565b6000613b99604083612e1b565b9150613ba482613b3d565b604082019050919050565b60006020820190508181036000830152613bc881613b8c565b9050919050565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b6000613c2b602f83612e1b565b9150613c3682613bcf565b604082019050919050565b60006020820190508181036000830152613c5a81613c1e565b9050919050565b600081905092915050565b60008154613c7981613500565b613c838186613c61565b94506001821660008114613c9e5760018114613cb357613ce6565b60ff1983168652811515820286019350613ce6565b613cbc85613531565b60005b83811015613cde57815481890152600182019150602081019050613cbf565b838801955050505b50505092915050565b6000613cfa82612e10565b613d048185613c61565b9350613d14818560208601612e2c565b80840191505092915050565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000600082015250565b6000613d56600583613c61565b9150613d6182613d20565b600582019050919050565b6000613d788285613c6c565b9150613d848284613cef565b9150613d8f82613d49565b91508190509392505050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000613df7602683612e1b565b9150613e0282613d9b565b604082019050919050565b60006020820190508181036000830152613e2681613dea565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613e63602083612e1b565b9150613e6e82613e2d565b602082019050919050565b60006020820190508181036000830152613e9281613e56565b9050919050565b6000604082019050613eae6000830185612f1b565b613ebb6020830184612f1b565b9392505050565b600081519050613ed1816132e2565b92915050565b600060208284031215613eed57613eec612c0e565b5b6000613efb84828501613ec2565b91505092915050565b6000613f0f82612bd0565b9150613f1a83612bd0565b9250828202613f2881612bd0565b91508282048414831517613f3f57613f3e6138a1565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613f8082612bd0565b9150613f8b83612bd0565b925082613f9b57613f9a613f46565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000613fe082612bd0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614012576140116138a1565b5b600182019050919050565b600081519050919050565b600082825260208201905092915050565b60006140448261401d565b61404e8185614028565b935061405e818560208601612e2c565b61406781612e56565b840191505092915050565b60006080820190506140876000830187612f1b565b6140946020830186612f1b565b6140a16040830185612bda565b81810360608301526140b38184614039565b905095945050505050565b6000815190506140cd81612c44565b92915050565b6000602082840312156140e9576140e8612c0e565b5b60006140f7848285016140be565b9150509291505056fea2646970667358221220916d94633d9814023825a7583c167fb303e1067546a1d6f7094af961826533f664736f6c63430008110033

Verified Source Code Partial Match

Compiler: v0.8.17+commit.8df45f5f EVM: london Optimization: No
oDDBOiNFT.sol 3001 lines
// 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/math/SafeMath.sol


// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

// File: operator-filter-registry/src/lib/Constants.sol


pragma solidity ^0.8.13;

address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E;
address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;

// File: operator-filter-registry/src/IOperatorFilterRegistry.sol


pragma solidity ^0.8.13;

interface IOperatorFilterRegistry {
    /**
     * @notice Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns
     *         true if supplied registrant address is not registered.
     */
    function isOperatorAllowed(address registrant, address operator) external view returns (bool);

    /**
     * @notice Registers an address with the registry. May be called by address itself or by EIP-173 owner.
     */
    function register(address registrant) external;

    /**
     * @notice Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes.
     */
    function registerAndSubscribe(address registrant, address subscription) external;

    /**
     * @notice Registers an address with the registry and copies the filtered operators and codeHashes from another
     *         address without subscribing.
     */
    function registerAndCopyEntries(address registrant, address registrantToCopy) external;

    /**
     * @notice Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner.
     *         Note that this does not remove any filtered addresses or codeHashes.
     *         Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes.
     */
    function unregister(address addr) external;

    /**
     * @notice Update an operator address for a registered address - when filtered is true, the operator is filtered.
     */
    function updateOperator(address registrant, address operator, bool filtered) external;

    /**
     * @notice Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates.
     */
    function updateOperators(address registrant, address[] calldata operators, bool filtered) external;

    /**
     * @notice Update a codeHash for a registered address - when filtered is true, the codeHash is filtered.
     */
    function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;

    /**
     * @notice Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates.
     */
    function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;

    /**
     * @notice Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous
     *         subscription if present.
     *         Note that accounts with subscriptions may go on to subscribe to other accounts - in this case,
     *         subscriptions will not be forwarded. Instead the former subscription's existing entries will still be
     *         used.
     */
    function subscribe(address registrant, address registrantToSubscribe) external;

    /**
     * @notice Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes.
     */
    function unsubscribe(address registrant, bool copyExistingEntries) external;

    /**
     * @notice Get the subscription address of a given registrant, if any.
     */
    function subscriptionOf(address addr) external returns (address registrant);

    /**
     * @notice Get the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscribers(address registrant) external returns (address[] memory);

    /**
     * @notice Get the subscriber at a given index in the set of addresses subscribed to a given registrant.
     *         Note that order is not guaranteed as updates are made.
     */
    function subscriberAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Copy filtered operators and codeHashes from a different registrantToCopy to addr.
     */
    function copyEntriesOf(address registrant, address registrantToCopy) external;

    /**
     * @notice Returns true if operator is filtered by a given address or its subscription.
     */
    function isOperatorFiltered(address registrant, address operator) external returns (bool);

    /**
     * @notice Returns true if the hash of an address's code is filtered by a given address or its subscription.
     */
    function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);

    /**
     * @notice Returns true if a codeHash is filtered by a given address or its subscription.
     */
    function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);

    /**
     * @notice Returns a list of filtered operators for a given address or its subscription.
     */
    function filteredOperators(address addr) external returns (address[] memory);

    /**
     * @notice Returns the set of filtered codeHashes for a given address or its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashes(address addr) external returns (bytes32[] memory);

    /**
     * @notice Returns the filtered operator at the given index of the set of filtered operators for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredOperatorAt(address registrant, uint256 index) external returns (address);

    /**
     * @notice Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or
     *         its subscription.
     *         Note that order is not guaranteed as updates are made.
     */
    function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);

    /**
     * @notice Returns true if an address has registered
     */
    function isRegistered(address addr) external returns (bool);

    /**
     * @dev Convenience method to compute the code hash of an arbitrary contract
     */
    function codeHashOf(address addr) external returns (bytes32);
}

// File: operator-filter-registry/src/OperatorFilterer.sol


pragma solidity ^0.8.13;


/**
 * @title  OperatorFilterer
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry.
 * @dev    This smart contract is meant to be inherited by token contracts so they can use the following:
 *         - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
 *         - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
 *         Please note that if your token contract does not provide an owner with EIP-173, it must provide
 *         administration methods on the contract itself to interact with the registry otherwise the subscription
 *         will be locked to the options set during construction.
 */

abstract contract OperatorFilterer {
    /// @dev Emitted when an operator is not allowed.
    error OperatorNotAllowed(address operator);

    IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
        IOperatorFilterRegistry(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS);

    /// @dev The constructor that is called when the contract is being deployed.
    constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
        // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
        // will not revert, but the contract will need to be registered with the registry once it is deployed in
        // order for the modifier to filter addresses.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            if (subscribe) {
                OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
            } else {
                if (subscriptionOrRegistrantToCopy != address(0)) {
                    OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
                } else {
                    OPERATOR_FILTER_REGISTRY.register(address(this));
                }
            }
        }
    }

    /**
     * @dev A helper function to check if an operator is allowed.
     */
    modifier onlyAllowedOperator(address from) virtual {
        // Allow spending tokens from addresses with balance
        // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
        // from an EOA.
        if (from != msg.sender) {
            _checkFilterOperator(msg.sender);
        }
        _;
    }

    /**
     * @dev A helper function to check if an operator approval is allowed.
     */
    modifier onlyAllowedOperatorApproval(address operator) virtual {
        _checkFilterOperator(operator);
        _;
    }

    /**
     * @dev A helper function to check if an operator is allowed.
     */
    function _checkFilterOperator(address operator) internal view virtual {
        // Check registry code length to facilitate testing in environments without a deployed registry.
        if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
            // under normal circumstances, this function will revert rather than return false, but inheriting contracts
            // may specify their own OperatorFilterRegistry implementations, which may behave differently
            if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
                revert OperatorNotAllowed(operator);
            }
        }
    }
}

// File: operator-filter-registry/src/DefaultOperatorFilterer.sol


pragma solidity ^0.8.13;


/**
 * @title  DefaultOperatorFilterer
 * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription.
 * @dev    Please note that if your token contract does not provide an owner with EIP-173, it must provide
 *         administration methods on the contract itself to interact with the registry otherwise the subscription
 *         will be locked to the options set during construction.
 */

abstract contract DefaultOperatorFilterer is OperatorFilterer {
    /// @dev The constructor that is called when the contract is being deployed.
    constructor() OperatorFilterer(CANONICAL_CORI_SUBSCRIPTION, true) {}
}

// 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/interfaces/IERC2981.sol


// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)

pragma solidity ^0.8.0;


/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

// 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/utils/cryptography/MerkleProof.sol


// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates merkle trees that are safe
 * against this attack out of the box.
 */
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 Calldata version of {verify}
     *
     * _Available since v4.7._
     */
    function verifyCalldata(
        bytes32[] calldata proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle 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++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Calldata version of {processProof}
     *
     * _Available since v4.7._
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            return hashes[totalHashes - 1];
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

// 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 e...

// [truncated — 110598 bytes total]

Read Contract

MAX_PUB_MINT 0xd3d21d2f → uint256
MAX_SUPPLY 0x32cb6b0c → uint256
MAX_WL_MINT 0x0109c52e → uint256
OPERATOR_FILTER_REGISTRY 0x41f43434 → address
Royalty 0xfa047031 → address
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
getMerkleRoot 0x49590657 → bytes32
hasClaimed 0x73b2e80e → bool
isApprovedForAll 0xe985e9c5 → bool
isRevealed 0x54214f69 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
pause 0x8456cb59 → bool
placeholderTokenUri 0x4cf5f7a4 → string
publicSale 0x33bc1c5c → bool
royaltyInfo 0x2a55205a → address, uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalPublicMint 0x1c16521c → uint256
totalSupply 0x18160ddd → uint256
totalWhitelistMint 0x0345e3cb → uint256
whiteListSale 0x86a173ee → bool

Write Contract 19 functions

These functions modify contract state and require a wallet transaction to execute.

RoyaltyReciever 0x062d807f
address _Royalty
approve 0x095ea7b3
address operator
uint256 tokenId
mint 0xa0712d68
uint256 _quantity
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
setMaxSupply 0x6f8b44b0
uint256 _MAX_SUPPLY
setMerkleRoot 0x7cb64759
bytes32 _merkleRoot
setPlaceHolderUri 0xb0962c53
string _placeholderTokenUri
setTokenUri 0x0675b7c6
string _baseTokenUri
teamMint 0x2fbba115
uint256 quantity
togglePublicSale 0xe222c7f9
No parameters
toggleReveal 0x5b8ad429
No parameters
toggleWhiteListSale 0x8bb64a8c
No parameters
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
whitelistMint 0x2904e6d9
bytes32[] _merkleProof
uint256 _quantity
withdraw 0x3ccfd60b
No parameters

Recent Transactions

No transactions found for this address