Forkchoice Ethereum Mainnet

Address Contract Partially Verified

Address 0x5C5e40407c357EEfdBE0a8bc16AEdb08983F9087
Balance 0 ETH
Nonce 1
Code Size 17983 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

17983 bytes
0x608060405234801561001057600080fd5b50600436106101a85760003560e01c80637f74cde2116100f9578063c8d6054f11610097578063f2fde38b11610071578063f2fde38b146104c7578063f5298aca146104e3578063f7ff704b146104ff578063fcc9def31461051b576101a8565b8063c8d6054f1461045f578063e985e9c51461047b578063f242432a146104ab576101a8565b8063a22cb465116100d3578063a22cb465146103d9578063ba2af520146103f5578063bd85b03914610413578063c5d63db114610443576101a8565b80637f74cde21461036f5780638da5cb5b1461039f5780639b2fec2c146103bd576101a8565b80632eb2c2d6116101665780634f558e79116101405780634f558e79146102fd5780636b20c4541461032d578063715018a61461034957806375c7c7d014610353576101a8565b80632eb2c2d6146102955780633ef009ef146102b15780634e1273f4146102cd576101a8565b8062fdd58e146101ad57806301ffc9a7146101dd57806302fe53051461020d5780630e89341c1461022957806319eea6c9146102595780631a98276914610277575b600080fd5b6101c760048036038101906101c29190612fa4565b610539565b6040516101d49190613aea565b60405180910390f35b6101f760048036038101906101f29190613129565b610602565b6040516102049190613812565b60405180910390f35b61022760048036038101906102229190613183565b6106e4565b005b610243600480360381019061023e91906131f9565b6106f8565b604051610250919061382d565b60405180910390f35b61026161078c565b60405161026e9190613aea565b60405180910390f35b61027f610791565b60405161028c9190613812565b60405180910390f35b6102af60048036038101906102aa9190612d73565b6107a4565b005b6102cb60048036038101906102c69190613226565b610845565b005b6102e760048036038101906102e29190613037565b610905565b6040516102f491906137b9565b60405180910390f35b610317600480360381019061031291906131f9565b610a1e565b6040516103249190613812565b60405180910390f35b61034760048036038101906103429190612ed9565b610a32565b005b610351610acf565b005b61036d600480360381019061036891906131f9565b610ae3565b005b610389600480360381019061038491906131f9565b610af5565b6040516103969190613aea565b60405180910390f35b6103a7610b0d565b6040516103b491906136dc565b60405180910390f35b6103d760048036038101906103d291906130fc565b610b37565b005b6103f360048036038101906103ee9190612f64565b610b5c565b005b6103fd610b72565b60405161040a9190613acf565b60405180910390f35b61042d600480360381019061042891906131f9565b610b86565b60405161043a9190613aea565b60405180910390f35b61045d60048036038101906104589190613279565b610ba3565b005b610479600480360381019061047491906130af565b610cc9565b005b61049560048036038101906104909190612d33565b611074565b6040516104a29190613812565b60405180910390f35b6104c560048036038101906104c09190612e42565b611108565b005b6104e160048036038101906104dc9190612d06565b6111a9565b005b6104fd60048036038101906104f89190612fe4565b61122d565b005b610519600480360381019061051491906131cc565b6112ca565b005b6105236112f2565b6040516105309190613aea565b60405180910390f35b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156105aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a1906138ef565b60405180910390fd5b60008083815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60007fd9b67a26000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106cd57507f0e89341c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806106dd57506106dc826112f8565b5b9050919050565b6106ec611362565b6106f5816113e0565b50565b60606002805461070790613df2565b80601f016020809104026020016040519081016040528092919081815260200182805461073390613df2565b80156107805780601f1061075557610100808354040283529160200191610780565b820191906000526020600020905b81548152906001019060200180831161076357829003601f168201915b50505050509050919050565b609681565b600660009054906101000a900460ff1681565b6107ac6113fa565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614806107f257506107f1856107ec6113fa565b611074565b5b610831576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108289061386f565b60405180910390fd5b61083e8585858585611402565b5050505050565b61084d611362565b609682600560008681526020019081526020016000205461086e9190613c7e565b11156108af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108a690613a0f565b60405180910390fd5b8160056000858152602001908152602001600020546108ce9190613c7e565b600560008581526020019081526020016000208190555061090081848460405180602001604052806000815250611724565b505050565b6060815183511461094b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094290613a6f565b60405180910390fd5b6000835167ffffffffffffffff81111561096857610967613f2b565b5b6040519080825280602002602001820160405280156109965781602001602082028036833780820191505090505b50905060005b8451811015610a13576109e38582815181106109bb576109ba613efc565b5b60200260200101518583815181106109d6576109d5613efc565b5b6020026020010151610539565b8282815181106109f6576109f5613efc565b5b60200260200101818152505080610a0c90613e55565b905061099c565b508091505092915050565b600080610a2a83610b86565b119050919050565b610a3a6113fa565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480610a805750610a7f83610a7a6113fa565b611074565b5b610abf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab69061386f565b60405180910390fd5b610aca8383836118d5565b505050565b610ad7611362565b610ae16000611ba4565b565b610aeb611362565b8060078190555050565b60056020528060005260406000206000915090505481565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610b3f611362565b80600660006101000a81548160ff02191690831515021790555050565b610b6e610b676113fa565b8383611c6a565b5050565b600660019054906101000a900461ffff1681565b600060036000838152602001908152602001600020549050919050565b610bab611362565b60968282905084610bbc9190613cd4565b6005600087815260200190815260200160002054610bda9190613c7e565b1115610c1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1290613a0f565b60405180910390fd5b8181905083610c2a9190613cd4565b6005600086815260200190815260200160002054610c489190613c7e565b600560008681526020019081526020016000208190555060005b82829050811015610cc257610caf838383818110610c8357610c82613efc565b5b9050602002016020810190610c989190612d06565b868660405180602001604052806000815250611724565b8080610cba90613e55565b915050610c62565b5050505050565b600660009054906101000a900460ff16610d18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0f9061390f565b60405180910390fd5b600660019054906101000a900461ffff1661ffff168282905014610d71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d689061392f565b60405180910390fd5b60966005600060075481526020019081526020016000205410610dc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc090613a2f565b60405180910390fd5b6000600a67ffffffffffffffff811115610de657610de5613f2b565b5b604051908082528060200260200182016040528015610e145781602001602082028036833780820191505090505b5090506000600660019054906101000a900461ffff1661ffff1667ffffffffffffffff811115610e4757610e46613f2b565b5b604051908082528060200260200182016040528015610e755781602001602082028036833780820191505090505b50905060005b600660019054906101000a900461ffff1661ffff16811015610fc8576000858583818110610eac57610eab613efc565b5b9050602002013510158015610edb5750600a858583818110610ed157610ed0613efc565b5b9050602002013511155b610ee457600080fd5b600083868684818110610efa57610ef9613efc565b5b9050602002013581518110610f1257610f11613efc565b5b602002602001015114610f5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f51906139cf565b60405180910390fd5b600183868684818110610f7057610f6f613efc565b5b9050602002013581518110610f8857610f87613efc565b5b6020026020010181815250506001828281518110610fa957610fa8613efc565b5b6020026020010181815250508080610fc090613e55565b915050610e7b565b50600160056000600754815260200190815260200160002054610feb9190613c7e565b6005600060075481526020019081526020016000208190555061105033858580806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050836118d5565b61106e33600754600160405180602001604052806000815250611724565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6111106113fa565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614806111565750611155856111506113fa565b611074565b5b611195576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118c9061386f565b60405180910390fd5b6111a28585858585611dd7565b5050505050565b6111b1611362565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611221576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611218906138af565b60405180910390fd5b61122a81611ba4565b50565b6112356113fa565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061127b575061127a836112756113fa565b611074565b5b6112ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b19061386f565b60405180910390fd5b6112c5838383612073565b505050565b6112d2611362565b80600660016101000a81548161ffff021916908361ffff16021790555050565b60075481565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61136a6113fa565b73ffffffffffffffffffffffffffffffffffffffff16611388610b0d565b73ffffffffffffffffffffffffffffffffffffffff16146113de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d5906139af565b60405180910390fd5b565b80600290805190602001906113f692919061291d565b5050565b600033905090565b8151835114611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143d90613a8f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156114b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ad9061394f565b60405180910390fd5b60006114c06113fa565b90506114d08187878787876122ba565b60005b84518110156116815760008582815181106114f1576114f0613efc565b5b6020026020010151905060008583815181106115105761150f613efc565b5b60200260200101519050600080600084815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156115b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a89061398f565b60405180910390fd5b81810360008085815260200190815260200160002060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160008085815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546116669190613c7e565b925050819055505050508061167a90613e55565b90506114d3565b508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516116f89291906137db565b60405180910390a461170e8187878787876122d0565b61171c8187878787876122d8565b505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611794576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178b90613aaf565b60405180910390fd5b600061179e6113fa565b905060006117ab856124bf565b905060006117b8856124bf565b90506117c9836000898585896122ba565b8460008088815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546118289190613c7e565b925050819055508673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6289896040516118a6929190613b05565b60405180910390a46118bd836000898585896122d0565b6118cc83600089898989612539565b50505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611945576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193c9061396f565b60405180910390fd5b8051825114611989576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198090613a8f565b60405180910390fd5b60006119936113fa565b90506119b3818560008686604051806020016040528060008152506122ba565b60005b8351811015611b005760008482815181106119d4576119d3613efc565b5b6020026020010151905060008483815181106119f3576119f2613efc565b5b60200260200101519050600080600084815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611a94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8b906138cf565b60405180910390fd5b81810360008085815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050508080611af890613e55565b9150506119b6565b50600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611b789291906137db565b60405180910390a4611b9e818560008686604051806020016040528060008152506122d0565b50505050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611cd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd090613a4f565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611dca9190613812565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611e47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3e9061394f565b60405180910390fd5b6000611e516113fa565b90506000611e5e856124bf565b90506000611e6b856124bf565b9050611e7b8389898585896122ba565b600080600088815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905085811015611f12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f099061398f565b60405180910390fd5b85810360008089815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508560008089815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611fc79190613c7e565b925050819055508773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628a8a604051612044929190613b05565b60405180910390a461205a848a8a86868a6122d0565b612068848a8a8a8a8a612539565b505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156120e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120da9061396f565b60405180910390fd5b60006120ed6113fa565b905060006120fa846124bf565b90506000612107846124bf565b9050612127838760008585604051806020016040528060008152506122ba565b600080600087815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050848110156121be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121b5906138cf565b60405180910390fd5b84810360008088815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62898960405161228b929190613b05565b60405180910390a46122b1848860008686604051806020016040528060008152506122d0565b50505050505050565b6122c8868686868686612720565b505050505050565b505050505050565b6122f78473ffffffffffffffffffffffffffffffffffffffff166128f2565b156124b7578373ffffffffffffffffffffffffffffffffffffffff1663bc197c8187878686866040518663ffffffff1660e01b815260040161233d9594939291906136f7565b602060405180830381600087803b15801561235757600080fd5b505af192505050801561238857506040513d601f19601f820116820180604052508101906123859190613156565b60015b61242e57612394613f5a565b806308c379a014156123f157506123a9614500565b806123b457506123f3565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123e8919061382d565b60405180910390fd5b505b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124259061384f565b60405180910390fd5b63bc197c8160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146124b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ac9061388f565b60405180910390fd5b505b505050505050565b60606000600167ffffffffffffffff8111156124de576124dd613f2b565b5b60405190808252806020026020018201604052801561250c5781602001602082028036833780820191505090505b509050828160008151811061252457612523613efc565b5b60200260200101818152505080915050919050565b6125588473ffffffffffffffffffffffffffffffffffffffff166128f2565b15612718578373ffffffffffffffffffffffffffffffffffffffff1663f23a6e6187878686866040518663ffffffff1660e01b815260040161259e95949392919061375f565b602060405180830381600087803b1580156125b857600080fd5b505af19250505080156125e957506040513d601f19601f820116820180604052508101906125e69190613156565b60015b61268f576125f5613f5a565b806308c379a01415612652575061260a614500565b806126155750612654565b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612649919061382d565b60405180910390fd5b505b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126869061384f565b60405180910390fd5b63f23a6e6160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614612716576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270d9061388f565b60405180910390fd5b505b505050505050565b61272e868686868686612915565b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127e05760005b83518110156127de5782818151811061278257612781613efc565b5b6020026020010151600360008684815181106127a1576127a0613efc565b5b6020026020010151815260200190815260200160002060008282546127c69190613c7e565b92505081905550806127d790613e55565b9050612766565b505b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156128ea5760005b83518110156128e857600084828151811061283657612835613efc565b5b60200260200101519050600084838151811061285557612854613efc565b5b60200260200101519050600060036000848152602001908152602001600020549050818110156128ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128b1906139ef565b60405180910390fd5b8181036003600085815260200190815260200160002081905550505050806128e190613e55565b9050612818565b505b505050505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b505050505050565b82805461292990613df2565b90600052602060002090601f01602090048101928261294b5760008555612992565b82601f1061296457805160ff1916838001178555612992565b82800160010185558215612992579182015b82811115612991578251825591602001919060010190612976565b5b50905061299f91906129a3565b5090565b5b808211156129bc5760008160009055506001016129a4565b5090565b60006129d36129ce84613b53565b613b2e565b905080838252602082019050828560208602820111156129f6576129f5613f86565b5b60005b85811015612a265781612a0c8882612b24565b8452602084019350602083019250506001810190506129f9565b5050509392505050565b6000612a43612a3e84613b7f565b613b2e565b90508083825260208201905082856020860282011115612a6657612a65613f86565b5b60005b85811015612a965781612a7c8882612cf1565b845260208401935060208301925050600181019050612a69565b5050509392505050565b6000612ab3612aae84613bab565b613b2e565b905082815260208101848484011115612acf57612ace613f8b565b5b612ada848285613db0565b509392505050565b6000612af5612af084613bdc565b613b2e565b905082815260208101848484011115612b1157612b10613f8b565b5b612b1c848285613db0565b509392505050565b600081359050612b3381614596565b92915050565b60008083601f840112612b4f57612b4e613f81565b5b8235905067ffffffffffffffff811115612b6c57612b6b613f7c565b5b602083019150836020820283011115612b8857612b87613f86565b5b9250929050565b600082601f830112612ba457612ba3613f81565b5b8135612bb48482602086016129c0565b91505092915050565b60008083601f840112612bd357612bd2613f81565b5b8235905067ffffffffffffffff811115612bf057612bef613f7c565b5b602083019150836020820283011115612c0c57612c0b613f86565b5b9250929050565b600082601f830112612c2857612c27613f81565b5b8135612c38848260208601612a30565b91505092915050565b600081359050612c50816145ad565b92915050565b600081359050612c65816145c4565b92915050565b600081519050612c7a816145c4565b92915050565b600082601f830112612c9557612c94613f81565b5b8135612ca5848260208601612aa0565b91505092915050565b600082601f830112612cc357612cc2613f81565b5b8135612cd3848260208601612ae2565b91505092915050565b600081359050612ceb816145db565b92915050565b600081359050612d00816145f2565b92915050565b600060208284031215612d1c57612d1b613f95565b5b6000612d2a84828501612b24565b91505092915050565b60008060408385031215612d4a57612d49613f95565b5b6000612d5885828601612b24565b9250506020612d6985828601612b24565b9150509250929050565b600080600080600060a08688031215612d8f57612d8e613f95565b5b6000612d9d88828901612b24565b9550506020612dae88828901612b24565b945050604086013567ffffffffffffffff811115612dcf57612dce613f90565b5b612ddb88828901612c13565b935050606086013567ffffffffffffffff811115612dfc57612dfb613f90565b5b612e0888828901612c13565b925050608086013567ffffffffffffffff811115612e2957612e28613f90565b5b612e3588828901612c80565b9150509295509295909350565b600080600080600060a08688031215612e5e57612e5d613f95565b5b6000612e6c88828901612b24565b9550506020612e7d88828901612b24565b9450506040612e8e88828901612cf1565b9350506060612e9f88828901612cf1565b925050608086013567ffffffffffffffff811115612ec057612ebf613f90565b5b612ecc88828901612c80565b9150509295509295909350565b600080600060608486031215612ef257612ef1613f95565b5b6000612f0086828701612b24565b935050602084013567ffffffffffffffff811115612f2157612f20613f90565b5b612f2d86828701612c13565b925050604084013567ffffffffffffffff811115612f4e57612f4d613f90565b5b612f5a86828701612c13565b9150509250925092565b60008060408385031215612f7b57612f7a613f95565b5b6000612f8985828601612b24565b9250506020612f9a85828601612c41565b9150509250929050565b60008060408385031215612fbb57612fba613f95565b5b6000612fc985828601612b24565b9250506020612fda85828601612cf1565b9150509250929050565b600080600060608486031215612ffd57612ffc613f95565b5b600061300b86828701612b24565b935050602061301c86828701612cf1565b925050604061302d86828701612cf1565b9150509250925092565b6000806040838503121561304e5761304d613f95565b5b600083013567ffffffffffffffff81111561306c5761306b613f90565b5b61307885828601612b8f565b925050602083013567ffffffffffffffff81111561309957613098613f90565b5b6130a585828601612c13565b9150509250929050565b600080602083850312156130c6576130c5613f95565b5b600083013567ffffffffffffffff8111156130e4576130e3613f90565b5b6130f085828601612bbd565b92509250509250929050565b60006020828403121561311257613111613f95565b5b600061312084828501612c41565b91505092915050565b60006020828403121561313f5761313e613f95565b5b600061314d84828501612c56565b91505092915050565b60006020828403121561316c5761316b613f95565b5b600061317a84828501612c6b565b91505092915050565b60006020828403121561319957613198613f95565b5b600082013567ffffffffffffffff8111156131b7576131b6613f90565b5b6131c384828501612cae565b91505092915050565b6000602082840312156131e2576131e1613f95565b5b60006131f084828501612cdc565b91505092915050565b60006020828403121561320f5761320e613f95565b5b600061321d84828501612cf1565b91505092915050565b60008060006060848603121561323f5761323e613f95565b5b600061324d86828701612cf1565b935050602061325e86828701612cf1565b925050604061326f86828701612b24565b9150509250925092565b6000806000806060858703121561329357613292613f95565b5b60006132a187828801612cf1565b94505060206132b287828801612cf1565b935050604085013567ffffffffffffffff8111156132d3576132d2613f90565b5b6132df87828801612b39565b925092505092959194509250565b60006132f983836136be565b60208301905092915050565b61330e81613d2e565b82525050565b600061331f82613c1d565b6133298185613c4b565b935061333483613c0d565b8060005b8381101561336557815161334c88826132ed565b975061335783613c3e565b925050600181019050613338565b5085935050505092915050565b61337b81613d40565b82525050565b600061338c82613c28565b6133968185613c5c565b93506133a6818560208601613dbf565b6133af81613f9a565b840191505092915050565b60006133c582613c33565b6133cf8185613c6d565b93506133df818560208601613dbf565b6133e881613f9a565b840191505092915050565b6000613400603483613c6d565b915061340b82613fb8565b604082019050919050565b6000613423602f83613c6d565b915061342e82614007565b604082019050919050565b6000613446602883613c6d565b915061345182614056565b604082019050919050565b6000613469602683613c6d565b9150613474826140a5565b604082019050919050565b600061348c602483613c6d565b9150613497826140f4565b604082019050919050565b60006134af602a83613c6d565b91506134ba82614143565b604082019050919050565b60006134d2601983613c6d565b91506134dd82614192565b602082019050919050565b60006134f5602083613c6d565b9150613500826141bb565b602082019050919050565b6000613518602583613c6d565b9150613523826141e4565b604082019050919050565b600061353b602383613c6d565b915061354682614233565b604082019050919050565b600061355e602a83613c6d565b915061356982614282565b604082019050919050565b6000613581602083613c6d565b915061358c826142d1565b602082019050919050565b60006135a4601983613c6d565b91506135af826142fa565b602082019050919050565b60006135c7602883613c6d565b91506135d282614323565b604082019050919050565b60006135ea601383613c6d565b91506135f582614372565b602082019050919050565b600061360d601283613c6d565b91506136188261439b565b602082019050919050565b6000613630602983613c6d565b915061363b826143c4565b604082019050919050565b6000613653602983613c6d565b915061365e82614413565b604082019050919050565b6000613676602883613c6d565b915061368182614462565b604082019050919050565b6000613699602183613c6d565b91506136a4826144b1565b604082019050919050565b6136b881613d78565b82525050565b6136c781613da6565b82525050565b6136d681613da6565b82525050565b60006020820190506136f16000830184613305565b92915050565b600060a08201905061370c6000830188613305565b6137196020830187613305565b818103604083015261372b8186613314565b9050818103606083015261373f8185613314565b905081810360808301526137538184613381565b90509695505050505050565b600060a0820190506137746000830188613305565b6137816020830187613305565b61378e60408301866136cd565b61379b60608301856136cd565b81810360808301526137ad8184613381565b90509695505050505050565b600060208201905081810360008301526137d38184613314565b905092915050565b600060408201905081810360008301526137f58185613314565b905081810360208301526138098184613314565b90509392505050565b60006020820190506138276000830184613372565b92915050565b6000602082019050818103600083015261384781846133ba565b905092915050565b60006020820190508181036000830152613868816133f3565b9050919050565b6000602082019050818103600083015261388881613416565b9050919050565b600060208201905081810360008301526138a881613439565b9050919050565b600060208201905081810360008301526138c88161345c565b9050919050565b600060208201905081810360008301526138e88161347f565b9050919050565b60006020820190508181036000830152613908816134a2565b9050919050565b60006020820190508181036000830152613928816134c5565b9050919050565b60006020820190508181036000830152613948816134e8565b9050919050565b600060208201905081810360008301526139688161350b565b9050919050565b600060208201905081810360008301526139888161352e565b9050919050565b600060208201905081810360008301526139a881613551565b9050919050565b600060208201905081810360008301526139c881613574565b9050919050565b600060208201905081810360008301526139e881613597565b9050919050565b60006020820190508181036000830152613a08816135ba565b9050919050565b60006020820190508181036000830152613a28816135dd565b9050919050565b60006020820190508181036000830152613a4881613600565b9050919050565b60006020820190508181036000830152613a6881613623565b9050919050565b60006020820190508181036000830152613a8881613646565b9050919050565b60006020820190508181036000830152613aa881613669565b9050919050565b60006020820190508181036000830152613ac88161368c565b9050919050565b6000602082019050613ae460008301846136af565b92915050565b6000602082019050613aff60008301846136cd565b92915050565b6000604082019050613b1a60008301856136cd565b613b2760208301846136cd565b9392505050565b6000613b38613b49565b9050613b448282613e24565b919050565b6000604051905090565b600067ffffffffffffffff821115613b6e57613b6d613f2b565b5b602082029050602081019050919050565b600067ffffffffffffffff821115613b9a57613b99613f2b565b5b602082029050602081019050919050565b600067ffffffffffffffff821115613bc657613bc5613f2b565b5b613bcf82613f9a565b9050602081019050919050565b600067ffffffffffffffff821115613bf757613bf6613f2b565b5b613c0082613f9a565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613c8982613da6565b9150613c9483613da6565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613cc957613cc8613e9e565b5b828201905092915050565b6000613cdf82613da6565b9150613cea83613da6565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613d2357613d22613e9e565b5b828202905092915050565b6000613d3982613d86565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015613ddd578082015181840152602081019050613dc2565b83811115613dec576000848401525b50505050565b60006002820490506001821680613e0a57607f821691505b60208210811415613e1e57613e1d613ecd565b5b50919050565b613e2d82613f9a565b810181811067ffffffffffffffff82111715613e4c57613e4b613f2b565b5b80604052505050565b6000613e6082613da6565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613e9357613e92613e9e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060033d1115613f795760046000803e613f76600051613fab565b90505b90565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160e01c9050919050565b7f455243313135353a207472616e7366657220746f206e6f6e204552433131353560008201527f526563656976657220696d706c656d656e746572000000000000000000000000602082015250565b7f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60008201527f6572206e6f7220617070726f7665640000000000000000000000000000000000602082015250565b7f455243313135353a204552433131353552656365697665722072656a6563746560008201527f6420746f6b656e73000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a206275726e20616d6f756e7420657863656564732062616c60008201527f616e636500000000000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a2061646472657373207a65726f206973206e6f742061207660008201527f616c6964206f776e657200000000000000000000000000000000000000000000602082015250565b7f526564656d7074696f6e206973206e6f74206163746976652e00000000000000600082015250565b7f57726f6e67206e756d626572206f6620746f6b656e73207375626d6974746564600082015250565b7f455243313135353a207472616e7366657220746f20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a206275726e2066726f6d20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a20696e73756666696369656e742062616c616e636520666f60008201527f72207472616e7366657200000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4561636820746f6b656e206d75737420626520756e6971756500000000000000600082015250565b7f455243313135353a206275726e20616d6f756e74206578636565647320746f7460008201527f616c537570706c79000000000000000000000000000000000000000000000000602082015250565b7f4e6f2072656d61696e696e6720737570706c7900000000000000000000000000600082015250565b7f4e6f2072656d616e696e6720737570706c790000000000000000000000000000600082015250565b7f455243313135353a2073657474696e6720617070726f76616c2073746174757360008201527f20666f722073656c660000000000000000000000000000000000000000000000602082015250565b7f455243313135353a206163636f756e747320616e6420696473206c656e67746860008201527f206d69736d617463680000000000000000000000000000000000000000000000602082015250565b7f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060008201527f6d69736d61746368000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a206d696e7420746f20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b600060443d101561451057614593565b614518613b49565b60043d036004823e80513d602482011167ffffffffffffffff82111715614540575050614593565b808201805167ffffffffffffffff81111561455e5750505050614593565b80602083010160043d03850181111561457b575050505050614593565b61458a82602001850186613e24565b82955050505050505b90565b61459f81613d2e565b81146145aa57600080fd5b50565b6145b681613d40565b81146145c157600080fd5b50565b6145cd81613d4c565b81146145d857600080fd5b50565b6145e481613d78565b81146145ef57600080fd5b50565b6145fb81613da6565b811461460657600080fd5b5056fea264697066735822122023b713720650eb55907a187db6f93b6dbd0c03e59a6888c134d3e94f50747b7d64736f6c63430008070033

