Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x2D052e5Dc5A4B515F1794e91aF3FEf65CDC8eeb7
Balance 0 ETH
Nonce 1
Code Size 15739 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

15739 bytes
0x6080604052600436106102885760003560e01c80637181160c1161015a578063b71309f8116100c1578063e9fc660d1161007a578063e9fc660d1461086c578063f11b81881461088c578063f2fde38b146108bc578063f628f673146108dc578063fcfff16f146108ef578063ff00148a1461090957600080fd5b8063b71309f81461078b578063beae6e6c146107ab578063cb38e238146107dd578063cb7ef3e5146107fd578063dd07694a1461081d578063e56b9dce1461083d57600080fd5b80639fc5fb2c116101135780639fc5fb2c14610695578063a3e56fa8146106b5578063abd90f85146106d5578063af5cd2421461070b578063b0dd7c521461074b578063b6f50ec01461076b57600080fd5b80637181160c146105d1578063731fb408146105f15780638a0d20ef146106215780638da5cb5b14610641578063910764c91461065f578063985b4dd41461067557600080fd5b8063425c9fa2116101fe57806359be45bc116101b757806359be45bc146105055780635a758cd0146105255780635b6b431d1461055c5780635f13e0c41461057c57806361d027b31461059c578063715018a6146105bc57600080fd5b8063425c9fa21461043557806342a59d27146104625780634418a5051461048f578063447d53be146104af5780634d69c6c6146104cf57806354f703f8146104ef57600080fd5b80631fe543e3116102505780631fe543e31461037557806321f224201461039557806329484706146103a85780632f337fec146103c857806332615640146103de5780633e9491a21461041f57600080fd5b8063041d443e1461028d57806309c50a44146102b6578063150b7a02146102d85780631758078b1461031d5780631d034b2e14610355575b600080fd5b34801561029957600080fd5b506102a3600f5481565b6040519081526020015b60405180910390f35b3480156102c257600080fd5b506102d66102d13660046134e9565b61091f565b005b3480156102e457600080fd5b506103046102f3366004613548565b630a85bd0160e11b95945050505050565b6040516001600160e01b031990911681526020016102ad565b34801561032957600080fd5b5060035461033d906001600160a01b031681565b6040516001600160a01b0390911681526020016102ad565b34801561036157600080fd5b506102d66103703660046134e9565b6109cb565b34801561038157600080fd5b506102d661039036600461366c565b610a35565b6102d66103a33660046136b3565b610ac2565b3480156103b457600080fd5b506102d66103c33660046136e3565b610be9565b3480156103d457600080fd5b506102a3600b5481565b3480156103ea57600080fd5b50600e5461040690600160a01b900467ffffffffffffffff1681565b60405167ffffffffffffffff90911681526020016102ad565b34801561042b57600080fd5b506102a360045481565b34801561044157600080fd5b506102a3610450366004613700565b60116020526000908152604090205481565b34801561046e57600080fd5b5061048261047d366004613700565b610c04565b6040516102ad9190613751565b34801561049b57600080fd5b506102d66104aa366004613700565b610d68565b3480156104bb57600080fd5b506102d66104ca366004613844565b610df5565b3480156104db57600080fd5b506102a36104ea366004613870565b610eb4565b3480156104fb57600080fd5b506102a360065481565b34801561051157600080fd5b506102d66105203660046138a0565b610edd565b34801561053157600080fd5b50610545610540366004613700565b611453565b6040805192151583526020830191909152016102ad565b34801561056857600080fd5b506102d6610577366004613700565b611541565b34801561058857600080fd5b506102d6610597366004613700565b61176a565b3480156105a857600080fd5b5060025461033d906001600160a01b031681565b3480156105c857600080fd5b506102d661187a565b3480156105dd57600080fd5b506102d66105ec36600461390a565b61188e565b3480156105fd57600080fd5b5061061161060c366004613870565b6118ec565b6040516102ad9493929190613973565b34801561062d57600080fd5b506102d661063c36600461399e565b6119fc565b34801561064d57600080fd5b506000546001600160a01b031661033d565b34801561066b57600080fd5b506102a360075481565b34801561068157600080fd5b506102d66106903660046134e9565b611a67565b3480156106a157600080fd5b506102d66106b0366004613700565b611a91565b3480156106c157600080fd5b50600e5461033d906001600160a01b031681565b3480156106e157600080fd5b5061033d6106f0366004613700565b6009602052600090815260409020546001600160a01b031681565b34801561071757600080fd5b5061073b610726366004613700565b600a6020526000908152604090205460ff1681565b60405190151581526020016102ad565b34801561075757600080fd5b506102d66107663660046134e9565b611b79565b34801561077757600080fd5b506102d6610786366004613700565b611bd8565b34801561079757600080fd5b506102d66107a63660046139e5565b611c28565b3480156107b757600080fd5b506010546107c89063ffffffff1681565b60405163ffffffff90911681526020016102ad565b3480156107e957600080fd5b506102d66107f8366004613700565b611d54565b34801561080957600080fd5b506102d66108183660046134e9565b611def565b34801561082957600080fd5b506102d6610838366004613870565b611e19565b34801561084957600080fd5b5061085d610858366004613700565b611e4d565b6040516102ad93929190613a5a565b34801561087857600080fd5b506102d6610887366004613700565b611eb7565b34801561089857600080fd5b5061073b6108a73660046134e9565b600d6020526000908152604090205460ff1681565b3480156108c857600080fd5b506102d66108d73660046134e9565b61218f565b6102d66108ea366004613a82565b612205565b3480156108fb57600080fd5b5060055461073b9060ff1681565b34801561091557600080fd5b506102a360085481565b61092761254a565b60088054600090815260096020908152604080832080546001600160a01b0319166001600160a01b03871690811790915584548452600a835292819020805460ff1916600190811790915593548151938452918301919091528101919091527f4e435dde759dcf9c36050c45daa530f84ca2c3ab65c25980d826c0df56e563109060600160405180910390a1600880549060006109c383613ad3565b919050555050565b6109d361254a565b6001600160a01b0381166000818152600d6020908152604091829020805460ff191660019081179091558251938452908301527ff419c416c0533e46364754aa7bdb0c5adbfce030a8424e1f348ce2cdc6eb89d791015b60405180910390a150565b336001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699091614610ab45760405163073e64fd60e21b81523360048201526001600160a01b037f000000000000000000000000271682deb8c4e0901d1a1550ad2e64d568e699091660248201526044015b60405180910390fd5b610abe82826125a4565b5050565b60055460ff16610b035760405162461bcd60e51b815260206004820152600c60248201526b6f6e6c79206f70656e696e6760a01b6044820152606401610aab565b610b0b61267b565b6000610b16836126d4565b905080600501544210610b555760405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606401610aab565b6000601582015460ff166004811115610b7057610b70613719565b14610b8d5760405162461bcd60e51b8152600401610aab90613aec565b81600003610bd45760405162461bcd60e51b8152602060048201526014602482015273696e76616c696420627579207175616e7469747960601b6044820152606401610aab565b610bdf83828461273b565b50610abe60018055565b610bf161254a565b6005805460ff1916911515919091179055565b610c0c613423565b6000610c17836126d4565b604080516102408101825282546001600160a01b0390811682526001840154166020820152600283015491810191909152600382015460608201526004808301546080830152600583015460a0830152600683015460c0830152600783015460ff908116151560e08401526008840154610100840152600c840154610120840152600d840154610140840152600e840154610160840152600f84015461018084015260108401546101a084015260118401546101c084015260128401546101e08401526013840154811615156102008401526015840154939450600093610220840192911690811115610d0c57610d0c613719565b905290506000601583015460ff166004811115610d2b57610d2b613719565b148015610d3c575081600501544210155b15610d615760036102208201526007546005830154610d5b9190613b23565b60c08201525b9392505050565b610d7061254a565b80600003610dc05760405162461bcd60e51b815260206004820152601d60248201527f696e76616c6964207375706572766973696f6e206c6f636b2074696d650000006044820152606401610aab565b60078190556040518181527fefcc909882666285a1fdd8eaffaa6f85a24d42dbc2f144b90104edb140f0e95590602001610a2a565b6002546001600160a01b03163314610e1f5760405162461bcd60e51b8152600401610aab90613b3b565b600454811115610e625760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610aab565b8060046000828254610e749190613b62565b90915550506040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015610eaf573d6000803e3d6000fd5b505050565b600080610ec0846126d4565b90506000610ed16009830185612846565b93505050505b92915050565b6003546001600160a01b03163314610f255760405162461bcd60e51b815260206004820152600b60248201526a37b7363c903a3930b232b960a91b6044820152606401610aab565b610f2d61267b565b6000610f38876126d4565b905080600501544210610f775760405162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b6044820152606401610aab565b6000601582015460ff166004811115610f9257610f92613719565b14610faf5760405162461bcd60e51b8152600401610aab90613aec565b60018101546001600160a01b03166000908152600d602052604090205460ff1661100b5760405162461bcd60e51b815260206004820152600d60248201526c1a5b9d985b1a5908185cdcd95d609a1b6044820152606401610aab565b6008810154600382015461101e9161286d565b8411156110635760405162461bcd60e51b8152602060048201526013602482015272696e76616c696420747261646520707269636560681b6044820152606401610aab565b60018101546040516331a9108f60e11b81526004810187905230916001600160a01b031690636352211e90602401602060405180830381865afa1580156110ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d29190613b79565b6001600160a01b0316036111215760405162461bcd60e51b815260206004820152601660248201527568617665206f776e6564204e465420616c726561647960501b6044820152606401610aab565b6000868152600960205260409020546001600160a01b03168061117e5760405162461bcd60e51b8152602060048201526015602482015274696e76616c69642070726f7879206164647265737360581b6044820152606401610aab565b6000878152600a602052604090205460ff166111d35760405162461bcd60e51b8152602060048201526014602482015273696e76616c69642070726f78792073746174757360601b6044820152606401610aab565b6040805160608101825260018401546001600160a01b039081168252602082018990528183018890529151632238617960e21b815290918316906388e185e49088906112279085908a908a90600401613b96565b6000604051808303818588803b15801561124057600080fd5b505af193505050508015611252575060015b611295573d808015611280576040519150601f19603f3d011682016040523d82523d6000602084013e611285565b606091505b5061128f81612879565b5061143f565b80516040516331a9108f60e11b81526004810189905230916001600160a01b031690636352211e90602401602060405180830381865afa1580156112dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113019190613b79565b6001600160a01b0316146113465760405162461bcd60e51b815260206004820152600c60248201526b191bdb9d081bdddb8813919560a21b6044820152606401610aab565b60158301805460ff191660011790556007546113629042613b23565b6006840155600c8301889055600d8301879055600e83018690556113868984612885565b600e54600f546010546040516305d3b1d360e41b81526004810192909252600160a01b830467ffffffffffffffff1660248301526003604483015263ffffffff166064820152600160848201526000916001600160a01b031690635d3b1d309060a4016020604051808303816000875af1158015611408573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061142c9190613be9565b60009081526011602052604090208a9055505b50505061144b60018055565b505050505050565b6000806000611461846126d4565b600781015490915060ff161561147d5750600093849350915050565b8060060154421015806114c457506000601582015460ff1660048111156114a6576114a6613719565b1480156114c4575060075481600501546114c09190613b23565b4210155b156115355760006001601583015460ff1660048111156114e6576114e6613719565b148061150a57506002601583015460ff16600481111561150857611508613719565b145b801561151b5750601382015460ff16155b9050600061152883612adf565b9196919550909350505050565b50600093849350915050565b61154961267b565b6000611554826126d4565b600781015490915060ff161561157c5760405162461bcd60e51b8152600401610aab90613c02565b6115868282612bc2565b6003601582015460ff1660048111156115a1576115a1613719565b14806115c557506004601582015460ff1660048111156115c3576115c3613719565b145b6115e15760405162461bcd60e51b8152600401610aab90613aec565b33600090815260148201602052604090205460ff161561163c5760405162461bcd60e51b8152602060048201526016602482015275686176652077697468647261776e20616c726561647960501b6044820152606401610aab565b60008061164c6009840133612846565b91509150816116925760405162461bcd60e51b81526020600482015260126024820152711a5cc81b9bdd081c185c9d1a58da5c185b9d60721b6044820152606401610aab565b60006116ab846004015483612c3a90919063ffffffff16565b9093509050826116cd5760405162461bcd60e51b8152600401610aab90613c32565b336000818152601486016020526040808220805460ff191660011790555183156108fc0291849190818181858888f19350505050158015611712573d6000803e3d6000fd5b5060408051868152336020820152908101839052606081018290527f1c84cc0f96161bdafea718a9094dd21c21d1fb2f9ca2ebb9bd4e39918efbaace9060800160405180910390a15050505061176760018055565b50565b61177261254a565b8015801590611782575060085481105b6117c15760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081c1c9bde1e481a5960821b6044820152606401610aab565b6000818152600a602052604090205460ff166118145760405162461bcd60e51b8152602060048201526012602482015271756e726567697374656420616c726561647960701b6044820152606401610aab565b6000818152600a60209081526040808320805460ff19169055600982528083205481516001600160a01b0390911681529182018490528101919091527f4e435dde759dcf9c36050c45daa530f84ca2c3ab65c25980d826c0df56e5631090606001610a2a565b61188261254a565b61188c6000612c83565b565b61189661254a565b600e8054600f949094556010805463ffffffff90941663ffffffff199094169390931790925567ffffffffffffffff16600160a01b026001600160e01b03199092166001600160a01b0390931692909217179055565b60008060008060006118fd876126d4565b905060006002601583015460ff16600481111561191c5761191c613719565b0361194157866001600160a01b031661193483612cd3565b6001600160a01b03161490505b60006119506009840189612846565b9150600090506002601585015460ff16600481111561197157611971613719565b0361198d57601084015461198690839061286d565b90506119c1565b6002601585015460ff1660048111156119a8576119a8613719565b11156119c15760048401546119be90839061286d565b90505b60158401546001600160a01b038a166000908152601490950160205260409094205460ff948516985092965094505016905092959194509250565b6002546001600160a01b03163314611a265760405162461bcd60e51b8152600401610aab90613b3b565b60005b8251811015610eaf57611a55838281518110611a4757611a47613c57565b602002602001015183612d85565b80611a5f81613ad3565b915050611a29565b611a6f61254a565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b611a9961267b565b6000611aa4826126d4565b90506002601582015460ff166004811115611ac157611ac1613719565b14611ade5760405162461bcd60e51b8152600401610aab90613aec565b600781015460ff1615611b035760405162461bcd60e51b8152600401610aab90613c02565b33600090815260148201602052604090205460ff1615611b655760405162461bcd60e51b815260206004820152601a60248201527f6861766520676f7474656e206368616e676520616c72656164790000000000006044820152606401610aab565b611b6f8282612feb565b5061176760018055565b611b8161254a565b6001600160a01b0381166000818152600d60209081526040808320805460ff191690558051938452908301919091527ff419c416c0533e46364754aa7bdb0c5adbfce030a8424e1f348ce2cdc6eb89d79101610a2a565b611be061254a565b612710811015611c235760405162461bcd60e51b815260206004820152600e60248201526d34b73b30b634b2103330b1ba37b960911b6044820152606401610aab565b600655565b611c3061267b565b60005b81811015610bdf576000611c5e848484818110611c5257611c52613c57565b905060200201356126d4565b90506002601582015460ff166004811115611c7b57611c7b613719565b14611c985760405162461bcd60e51b8152600401610aab90613aec565b600781015460ff1615611cbd5760405162461bcd60e51b8152600401610aab90613c02565b33600090815260148201602052604090205460ff1615611d1f5760405162461bcd60e51b815260206004820152601a60248201527f6861766520676f7474656e206368616e676520616c72656164790000000000006044820152606401610aab565b611d41848484818110611d3457611d34613c57565b9050602002013582612feb565b5080611d4c81613ad3565b915050611c33565b611d5c61254a565b6000611d67826126d4565b90506000601582015460ff166004811115611d8457611d84613719565b14611da15760405162461bcd60e51b8152600401610aab90613aec565b60158101805460ff19166004179055600754611dbd9042613b23565b6006820155604051600080516020613d2683398151915290611de3908490600490613c6d565b60405180910390a15050565b611df761254a565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b03163314611e435760405162461bcd60e51b8152600401610aab90613b3b565b610abe8282612d85565b600080600080611e5c856126d4565b90506002601582015460ff166004811115611e7957611e79613719565b14611e93576015015460ff16925060009150819050611eb0565b6000611e9e82612cd3565b60109092015460029550919350909150505b9193909250565b611ebf61267b565b6000611eca826126d4565b600781015490915060ff1615611ef25760405162461bcd60e51b8152600401610aab90613c02565b6002601582015460ff166004811115611f0d57611f0d613719565b14611f2a5760405162461bcd60e51b8152600401610aab90613aec565b6000611f3582612cd3565b9050336001600160a01b03821614611f7f5760405162461bcd60e51b815260206004820152600d60248201526c34b9903737ba103bb4b73732b960991b6044820152606401610aab565b601382015460ff166120695760138201805460ff19166001908117909155820154600d8301546040516323b872dd60e01b81523060048201526001600160a01b03848116602483015260448201929092529116906323b872dd90606401600060405180830381600087803b158015611ff657600080fd5b505af115801561200a573d6000803e3d6000fd5b505050506001820154600d830154604080518681526001600160a01b0380861660208301529093169083015260608201527fb7e63d4c039ba02964e5322431009fa0a6402ce22c5ab01aa1818b17658da3619060800160405180910390a15b6001600160a01b038116600090815260148301602052604090205460ff1661218457600061209a6009840183612846565b60108501549092506000915081906120b3908490612c3a565b91509150816120d45760405162461bcd60e51b8152600401610aab90613c32565b6001600160a01b03841660009081526014860160205260409020805460ff191660011790558015612137576040516001600160a01b0385169082156108fc029083906000818181858888f19350505050158015612135573d6000803e3d6000fd5b505b604080518781526001600160a01b03861660208201529081018290527fec5ebc1ec12ff76642d357b39d3e497c36fcab15f64f8a3ec71341b62e7ad5f49060600160405180910390a15050505b505061176760018055565b61219761254a565b6001600160a01b0381166121fc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610aab565b61176781612c83565b60055460ff166122465760405162461bcd60e51b815260206004820152600c60248201526b6f6e6c79206f70656e696e6760a01b6044820152606401610aab565b61224e61267b565b6001600160a01b0384166122945760405162461bcd60e51b815260206004820152600d60248201526c1a5b9d985b1a5908185cdcd95d609a1b6044820152606401610aab565b6001600160a01b0384166000908152600d602052604090205460ff166122f15760405162461bcd60e51b8152602060048201526012602482015271185cdcd95d081d5b9c9959da5cdd195c995960721b6044820152606401610aab565b826000036123375760405162461bcd60e51b8152602060048201526013602482015272696e76616c696420736861726520707269636560681b6044820152606401610aab565b8142106123865760405162461bcd60e51b815260206004820152601760248201527f696e76616c69642065787069726174696f6e2074696d650000000000000000006044820152606401610aab565b806000036123cb5760405162461bcd60e51b8152602060048201526012602482015271696e76616c6964206275792073686172657360701b6044820152606401610aab565b600b546000908152600c602052604081208054336001600160a01b03199182161782556006805460028401556001830180549092166001600160a01b0389161790915560038201869055600582018590556000198183015560158201805460ff19169055549091908190612440908790612c3a565b91509150816124845760405162461bcd60e51b815260206004820152601060248201526f1d5a5b9d081d1c9e535d5b0819985a5b60821b6044820152606401610aab565b6124908161271061310a565b60048401819055600b54604080519182526001600160a01b038a1660208301528101889052606081018790529091507f3affe688992d11cc7dd9fbe2a0c7db5de1c380fc8343d0578cb90eceb3e76aaf9060800160405180910390a1600080516020613d26833981519152600b54600060405161250e929190613c6d565b60405180910390a1612523600b54848661273b565b600b805490600061253383613ad3565b919050555050505061254460018055565b50505050565b6000546001600160a01b0316331461188c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610aab565b600082815260116020526040812054908190036125f95760405162461bcd60e51b81526020600482015260136024820152721a5b9d985b1a590818dc9bddd9199d5b991259606a1b6044820152606401610aab565b6000612604826126d4565b90508260008151811061261957612619613c57565b60200260200101518160120181905550600754426126379190613b23565b600682015560158101805460ff19166002908117909155604051600080516020613d268339815191529161266d91859190613c6d565b60405180910390a150505050565b6002600154036126cd5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610aab565b6002600155565b600080821180156126e65750600b5482105b6127295760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a590818dc9bddd9199d5b99081a5960621b6044820152606401610aab565b506000908152600c6020526040902090565b600882015460009061274d9083613116565b60088501559050806127715760405162461bcd60e51b8152600401610aab90613c81565b60048301546000906127839084612c3a565b9092509050816127a55760405162461bcd60e51b8152600401610aab90613c81565b6127b0600082613131565b60006127bf6009860133612846565b91506127cd90508185613116565b9093509050826127ef5760405162461bcd60e51b8152600401610aab90613c81565b6127fd60098601338361323e565b50604080518781523360208201529081018590527f66f5cd880edf48cdde6c966e5da0784fcc4c5e85572b8b3b62c4357798d447d79060600160405180910390a1505050505050565b600080808061285e866001600160a01b03871661325c565b909450925050505b9250929050565b6000610d618284613cab565b60208101815181018082fd5b6000806128a3836003015484600e015461329690919063ffffffff16565b91509150816128e25760405162461bcd60e51b815260206004820152600b60248201526a1d1c9e54dd588819985a5b60aa1b6044820152606401610aab565b826003015483600e01546128f69190613ce0565b15612909578061290581613ad3565b9150505b600061292984600401548386600801546129239190613b62565b90612c3a565b90935090508261294b5760405162461bcd60e51b8152600401610aab90613c32565b600061296485600801548361329690919063ffffffff16565b9094509050836129a45760405162461bcd60e51b815260206004820152600b60248201526a1d1c9e511a5d8819985a5b60aa1b6044820152606401610aab565b60006129c186600401548760080154612c3a90919063ffffffff16565b809250819650505060006129fa6129f388600e01546129ed8a600801548761286d90919063ffffffff16565b906132c9565b83906132d5565b909650905085612a3a5760405162461bcd60e51b815260206004820152600b60248201526a1d1c9e54dd588819985a5b60aa1b6044820152606401610aab565b600454612a479082613116565b600455955085612a875760405162461bcd60e51b815260206004820152600b60248201526a1d1c9e5059190819985a5b60aa1b6044820152606401610aab565b600f8701859055601087018390556011870181905560408051898152602081018390527f7893d8ce48cf0384f5420e94c30695b9be1abb188c2024a6eb485031c522da72910160405180910390a15050505050505050565b6000806000806000612af3866009016132f7565b905060005b81811015612b5357612b0d6009880182613302565b6001600160a01b038216600090815260148a016020526040902054919550935060ff16612b4157612b3e8386613b23565b94505b80612b4b81613ad3565b915050612af8565b506001601587015460ff166004811115612b6f57612b6f613719565b1480612b9357506002601587015460ff166004811115612b9157612b91613719565b145b15612bb257838660100154612ba89190613cab565b9695505050505050565b838660040154612ba89190613cab565b6000601582015460ff166004811115612bdd57612bdd613719565b148015612bee575080600501544210155b15610abe5760158101805460ff191660031790556007546005820154612c149190613b23565b6006820155604051600080516020613d2683398151915290611de3908490600390613c6d565b60008083600003612c515750600190506000612866565b83830283858281612c6457612c64613cca565b0414612c77576000809250925050612866565b60019590945092505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060008084600801548560120154612ced9190613ce0565b612cf8906001613b23565b90506000612d08866009016132f7565b905060005b612d18600183613b62565b811015612d6157612d2c6009880182613302565b9095509350838311612d4357509295945050505050565b612d4d8484613b62565b925080612d5981613ad3565b915050612d0d565b50612d7a612d70600183613b62565b6009880190613302565b509695505050505050565b6000612d90836126d4565b600781015490915060ff1615612db85760405162461bcd60e51b8152600401610aab90613c02565b612dc28382612bc2565b8060060154421015612e165760405162461bcd60e51b815260206004820152601860248201527f6e6f7420796574207375706572766973696f6e2074696d6500000000000000006044820152606401610aab565b60078101805460ff19166001908117909155600090601583015460ff166004811115612e4457612e44613719565b1480612e6857506002601583015460ff166004811115612e6657612e66613719565b145b8015612e795750601382015460ff16155b90508015612f4f576001820154600d8301546040516323b872dd60e01b81523060048201526001600160a01b03868116602483015260448201929092529116906323b872dd90606401600060405180830381600087803b158015612edc57600080fd5b505af1158015612ef0573d6000803e3d6000fd5b505050506001820154600d830154604080518781526001600160a01b0380881660208301529093169083015260608201527f13ddf09152b2b598ff3c9b764e4098223f512603bbbb0952f0a145d7b9857f3a9060800160405180910390a15b6000612f5a83612adf565b90508015612fe4576040516001600160a01b0385169082156108fc029083906000818181858888f19350505050158015612f98573d6000803e3d6000fd5b50604080518681526001600160a01b03861660208201529081018290527fbb3160732946e5551ad7239b7d16f03020ae78497b192478d288792fa8544ad9906060015b60405180910390a15b5050505050565b600080612ffb6009840133612846565b91509150816130415760405162461bcd60e51b81526020600482015260126024820152711a5cc81b9bdd081c185c9d1a58da5c185b9d60721b6044820152606401610aab565b600061305a846010015483612c3a90919063ffffffff16565b90935090508261307c5760405162461bcd60e51b8152600401610aab90613c32565b3360009081526014850160205260409020805460ff1916600117905580156130cd57604051339082156108fc029083906000818181858888f193505050501580156130cb573d6000803e3d6000fd5b505b604080518681523360208201529081018290527fec5ebc1ec12ff76642d357b39d3e497c36fcab15f64f8a3ec71341b62e7ad5f490606001612fdb565b6000610d618284613cf4565b60008083830184811015612c77576000809250925050612866565b8015610abe576001600160a01b0382166131825780341015610abe5760405162461bcd60e51b815260206004820152600a6024820152690dcdee840cadcdeeaced60b31b6044820152606401610aab565b6040516323b872dd60e01b8152336004820152306024820152604481018290526001600160a01b038316906323b872dd906064016020604051808303816000875af11580156131d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131f99190613d08565b610abe5760405162461bcd60e51b81526020600482015260166024820152751d1c985b9cd9995c881a5b881b5bdb995e4819985a5b60521b6044820152606401610aab565b6000613254846001600160a01b03851684613311565b949350505050565b600081815260028301602052604081205481908061328b5761327e858561332e565b9250600091506128669050565b600192509050612866565b600080826000036132ac57506000905080612866565b60018385816132bd576132bd613cca565b04915091509250929050565b6000610d618284613b23565b600080838311156132eb57506000905080612866565b50600193919092039150565b6000610ed78261333a565b600080808061285e8686613345565b600082815260028401602052604081208290556132548484613370565b6000610d61838361337c565b6000610ed782613394565b60008080613353858561339e565b600081815260029690960160205260409095205494959350505050565b6000610d6183836133aa565b60008181526001830160205260408120541515610d61565b6000610ed7825490565b6000610d6183836133f9565b60008181526001830160205260408120546133f157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610ed7565b506000610ed7565b600082600001828154811061341057613410613c57565b9060005260206000200154905092915050565b60405180610240016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001600060048111156134cf576134cf613719565b905290565b6001600160a01b038116811461176757600080fd5b6000602082840312156134fb57600080fd5b8135610d61816134d4565b60008083601f84011261351857600080fd5b50813567ffffffffffffffff81111561353057600080fd5b60208301915083602082850101111561286657600080fd5b60008060008060006080868803121561356057600080fd5b853561356b816134d4565b9450602086013561357b816134d4565b935060408601359250606086013567ffffffffffffffff81111561359e57600080fd5b6135aa88828901613506565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126135e257600080fd5b8135602067ffffffffffffffff808311156135ff576135ff6135bb565b8260051b604051601f19603f83011681018181108482111715613624576136246135bb565b60405293845285810183019383810192508785111561364257600080fd5b83870191505b8482101561366157813583529183019190830190613648565b979650505050505050565b6000806040838503121561367f57600080fd5b82359150602083013567ffffffffffffffff81111561369d57600080fd5b6136a9858286016135d1565b9150509250929050565b600080604083850312156136c657600080fd5b50508035926020909101359150565b801515811461176757600080fd5b6000602082840312156136f557600080fd5b8135610d61816136d5565b60006020828403121561371257600080fd5b5035919050565b634e487b7160e01b600052602160045260246000fd5b6005811061374d57634e487b7160e01b600052602160045260246000fd5b9052565b81516001600160a01b031681526102408101602083015161377d60208401826001600160a01b03169052565b5060408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e08301516137c360e084018215159052565b50610100838101519083015261012080840151908301526101408084015190830152610160808401519083015261018080840151908301526101a080840151908301526101c080840151908301526101e08084015190830152610200808401511515908301526102208084015161383c8285018261372f565b505092915050565b6000806040838503121561385757600080fd5b8235613862816134d4565b946020939093013593505050565b6000806040838503121561388357600080fd5b823591506020830135613895816134d4565b809150509250929050565b60008060008060008060a087890312156138b957600080fd5b86359550602087013594506040870135935060608701359250608087013567ffffffffffffffff8111156138ec57600080fd5b6138f889828a01613506565b979a9699509497509295939492505050565b6000806000806080858703121561392057600080fd5b843561392b816134d4565b935060208501359250604085013563ffffffff8116811461394b57600080fd5b9150606085013567ffffffffffffffff8116811461396857600080fd5b939692955090935050565b60808101613981828761372f565b931515602082015260408101929092521515606090910152919050565b600080604083850312156139b157600080fd5b823567ffffffffffffffff8111156139c857600080fd5b6139d4858286016135d1565b9250506020830135613895816134d4565b600080602083850312156139f857600080fd5b823567ffffffffffffffff80821115613a1057600080fd5b818501915085601f830112613a2457600080fd5b813581811115613a3357600080fd5b8660208260051b8501011115613a4857600080fd5b60209290920196919550909350505050565b60608101613a68828661372f565b6001600160a01b0393909316602082015260400152919050565b60008060008060808587031215613a9857600080fd5b8435613aa3816134d4565b966020860135965060408601359560600135945092505050565b634e487b7160e01b600052601160045260246000fd5b600060018201613ae557613ae5613abd565b5060010190565b60208082526018908201527f696e76616c69642063726f776466756e64207374617475730000000000000000604082015260600190565b60008219821115613b3657613b36613abd565b500190565b6020808252600d908201526c6f6e6c7920747265617375727960981b604082015260600190565b600082821015613b7457613b74613abd565b500390565b600060208284031215613b8b57600080fd5b8151610d61816134d4565b60018060a01b038451168152602084015160208201526040840151604082015260806060820152816080820152818360a0830137600081830160a090810191909152601f909201601f1916010192915050565b600060208284031215613bfb57600080fd5b5051919050565b60208082526016908201527568617665206d6f76656420746f20747265617375727960501b604082015260600190565b6020808252600b908201526a1d1c9e535d5b0819985a5b60aa1b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b82815260408101610d61602083018461372f565b60208082526010908201526f696e76616c6964207175616e7469747960801b604082015260600190565b6000816000190483118215151615613cc557613cc5613abd565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613cef57613cef613cca565b500690565b600082613d0357613d03613cca565b500490565b600060208284031215613d1a57600080fd5b8151610d61816136d556fe365a3d0a71be5f440c8224437355d5bd81a703759bf906e441902272bfbafcb3a26469706673582212204c774e89a196b0ab7acddaf9d634f6197fc47edc6b65e68de3b190f5e0d2607964736f6c634300080d0033

