Forkchoice Ethereum Mainnet

Address Contract Verified

Address 0x90d4ffBf13bF3203940E6DAcE392F7C23ff6b9Ed
Balance 0 ETH
Nonce 1
Code Size 23499 bytes
Indexed Transactions 0 (1 on-chain, 0.6% indexed)
External Etherscan · Sourcify

Contract Bytecode

23499 bytes
0x6080604052600436106102935760003560e01c80636ba4c1381161015a578063b88d4fde116100c1578063da3ef23f1161007a578063da3ef23f146109ed578063dc559fce14610a16578063e985e9c514610a41578063f1c51b3914610a7e578063f2fde38b14610aa9578063f94a279b14610ad257610293565b8063b88d4fde146108df578063b90ae3ed14610908578063c4e3709514610933578063c66828621461095c578063c87b56dd14610987578063d1be66ba146109c457610293565b806395d89b411161011357806395d89b41146107fd57806397254e55146108285780639a72580914610844578063a0712d681461086f578063a22cb4651461088b578063aaa25f4e146108b457610293565b80636ba4c138146107015780636c0360eb1461072a57806370a0823114610755578063715018a614610792578063819b25ba146107a95780638da5cb5b146107d257610293565b80632f745c59116101fe5780634b014e28116101b75780634b014e28146105df5780634f6ccce71461060857806355f804b3146106455780635c975abb1461066e578063603f4d52146106995780636352211e146106c457610293565b80632f745c59146104de57806333039d3d1461051b5780633ccfd60b1461054657806342842e0e14610550578063438b6300146105795780634783f0ef146105b657610293565b806313faede61161025057806313faede6146103ba5780631681d158146103e557806318160ddd1461042257806318cae2691461044d57806323b872dd1461048a5780632eb4a7ab146104b357610293565b806301e05ba41461029857806301ffc9a7146102c357806302329a291461030057806306fdde0314610329578063081812fc14610354578063095ea7b314610391575b600080fd5b3480156102a457600080fd5b506102ad610afd565b6040516102ba9190614e54565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190614129565b610b03565b6040516102f791906149c1565b60405180910390f35b34801561030c57600080fd5b50610327600480360381019061032291906140d7565b610b7d565b005b34801561033557600080fd5b5061033e610c16565b60405161034b9190614a12565b60405180910390f35b34801561036057600080fd5b5061037b600480360381019061037691906141bc565b610ca8565b6040516103889190614938565b60405180910390f35b34801561039d57600080fd5b506103b860048036038101906103b39190614015565b610d2d565b005b3480156103c657600080fd5b506103cf610e45565b6040516103dc9190614e54565b60405180910390f35b3480156103f157600080fd5b5061040c600480360381019061040791906141bc565b610e4b565b60405161041991906149c1565b60405180910390f35b34801561042e57600080fd5b50610437610e63565b6040516104449190614e54565b60405180910390f35b34801561045957600080fd5b50610474600480360381019061046f9190613e81565b610e70565b6040516104819190614e54565b60405180910390f35b34801561049657600080fd5b506104b160048036038101906104ac9190613f0f565b610e88565b005b3480156104bf57600080fd5b506104c8610ee8565b6040516104d591906149dc565b60405180910390f35b3480156104ea57600080fd5b5061050560048036038101906105009190614015565b610eee565b6040516105129190614e54565b60405180910390f35b34801561052757600080fd5b50610530610f93565b60405161053d9190614e54565b60405180910390f35b61054e610f99565b005b34801561055c57600080fd5b5061057760048036038101906105729190613f0f565b611095565b005b34801561058557600080fd5b506105a0600480360381019061059b9190613e81565b6110b5565b6040516105ad919061499f565b60405180910390f35b3480156105c257600080fd5b506105dd60048036038101906105d89190614100565b6111af565b005b3480156105eb57600080fd5b50610606600480360381019061060191906140d7565b61126e565b005b34801561061457600080fd5b5061062f600480360381019061062a91906141bc565b611307565b60405161063c9190614e54565b60405180910390f35b34801561065157600080fd5b5061066c6004803603810190610667919061417b565b61139e565b005b34801561067a57600080fd5b50610683611434565b60405161069091906149c1565b60405180910390f35b3480156106a557600080fd5b506106ae611447565b6040516106bb91906149c1565b60405180910390f35b3480156106d057600080fd5b506106eb60048036038101906106e691906141bc565b61145a565b6040516106f89190614938565b60405180910390f35b34801561070d57600080fd5b5061072860048036038101906107239190614096565b61150c565b005b34801561073657600080fd5b5061073f6117d7565b60405161074c9190614a12565b60405180910390f35b34801561076157600080fd5b5061077c60048036038101906107779190613e81565b611865565b6040516107899190614e54565b60405180910390f35b34801561079e57600080fd5b506107a761191d565b005b3480156107b557600080fd5b506107d060048036038101906107cb91906141bc565b6119a5565b005b3480156107de57600080fd5b506107e7611af4565b6040516107f49190614938565b60405180910390f35b34801561080957600080fd5b50610812611b1e565b60405161081f9190614a12565b60405180910390f35b610842600480360381019061083d9190614051565b611bb0565b005b34801561085057600080fd5b50610859611eda565b60405161086691906149c1565b60405180910390f35b610889600480360381019061088491906141bc565b611eed565b005b34801561089757600080fd5b506108b260048036038101906108ad9190613fd9565b6121fb565b005b3480156108c057600080fd5b506108c9612211565b6040516108d69190614e54565b60405180910390f35b3480156108eb57600080fd5b5061090660048036038101906109019190613f5e565b612230565b005b34801561091457600080fd5b5061091d612292565b60405161092a91906149f7565b60405180910390f35b34801561093f57600080fd5b5061095a600480360381019061095591906140d7565b6122b8565b005b34801561096857600080fd5b50610971612351565b60405161097e9190614a12565b60405180910390f35b34801561099357600080fd5b506109ae60048036038101906109a991906141bc565b6123df565b6040516109bb9190614a12565b60405180910390f35b3480156109d057600080fd5b506109eb60048036038101906109e69190613e81565b612489565b005b3480156109f957600080fd5b50610a146004803603810190610a0f919061417b565b612549565b005b348015610a2257600080fd5b50610a2b6125df565b604051610a389190614e54565b60405180910390f35b348015610a4d57600080fd5b50610a686004803603810190610a639190613ed3565b6125e5565b604051610a7591906149c1565b60405180910390f35b348015610a8a57600080fd5b50610a93612679565b604051610aa09190614e54565b60405180910390f35b348015610ab557600080fd5b50610ad06004803603810190610acb9190613e81565b61267f565b005b348015610ade57600080fd5b50610ae7612777565b604051610af49190614e54565b60405180910390f35b6113a181565b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610b765750610b758261277c565b5b9050919050565b610b8561285e565b73ffffffffffffffffffffffffffffffffffffffff16610ba3611af4565b73ffffffffffffffffffffffffffffffffffffffff1614610bf9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf090614c74565b60405180910390fd5b80601160006101000a81548160ff02191690831515021790555050565b606060008054610c25906151b7565b80601f0160208091040260200160405190810160405280929190818152602001828054610c51906151b7565b8015610c9e5780601f10610c7357610100808354040283529160200191610c9e565b820191906000526020600020905b815481529060010190602001808311610c8157829003601f168201915b5050505050905090565b6000610cb382612866565b610cf2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce990614c54565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610d388261145a565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610da9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610da090614d54565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610dc861285e565b73ffffffffffffffffffffffffffffffffffffffff161480610df75750610df681610df161285e565b6125e5565b5b610e36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2d90614bb4565b60405180910390fd5b610e4083836128d2565b505050565b60105481565b6000801515610e5983612866565b1515149050919050565b6000600880549050905090565b60136020528060005260406000206000915090505481565b610e99610e9361285e565b8261298b565b610ed8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ecf90614d94565b60405180910390fd5b610ee3838383612a69565b505050565b60125481565b6000610ef983611865565b8210610f3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3190614a74565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b61271081565b610fa161285e565b73ffffffffffffffffffffffffffffffffffffffff16610fbf611af4565b73ffffffffffffffffffffffffffffffffffffffff1614611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c90614c74565b60405180910390fd5b600061101f611af4565b73ffffffffffffffffffffffffffffffffffffffff164760405161104290614923565b60006040518083038185875af1925050503d806000811461107f576040519150601f19603f3d011682016040523d82523d6000602084013e611084565b606091505b505090508061109257600080fd5b50565b6110b083838360405180602001604052806000815250612230565b505050565b606060006110c283611865565b905060008167ffffffffffffffff811115611106577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156111345781602001602082028036833780820191505090505b50905060005b828110156111a45761114c8582610eee565b828281518110611185577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001018181525050808061119c9061521a565b91505061113a565b508092505050919050565b6111b761285e565b73ffffffffffffffffffffffffffffffffffffffff166111d5611af4565b73ffffffffffffffffffffffffffffffffffffffff161461122b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122290614c74565b60405180910390fd5b806012819055507f90004c04698bc3322499a575ed3752dd4abf33e0a7294c06a787a0fe01bea94160125460405161126391906149dc565b60405180910390a150565b61127661285e565b73ffffffffffffffffffffffffffffffffffffffff16611294611af4565b73ffffffffffffffffffffffffffffffffffffffff16146112ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e190614c74565b60405180910390fd5b80601160016101000a81548160ff02191690831515021790555050565b6000611311610e63565b8210611352576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134990614db4565b60405180910390fd5b6008828154811061138c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050919050565b6113a661285e565b73ffffffffffffffffffffffffffffffffffffffff166113c4611af4565b73ffffffffffffffffffffffffffffffffffffffff161461141a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141190614c74565b60405180910390fd5b80600e9080519060200190611430929190613b9b565b5050565b601160009054906101000a900460ff1681565b601160029054906101000a900460ff1681565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114fa90614bf4565b60405180910390fd5b80915050919050565b601160019054906101000a900460ff1661155b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155290614c14565b60405180910390fd5b601160009054906101000a900460ff16156115ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a290614e34565b60405180910390fd5b60005b81518110156117d35760008282815181106115f2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015190506000151561160982612866565b15151461164b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161164290614a54565b60405180910390fd5b6113a1811061168f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168690614cb4565b60405180910390fd5b61169761285e565b73ffffffffffffffffffffffffffffffffffffffff16601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b81526004016117089190614e54565b60206040518083038186803b15801561172057600080fd5b505afa158015611734573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117589190613eaa565b73ffffffffffffffffffffffffffffffffffffffff16146117ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a590614b14565b60405180910390fd5b6117bf6117b961285e565b82612cc5565b5080806117cb9061521a565b9150506115ae565b5050565b600e80546117e4906151b7565b80601f0160208091040260200160405190810160405280929190818152602001828054611810906151b7565b801561185d5780601f106118325761010080835404028352916020019161185d565b820191906000526020600020905b81548152906001019060200180831161184057829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118cd90614bd4565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61192561285e565b73ffffffffffffffffffffffffffffffffffffffff16611943611af4565b73ffffffffffffffffffffffffffffffffffffffff1614611999576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199090614c74565b60405180910390fd5b6119a36000612ce3565b565b6119ad61285e565b73ffffffffffffffffffffffffffffffffffffffff166119cb611af4565b73ffffffffffffffffffffffffffffffffffffffff1614611a21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1890614c74565b60405180910390fd5b60e181600c54611a319190614fbe565b1115611a72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6990614a34565b60405180910390fd5b60005b81811015611af057611ac3611a8861285e565b600c5460e16113a1612710611a9d919061509f565b611aa7919061509f565b6113a1611ab49190614fbe565b611abe9190614fbe565b612cc5565b6001600c6000828254611ad69190614fbe565b925050819055508080611ae89061521a565b915050611a75565b5050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060018054611b2d906151b7565b80601f0160208091040260200160405190810160405280929190818152602001828054611b59906151b7565b8015611ba65780601f10611b7b57610100808354040283529160200191611ba6565b820191906000526020600020905b815481529060010190602001808311611b8957829003601f168201915b5050505050905090565b601160009054906101000a900460ff1615611c00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bf790614cd4565b60405180910390fd5b6000801b6012541415611c48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3f90614d34565b60405180910390fd5b60e16113a1612710611c5a919061509f565b611c64919061509f565b611c7a6001600d54612da990919063ffffffff16565b1115611cbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb290614ad4565b60405180910390fd5b6001601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611d3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3490614c94565b60405180910390fd5b611db1828280806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505060125433604051602001611d9691906148ab565b60405160208183030381529060405280519060200120612dbf565b611df0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de790614dd4565b60405180910390fd5b611e066001601054612dd690919063ffffffff16565b3414611e47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3e90614b74565b60405180910390fd5b601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e979061521a565b9190505550611ebc611ea761285e565b600d546113a1611eb79190614fbe565b612cc5565b6001600d6000828254611ecf9190614fbe565b925050819055505050565b601160019054906101000a900460ff1681565b601160029054906101000a900460ff16611f3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f3390614d74565b60405180910390fd5b601160009054906101000a900460ff1615611f8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f8390614e34565b60405180910390fd5b6002600b541415611fd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc990614e14565b60405180910390fd5b6002600b81905550601160009054906101000a900460ff161561202a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202190614cd4565b60405180910390fd5b60e16113a161271061203c919061509f565b612046919061509f565b61205b82600d54612da990919063ffffffff16565b111561209c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209390614ad4565b60405180910390fd5b6000811180156120ad575060098111155b6120ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e390614df4565b60405180910390fd5b61210181601054612dd690919063ffffffff16565b3414612142576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213990614b74565b60405180910390fd5b60005b818110156121ef57601360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061219d9061521a565b91905055506121c26121ad61285e565b600d546113a16121bd9190614fbe565b612cc5565b6001600d60008282546121d59190614fbe565b9250508190555080806121e79061521a565b915050612145565b506001600b8190555050565b61220d61220661285e565b8383612dec565b5050565b60e16113a1612710612223919061509f565b61222d919061509f565b81565b61224161223b61285e565b8361298b565b612280576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227790614d94565b60405180910390fd5b61228c84848484612f59565b50505050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6122c061285e565b73ffffffffffffffffffffffffffffffffffffffff166122de611af4565b73ffffffffffffffffffffffffffffffffffffffff1614612334576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161232b90614c74565b60405180910390fd5b80601160026101000a81548160ff02191690831515021790555050565b600f805461235e906151b7565b80601f016020809104026020016040519081016040528092919081815260200182805461238a906151b7565b80156123d75780601f106123ac576101008083540402835291602001916123d7565b820191906000526020600020905b8154815290600101906020018083116123ba57829003601f168201915b505050505081565b60606123ea82612866565b612429576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161242090614d14565b60405180910390fd5b6000612433612fb5565b905060008151116124535760405180602001604052806000815250612481565b8061245d84613047565b600f604051602001612471939291906148f2565b6040516020818303038152906040525b915050919050565b61249161285e565b73ffffffffffffffffffffffffffffffffffffffff166124af611af4565b73ffffffffffffffffffffffffffffffffffffffff1614612505576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fc90614c74565b60405180910390fd5b80601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61255161285e565b73ffffffffffffffffffffffffffffffffffffffff1661256f611af4565b73ffffffffffffffffffffffffffffffffffffffff16146125c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125bc90614c74565b60405180910390fd5b80600f90805190602001906125db929190613b9b565b5050565b600d5481565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600c5481565b61268761285e565b73ffffffffffffffffffffffffffffffffffffffff166126a5611af4565b73ffffffffffffffffffffffffffffffffffffffff16146126fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126f290614c74565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561276b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276290614ab4565b60405180910390fd5b61277481612ce3565b50565b60e181565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061284757507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806128575750612856826131f4565b5b9050919050565b600033905090565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166129458361145a565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061299682612866565b6129d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129cc90614b94565b60405180910390fd5b60006129e08361145a565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612a4f57508373ffffffffffffffffffffffffffffffffffffffff16612a3784610ca8565b73ffffffffffffffffffffffffffffffffffffffff16145b80612a605750612a5f81856125e5565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16612a898261145a565b73ffffffffffffffffffffffffffffffffffffffff1614612adf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ad690614cf4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612b4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b4690614b34565b60405180910390fd5b612b5a83838361325e565b612b656000826128d2565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612bb5919061509f565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612c0c9190614fbe565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b612cdf828260405180602001604052806000815250613372565b5050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008183612db79190614fbe565b905092915050565b600082612dcc85846133cd565b1490509392505050565b60008183612de49190615045565b905092915050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612e5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e5290614b54565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051612f4c91906149c1565b60405180910390a3505050565b612f64848484612a69565b612f70848484846134a6565b612faf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fa690614a94565b60405180910390fd5b50505050565b6060600e8054612fc4906151b7565b80601f0160208091040260200160405190810160405280929190818152602001828054612ff0906151b7565b801561303d5780601f106130125761010080835404028352916020019161303d565b820191906000526020600020905b81548152906001019060200180831161302057829003601f168201915b5050505050905090565b6060600082141561308f576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506131ef565b600082905060005b600082146130c15780806130aa9061521a565b915050600a826130ba9190615014565b9150613097565b60008167ffffffffffffffff811115613103577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156131355781602001600182028036833780820191505090505b5090505b600085146131e85760018261314e919061509f565b9150600a8561315d9190615291565b60306131699190614fbe565b60f81b8183815181106131a5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856131e19190615014565b9450613139565b8093505050505b919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61326983838361363d565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156132ac576132a781613642565b6132eb565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146132ea576132e9838261368b565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561332e57613329816137f8565b61336d565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461336c5761336b828261393b565b5b5b505050565b61337c83836139ba565b61338960008484846134a6565b6133c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133bf90614a94565b60405180910390fd5b505050565b60008082905060005b845181101561349b57600085828151811061341a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905080831161345b57828160405160200161343e9291906148c6565b604051602081830303815290604052805190602001209250613487565b808360405160200161346e9291906148c6565b6040516020818303038152906040528051906020012092505b5080806134939061521a565b9150506133d6565b508091505092915050565b60006134c78473ffffffffffffffffffffffffffffffffffffffff16613b88565b15613630578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026134f061285e565b8786866040518563ffffffff1660e01b81526004016135129493929190614953565b602060405180830381600087803b15801561352c57600080fd5b505af192505050801561355d57506040513d601f19601f8201168201806040525081019061355a9190614152565b60015b6135e0573d806000811461358d576040519150601f19603f3d011682016040523d82523d6000602084013e613592565b606091505b506000815114156135d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016135cf90614a94565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050613635565b600190505b949350505050565b505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b6000600161369884611865565b6136a2919061509f565b9050600060076000848152602001908152602001600020549050818114613787576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b6000600160088054905061380c919061509f565b9050600060096000848152602001908152602001600020549050600060088381548110613862577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905080600883815481106138aa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001819055508160096000838152602001908152602001600020819055506009600085815260200190815260200160002060009055600880548061391f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b600061394683611865565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613a2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613a2190614c34565b60405180910390fd5b613a3381612866565b15613a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613a6a90614af4565b60405180910390fd5b613a7f6000838361325e565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613acf9190614fbe565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b600080823b905060008111915050919050565b828054613ba7906151b7565b90600052602060002090601f016020900481019282613bc95760008555613c10565b82601f10613be257805160ff1916838001178555613c10565b82800160010185558215613c10579182015b82811115613c0f578251825591602001919060010190613bf4565b5b509050613c1d9190613c21565b5090565b5b80821115613c3a576000816000905550600101613c22565b5090565b6000613c51613c4c84614e94565b614e6f565b90508083825260208201905082856020860282011115613c7057600080fd5b60005b85811015613ca05781613c868882613e6c565b845260208401935060208301925050600181019050613c73565b5050509392505050565b6000613cbd613cb884614ec0565b614e6f565b905082815260208101848484011115613cd557600080fd5b613ce0848285615175565b509392505050565b6000613cfb613cf684614ef1565b614e6f565b905082815260208101848484011115613d1357600080fd5b613d1e848285615175565b509392505050565b600081359050613d3581615b22565b92915050565b600081519050613d4a81615b22565b92915050565b60008083601f840112613d6257600080fd5b8235905067ffffffffffffffff811115613d7b57600080fd5b602083019150836020820283011115613d9357600080fd5b9250929050565b600082601f830112613dab57600080fd5b8135613dbb848260208601613c3e565b91505092915050565b600081359050613dd381615b39565b92915050565b600081359050613de881615b50565b92915050565b600081359050613dfd81615b67565b92915050565b600081519050613e1281615b67565b92915050565b600082601f830112613e2957600080fd5b8135613e39848260208601613caa565b91505092915050565b600082601f830112613e5357600080fd5b8135613e63848260208601613ce8565b91505092915050565b600081359050613e7b81615b7e565b92915050565b600060208284031215613e9357600080fd5b6000613ea184828501613d26565b91505092915050565b600060208284031215613ebc57600080fd5b6000613eca84828501613d3b565b91505092915050565b60008060408385031215613ee657600080fd5b6000613ef485828601613d26565b9250506020613f0585828601613d26565b9150509250929050565b600080600060608486031215613f2457600080fd5b6000613f3286828701613d26565b9350506020613f4386828701613d26565b9250506040613f5486828701613e6c565b9150509250925092565b60008060008060808587031215613f7457600080fd5b6000613f8287828801613d26565b9450506020613f9387828801613d26565b9350506040613fa487828801613e6c565b925050606085013567ffffffffffffffff811115613fc157600080fd5b613fcd87828801613e18565b91505092959194509250565b60008060408385031215613fec57600080fd5b6000613ffa85828601613d26565b925050602061400b85828601613dc4565b9150509250929050565b6000806040838503121561402857600080fd5b600061403685828601613d26565b925050602061404785828601613e6c565b9150509250929050565b6000806020838503121561406457600080fd5b600083013567ffffffffffffffff81111561407e57600080fd5b61408a85828601613d50565b92509250509250929050565b6000602082840312156140a857600080fd5b600082013567ffffffffffffffff8111156140c257600080fd5b6140ce84828501613d9a565b91505092915050565b6000602082840312156140e957600080fd5b60006140f784828501613dc4565b91505092915050565b60006020828403121561411257600080fd5b600061412084828501613dd9565b91505092915050565b60006020828403121561413b57600080fd5b600061414984828501613dee565b91505092915050565b60006020828403121561416457600080fd5b600061417284828501613e03565b91505092915050565b60006020828403121561418d57600080fd5b600082013567ffffffffffffffff8111156141a757600080fd5b6141b384828501613e42565b91505092915050565b6000602082840312156141ce57600080fd5b60006141dc84828501613e6c565b91505092915050565b60006141f1838361488d565b60208301905092915050565b614206816150d3565b82525050565b61421d614218826150d3565b615263565b82525050565b600061422e82614f47565b6142388185614f75565b935061424383614f22565b8060005b8381101561427457815161425b88826141e5565b975061426683614f68565b925050600181019050614247565b5085935050505092915050565b61428a816150e5565b82525050565b614299816150f1565b82525050565b6142b06142ab826150f1565b615275565b82525050565b60006142c182614f52565b6142cb8185614f86565b93506142db818560208601615184565b6142e48161537e565b840191505092915050565b6142f881615151565b82525050565b600061430982614f5d565b6143138185614fa2565b9350614323818560208601615184565b61432c8161537e565b840191505092915050565b600061434282614f5d565b61434c8185614fb3565b935061435c818560208601615184565b80840191505092915050565b60008154614375816151b7565b61437f8186614fb3565b9450600182166000811461439a57600181146143ab576143de565b60ff198316865281860193506143de565b6143b485614f32565b60005b838110156143d6578154818901526001820191506020810190506143b7565b838801955050505b50505092915050565b60006143f4601383614fa2565b91506143ff8261539c565b602082019050919050565b6000614417601083614fa2565b9150614422826153c5565b602082019050919050565b600061443a602b83614fa2565b9150614445826153ee565b604082019050919050565b600061445d603283614fa2565b91506144688261543d565b604082019050919050565b6000614480602683614fa2565b915061448b8261548c565b604082019050919050565b60006144a3600983614fa2565b91506144ae826154db565b602082019050919050565b60006144c6601c83614fa2565b91506144d182615504565b602082019050919050565b60006144e9600a83614fa2565b91506144f48261552d565b602082019050919050565b600061450c602483614fa2565b915061451782615556565b604082019050919050565b600061452f601983614fa2565b915061453a826155a5565b602082019050919050565b6000614552601f83614fa2565b915061455d826155ce565b602082019050919050565b6000614575602c83614fa2565b9150614580826155f7565b604082019050919050565b6000614598603883614fa2565b91506145a382615646565b604082019050919050565b60006145bb602a83614fa2565b91506145c682615695565b604082019050919050565b60006145de602983614fa2565b91506145e9826156e4565b604082019050919050565b6000614601600f83614fa2565b915061460c82615733565b602082019050919050565b6000614624602083614fa2565b915061462f8261575c565b602082019050919050565b6000614647602c83614fa2565b915061465282615785565b604082019050919050565b600061466a602083614fa2565b9150614675826157d4565b602082019050919050565b600061468d602483614fa2565b9150614698826157fd565b604082019050919050565b60006146b0601283614fa2565b91506146bb8261584c565b602082019050919050565b60006146d3601683614fa2565b91506146de82615875565b602082019050919050565b60006146f6602983614fa2565b91506147018261589e565b604082019050919050565b6000614719602f83614fa2565b9150614724826158ed565b604082019050919050565b600061473c601783614fa2565b91506147478261593c565b602082019050919050565b600061475f602183614fa2565b915061476a82615965565b604082019050919050565b6000614782600e83614fa2565b915061478d826159b4565b602082019050919050565b60006147a5600083614f97565b91506147b0826159dd565b600082019050919050565b60006147c8603183614fa2565b91506147d3826159e0565b604082019050919050565b60006147eb602c83614fa2565b91506147f682615a2f565b604082019050919050565b600061480e600d83614fa2565b915061481982615a7e565b602082019050919050565b6000614831602083614fa2565b915061483c82615aa7565b602082019050919050565b6000614854601f83614fa2565b915061485f82615ad0565b602082019050919050565b6000614877600f83614fa2565b915061488282615af9565b602082019050919050565b61489681615147565b82525050565b6148a581615147565b82525050565b60006148b7828461420c565b60148201915081905092915050565b60006148d2828561429f565b6020820191506148e2828461429f565b6020820191508190509392505050565b60006148fe8286614337565b915061490a8285614337565b91506149168284614368565b9150819050949350505050565b600061492e82614798565b9150819050919050565b600060208201905061494d60008301846141fd565b92915050565b600060808201905061496860008301876141fd565b61497560208301866141fd565b614982604083018561489c565b818103606083015261499481846142b6565b905095945050505050565b600060208201905081810360008301526149b98184614223565b905092915050565b60006020820190506149d66000830184614281565b92915050565b60006020820190506149f16000830184614290565b92915050565b6000602082019050614a0c60008301846142ef565b92915050565b60006020820190508181036000830152614a2c81846142fe565b905092915050565b60006020820190508181036000830152614a4d816143e7565b9050919050565b60006020820190508181036000830152614a6d8161440a565b9050919050565b60006020820190508181036000830152614a8d8161442d565b9050919050565b60006020820190508181036000830152614aad81614450565b9050919050565b60006020820190508181036000830152614acd81614473565b9050919050565b60006020820190508181036000830152614aed81614496565b9050919050565b60006020820190508181036000830152614b0d816144b9565b9050919050565b60006020820190508181036000830152614b2d816144dc565b9050919050565b60006020820190508181036000830152614b4d816144ff565b9050919050565b60006020820190508181036000830152614b6d81614522565b9050919050565b60006020820190508181036000830152614b8d81614545565b9050919050565b60006020820190508181036000830152614bad81614568565b9050919050565b60006020820190508181036000830152614bcd8161458b565b9050919050565b60006020820190508181036000830152614bed816145ae565b9050919050565b60006020820190508181036000830152614c0d816145d1565b9050919050565b60006020820190508181036000830152614c2d816145f4565b9050919050565b60006020820190508181036000830152614c4d81614617565b9050919050565b60006020820190508181036000830152614c6d8161463a565b9050919050565b60006020820190508181036000830152614c8d8161465d565b9050919050565b60006020820190508181036000830152614cad81614680565b9050919050565b60006020820190508181036000830152614ccd816146a3565b9050919050565b60006020820190508181036000830152614ced816146c6565b9050919050565b60006020820190508181036000830152614d0d816146e9565b9050919050565b60006020820190508181036000830152614d2d8161470c565b9050919050565b60006020820190508181036000830152614d4d8161472f565b9050919050565b60006020820190508181036000830152614d6d81614752565b9050919050565b60006020820190508181036000830152614d8d81614775565b9050919050565b60006020820190508181036000830152614dad816147bb565b9050919050565b60006020820190508181036000830152614dcd816147de565b9050919050565b60006020820190508181036000830152614ded81614801565b9050919050565b60006020820190508181036000830152614e0d81614824565b9050919050565b60006020820190508181036000830152614e2d81614847565b9050919050565b60006020820190508181036000830152614e4d8161486a565b9050919050565b6000602082019050614e69600083018461489c565b92915050565b6000614e79614e8a565b9050614e8582826151e9565b919050565b6000604051905090565b600067ffffffffffffffff821115614eaf57614eae61534f565b5b602082029050602081019050919050565b600067ffffffffffffffff821115614edb57614eda61534f565b5b614ee48261537e565b9050602081019050919050565b600067ffffffffffffffff821115614f0c57614f0b61534f565b5b614f158261537e565b9050602081019050919050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b6000614fc982615147565b9150614fd483615147565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115615009576150086152c2565b5b828201905092915050565b600061501f82615147565b915061502a83615147565b92508261503a576150396152f1565b5b828204905092915050565b600061505082615147565b915061505b83615147565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615615094576150936152c2565b5b828202905092915050565b60006150aa82615147565b91506150b583615147565b9250828210156150c8576150c76152c2565b5b828203905092915050565b60006150de82615127565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061515c82615163565b9050919050565b600061516e82615127565b9050919050565b82818337600083830152505050565b60005b838110156151a2578082015181840152602081019050615187565b838111156151b1576000848401525b50505050565b600060028204905060018216806151cf57607f821691505b602082108114156151e3576151e2615320565b5b50919050565b6151f28261537e565b810181811067ffffffffffffffff821117156152115761521061534f565b5b80604052505050565b600061522582615147565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415615258576152576152c2565b5b600182019050919050565b600061526e8261527f565b9050919050565b6000819050919050565b600061528a8261538f565b9050919050565b600061529c82615147565b91506152a783615147565b9250826152b7576152b66152f1565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b7f4578636565646564206769766561776179732e00000000000000000000000000600082015250565b7f416c726561647920636c61696d65642100000000000000000000000000000000600082015250565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f536f6c64204f7574210000000000000000000000000000000000000000000000600082015250565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f426164206f776e65722100000000000000000000000000000000000000000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f45746865722076616c75652073656e74206973206e6f7420636f727265637400600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f436c61696d20697320436c6f7365640000000000000000000000000000000000600082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f416c726561647920436c61696d6564207468652077686974656c69737465642060008201527f6d696e7400000000000000000000000000000000000000000000000000000000602082015250565b7f506f73742d636c61696d20637570636174210000000000000000000000000000600082015250565b7f74686520636f6e74726163742069732070617573656400000000000000000000600082015250565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b7f5768697465204c697374204d696e747320436c6f736564000000000000000000600082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f53616c6520697320436c6f736564000000000000000000000000000000000000600082015250565b50565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b7f496e76616c69642070726f6f6600000000000000000000000000000000000000600082015250565b7f43616e206f6e6c79206d696e74203920746f6b656e7320617420612074696d65600082015250565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b7f436f6e7472616374205061757365640000000000000000000000000000000000600082015250565b615b2b816150d3565b8114615b3657600080fd5b50565b615b42816150e5565b8114615b4d57600080fd5b50565b615b59816150f1565b8114615b6457600080fd5b50565b615b70816150fb565b8114615b7b57600080fd5b50565b615b8781615147565b8114615b9257600080fd5b5056fea2646970667358221220b611edcdeb8e3e4c5d4bb98b38a73e6e8c44a3f807ab441ac72d53a4b224c81464736f6c63430008040033