Verified Source Code Partial Match

Compiler: v0.8.7+commit.e28d00a7 EVM: london Optimization: No
main.sol 1365 lines
// This contract is part of Zellic’s smart contract dataset, which is a collection of publicly available contract code gathered as of March 2023.

// File: @openzeppelin/contracts/utils/Context.sol


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

pragma solidity ^0.8.0;

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

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

// File: @openzeppelin/contracts/access/Ownable.sol


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

pragma solidity ^0.8.0;


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

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

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/utils/Address.sol


// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/utils/introspection/IERC165.sol


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

pragma solidity ^0.8.0;

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

// File: @openzeppelin/contracts/utils/introspection/ERC165.sol


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

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/ERC1155/IERC1155Receiver.sol


// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;


/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

// File: @openzeppelin/contracts/token/ERC1155/IERC1155.sol


// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;


/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

// File: @openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol


// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.0;


/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

// File: @openzeppelin/contracts/token/ERC1155/ERC1155.sol


// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.0;







/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;

    // Mapping from token ID to account balances
    mapping(uint256 => mapping(address => uint256)) private _balances;

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

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    constructor(string memory uri_) {
        _setURI(uri_);
    }

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

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: address zero is not a valid owner");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

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

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

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not token owner nor approved"
        );
        _safeTransferFrom(from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not token owner nor approved"
        );
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }
        _balances[id][to] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _afterTokenTransfer(operator, from, to, ids, amounts, data);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
            _balances[id][to] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _afterTokenTransfer(operator, from, to, ids, amounts, data);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        _balances[id][to] += amount;
        emit TransferSingle(operator, address(0), to, id, amount);

        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);

        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; i++) {
            _balances[ids[i]][to] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _afterTokenTransfer(operator, address(0), to, ids, amounts, data);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    /**
     * @dev Destroys `amount` tokens of token type `id` from `from`
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `amount` tokens of token type `id`.
     */
    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }

        emit TransferSingle(operator, from, address(0), id, amount);

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        for (uint256 i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
        }

        emit TransferBatch(operator, from, address(0), ids, amounts);

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC1155: setting approval status for self");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `ids` and `amounts` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}

// File: @openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol


// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/extensions/ERC1155Burnable.sol)

pragma solidity ^0.8.0;


/**
 * @dev Extension of {ERC1155} that allows token holders to destroy both their
 * own tokens and those that they have been approved to use.
 *
 * _Available since v3.1._
 */
abstract contract ERC1155Burnable is ERC1155 {
    function burn(
        address account,
        uint256 id,
        uint256 value
    ) public virtual {
        require(
            account == _msgSender() || isApprovedForAll(account, _msgSender()),
            "ERC1155: caller is not token owner nor approved"
        );

        _burn(account, id, value);
    }

    function burnBatch(
        address account,
        uint256[] memory ids,
        uint256[] memory values
    ) public virtual {
        require(
            account == _msgSender() || isApprovedForAll(account, _msgSender()),
            "ERC1155: caller is not token owner nor approved"
        );

        _burnBatch(account, ids, values);
    }
}

// File: @openzeppelin/contracts/token/ERC1155/extensions/ERC1155Supply.sol


// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC1155/extensions/ERC1155Supply.sol)

pragma solidity ^0.8.0;


/**
 * @dev Extension of ERC1155 that adds tracking of total supply per id.
 *
 * Useful for scenarios where Fungible and Non-fungible tokens have to be
 * clearly identified. Note: While a totalSupply of 1 might mean the
 * corresponding is an NFT, there is no guarantees that no other token with the
 * same id are not going to be minted.
 */