Verified Source Code Partial Match

Compiler: v0.8.13+commit.abaa5c0e EVM: london Optimization: Yes (200 runs)
LuckyNFT.sol 2836 lines
// Sources flattened with hardhat v2.9.9 https://hardhat.org

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


// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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


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


// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}


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


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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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


// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}


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


// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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


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


// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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


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


// OpenZeppelin Contracts (last updated v4.6.0) (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 `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}


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


// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}


// File @chainlink/contracts/src/v0.8/interfaces/[email protected]


pragma solidity ^0.8.0;

interface VRFCoordinatorV2Interface {
  /**
   * @notice Get configuration relevant for making requests
   * @return minimumRequestConfirmations global min for request confirmations
   * @return maxGasLimit global max for request gas limit
   * @return s_provingKeyHashes list of registered key hashes
   */
  function getRequestConfig()
    external
    view
    returns (
      uint16,
      uint32,
      bytes32[] memory
    );

  /**
   * @notice Request a set of random words.
   * @param keyHash - Corresponds to a particular oracle job which uses
   * that key for generating the VRF proof. Different keyHash's have different gas price
   * ceilings, so you can select a specific one to bound your maximum per request cost.
   * @param subId  - The ID of the VRF subscription. Must be funded
   * with the minimum subscription balance required for the selected keyHash.
   * @param minimumRequestConfirmations - How many blocks you'd like the
   * oracle to wait before responding to the request. See SECURITY CONSIDERATIONS
   * for why you may want to request more. The acceptable range is
   * [minimumRequestBlockConfirmations, 200].
   * @param callbackGasLimit - How much gas you'd like to receive in your
   * fulfillRandomWords callback. Note that gasleft() inside fulfillRandomWords
   * may be slightly less than this amount because of gas used calling the function
   * (argument decoding etc.), so you may need to request slightly more than you expect
   * to have inside fulfillRandomWords. The acceptable range is
   * [0, maxGasLimit]
   * @param numWords - The number of uint256 random values you'd like to receive
   * in your fulfillRandomWords callback. Note these numbers are expanded in a
   * secure way by the VRFCoordinator from a single random value supplied by the oracle.
   * @return requestId - A unique identifier of the request. Can be used to match
   * a request to a response in fulfillRandomWords.
   */
  function requestRandomWords(
    bytes32 keyHash,
    uint64 subId,
    uint16 minimumRequestConfirmations,
    uint32 callbackGasLimit,
    uint32 numWords
  ) external returns (uint256 requestId);

  /**
   * @notice Create a VRF subscription.
   * @return subId - A unique subscription id.
   * @dev You can manage the consumer set dynamically with addConsumer/removeConsumer.
   * @dev Note to fund the subscription, use transferAndCall. For example
   * @dev  LINKTOKEN.transferAndCall(
   * @dev    address(COORDINATOR),
   * @dev    amount,
   * @dev    abi.encode(subId));
   */
  function createSubscription() external returns (uint64 subId);

  /**
   * @notice Get a VRF subscription.
   * @param subId - ID of the subscription
   * @return balance - LINK balance of the subscription in juels.
   * @return reqCount - number of requests for this subscription, determines fee tier.
   * @return owner - owner of the subscription.
   * @return consumers - list of consumer address which are able to use this subscription.
   */
  function getSubscription(uint64 subId)
    external
    view
    returns (
      uint96 balance,
      uint64 reqCount,
      address owner,
      address[] memory consumers
    );

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @param newOwner - proposed new owner of the subscription
   */
  function requestSubscriptionOwnerTransfer(uint64 subId, address newOwner) external;

  /**
   * @notice Request subscription owner transfer.
   * @param subId - ID of the subscription
   * @dev will revert if original owner of subId has
   * not requested that msg.sender become the new owner.
   */
  function acceptSubscriptionOwnerTransfer(uint64 subId) external;