Verified Source Code Full Match

Compiler: v0.8.4+commit.c7e474f2 EVM: istanbul Optimization: No
CCK.sol 158 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

interface CupCatInterface is IERC721{
    function walletOfOwner(address _owner) external view returns (uint256[] memory);
}

contract CupcatKittens is ERC721Enumerable, Ownable, ReentrancyGuard  {  
    using SafeMath for uint256;
    uint256 public _tokenIdTrackerReserve;
    uint256 public _tokenIdTrackerSale;
    using Strings for uint256;
    uint256 public constant MAXCLAIMSUPPLY = 5025;
    uint256 public constant MAX_TOTAL_SUPPLY = 10000; 
    uint256 public constant MAXRESERVE = 225;
    uint256 public constant MAXSALE = MAX_TOTAL_SUPPLY - MAXCLAIMSUPPLY - MAXRESERVE;
    string public baseURI;
    string public baseExtension = ".json";
    uint256 public cost = 17500000000000000;
    bool public paused = false;
    bool public claimState = false;
    bool public saleState = false;
    bytes32 public merkleRoot = 0x0000000000000000000000000000000000000000000000000000000000000000;
    mapping(address => uint256) public addressMintedBalance;
    event MerkleRootUpdated(bytes32 new_merkle_root);
    CupCatInterface public cupCats;

constructor(
    ) ERC721("Cupcat Kittens", "CCK") {
    setBaseURI("exampleurl");
    setCupcats(0x8Cd8155e1af6AD31dd9Eec2cEd37e04145aCFCb3);
    }
    // internal
    function _baseURI() internal view virtual override returns (string memory) {
    return baseURI;
    }
    //Modify
    modifier claimIsOpen {
          require(claimState, "Claim is Closed");
          require(!paused, "Contract Paused");
          _;
      }
    modifier saleIsOpen {
          require(saleState, "Sale is Closed");
          require(!paused, "Contract Paused");
          _;
      }
    // public
    function whiteListMint(bytes32[] calldata _merkleProof ) public payable  {
          require(!paused, "the contract is paused");
          require(merkleRoot != 0x0000000000000000000000000000000000000000000000000000000000000000 , "White List Mints Closed");
          require(_tokenIdTrackerSale.add(1) <= MAXSALE, "Sold Out!");
          //Verify Already whiteListMint this Wallet
          require(addressMintedBalance[msg.sender] < 1 , "Already Claimed the whitelisted mint");
          //Merkle
          require(MerkleProof.verify(_merkleProof, merkleRoot,  keccak256(abi.encodePacked(msg.sender))  ), "Invalid proof");
          //verify Cost
          require(msg.value == cost.mul(1),  "Ether value sent is not correct");
          //Mark Claim
          addressMintedBalance[msg.sender]++;
          //Mint --
          _safeMint(_msgSender(), MAXCLAIMSUPPLY +  _tokenIdTrackerSale);
          _tokenIdTrackerSale += 1;
    }
    function mint(uint256 _count) public payable saleIsOpen nonReentrant{
          require(!paused, "the contract is paused");
          require(_tokenIdTrackerSale.add(_count) <= MAXSALE, "Sold Out!");
          require(_count > 0 && _count <= 9, "Can only mint 9 tokens at a time");
          require(msg.value==cost.mul(_count), "Ether value sent is not correct");
          for (uint256 i = 0; i < _count; i++) {
              addressMintedBalance[msg.sender]++;
              _safeMint(_msgSender(), MAXCLAIMSUPPLY  + _tokenIdTrackerSale);
              _tokenIdTrackerSale += 1;
          }
    }
    function claim(uint256[] memory _tokensId) public claimIsOpen {
          //Require claimIsOpen True
          for (uint256 i = 0; i < _tokensId.length; i++) {
          uint256 tokenId = _tokensId[i];
          require(_exists(tokenId) == false, "Already claimed!");
          require(tokenId < MAXCLAIMSUPPLY, "Post-claim cupcat!");
          require(cupCats.ownerOf(tokenId) == _msgSender(), "Bad owner!");
        _safeMint(_msgSender(), tokenId); 
          }
    }
    function reserve(uint256 _count) public onlyOwner {
          require(_tokenIdTrackerReserve + _count <= MAXRESERVE, "Exceeded giveaways.");
            for (uint256 i = 0; i < _count; i++) {
                  _safeMint(_msgSender(), MAXCLAIMSUPPLY + MAXSALE+ _tokenIdTrackerReserve);
                  _tokenIdTrackerReserve += 1;
            }
    }
    function checkClaim(uint256 _tokenId) public view returns(bool) {
        return _exists(_tokenId) == false;
    }
    function walletOfOwner(address _owner)
        public
        view
        returns (uint256[] memory)
        {
        uint256 ownerTokenCount = balanceOf(_owner);
        uint256[] memory tokenIds = new uint256[](ownerTokenCount);
        for (uint256 i; i < ownerTokenCount; i++) {
        tokenIds[i] = tokenOfOwnerByIndex(_owner, i);
        }
      return tokenIds;
    }
    function tokenURI(uint256 tokenId)
        public
        view
        virtual
        override
        returns (string memory)
      {
        require(
          _exists(tokenId),
          "ERC721Metadata: URI query for nonexistent token"
        );
        string memory currentBaseURI = _baseURI();
        return bytes(currentBaseURI).length > 0
            ? string(abi.encodePacked(currentBaseURI, tokenId.toString(), baseExtension))
            : "";
    }
    //only owner
    function setCupcats(address _cupCats) public onlyOwner {
        cupCats = CupCatInterface(_cupCats);
    }
    function setBaseURI(string memory _newBaseURI) public onlyOwner {
        baseURI = _newBaseURI;
    }
    function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
        baseExtension = _newBaseExtension;
    }
    function pause(bool _state) public onlyOwner {
        paused = _state;
    }
    function setSaleState(bool _state) public onlyOwner{
        saleState = _state;
    }
    function setClaimState(bool _state) public onlyOwner {
        claimState = _state;
    }
    function withdraw() public payable onlyOwner {
        (bool os, ) = payable(owner()).call{value: address(this).balance}("");
        require(os);
    }
    // to set the merkle proof
    function updateMerkleRoot(bytes32 newmerkleRoot) external onlyOwner {
        merkleRoot = newmerkleRoot;
        emit MerkleRootUpdated(merkleRoot);
    }
}   
Address.sol 217 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
ERC721.sol 424 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _owners[tokenId] != address(0);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver.onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert("ERC721: transfer to non ERC721Receiver implementer");
                } else {
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}
SafeMath.sol 227 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 substraction 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;
        }
    }
}
IERC721.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}
ReentrancyGuard.sol 63 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
IERC721Receiver.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}
MerkleProof.sol 52 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];
            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
            }
        }
        return computedHash;
    }
}
IERC721Metadata.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}
ERC721Enumerable.sol 163 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
        return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, ``from``'s `tokenId` will be burned.
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, tokenId);

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}
IERC721Enumerable.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