abstract contract ERC1155Supply is ERC1155 {
    mapping(uint256 => uint256) private _totalSupply;

    /**
     * @dev Total amount of tokens in with a given id.
     */
    function totalSupply(uint256 id) public view virtual returns (uint256) {
        return _totalSupply[id];
    }

    /**
     * @dev Indicates whether any token exist with a given id, or not.
     */
    function exists(uint256 id) public view virtual returns (bool) {
        return ERC1155Supply.totalSupply(id) > 0;
    }

    /**
     * @dev See {ERC1155-_beforeTokenTransfer}.
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual override {
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);

        if (from == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                _totalSupply[ids[i]] += amounts[i];
            }
        }

        if (to == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                uint256 id = ids[i];
                uint256 amount = amounts[i];
                uint256 supply = _totalSupply[id];
                require(supply >= amount, "ERC1155: burn amount exceeds totalSupply");
                unchecked {
                    _totalSupply[id] = supply - amount;
                }
            }
        }
    }
}

// File: contracts/Fins.sol

// contracts/Fins.sol

pragma solidity ^0.8.7;





contract FinsBeachBar is ERC1155, ERC1155Supply, ERC1155Burnable, Ownable {
    constructor(string memory _uri) ERC1155(_uri) {
        _setURI(_uri);
    }

    uint256 public constant MAX_PER_ITEM = 150;

    mapping (uint256 => uint256) public tokensMinted;

    /// turn on/off redemption
    bool public redeemIsActive = false;

    function setRedeemIsActive(bool _status) external onlyOwner {
        redeemIsActive = _status;
    }

    /// adjust the number of tokens needed to claim
    uint16 public requiredToClaim = 10;

    function setRequiredToClaim(uint16 _number) external onlyOwner {
        requiredToClaim = _number;
    }

    /// set the claim token ID
    uint256 public claimTokenID = 10;

    function setClaimTokenID(uint256 _id) external onlyOwner {
        claimTokenID = _id;
    }

    /// @dev set the URI to your base URI here, don't forget the {id} param.
    function setURI(string memory newuri) external onlyOwner {
        _setURI(newuri);
    }

    /**
     * @notice Airdrop a token to multiple addresses at once.
     * @dev Airdrop x tokens to each address in the calldata list,
     * setting the supply to the length of the list + previously minted (airdropped) supply. 
     * An address can appear more than once, and it will be given more tokens accordingly.
     * @param _tokenID The tokenID to send
     * @param _quantity The number of tokens to air drop to each address in the list
     * @param _list address[] list of wallets to send tokens to
     */
    function airdrop(
        uint256 _tokenID, 
        uint256 _quantity, 
        address[] calldata _list
    ) external onlyOwner {

        /// ensure the list length + existing supply don't exceed the max tokens that can be issued
        require(tokensMinted[_tokenID] + (_quantity * _list.length) <= MAX_PER_ITEM, "No remaining supply");

        tokensMinted[_tokenID] = tokensMinted[_tokenID] + (_quantity * _list.length);

        for (uint256 i = 0; i < _list.length; i++) {
            /// we doo a little air drop
            _mint(_list[i], _tokenID, _quantity, "");
        }
    }

    /**
     * @notice Sends multiple tokens to a single address
     * @param _tokenID The address to receive the tokens
     * @param _quantity How many to send she receiver
     * @param _address The address to receive the tokens
     */
    function batchMint(
        uint256 _tokenID,
        uint256 _quantity,
        address _address
    ) external onlyOwner {

        // ensure the list length + existing supply don't exceed the max tokens that can be issued
        require(tokensMinted[_tokenID] + _quantity <= MAX_PER_ITEM, "No remaining supply");
        tokensMinted[_tokenID] = tokensMinted[_tokenID] + _quantity;
        _mint(_address, _tokenID, _quantity, "");
    }

    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal override(ERC1155, ERC1155Supply) {
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
    }

    function burnToRedeem(uint256[] calldata ids) public {
        /// check that redemption is active
        require(redeemIsActive, "Redemption is not active.");
        /// ensure that exactly the required number of items are submitted to burn
        require(ids.length == requiredToClaim, "Wrong number of tokens submitted");
        /// ensure the list length + existing supply don't exceed the max tokens that can be issued
        require(tokensMinted[claimTokenID] < MAX_PER_ITEM, "No remaning supply");
        
        /// keep track of which tokens were submitted to prevent dupes
        uint256[] memory tokens = new uint256[](10);
        uint256[] memory values = new uint256[](requiredToClaim);

        /// loop over each token
        for (uint256 i = 0; i < requiredToClaim; i++) {
            /// ensure the token id is between 0 and 10
            require(ids[i] >= 0 && ids[i] <= 10);
            /// ensure that the token is not already in the list
            require(tokens[ids[i]] == 0, "Each token must be unique");
            /// mark the token as "used" so we prevent duplicates from being used
            tokens[ids[i]] = 1;
            values[i] = 1;
        }
        /// burn the set of tokens and exchange them for a new one
        tokensMinted[claimTokenID] = tokensMinted[claimTokenID] + 1;
        _burnBatch(msg.sender, ids, values);
        _mint(msg.sender, claimTokenID, 1, "");

    }
}

Read Contract

MAX_PER_ITEM 0x19eea6c9 → uint256
balanceOf 0x00fdd58e → uint256
balanceOfBatch 0x4e1273f4 → uint256[]
claimTokenID 0xfcc9def3 → uint256
exists 0x4f558e79 → bool
isApprovedForAll 0xe985e9c5 → bool
owner 0x8da5cb5b → address
redeemIsActive 0x1a982769 → bool
requiredToClaim 0xba2af520 → uint16
supportsInterface 0x01ffc9a7 → bool
tokensMinted 0x7f74cde2 → uint256
totalSupply 0xbd85b039 → uint256
uri 0x0e89341c → string

Write Contract 14 functions

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

airdrop 0xc5d63db1
uint256 _tokenID
uint256 _quantity
address[] _list
batchMint 0x3ef009ef
uint256 _tokenID
uint256 _quantity
address _address
burn 0xf5298aca
address account
uint256 id
uint256 value
burnBatch 0x6b20c454
address account
uint256[] ids
uint256[] values
burnToRedeem 0xc8d6054f
uint256[] ids
renounceOwnership 0x715018a6
No parameters
safeBatchTransferFrom 0x2eb2c2d6
address from
address to
uint256[] ids
uint256[] amounts
bytes data
safeTransferFrom 0xf242432a
address from
address to
uint256 id
uint256 amount
bytes data
setApprovalForAll 0xa22cb465
address operator
bool approved
setClaimTokenID 0x75c7c7d0
uint256 _id
setRedeemIsActive 0x9b2fec2c
bool _status
setRequiredToClaim 0xf7ff704b
uint16 _number
setURI 0x02fe5305
string newuri
transferOwnership 0xf2fde38b
address newOwner

Recent Transactions

No transactions found for this address