  /**
   * @notice Add a consumer to a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - New consumer which can use the subscription
   */
  function addConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Remove a consumer from a VRF subscription.
   * @param subId - ID of the subscription
   * @param consumer - Consumer to remove from the subscription
   */
  function removeConsumer(uint64 subId, address consumer) external;

  /**
   * @notice Cancel a subscription
   * @param subId - ID of the subscription
   * @param to - Where to send the remaining LINK to
   */
  function cancelSubscription(uint64 subId, address to) external;
}


// File @chainlink/contracts/src/v0.8/[email protected]


pragma solidity ^0.8.4;

/** ****************************************************************************
 * @notice Interface for contracts using VRF randomness
 * *****************************************************************************
 * @dev PURPOSE
 *
 * @dev Reggie the Random Oracle (not his real job) wants to provide randomness
 * @dev to Vera the verifier in such a way that Vera can be sure he's not
 * @dev making his output up to suit himself. Reggie provides Vera a public key
 * @dev to which he knows the secret key. Each time Vera provides a seed to
 * @dev Reggie, he gives back a value which is computed completely
 * @dev deterministically from the seed and the secret key.
 *
 * @dev Reggie provides a proof by which Vera can verify that the output was
 * @dev correctly computed once Reggie tells it to her, but without that proof,
 * @dev the output is indistinguishable to her from a uniform random sample
 * @dev from the output space.
 *
 * @dev The purpose of this contract is to make it easy for unrelated contracts
 * @dev to talk to Vera the verifier about the work Reggie is doing, to provide
 * @dev simple access to a verifiable source of randomness. It ensures 2 things:
 * @dev 1. The fulfillment came from the VRFCoordinator
 * @dev 2. The consumer contract implements fulfillRandomWords.
 * *****************************************************************************
 * @dev USAGE
 *
 * @dev Calling contracts must inherit from VRFConsumerBase, and can
 * @dev initialize VRFConsumerBase's attributes in their constructor as
 * @dev shown:
 *
 * @dev   contract VRFConsumer {
 * @dev     constructor(<other arguments>, address _vrfCoordinator, address _link)
 * @dev       VRFConsumerBase(_vrfCoordinator) public {
 * @dev         <initialization with other arguments goes here>
 * @dev       }
 * @dev   }
 *
 * @dev The oracle will have given you an ID for the VRF keypair they have
 * @dev committed to (let's call it keyHash). Create subscription, fund it
 * @dev and your consumer contract as a consumer of it (see VRFCoordinatorInterface
 * @dev subscription management functions).
 * @dev Call requestRandomWords(keyHash, subId, minimumRequestConfirmations,
 * @dev callbackGasLimit, numWords),
 * @dev see (VRFCoordinatorInterface for a description of the arguments).
 *
 * @dev Once the VRFCoordinator has received and validated the oracle's response
 * @dev to your request, it will call your contract's fulfillRandomWords method.
 *
 * @dev The randomness argument to fulfillRandomWords is a set of random words
 * @dev generated from your requestId and the blockHash of the request.
 *
 * @dev If your contract could have concurrent requests open, you can use the
 * @dev requestId returned from requestRandomWords to track which response is associated
 * @dev with which randomness request.
 * @dev See "SECURITY CONSIDERATIONS" for principles to keep in mind,
 * @dev if your contract could have multiple requests in flight simultaneously.
 *
 * @dev Colliding `requestId`s are cryptographically impossible as long as seeds
 * @dev differ.
 *
 * *****************************************************************************
 * @dev SECURITY CONSIDERATIONS
 *
 * @dev A method with the ability to call your fulfillRandomness method directly
 * @dev could spoof a VRF response with any random value, so it's critical that
 * @dev it cannot be directly called by anything other than this base contract
 * @dev (specifically, by the VRFConsumerBase.rawFulfillRandomness method).
 *
 * @dev For your users to trust that your contract's random behavior is free
 * @dev from malicious interference, it's best if you can write it so that all
 * @dev behaviors implied by a VRF response are executed *during* your
 * @dev fulfillRandomness method. If your contract must store the response (or
 * @dev anything derived from it) and use it later, you must ensure that any
 * @dev user-significant behavior which depends on that stored value cannot be
 * @dev manipulated by a subsequent VRF request.
 *
 * @dev Similarly, both miners and the VRF oracle itself have some influence
 * @dev over the order in which VRF responses appear on the blockchain, so if
 * @dev your contract could have multiple VRF requests in flight simultaneously,
 * @dev you must ensure that the order in which the VRF responses arrive cannot
 * @dev be used to manipulate your contract's user-significant behavior.
 *
 * @dev Since the block hash of the block which contains the requestRandomness
 * @dev call is mixed into the input to the VRF *last*, a sufficiently powerful
 * @dev miner could, in principle, fork the blockchain to evict the block
 * @dev containing the request, forcing the request to be included in a
 * @dev different block with a different hash, and therefore a different input
 * @dev to the VRF. However, such an attack would incur a substantial economic
 * @dev cost. This cost scales with the number of blocks the VRF oracle waits
 * @dev until it calls responds to a request. It is for this reason that
 * @dev that you can signal to an oracle you'd like them to wait longer before
 * @dev responding to the request (however this is not enforced in the contract
 * @dev and so remains effective only in the case of unmodified oracle software).
 */