Read Contract

MAXCLAIMSUPPLY 0x01e05ba4 → uint256
MAXRESERVE 0xf94a279b → uint256
MAXSALE 0xaaa25f4e → uint256
MAX_TOTAL_SUPPLY 0x33039d3d → uint256
_tokenIdTrackerReserve 0xf1c51b39 → uint256
_tokenIdTrackerSale 0xdc559fce → uint256
addressMintedBalance 0x18cae269 → uint256
balanceOf 0x70a08231 → uint256
baseExtension 0xc6682862 → string
baseURI 0x6c0360eb → string
checkClaim 0x1681d158 → bool
claimState 0x9a725809 → bool
cost 0x13faede6 → uint256
cupCats 0xb90ae3ed → address
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
merkleRoot 0x2eb4a7ab → bytes32
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
saleState 0x603f4d52 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
walletOfOwner 0x438b6300 → uint256[]

Write Contract 19 functions

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

approve 0x095ea7b3
address to
uint256 tokenId
claim 0x6ba4c138
uint256[] _tokensId
mint 0xa0712d68
uint256 _count
pause 0x02329a29
bool _state
renounceOwnership 0x715018a6
No parameters
reserve 0x819b25ba
uint256 _count
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseExtension 0xda3ef23f
string _newBaseExtension
setBaseURI 0x55f804b3
string _newBaseURI
setClaimState 0x4b014e28
bool _state
setCupcats 0xd1be66ba
address _cupCats
setSaleState 0xc4e37095
bool _state
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
updateMerkleRoot 0x4783f0ef
bytes32 newmerkleRoot
whiteListMint 0x97254e55
bytes32[] _merkleProof
withdraw 0x3ccfd60b
No parameters

Recent Transactions

This address has 1 on-chain transactions, but only 0.6% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →