Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x3f5FB35468e9834A43dcA1C160c69EaAE78b6360
Balance 0 ETH
Nonce 1
Code Size 19188 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

19188 bytes
0x60806040526004361061020f5760003560e01c8063853828b611610118578063c23476d1116100a0578063e79efc361161006f578063e79efc3614610796578063e985e9c5146107bf578063ea44acfd146107fc578063f2fde38b14610827578063f36089ec146108505761020f565b8063c23476d1146106c8578063c87b56dd14610705578063cbf21fe414610742578063d2e804941461076d5761020f565b806398d5fdca116100e757806398d5fdca146105f2578063a0712d681461061d578063a22cb46514610639578063ae8e5ec914610662578063b88d4fde1461069f5761020f565b8063853828b6146105695780638da5cb5b1461057357806391b7f5ed1461059e57806395d89b41146105c75761020f565b80633bd2b67d1161019b57806355f804b31161016a57806355f804b3146104935780636352211e146104bc57806370a08231146104f9578063715018a6146105365780637835c6351461054d5761020f565b80633bd2b67d146103c757806342842e0e146103f0578063438b6300146104195780634f6ccce7146104565761020f565b8063095ea7b3116101e2578063095ea7b3146102e457806318160ddd1461030d578063233f50661461033857806323b872dd146103615780632f745c591461038a5761020f565b806301ffc9a71461021457806306fdde0314610251578063081812fc1461027c5780630922f9c5146102b9575b600080fd5b34801561022057600080fd5b5061023b600480360381019061023691906134c3565b61087b565b60405161024891906141f9565b60405180910390f35b34801561025d57600080fd5b506102666108f5565b6040516102739190614214565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190613556565b610987565b6040516102b09190614170565b60405180910390f35b3480156102c557600080fd5b506102ce610a0c565b6040516102db91906145f6565b60405180910390f35b3480156102f057600080fd5b5061030b60048036038101906103069190613487565b610a11565b005b34801561031957600080fd5b50610322610b29565b60405161032f91906145f6565b60405180910390f35b34801561034457600080fd5b5061035f600480360381019061035a919061331c565b610b36565b005b34801561036d57600080fd5b5061038860048036038101906103839190613381565b610c0d565b005b34801561039657600080fd5b506103b160048036038101906103ac9190613487565b610c6d565b6040516103be91906145f6565b60405180910390f35b3480156103d357600080fd5b506103ee60048036038101906103e99190613556565b610d12565b005b3480156103fc57600080fd5b5061041760048036038101906104129190613381565b610d98565b005b34801561042557600080fd5b50610440600480360381019061043b919061331c565b610db8565b60405161044d91906141d7565b60405180910390f35b34801561046257600080fd5b5061047d60048036038101906104789190613556565b610f34565b60405161048a91906145f6565b60405180910390f35b34801561049f57600080fd5b506104ba60048036038101906104b59190613515565b610fcb565b005b3480156104c857600080fd5b506104e360048036038101906104de9190613556565b611061565b6040516104f09190614170565b60405180910390f35b34801561050557600080fd5b50610520600480360381019061051b919061331c565b611113565b60405161052d91906145f6565b60405180910390f35b34801561054257600080fd5b5061054b6111cb565b005b61056760048036038101906105629190613556565b611253565b005b61057161153b565b005b34801561057f57600080fd5b506105886115f7565b6040516105959190614170565b60405180910390f35b3480156105aa57600080fd5b506105c560048036038101906105c09190613556565b611621565b005b3480156105d357600080fd5b506105dc6116a7565b6040516105e99190614214565b60405180910390f35b3480156105fe57600080fd5b50610607611739565b60405161061491906145f6565b60405180910390f35b61063760048036038101906106329190613556565b611743565b005b34801561064557600080fd5b50610660600480360381019061065b919061344b565b6118f4565b005b34801561066e57600080fd5b506106896004803603810190610684919061331c565b611a75565b60405161069691906141f9565b60405180910390f35b3480156106ab57600080fd5b506106c660048036038101906106c191906133d0565b611acb565b005b3480156106d457600080fd5b506106ef60048036038101906106ea919061331c565b611b2d565b6040516106fc91906145f6565b60405180910390f35b34801561071157600080fd5b5061072c60048036038101906107279190613556565b611b76565b6040516107399190614214565b60405180910390f35b34801561074e57600080fd5b50610757611c1d565b60405161076491906145f6565b60405180910390f35b34801561077957600080fd5b50610794600480360381019061078f9190613556565b611c27565b005b3480156107a257600080fd5b506107bd60048036038101906107b89190613556565b611cad565b005b3480156107cb57600080fd5b506107e660048036038101906107e19190613345565b611e0e565b6040516107f391906141f9565b60405180910390f35b34801561080857600080fd5b50610811611ea2565b60405161081e91906145f6565b60405180910390f35b34801561083357600080fd5b5061084e6004803603810190610849919061331c565b611ea8565b005b34801561085c57600080fd5b50610865611fa0565b60405161087291906145f6565b60405180910390f35b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108ee57506108ed82611faa565b5b9050919050565b606060008054610904906148e9565b80601f0160208091040260200160405190810160405280929190818152602001828054610930906148e9565b801561097d5780601f106109525761010080835404028352916020019161097d565b820191906000526020600020905b81548152906001019060200180831161096057829003601f168201915b5050505050905090565b60006109928261208c565b6109d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c890614436565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b606481565b6000610a1c82611061565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a84906144f6565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610aac6120f8565b73ffffffffffffffffffffffffffffffffffffffff161480610adb5750610ada81610ad56120f8565b611e0e565b5b610b1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b11906143b6565b60405180910390fd5b610b248383612100565b505050565b6000600880549050905090565b610b3e6120f8565b73ffffffffffffffffffffffffffffffffffffffff16610b5c6115f7565b73ffffffffffffffffffffffffffffffffffffffff1614610bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba990614476565b60405180910390fd5b6001600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c1e610c186120f8565b826121b9565b610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490614536565b60405180910390fd5b610c68838383612297565b505050565b6000610c7883611113565b8210610cb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb090614296565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b610d1a6120f8565b73ffffffffffffffffffffffffffffffffffffffff16610d386115f7565b73ffffffffffffffffffffffffffffffffffffffff1614610d8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8590614476565b60405180910390fd5b80600e8190555050565b610db383838360405180602001604052806000815250611acb565b505050565b60606000610dc583611113565b90506000811415610e4857600067ffffffffffffffff811115610e11577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015610e3f5781602001602082028036833780820191505090505b50915050610f2f565b60008167ffffffffffffffff811115610e8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015610eb85781602001602082028036833780820191505090505b50905060005b82811015610f2857610ed08582610c6d565b828281518110610f09577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181815250508080610f209061491b565b915050610ebe565b5080925050505b919050565b6000610f3e610b29565b8210610f7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7690614556565b60405180910390fd5b60088281548110610fb9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050919050565b610fd36120f8565b73ffffffffffffffffffffffffffffffffffffffff16610ff16115f7565b73ffffffffffffffffffffffffffffffffffffffff1614611047576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103e90614476565b60405180910390fd5b806011908051906020019061105d929190613140565b5050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561110a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611101906143f6565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611184576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117b906143d6565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6111d36120f8565b73ffffffffffffffffffffffffffffffffffffffff166111f16115f7565b73ffffffffffffffffffffffffffffffffffffffff1614611247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123e90614476565b60405180910390fd5b61125160006124f3565b565b62029f7c600e5461126491906147ff565b4210156112a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129d90614256565b60405180910390fd5b600e5442106112ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e190614516565b60405180910390fd5b60006112f4610b29565b9050600b5482111561133b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133290614596565b60405180910390fd5b60011515600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146113ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c590614456565b60405180910390fd5b600b5482601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461141c919061471e565b111561145d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145490614236565b60405180910390fd5b3482600d5461146c91906147a5565b11156114ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a490614276565b60405180910390fd5b60005b828110156114e0576114cd3382846114c8919061471e565b6125b9565b80806114d89061491b565b9150506114b0565b5081601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611530919061471e565b925050819055505050565b6115436120f8565b73ffffffffffffffffffffffffffffffffffffffff166115616115f7565b73ffffffffffffffffffffffffffffffffffffffff16146115b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ae90614476565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050506115f557600080fd5b565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6116296120f8565b73ffffffffffffffffffffffffffffffffffffffff166116476115f7565b73ffffffffffffffffffffffffffffffffffffffff161461169d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169490614476565b60405180910390fd5b80600d8190555050565b6060600180546116b6906148e9565b80601f01602080910402602001604051908101604052809291908181526020018280546116e2906148e9565b801561172f5780601f106117045761010080835404028352916020019161172f565b820191906000526020600020905b81548152906001019060200180831161171257829003601f168201915b5050505050905090565b6000600d54905090565b600e54421015611788576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177f906145b6565b60405180910390fd5b6000611792610b29565b9050600c5482106117d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117cf906144b6565b60405180910390fd5b612710811061181c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181390614376565b60405180910390fd5b612710828261182b919061471e565b111561186c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186390614576565b60405180910390fd5b3482600d5461187b91906147a5565b11156118bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b390614276565b60405180910390fd5b60005b828110156118ef576118dc3382846118d7919061471e565b6125b9565b80806118e79061491b565b9150506118bf565b505050565b6118fc6120f8565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561196a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196190614356565b60405180910390fd5b80600560006119776120f8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611a246120f8565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611a6991906141f9565b60405180910390a35050565b6000600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b611adc611ad66120f8565b836121b9565b611b1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b1290614536565b60405180910390fd5b611b27848484846125d7565b50505050565b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060611b818261208c565b611bc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb7906144d6565b60405180910390fd5b6000611bca612633565b90506000815111611bea5760405180602001604052806000815250611c15565b80611bf4846126c5565b604051602001611c0592919061414c565b6040516020818303038152906040525b915050919050565b6000600e54905090565b611c2f6120f8565b73ffffffffffffffffffffffffffffffffffffffff16611c4d6115f7565b73ffffffffffffffffffffffffffffffffffffffff1614611ca3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9a90614476565b60405180910390fd5b80600b8190555050565b611cb56120f8565b73ffffffffffffffffffffffffffffffffffffffff16611cd36115f7565b73ffffffffffffffffffffffffffffffffffffffff1614611d29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2090614476565b60405180910390fd5b6000611d33610b29565b905062029f7c600e54611d4691906147ff565b4210611d87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7e90614316565b60405180910390fd5b60648282611d95919061471e565b1115611dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcd906145d6565b60405180910390fd5b60005b82811015611e0957611df6338284611df1919061471e565b6125b9565b8080611e019061491b565b915050611dd9565b505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61271081565b611eb06120f8565b73ffffffffffffffffffffffffffffffffffffffff16611ece6115f7565b73ffffffffffffffffffffffffffffffffffffffff1614611f24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1b90614476565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f8b906142d6565b60405180910390fd5b611f9d816124f3565b50565b6000600b54905090565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061207557507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80612085575061208482612872565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff1661217383611061565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60006121c48261208c565b612203576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121fa90614396565b60405180910390fd5b600061220e83611061565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061227d57508373ffffffffffffffffffffffffffffffffffffffff1661226584610987565b73ffffffffffffffffffffffffffffffffffffffff16145b8061228e575061228d8185611e0e565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166122b782611061565b73ffffffffffffffffffffffffffffffffffffffff161461230d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230490614496565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561237d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237490614336565b60405180910390fd5b6123888383836128dc565b612393600082612100565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546123e391906147ff565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461243a919061471e565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6125d38282604051806020016040528060008152506129f0565b5050565b6125e2848484612297565b6125ee84848484612a4b565b61262d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612624906142b6565b60405180910390fd5b50505050565b606060118054612642906148e9565b80601f016020809104026020016040519081016040528092919081815260200182805461266e906148e9565b80156126bb5780601f10612690576101008083540402835291602001916126bb565b820191906000526020600020905b81548152906001019060200180831161269e57829003601f168201915b5050505050905090565b6060600082141561270d576040518060400160405280600181526020017f3000000000000000000000000000000000000000000000000000000000000000815250905061286d565b600082905060005b6000821461273f5780806127289061491b565b915050600a826127389190614774565b9150612715565b60008167ffffffffffffffff811115612781577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156127b35781602001600182028036833780820191505090505b5090505b60008514612866576001826127cc91906147ff565b9150600a856127db9190614964565b60306127e7919061471e565b60f81b818381518110612823577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561285f9190614774565b94506127b7565b8093505050505b919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6128e7838383612be2565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561292a5761292581612be7565b612969565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612968576129678382612c30565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156129ac576129a781612d9d565b6129eb565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146129ea576129e98282612ee0565b5b5b505050565b6129fa8383612f5f565b612a076000848484612a4b565b612a46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3d906142b6565b60405180910390fd5b505050565b6000612a6c8473ffffffffffffffffffffffffffffffffffffffff1661312d565b15612bd5578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612a956120f8565b8786866040518563ffffffff1660e01b8152600401612ab7949392919061418b565b602060405180830381600087803b158015612ad157600080fd5b505af1925050508015612b0257506040513d601f19601f82011682018060405250810190612aff91906134ec565b60015b612b85573d8060008114612b32576040519150601f19603f3d011682016040523d82523d6000602084013e612b37565b606091505b50600081511415612b7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b74906142b6565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612bda565b600190505b949350505050565b505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b60006001612c3d84611113565b612c4791906147ff565b9050600060076000848152602001908152602001600020549050818114612d2c576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b60006001600880549050612db191906147ff565b9050600060096000848152602001908152602001600020549050600060088381548110612e07577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015490508060088381548110612e4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020018190555081600960008381526020019081526020016000208190555060096000858152602001908152602001600020600090556008805480612ec4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000612eeb83611113565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612fcf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fc690614416565b60405180910390fd5b612fd88161208c565b15613018576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161300f906142f6565b60405180910390fd5b613024600083836128dc565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613074919061471e565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b600080823b905060008111915050919050565b82805461314c906148e9565b90600052602060002090601f01602090048101928261316e57600085556131b5565b82601f1061318757805160ff19168380011785556131b5565b828001600101855582156131b5579182015b828111156131b4578251825591602001919060010190613199565b5b5090506131c291906131c6565b5090565b5b808211156131df5760008160009055506001016131c7565b5090565b60006131f66131f184614642565b614611565b90508281526020810184848401111561320e57600080fd5b6132198482856148a7565b509392505050565b600061323461322f84614672565b614611565b90508281526020810184848401111561324c57600080fd5b6132578482856148a7565b509392505050565b60008135905061326e81614a62565b92915050565b60008135905061328381614a79565b92915050565b60008135905061329881614a90565b92915050565b6000815190506132ad81614a90565b92915050565b600082601f8301126132c457600080fd5b81356132d48482602086016131e3565b91505092915050565b600082601f8301126132ee57600080fd5b81356132fe848260208601613221565b91505092915050565b60008135905061331681614aa7565b92915050565b60006020828403121561332e57600080fd5b600061333c8482850161325f565b91505092915050565b6000806040838503121561335857600080fd5b60006133668582860161325f565b92505060206133778582860161325f565b9150509250929050565b60008060006060848603121561339657600080fd5b60006133a48682870161325f565b93505060206133b58682870161325f565b92505060406133c686828701613307565b9150509250925092565b600080600080608085870312156133e657600080fd5b60006133f48782880161325f565b94505060206134058782880161325f565b935050604061341687828801613307565b925050606085013567ffffffffffffffff81111561343357600080fd5b61343f878288016132b3565b91505092959194509250565b6000806040838503121561345e57600080fd5b600061346c8582860161325f565b925050602061347d85828601613274565b9150509250929050565b6000806040838503121561349a57600080fd5b60006134a88582860161325f565b92505060206134b985828601613307565b9150509250929050565b6000602082840312156134d557600080fd5b60006134e384828501613289565b91505092915050565b6000602082840312156134fe57600080fd5b600061350c8482850161329e565b91505092915050565b60006020828403121561352757600080fd5b600082013567ffffffffffffffff81111561354157600080fd5b61354d848285016132dd565b91505092915050565b60006020828403121561356857600080fd5b600061357684828501613307565b91505092915050565b600061358b838361412e565b60208301905092915050565b6135a081614833565b82525050565b60006135b1826146b2565b6135bb81856146e0565b93506135c6836146a2565b8060005b838110156135f75781516135de888261357f565b97506135e9836146d3565b9250506001810190506135ca565b5085935050505092915050565b61360d81614845565b82525050565b600061361e826146bd565b61362881856146f1565b93506136388185602086016148b6565b61364181614a51565b840191505092915050565b6000613657826146c8565b6136618185614702565b93506136718185602086016148b6565b61367a81614a51565b840191505092915050565b6000613690826146c8565b61369a8185614713565b93506136aa8185602086016148b6565b80840191505092915050565b60006136c3602e83614702565b91507f4578636565647320737570706c79206f662070726573616c65204b6f616c617360008301527f20796f752063616e206d696e742e0000000000000000000000000000000000006020830152604082019050919050565b6000613729602083614702565b91507f5468652070726573616c6520686173206e6f742079657420737461727465642e6000830152602082019050919050565b6000613769601a83614702565b91507f5472616e73616374696f6e2076616c756520746f6f206c6f772e0000000000006000830152602082019050919050565b60006137a9602b83614702565b91507f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008301527f74206f6620626f756e64730000000000000000000000000000000000000000006020830152604082019050919050565b600061380f603283614702565b91507f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008301527f63656976657220696d706c656d656e74657200000000000000000000000000006020830152604082019050919050565b6000613875602683614702565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006138db601c83614702565b91507f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006000830152602082019050919050565b600061391b601983614702565b91507f53616c652068617320616c726561647920737461727465642e000000000000006000830152602082019050919050565b600061395b602483614702565b91507f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006139c1601983614702565b91507f4552433732313a20617070726f766520746f2063616c6c6572000000000000006000830152602082019050919050565b6000613a01601e83614702565b91507f416c6c204b6f616c61732061726520616c7265616479206d696e7465642e00006000830152602082019050919050565b6000613a41602c83614702565b91507f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008301527f697374656e7420746f6b656e00000000000000000000000000000000000000006020830152604082019050919050565b6000613aa7603883614702565b91507f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008301527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006020830152604082019050919050565b6000613b0d602a83614702565b91507f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008301527f726f2061646472657373000000000000000000000000000000000000000000006020830152604082019050919050565b6000613b73602983614702565b91507f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008301527f656e7420746f6b656e00000000000000000000000000000000000000000000006020830152604082019050919050565b6000613bd9602083614702565b91507f4552433732313a206d696e7420746f20746865207a65726f20616464726573736000830152602082019050919050565b6000613c19602c83614702565b91507f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008301527f697374656e7420746f6b656e00000000000000000000000000000000000000006020830152604082019050919050565b6000613c7f603083614702565b91507f546869732061646472657373206973206e6f742077686974656c69737465642060008301527f666f72207468652070726573616c652e000000000000000000000000000000006020830152604082019050919050565b6000613ce5602083614702565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000613d25602983614702565b91507f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008301527f73206e6f74206f776e00000000000000000000000000000000000000000000006020830152604082019050919050565b6000613d8b603083614702565b91507f576f61682c204e656c6c792e205468617427732077617920746f6f206d616e7960008301527f204b6f616c617320746f206d696e7421000000000000000000000000000000006020830152604082019050919050565b6000613df1602f83614702565b91507f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008301527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006020830152604082019050919050565b6000613e57602183614702565b91507f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008301527f72000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613ebd602483614702565b91507f546865207075626c69632073616c652068617320616c7265616479207374617260008301527f7465642e000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613f23603183614702565b91507f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008301527f776e6572206e6f7220617070726f7665640000000000000000000000000000006020830152604082019050919050565b6000613f89602c83614702565b91507f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008301527f7574206f6620626f756e647300000000000000000000000000000000000000006020830152604082019050919050565b6000613fef602d83614702565b91507f5468697320616d6f756e74206f66204b6f616c61732077696c6c20657863656560008301527f64206d617820737570706c792e000000000000000000000000000000000000006020830152604082019050919050565b6000614055602f83614702565b91507f4d696e74207472616e73616374696f6e206578636565647320796f757220617660008301527f61696c61626c6520737570706c792e00000000000000000000000000000000006020830152604082019050919050565b60006140bb601583614702565b91507f53616c65206973206e6f7420796574206f70656e2e00000000000000000000006000830152602082019050919050565b60006140fb601083614702565b91507f4265796f6e64206d6178206c696d6974000000000000000000000000000000006000830152602082019050919050565b6141378161489d565b82525050565b6141468161489d565b82525050565b60006141588285613685565b91506141648284613685565b91508190509392505050565b60006020820190506141856000830184613597565b92915050565b60006080820190506141a06000830187613597565b6141ad6020830186613597565b6141ba604083018561413d565b81810360608301526141cc8184613613565b905095945050505050565b600060208201905081810360008301526141f181846135a6565b905092915050565b600060208201905061420e6000830184613604565b92915050565b6000602082019050818103600083015261422e818461364c565b905092915050565b6000602082019050818103600083015261424f816136b6565b9050919050565b6000602082019050818103600083015261426f8161371c565b9050919050565b6000602082019050818103600083015261428f8161375c565b9050919050565b600060208201905081810360008301526142af8161379c565b9050919050565b600060208201905081810360008301526142cf81613802565b9050919050565b600060208201905081810360008301526142ef81613868565b9050919050565b6000602082019050818103600083015261430f816138ce565b9050919050565b6000602082019050818103600083015261432f8161390e565b9050919050565b6000602082019050818103600083015261434f8161394e565b9050919050565b6000602082019050818103600083015261436f816139b4565b9050919050565b6000602082019050818103600083015261438f816139f4565b9050919050565b600060208201905081810360008301526143af81613a34565b9050919050565b600060208201905081810360008301526143cf81613a9a565b9050919050565b600060208201905081810360008301526143ef81613b00565b9050919050565b6000602082019050818103600083015261440f81613b66565b9050919050565b6000602082019050818103600083015261442f81613bcc565b9050919050565b6000602082019050818103600083015261444f81613c0c565b9050919050565b6000602082019050818103600083015261446f81613c72565b9050919050565b6000602082019050818103600083015261448f81613cd8565b9050919050565b600060208201905081810360008301526144af81613d18565b9050919050565b600060208201905081810360008301526144cf81613d7e565b9050919050565b600060208201905081810360008301526144ef81613de4565b9050919050565b6000602082019050818103600083015261450f81613e4a565b9050919050565b6000602082019050818103600083015261452f81613eb0565b9050919050565b6000602082019050818103600083015261454f81613f16565b9050919050565b6000602082019050818103600083015261456f81613f7c565b9050919050565b6000602082019050818103600083015261458f81613fe2565b9050919050565b600060208201905081810360008301526145af81614048565b9050919050565b600060208201905081810360008301526145cf816140ae565b9050919050565b600060208201905081810360008301526145ef816140ee565b9050919050565b600060208201905061460b600083018461413d565b92915050565b6000604051905081810181811067ffffffffffffffff8211171561463857614637614a22565b5b8060405250919050565b600067ffffffffffffffff82111561465d5761465c614a22565b5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff82111561468d5761468c614a22565b5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006147298261489d565b91506147348361489d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561476957614768614995565b5b828201905092915050565b600061477f8261489d565b915061478a8361489d565b92508261479a576147996149c4565b5b828204905092915050565b60006147b08261489d565b91506147bb8361489d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156147f4576147f3614995565b5b828202905092915050565b600061480a8261489d565b91506148158361489d565b92508282101561482857614827614995565b5b828203905092915050565b600061483e8261487d565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b838110156148d45780820151818401526020810190506148b9565b838111156148e3576000848401525b50505050565b6000600282049050600182168061490157607f821691505b60208210811415614915576149146149f3565b5b50919050565b60006149268261489d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561495957614958614995565b5b600182019050919050565b600061496f8261489d565b915061497a8361489d565b92508261498a576149896149c4565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b614a6b81614833565b8114614a7657600080fd5b50565b614a8281614845565b8114614a8d57600080fd5b50565b614a9981614851565b8114614aa457600080fd5b50565b614ab08161489d565b8114614abb57600080fd5b5056fea2646970667358221220564623dae5f97bc7617fce262519df8b514e7ac5dc71e0542716a202915ab79064736f6c63430008000033