abstract contract VRFConsumerBaseV2 {
  error OnlyCoordinatorCanFulfill(address have, address want);
  address private immutable vrfCoordinator;

  /**
   * @param _vrfCoordinator address of VRFCoordinator contract
   */
  constructor(address _vrfCoordinator) {
    vrfCoordinator = _vrfCoordinator;
  }

  /**
   * @notice fulfillRandomness handles the VRF response. Your contract must
   * @notice implement it. See "SECURITY CONSIDERATIONS" above for important
   * @notice principles to keep in mind when implementing your fulfillRandomness
   * @notice method.
   *
   * @dev VRFConsumerBaseV2 expects its subcontracts to have a method with this
   * @dev signature, and will call it once it has verified the proof
   * @dev associated with the randomness. (It is triggered via a call to
   * @dev rawFulfillRandomness, below.)
   *
   * @param requestId The Id initially returned by requestRandomness
   * @param randomWords the VRF output expanded to the requested number of words
   */
  function fulfillRandomWords(uint256 requestId, uint256[] memory randomWords) internal virtual;

  // rawFulfillRandomness is called by VRFCoordinator when it receives a valid VRF
  // proof. rawFulfillRandomness then calls fulfillRandomness, after validating
  // the origin of the call
  function rawFulfillRandomWords(uint256 requestId, uint256[] memory randomWords) external {
    if (msg.sender != vrfCoordinator) {
      revert OnlyCoordinatorCanFulfill(msg.sender, vrfCoordinator);
    }
    fulfillRandomWords(requestId, randomWords);
  }
}


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


// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}


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


// OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableMap.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableMap.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing an enumerable variant of Solidity's
 * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
 * type.
 *
 * Maps have the following properties:
 *
 * - Entries are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Entries are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableMap for EnumerableMap.UintToAddressMap;
 *
 *     // Declare a set state variable
 *     EnumerableMap.UintToAddressMap private myMap;
 * }
 * ```
 *
 * The following map types are supported:
 *
 * - `uint256 -> address` (`UintToAddressMap`) since v3.0.0
 * - `address -> uint256` (`AddressToUintMap`) since v4.6.0
 * - `bytes32 -> bytes32` (`Bytes32ToBytes32Map`) since v4.6.0
 * - `uint256 -> uint256` (`UintToUintMap`) since v4.7.0
 * - `bytes32 -> uint256` (`Bytes32ToUintMap`) since v4.7.0
 *
 * [WARNING]
...

// [truncated — 95731 bytes total]

Read Contract

GetCrowdfund 0x42a59d27 → tuple
GetPrize 0xe56b9dce → uint8, address, uint256
GetShareQuantity 0x4d69c6c6 → uint256
GetSuperviseAssets 0x5a758cd0 → bool, uint256
GetUserPrize 0x731fb408 → uint8, bool, uint256, bool
assets 0xf11b8188 → bool
factor 0x54f703f8 → uint256
nextCrowdfundId 0x2f337fec → uint256
nextProxyId 0xff00148a → uint256
open 0xfcfff16f → bool
owner 0x8da5cb5b → address
proxies 0xabd90f85 → address
proxyStatus 0xaf5cd242 → bool
revenue 0x3e9491a2 → uint256
supervisionLockTime 0x910764c9 → uint256
trader 0x1758078b → address
treasury 0x61d027b3 → address
vrfCBGasLimit 0xbeae6e6c → uint32
vrfCoordinator 0xa3e56fa8 → address
vrfKeyHash 0x041d443e → bytes32
vrfRequestIds 0x425c9fa2 → uint256
vrfSubId 0x32615640 → uint64

Write Contract 25 functions

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

BuyShares 0x21f22420
uint256 crowdfundId
uint256 buyQuantity
CashPrize 0xe9fc660d
uint256 crowdfundId
CreateCrowdfund 0xf628f673
address asset
uint256 sharePriceWithoutFactor
uint256 expirationTime
uint256 buyQuantity
GetChange 0x9fc5fb2c
uint256 crowdfundId
GetMultiChanges 0xb71309f8
uint256[] crowdfundIds
RegisterAsset 0x1d034b2e
address asset
RegisterProxy 0x09c50a44
address proxy
SetChainlinkVRF 0x7181160c
address vrfCoordinator_
bytes32 keyHash_
uint32 callbackGasLimit_
uint64 subscriptionId_
SetFactor 0xb6f50ec0
uint256 factor_
SetOpen 0x29484706
bool open_
SetTrader 0x985b4dd4
address trader_
SetTreasury 0xcb7ef3e5
address treasury_
Stop 0xcb38e238
uint256 crowdfundId
Supervise 0xdd07694a
uint256 crowdfundId
address to
SuperviseMulti 0x8a0d20ef
uint256[] crowdfundIds
address to
Trade 0x59be45bc
uint256 crowdfundId
uint256 proxyId
uint256 tokenId
uint256 tradePrice
bytes data
UnregisterAsset 0xb0dd7c52
address asset
UnregisterProxy 0x5f13e0c4
uint256 id
Withdraw 0x5b6b431d
uint256 crowdfundId
WithdrawRevenue 0x447d53be
address to
uint256 amount
onERC721Received 0x150b7a02
address operator
address from
uint256 tokenId
bytes data
returns: bytes4
rawFulfillRandomWords 0x1fe543e3
uint256 requestId
uint256[] randomWords
renounceOwnership 0x715018a6
No parameters
setSupervisionLockTime 0x4418a505
uint256 supervisionLockTime_
transferOwnership 0xf2fde38b
address newOwner

Token Balances (1)

View Transfers →
WETH 0

Recent Transactions

No transactions found for this address