Verified Source Code Partial Match

Compiler: v0.8.0+commit.c7dfd78e EVM: istanbul Optimization: No
KIA.sol 1412 lines
// Sources flattened with hardhat v2.6.0 https://hardhat.org

// File @openzeppelin/contracts/utils/introspection/[email protected]

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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


// File @openzeppelin/contracts/token/ERC721/[email protected]


pragma solidity ^0.8.0;

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, 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;
}


// File @openzeppelin/contracts/token/ERC721/[email protected]


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);
}


// File @openzeppelin/contracts/token/ERC721/extensions/[email protected]


pragma solidity ^0.8.0;

/**
 * @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);
}


// File @openzeppelin/contracts/utils/[email protected]


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);
    }

    function _verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) private 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);
            }
        }
    }
}


// File @openzeppelin/contracts/utils/[email protected]


pragma solidity ^0.8.0;

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

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}


// File @openzeppelin/contracts/utils/[email protected]


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);
    }
}


// File @openzeppelin/contracts/utils/introspection/[email protected]


pragma solidity ^0.8.0;

/**
 * @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;
    }
}


// File @openzeppelin/contracts/token/ERC721/[email protected]


pragma solidity ^0.8.0;







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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

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

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

        emit Transfer(from, to, tokenId);
    }

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

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        if (to.isContract()) {
            try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                return retval == IERC721Receiver(to).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 {}
}


// File @openzeppelin/contracts/token/ERC721/extensions/[email protected]


pragma solidity ^0.8.0;

/**
 * @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);
}


// File @openzeppelin/contracts/token/ERC721/extensions/[email protected]


pragma solidity ^0.8.0;


/**
 * @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();
    }
}


// File @openzeppelin/contracts/access/[email protected]


pragma solidity ^0.8.0;

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

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

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

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

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

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

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

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}


// File contracts/KIA.sol

pragma solidity ^0.8.0;

contract KIA is ERC721Enumerable, Ownable {
    uint256 public constant MAX_KOALAS = 10000;
    uint256 public constant RESERVES = 100;

    uint256 private _conversionRate = 7;
    uint256 private _maxPerTx = 16; // Set to one higher than actual, to save gas on lte/gte checks.
    uint256 private _price = 50000000000000000; // .05 ETH
    uint256 private _saleTime = 1629757800; // August 23rd @ 6:30 EST

    // Faciliating the needed functionality for the presale
    mapping(address => bool) addressToPreSaleEntry;
    mapping(address => uint256) addressToPreSaleKoalasMinted;

    string private _baseTokenURI;

    constructor(string memory baseURI, address[] memory preSaleWalletAddresses)
        ERC721("KIA", "KIA")
    {
        setBaseURI(baseURI);
        for (uint256 i; i < preSaleWalletAddresses.length; i++) {
            addressToPreSaleEntry[preSaleWalletAddresses[i]] = true;
        }
    }

    modifier preSaleIsOpen() {
        require(
            block.timestamp >= _saleTime - 171900,
            "The presale has not yet started."
        );
        require(
            block.timestamp < _saleTime,
            "The public sale has already started."
        );
        _;
    }

    modifier saleIsOpen() {
        require(block.timestamp >= _saleTime, "Sale is not yet open.");
        _;
    }

    function setBaseURI(string memory baseURI) public onlyOwner {
        _baseTokenURI = baseURI;
    }

    function _baseURI() internal view virtual override returns (string memory) {
        return _baseTokenURI;
    }

    function setSaleTime(uint256 _time) public onlyOwner {
        _saleTime = _time;
    }

    function getSaleTime() public view returns (uint256) {
        return _saleTime;
    }

    function setConversionRate(uint256 _val) public onlyOwner {
        _conversionRate = _val;
    }

    function getConversionRate() public view returns (uint256) {
        return _conversionRate;
    }

    function setPrice(uint256 _newWEIPrice) public onlyOwner {
        _price = _newWEIPrice;
    }

    function getPrice() public view returns (uint256) {
        return _price;
    }

    function addWalletToPreSale(address _address) public onlyOwner {
        addressToPreSaleEntry[_address] = true;
    }

    function isWalletInPreSale(address _address) public view returns (bool) {
        return addressToPreSaleEntry[_address];
    }

    function preSaleKoalasMinted(address _address)
        public
        view
        returns (uint256)
    {
        return addressToPreSaleKoalasMinted[_address];
    }

    function preSaleMint(uint256 _count) public payable preSaleIsOpen {
        uint256 totalSupply = totalSupply();
        require(
            _count <= _conversionRate,
            "Mint transaction exceeds your available supply."
        );
        require(
            addressToPreSaleEntry[msg.sender] == true,
            "This address is not whitelisted for the presale."
        );
        require(
            addressToPreSaleKoalasMinted[msg.sender] + _count <=
                _conversionRate,
            "Exceeds supply of presale Koalas you can mint."
        );
        require(_price * _count <= msg.value, "Transaction value too low.");

        for (uint256 i; i < _count; i++) {
            _safeMint(msg.sender, totalSupply + i);
        }

        // Keeps track of how many they've minted
        addressToPreSaleKoalasMinted[msg.sender] += _count;
    }

    function mint(uint256 _count) public payable saleIsOpen {
        uint256 totalSupply = totalSupply();
        require(
            _count < _maxPerTx,
            "Woah, Nelly. That's way too many Koalas to mint!"
        );
        require(totalSupply < MAX_KOALAS, "All Koalas are already minted.");
        require(
            totalSupply + _count <= MAX_KOALAS,
            "This amount of Koalas will exceed max supply."
        );
        require(_price * _count <= msg.value, "Transaction value too low.");

        for (uint256 i; i < _count; i++) {
            _safeMint(msg.sender, totalSupply + i);
        }
    }

    function reserveKoalas(uint256 _count) public onlyOwner {
        uint256 totalSupply = totalSupply();
        require(
            block.timestamp < _saleTime - 171900,
            "Sale has already started."
        );
        require(totalSupply + _count <= RESERVES, "Beyond max limit");

        for (uint256 i; i < _count; i++) {
            _safeMint(msg.sender, totalSupply + i);
        }
    }

    function walletOfOwner(address _owner)
        public
        view
        returns (uint256[] memory)
    {
        uint256 tokenCount = balanceOf(_owner);
        if (tokenCount == 0) {
            return new uint256[](0);
        }

        uint256[] memory tokensId = new uint256[](tokenCount);
        for (uint256 i; i < tokenCount; i++) {
            tokensId[i] = tokenOfOwnerByIndex(_owner, i);
        }
        return tokensId;
    }

    function withdrawAll() public payable onlyOwner {
        require(payable(msg.sender).send(address(this).balance));
    }
}

Read Contract

MAX_KOALAS 0xea44acfd → uint256
RESERVES 0x0922f9c5 → uint256
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
getConversionRate 0xf36089ec → uint256
getPrice 0x98d5fdca → uint256
getSaleTime 0xcbf21fe4 → uint256
isApprovedForAll 0xe985e9c5 → bool
isWalletInPreSale 0xae8e5ec9 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
preSaleKoalasMinted 0xc23476d1 → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
walletOfOwner 0x438b6300 → uint256[]

Write Contract 16 functions

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

addWalletToPreSale 0x233f5066
address _address
approve 0x095ea7b3
address to
uint256 tokenId
mint 0xa0712d68
uint256 _count
preSaleMint 0x7835c635
uint256 _count
renounceOwnership 0x715018a6
No parameters
reserveKoalas 0xe79efc36
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
setBaseURI 0x55f804b3
string baseURI
setConversionRate 0xd2e80494
uint256 _val
setPrice 0x91b7f5ed
uint256 _newWEIPrice
setSaleTime 0x3bd2b67d
uint256 _time
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdrawAll 0x853828b6
No parameters

Recent Transactions

No transactions found for this address