Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x31A5A9F60Dc3d62fa5168352CaF0Ee05aA18f5B8
Balance 0 ETH
Nonce 1
Code Size 18054 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

18054 bytes
0x608060405260043610610341575f3560e01c80635f45bac8116101bd578063b92d0eff116100f2578063d555f36811610092578063f07f287d1161006d578063f07f287d14610a9c578063f2fde38b14610aca578063fbfa77cf14610ae9578063ff7bd03d14610b1c575f80fd5b8063d555f36814610a27578063d7424e3314610a46578063de35f5cb14610a65575f80fd5b8063c29d2f10116100cd578063c29d2f1014610967578063ca5eb5e114610986578063cab716e8146109a5578063d1822216146109b8575f80fd5b8063b92d0eff1461090b578063bb0b6a531461091d578063bf7e214f14610948575f80fd5b80639a94d3d01161015d578063a924bf6111610138578063a924bf611461088e578063abd626b0146108ad578063b187bd26146108cc578063b5ba6182146108ec575f80fd5b80639a94d3d01461081e5780639d574420146108495780639fdb11b614610868575f80fd5b80638456cb59116101985780638456cb59146107ba5780638da5cb5b146107ce5780638dfd8ba1146107ec57806394f512891461080b575f80fd5b80635f45bac8146107455780637a9e5e4b146107645780637d25a05e14610783575f80fd5b806326a64b40116102935780633f4ba83a1161023357806346b563f41161020e57806346b563f4146106a15780634fb3ccc5146106c057806355a2d64d146106f35780635e280f1114610712575f80fd5b80633f4ba83a1461060957806341fee44a1461061d57806345ad606314610682575f80fd5b806334dafd6b1161026e57806334dafd6b1461058d5780633b575407146105ac5780633d935d9e146105cb5780633e64ce99146105ea575f80fd5b806326a64b40146105215780632c524c421461054f5780633400288b1461056e575f80fd5b80631568fc58116102fe57806318aed921116102d957806318aed921146104a55780631b62636c146104c45780631ba9a458146104e3578063202eac5714610502575f80fd5b80631568fc581461043b57806317442b701461045a5780631899ea811461047a575f80fd5b806304ded84a1461034557806305921740146103885780630b48a8b81461039d5780630efe6a8b146103e857806312056e2d1461040957806313137d6514610428575b5f80fd5b348015610350575f80fd5b5061037361035f366004613b79565b60086020525f908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61039b610396366004613bee565b610b3b565b005b3480156103a8575f80fd5b506103d07f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6040516001600160a01b03909116815260200161037f565b6103fb6103f6366004613c6b565b610be1565b60405190815260200161037f565b348015610414575f80fd5b5061039b610423366004613cb1565b610dea565b61039b610436366004613ce2565b610e75565b348015610446575f80fd5b5061039b610455366004613da3565b610f30565b348015610465575f80fd5b5060408051600180825260208201520161037f565b348015610485575f80fd5b506103fb610494366004613b79565b60066020525f908152604090205481565b3480156104b0575f80fd5b5061039b6104bf366004613b79565b611005565b3480156104cf575f80fd5b5061039b6104de366004613b79565b61110d565b3480156104ee575f80fd5b5061039b6104fd366004613b79565b611189565b34801561050d575f80fd5b5061039b61051c366004613dd4565b611202565b34801561052c575f80fd5b5061037361053b366004613b79565b60076020525f908152604090205460ff1681565b34801561055a575f80fd5b5061039b610569366004613b79565b6112a9565b348015610579575f80fd5b5061039b610588366004613e09565b611325565b348015610598575f80fd5b5061039b6105a7366004613e3e565b611364565b3480156105b7575f80fd5b5061039b6105c6366004613b79565b6114b8565b3480156105d6575f80fd5b506103fb6105e5366004613eb5565b611534565b3480156105f5575f80fd5b506103fb610604366004613f15565b611632565b348015610614575f80fd5b5061039b6118bf565b348015610628575f80fd5b50610661610637366004613b79565b60036020525f908152604090205460ff8082169161010081049091169062010000900461ffff1683565b604080519315158452911515602084015261ffff169082015260600161037f565b34801561068d575f80fd5b5061039b61069c366004613f5c565b611927565b3480156106ac575f80fd5b5061039b6106bb366004613f75565b6119b0565b3480156106cb575f80fd5b506103d07f0000000000000000000000003a592f9ea2463379c4154d03461a73c48499366881565b3480156106fe575f80fd5b5061039b61070d366004613f5c565b611bba565b34801561071d575f80fd5b506103d07f0000000000000000000000001a44076050125825900e736c501f859c50fe728c81565b348015610750575f80fd5b5061039b61075f366004613b79565b611c5f565b34801561076f575f80fd5b5061039b61077e366004613b79565b611cd8565b34801561078e575f80fd5b506107a261079d366004613e09565b611dbc565b6040516001600160401b03909116815260200161037f565b3480156107c5575f80fd5b5061039b611dc4565b3480156107d9575f80fd5b505f546103d0906001600160a01b031681565b3480156107f7575f80fd5b5061039b610806366004613fd5565b611e32565b6103fb610819366004614029565b611f4b565b348015610829575f80fd5b506103fb6108383660046140ed565b60056020525f908152604090205481565b348015610854575f80fd5b506103fb610863366004613f15565b612084565b348015610873575f80fd5b506004546107a290600160601b90046001600160401b031681565b348015610899575f80fd5b5061039b6108a8366004613b79565b612149565b3480156108b8575f80fd5b5061039b6108c7366004614104565b6121c2565b3480156108d7575f80fd5b5060045461037390600160a01b900460ff1681565b3480156108f7575f80fd5b5061039b61090636600461414c565b612297565b348015610916575f80fd5b50306103d0565b348015610928575f80fd5b506103fb610937366004613f5c565b600a6020525f908152604090205481565b348015610953575f80fd5b506001546103d0906001600160a01b031681565b348015610972575f80fd5b5061039b610981366004613b79565b612394565b348015610991575f80fd5b5061039b6109a0366004613b79565b612495565b6103fb6109b336600461418e565b61253f565b3480156109c3575f80fd5b50610a016109d2366004613f5c565b600b6020525f908152604090205460ff808216916101008104909116906201000090046001600160801b031683565b60408051931515845291151560208401526001600160801b03169082015260600161037f565b348015610a32575f80fd5b5061039b610a41366004613f5c565b612666565b348015610a51575f80fd5b506103fb610a60366004614220565b6126e6565b348015610a70575f80fd5b50600454610a84906001600160601b031681565b6040516001600160601b03909116815260200161037f565b348015610aa7575f80fd5b50610373610ab6366004613b79565b60096020525f908152604090205460ff1681565b348015610ad5575f80fd5b5061039b610ae4366004613b79565b612731565b348015610af4575f80fd5b506103d07f0000000000000000000000003bce5cb273f0f148010bbea2470e7b5df84c781281565b348015610b27575f80fd5b50610373610b36366004614295565b6127ac565b610b50335f356001600160e01b0319166127e0565b610b755760405162461bcd60e51b8152600401610b6c906142af565b60405180910390fd5b600254600114610b975760405162461bcd60e51b8152600401610b6c906142d5565b60028055600454600160a01b900460ff1615610bc65760405163e0f9e71d60e01b815260040160405180910390fd5b610bd4868686868686612886565b5050600160025550505050565b5f610bf7335f356001600160e01b0319166127e0565b610c135760405162461bcd60e51b8152600401610b6c906142af565b600254600114610c355760405162461bcd60e51b8152600401610b6c906142d5565b600280555f610c43856129c0565b90505f73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03871601610d7f57345f03610c8b5760405163259be69560e11b815260040160405180910390fd5b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004015f604051808303818588803b158015610ce4575f80fd5b505af1158015610cf6573d5f803e3d5ffd5b50349850610d559350506001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21691507f0000000000000000000000003bce5cb273f0f148010bbea2470e7b5df84c7812905087612a7b565b507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2945030610da1565b3415610d9e57604051631cf02cf960e21b815260040160405180910390fd5b50335b610daf868686843387612afd565b9250610ddc338787866004600c9054906101000a90046001600160401b03166001600160401b0316612cbc565b505060016002559392505050565b610dff335f356001600160e01b0319166127e0565b610e1b5760405162461bcd60e51b8152600401610b6c906142af565b6203f480816001600160401b03161115610e4857604051631fac010160e21b815260040160405180910390fd5b600480546001600160401b03909216600160601b0267ffffffffffffffff60601b19909216919091179055565b7f0000000000000000000000001a44076050125825900e736c501f859c50fe728c6001600160a01b03163314610ec0576040516391ac5e4f60e01b8152336004820152602401610b6c565b60208701803590610eda90610ed5908a613f5c565b612deb565b14610f1857610eec6020880188613f5c565b60405163309afaf360e21b815263ffffffff909116600482015260208801356024820152604401610b6c565b610f2787878787878787612e26565b50505050505050565b610f45335f356001600160e01b0319166127e0565b610f615760405162461bcd60e51b8152600401610b6c906142af565b806001600160801b03165f03610f8a5760405163c80ed59560e01b815260040160405180910390fd5b63ffffffff82165f818152600b6020908152604091829020805462010000600160901b031916620100006001600160801b038716908102919091178255835194855291840191909152917f0aa48359f83e8464fda3f4ea4bd3f2d6af01e90b46ab9464aa7d538e1772947a91015b60405180910390a1505050565b61101a335f356001600160e01b0319166127e0565b6110365760405162461bcd60e51b8152600401610b6c906142af565b6001600160a01b0381165f8181526007602090815260408083208054600160ff1991821681179092556008845282852080548216831790556009909352818420805490931617909155517fd658022b1a3aaf6ad3b3c615253712807f21a8f7bc3e4996e10618175d4afb2b9190a26040516001600160a01b038216907f79fc685a7dbabb75a67df5e69a90602cef1f19bc465b060eab1ac56685e04a13905f90a26040516001600160a01b038216907f3afb02134e37f7205acf470adc2fc4ebb70614b1599a602d069790915380e2aa905f90a250565b611122335f356001600160e01b0319166127e0565b61113e5760405162461bcd60e51b8152600401610b6c906142af565b6001600160a01b0381165f81815260096020526040808220805460ff19166001179055517f3afb02134e37f7205acf470adc2fc4ebb70614b1599a602d069790915380e2aa9190a250565b61119e335f356001600160e01b0319166127e0565b6111ba5760405162461bcd60e51b8152600401610b6c906142af565b6001600160a01b0381165f81815260096020526040808220805460ff19169055517f77cb944c14da76928795279d1519ce9150085a06e0a53c61d5a86fc4e0fd57c69190a250565b611217335f356001600160e01b0319166127e0565b6112335760405162461bcd60e51b8152600401610b6c906142af565b63ffffffff82165f908152600b60205260409020805460ff19166001178155611265836001600160a01b038416612ee3565b6040805163ffffffff851681526001600160a01b03841660208201527fe925de263dcdbdc20307c9ab92758ed8cc0edf3d173dad4a3aa54c070f27a5439101610ff8565b6112be335f356001600160e01b0319166127e0565b6112da5760405162461bcd60e51b8152600401610b6c906142af565b6001600160a01b0381165f81815260076020526040808220805460ff19166001179055517fd658022b1a3aaf6ad3b3c615253712807f21a8f7bc3e4996e10618175d4afb2b9190a250565b61133a335f356001600160e01b0319166127e0565b6113565760405162461bcd60e51b8152600401610b6c906142af565b6113608282612ee3565b5050565b611379335f356001600160e01b0319166127e0565b6113955760405162461bcd60e51b8152600401610b6c906142af565b8280156113a957506001600160801b038116155b156113c75760405163c80ed59560e01b815260040160405180910390fd5b60408051606081018252851515815284151560208083019182526001600160801b0385811684860190815263ffffffff8b165f908152600b90935294909120925183549251945161ffff1990931690151561ff00191617610100941515949094029390931762010000600160901b03191662010000919093160291909117905561145a856001600160a01b038416612ee3565b6040805163ffffffff871681528515156020820152841515818301526001600160a01b038416606082015290517f5dbe727bffd24a6d61a5aeef919510389c66c0deeaa82634862cf4f098961fb89181900360800190a15050505050565b6114cd335f356001600160e01b0319166127e0565b6114e95760405162461bcd60e51b8152600401610b6c906142af565b6001600160a01b0381165f81815260086020526040808220805460ff19166001179055517f79fc685a7dbabb75a67df5e69a90602cef1f19bc465b060eab1ac56685e04a139190a250565b5f61154a335f356001600160e01b0319166127e0565b6115665760405162461bcd60e51b8152600401610b6c906142af565b6002546001146115885760405162461bcd60e51b8152600401610b6c906142d5565b600280558773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038216016115cb576040516316df5df960e31b815260040160405180910390fd5b5f6115d58a6129c0565b90506115e58a8a89898989612f30565b6115f38a8a8a333386612afd565b9250611620338b8b866004600c9054906101000a90046001600160401b03166001600160401b0316612cbc565b50506001600255979650505050505050565b5f611648335f356001600160e01b0319166127e0565b6116645760405162461bcd60e51b8152600401610b6c906142af565b600454600160a01b900460ff161561168f5760405163e0f9e71d60e01b815260040160405180910390fd5b6001600160a01b0385165f908152600360209081526040918290208251606081018452905460ff80821615158352610100820416151592820183905262010000900461ffff16928101929092526116f95760405163645fd19f60e11b815260040160405180910390fd5b845f0361171957604051630ea3153160e21b815260040160405180910390fd5b604051634104b9ed60e11b81526001600160a01b0387811660048301526117cf917f0000000000000000000000003a592f9ea2463379c4154d03461a73c4849936689091169063820973da90602401602060405180830381865afa158015611783573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117a791906142f9565b86907f0000000000000000000000000000000000000000000000000de0b6b3a7640000613088565b9150838210156117f2576040516302620f6160e61b815260040160405180910390fd5b6040516318457e6160e01b81526001600160a01b037f0000000000000000000000003bce5cb273f0f148010bbea2470e7b5df84c781216906318457e61906118469086908a90879033908c90600401614310565b5f604051808303815f87803b15801561185d575f80fd5b505af115801561186f573d5f803e3d5ffd5b50505050856001600160a01b03167fdcc60b41ff1c604459e6aa4a7299817416b19fc586a392f111646e26597c4af9866040516118ae91815260200190565b60405180910390a250949350505050565b6118d4335f356001600160e01b0319166127e0565b6118f05760405162461bcd60e51b8152600401610b6c906142af565b6004805460ff60a01b191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d16933905f90a1565b61193c335f356001600160e01b0319166127e0565b6119585760405162461bcd60e51b8152600401610b6c906142af565b63ffffffff81165f818152600b6020908152604091829020805461ff0019168155915192835290917fc45af64a13a09ef916a1114c59589294ec9c3095f2bfbbb093a7a96656858ded91015b60405180910390a15050565b6119c5335f356001600160e01b0319166127e0565b6119e15760405162461bcd60e51b8152600401610b6c906142af565b806119ec8342614357565b10611a0a57604051634c1eef1760e11b815260040160405180910390fd5b604080516001600160a01b038089166020830152871691810191909152606081018590526080810184905260a0810183905260c081018290525f9060e00160408051601f1981840301815291815281516020928301205f8b815260059093529120549091508114611a8e5760405163fa174ecb60e01b815260040160405180910390fd5b5f888152600560205260408120556001600160a01b03861673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14611ac65785611ae8565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25b6040516318457e6160e01b81529096506001600160a01b037f0000000000000000000000003bce5cb273f0f148010bbea2470e7b5df84c781216906318457e6190611b3f908a908a908a9083908b90600401614310565b5f604051808303815f87803b158015611b56575f80fd5b505af1158015611b68573d5f803e3d5ffd5b50505050866001600160a01b0316887faf98ea774275cadfa3e477a7b52cba03e01197445a76bd5d0d561608708c362483604051611ba891815260200190565b60405180910390a35050505050505050565b611bcf335f356001600160e01b0319166127e0565b611beb5760405162461bcd60e51b8152600401610b6c906142af565b63ffffffff81165f908152600b60205260408120805471ffffffffffffffffffffffffffffffffffff19169055611c23908290612ee3565b60405163ffffffff821681527f11a9d1a77f76361ed131c19b1dc5758504c51dbde2e49fc973a0ef9577ad13d59060200160405180910390a150565b611c74335f356001600160e01b0319166127e0565b611c905760405162461bcd60e51b8152600401610b6c906142af565b6001600160a01b0381165f81815260086020526040808220805460ff19169055517f039bcf51833310242b8b7c6aa0fbabf1bf2b5e5270807ee020f1920ef200666b9190a250565b5f546001600160a01b0316331480611d69575060015460405163b700961360e01b81526001600160a01b039091169063b700961390611d2a90339030906001600160e01b03195f35169060040161436a565b602060405180830381865afa158015611d45573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611d699190614397565b611d71575f80fd5b600180546001600160a01b0319166001600160a01b03831690811790915560405133907fa3396fd7f6e0a21b50e5089d2da70d5ac0a3bbbd1f617a93f134b76389980198905f90a350565b5f5b92915050565b611dd9335f356001600160e01b0319166127e0565b611df55760405162461bcd60e51b8152600401610b6c906142af565b6004805460ff60a01b1916600160a01b1790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e752905f90a1565b611e47335f356001600160e01b0319166127e0565b611e635760405162461bcd60e51b8152600401610b6c906142af565b6103e861ffff82161115611e8a57604051636c5cde8760e01b815260040160405180910390fd5b6040805160608082018352851515808352851515602080850182815261ffff8881168789018181526001600160a01b038e165f818152600387528b902099518a549551925161ffff1990961690151561ff00191617610100921515929092029190911763ffff0000191662010000949093169390930291909117909655865193845290830191909152938101929092527fe08301321781ac43935a2099b2c3fd42de0a0ee87a519cac00e8c9cecd26ff12910160405180910390a250505050565b5f611f61335f356001600160e01b0319166127e0565b611f7d5760405162461bcd60e51b8152600401610b6c906142af565b600254600114611f9f5760405162461bcd60e51b8152600401610b6c906142d5565b600280558c73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03821601611fe2576040516316df5df960e31b815260040160405180910390fd5b5f611fec8f6129c0565b9050611ffc8f8f8e8e8e8e612f30565b61200a8f8f8f333386612afd565b925050612038338f8f856004600c9054906101000a90046001600160401b03166001600160401b0316612cbc565b6001600160601b03821115612060576040516389588ab360e01b815260040160405180910390fd5b61206e828888888888612886565b5060016002559c9b505050505050505050505050565b5f61209a335f356001600160e01b0319166127e0565b6120b65760405162461bcd60e51b8152600401610b6c906142af565b6002546001146120d85760405162461bcd60e51b8152600401610b6c906142d5565b600280555f6120e6866129c0565b90506120f6868686338786612afd565b9150856001600160a01b03167f6f9b974223f85a1ae805c33b8b519039e2435481d949db1110de151a94d587af8660405161213391815260200190565b60405180910390a2506001600255949350505050565b61215e335f356001600160e01b0319166127e0565b61217a5760405162461bcd60e51b8152600401610b6c906142af565b6001600160a01b0381165f81815260076020526040808220805460ff19169055517fae893dda71e2eee548f8291f458cceae4bd22b56a79906928591e4420444c0e99190a250565b6001600160a01b0383165f9081526007602052604090205460ff16806121ff57506001600160a01b0382165f9081526008602052604090205460ff165b8061222157506001600160a01b0381165f9081526009602052604090205460ff165b1561225a57604051632821264f60e01b81526001600160a01b038085166004830152808416602483015282166044820152606401610b6c565b6001600160a01b0383165f908152600660205260409020544210156122925760405163f64059db60e01b815260040160405180910390fd5b505050565b6122ac335f356001600160e01b0319166127e0565b6122c85760405162461bcd60e51b8152600401610b6c906142af565b806001600160801b03165f036122f15760405163c80ed59560e01b815260040160405180910390fd5b63ffffffff83165f908152600b60205260409020805461010071ffffffffffffffffffffffffffffffffff0019909116620100006001600160801b0385160217178155612347846001600160a01b038516612ee3565b6040805163ffffffff861681526001600160a01b03851660208201527f34fe916485e02ec88e487b0e611e5c9bacabba9e3eaae7a900aa08be8197d419910160405180910390a150505050565b6123a9335f356001600160e01b0319166127e0565b6123c55760405162461bcd60e51b8152600401610b6c906142af565b6001600160a01b0381165f818152600760209081526040808320805460ff199081169091556008835281842080548216905560099092528083208054909216909155517fae893dda71e2eee548f8291f458cceae4bd22b56a79906928591e4420444c0e99190a26040516001600160a01b038216907f039bcf51833310242b8b7c6aa0fbabf1bf2b5e5270807ee020f1920ef200666b905f90a26040516001600160a01b038216907f77cb944c14da76928795279d1519ce9150085a06e0a53c61d5a86fc4e0fd57c6905f90a250565b6124aa335f356001600160e01b0319166127e0565b6124c65760405162461bcd60e51b8152600401610b6c906142af565b60405163ca5eb5e160e01b81526001600160a01b0382811660048301527f0000000000000000000000001a44076050125825900e736c501f859c50fe728c169063ca5eb5e1906024015f604051808303815f87803b158015612526575f80fd5b505af1158015612538573d5f803e3d5ffd5b5050505050565b5f612555335f356001600160e01b0319166127e0565b6125715760405162461bcd60e51b8152600401610b6c906142af565b6002546001146125935760405162461bcd60e51b8152600401610b6c906142d5565b600280558873eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038216016125d6576040516316df5df960e31b815260040160405180910390fd5b5f6125e08b6129c0565b90506125f08b8b8b333386612afd565b925061261d338c8c866004600c9054906101000a90046001600160401b03166001600160401b0316612cbc565b6001600160601b03831115612645576040516389588ab360e01b815260040160405180910390fd5b612653838989898989612886565b5050600160025598975050505050505050565b61267b335f356001600160e01b0319166127e0565b6126975760405162461bcd60e51b8152600401610b6c906142af565b63ffffffff81165f818152600b6020908152604091829020805460ff19168155915192835290917f1cb867ed6a020e020ea220d4f48bb8e36552abf9095e093e377d33933f2b31e491016119a4565b604080518082019091526001600160601b03861681526001600160a01b03851660208201525f9081612717826130a3565b9050612725818787876130ea565b98975050505050505050565b612746335f356001600160e01b0319166127e0565b6127625760405162461bcd60e51b8152600401610b6c906142af565b5f80546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b5f60208201803590600a9083906127c39086613f5c565b63ffffffff16815260208101919091526040015f20541492915050565b6001545f906001600160a01b03168015801590612867575060405163b700961360e01b81526001600160a01b0382169063b7009613906128289087903090889060040161436a565b602060405180830381865afa158015612843573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906128679190614397565b8061287e57505f546001600160a01b038581169116145b949350505050565b612891335f336121c2565b6040516318457e6160e01b81525f600482018190526024820181905260448201523360648201526001600160601b03871660848201527f0000000000000000000000003bce5cb273f0f148010bbea2470e7b5df84c78126001600160a01b0316906318457e619060a4015f604051808303815f87803b158015612912575f80fd5b505af1158015612924573d5f803e3d5ffd5b5050604080518082019091526001600160601b03891681526001600160a01b038816602082015291505f9050612959826130a3565b90505f61296982888888886132b9565b6040516001600160601b038b1681529091506001600160a01b0389169082907fe0ec62d39b054dc2fd626dbc271483735df6e6fa1ef8389754bf8ab27a75eab29060200160405180910390a3505050505050505050565b604080516060810182525f8082526020820181905291810191909152600454600160a01b900460ff1615612a075760405163e0f9e71d60e01b815260040160405180910390fd5b506001600160a01b0381165f908152600360209081526040918290208251606081018452905460ff8082161515808452610100830490911615159383019390935262010000900461ffff1692810192909252612a765760405163645fd19f60e11b815260040160405180910390fd5b919050565b5f60405163095ea7b360e01b81526001600160a01b038416600482015282602482015260205f6044835f895af13d15601f3d1160015f511416171691505080612af75760405162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b6044820152606401610b6c565b50505050565b5f855f03612b1e5760405163259be69560e11b815260040160405180910390fd5b604051634104b9ed60e11b81526001600160a01b038881166004830152612bd4917f0000000000000000000000000000000000000000000000000de0b6b3a7640000917f0000000000000000000000003a592f9ea2463379c4154d03461a73c484993668169063820973da90602401602060405180830381865afa158015612ba8573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612bcc91906142f9565b889190613088565b90505f826040015161ffff1611612beb5780612c0e565b612c0e8260400151612710612c0091906143b2565b829061ffff16612710613088565b905084811015612c315760405163097b2ad560e31b815260040160405180910390fd5b604051631ceb5d1960e11b81526001600160a01b037f0000000000000000000000003bce5cb273f0f148010bbea2470e7b5df84c781216906339d6ba3290612c859087908b908b9089908890600401614310565b5f604051808303815f87803b158015612c9c575f80fd5b505af1158015612cae573d5f803e3d5ffd5b505050509695505050505050565b600480545f91908290612cd7906001600160601b03166143d4565b82546001600160601b039182166101009390930a838102920219161790915590508115612d7b57612d0882426143f9565b6001600160a01b038781165f81815260066020908152604091829020949094558051938401919091529087169082015260608101859052608081018490524260a082015260c0810183905260e00160408051601f1981840301815291815281516020928301205f84815260059093529120555b846001600160a01b0316866001600160a01b0316827fe96d7872363f475d18b2f5390caaa5eaa96b2d38e42c62afe4ac08ebd2b13c3a87874288604051612ddb949392919093845260208401929092526040830152606082015260800190565b60405180910390a4505050505050565b63ffffffff81165f908152600a602052604081205480611dbe5760405163f6ff4fb760e01b815263ffffffff84166004820152602401610b6c565b5f600b81612e3760208b018b613f5c565b63ffffffff16815260208082019290925260409081015f208151606081018352905460ff808216151580845261010083049091161515948301949094526201000090046001600160801b0316918101919091529150612ebf57612e9d6020890189613f5c565b6040516315b73a2960e21b815263ffffffff9091166004820152602401610b6c565b5f612ecc868801886140ed565b9050612ed888826134dc565b505050505050505050565b63ffffffff82165f818152600a6020908152604091829020849055815192835282018390527f238399d427b947898edb290f5ff0f9109849b1c3ba196a42e35f00c50a54b98b91016119a4565b60405163d505accf60e01b81523360048201526001600160a01b037f0000000000000000000000003bce5cb273f0f148010bbea2470e7b5df84c781281166024830152604482018790526064820186905260ff8516608483015260a4820184905260c4820183905287169063d505accf9060e4015f604051808303815f87803b158015612fbb575f80fd5b505af1925050508015612fcc575060015b61308057604051636eb1769f60e11b81523360048201526001600160a01b037f0000000000000000000000003bce5cb273f0f148010bbea2470e7b5df84c78128116602483015286919088169063dd62ed3e90604401602060405180830381865afa15801561303d573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061306191906142f9565b1015613080576040516301b8851f60e41b815260040160405180910390fd5b505050505050565b5f825f19048411830215820261309c575f80fd5b5091020490565b80515f906001600160601b0310156130ce57604051633524486360e01b815260040160405180910390fd5b81516020909201516001600160a01b031660a09290921b171790565b5f6001600160a01b03821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1480159061314a57507f0000000000000000000000006985884c4392d348587b19cb9eaaf157f13271cd6001600160a01b0316826001600160a01b031614155b1561316857604051637f3cd08160e11b815260040160405180910390fd5b5f61317584860186613f5c565b63ffffffff81165f908152600b60209081526040918290208251606081018452905460ff8082161515835261010082041615159282018390526201000090046001600160801b031692810192909252919250906131ed5760405163420eae3760e01b815263ffffffff83166004820152602401610b6c565b5f8760405160200161320191815260200190565b60405160208183030381529060405290505f61324983604001515f61324260408051600360f01b602082015281516002818303018152602290910190915290565b91906135c8565b90505f6132788584846001600160a01b038b1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561362d565b90506001600160a01b03871673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146132a85780602001516132ab565b80515b9a9950505050505050505050565b5f806132c785870187613f5c565b63ffffffff81165f908152600b60209081526040918290208251606081018452905460ff8082161515835261010082041615159282018390526201000090046001600160801b0316928101929092529192509061333f5760405163420eae3760e01b815263ffffffff83166004820152602401610b6c565b5f8860405160200161335391815260200190565b60405160208183030381529060405290505f61339483604001515f61324260408051600360f01b602082015281516002818303018152602290910190915290565b90505f6133c38584846001600160a01b038c1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee141561362d565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0389160161342a57805187101561342557805160405163f5ac3fa760e01b815263ffffffff87166004820152602481019190915260448101889052606401610b6c565b6134bd565b7f0000000000000000000000006985884c4392d348587b19cb9eaaf157f13271cd6001600160a01b0316886001600160a01b0316036134a457868160200151111561342557602081015160405163f5ac3fa760e01b815263ffffffff87166004820152602481019190915260448101889052606401610b6c565b604051637f3cd08160e11b815260040160405180910390fd5b5f6134cb868585853361370b565b519c9b505050505050505050505050565b60408051808201825260a083901c8082526001600160a01b03808516602084018190529351631ceb5d1960e11b815292937f0000000000000000000000003bce5cb273f0f148010bbea2470e7b5df84c7812909116926339d6ba329261354b925f928392839291600401614310565b5f604051808303815f87803b158015613562575f80fd5b505af1158015613574573d5f803e3d5ffd5b5050505080602001516001600160a01b0316837fb944fddc61d7fedb8b736790454ba972000703b0d21c7481d6dbf95b7c2cc2f1835f01516040516135bb91815260200190565b60405180910390a3505050565b60608360036135d7825f613811565b61ffff161461360a576135ea815f613811565b604051633a51740d60e01b815261ffff9091166004820152602401610b6c565b5f613615858561386d565b9050613623866001836138e6565b9695505050505050565b604080518082019091525f80825260208201527f0000000000000000000000001a44076050125825900e736c501f859c50fe728c6001600160a01b031663ddc28c586040518060a001604052808863ffffffff16815260200161368f89612deb565b8152602001878152602001868152602001851515815250306040518363ffffffff1660e01b81526004016136c4929190614459565b6040805180830381865afa1580156136de573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906137029190614529565b95945050505050565b613713613b14565b5f613720845f015161394f565b60208501519091501561373a5761373a8460200151613976565b7f0000000000000000000000001a44076050125825900e736c501f859c50fe728c6001600160a01b0316632637a450826040518060a001604052808b63ffffffff16815260200161378a8c612deb565b81526020018a81526020018981526020015f8960200151111515815250866040518463ffffffff1660e01b81526004016137c5929190614459565b60806040518083038185885af11580156137e1573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906138069190614543565b979650505050505050565b5f61381d8260026143f9565b835110156138645760405162461bcd60e51b8152602060048201526014602482015273746f55696e7431365f6f75744f66426f756e647360601b6044820152606401610b6c565b50016002015190565b60606001600160801b038216156138b557604080516001600160801b0319608086811b8216602084015285901b166030820152016040516020818303038152906040526138df565b6040516001600160801b0319608085901b1660208201526030016040516020818303038152906040525b9392505050565b60608360036138f5825f613811565b61ffff1614613908576135ea815f613811565b8460016139158551613a55565b6139209060016145b4565b86866040516020016139369594939291906145cf565b6040516020818303038152906040529150509392505050565b5f813414613972576040516304fb820960e51b8152346004820152602401610b6c565b5090565b5f7f0000000000000000000000001a44076050125825900e736c501f859c50fe728c6001600160a01b031663e4fe1d946040518163ffffffff1660e01b8152600401602060405180830381865afa1580156139d3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906139f79190614635565b90506001600160a01b038116613a20576040516329b99a9560e11b815260040160405180910390fd5b6113606001600160a01b038216337f0000000000000000000000001a44076050125825900e736c501f859c50fe728c85613a83565b5f61ffff821115613972576040516306dfcc6560e41b81526010600482015260248101839052604401610b6c565b5f6040516323b872dd60e01b81526001600160a01b03851660048201526001600160a01b038416602482015282604482015260205f6064835f8a5af13d15601f3d1160015f5114161716915050806125385760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b6044820152606401610b6c565b60405180606001604052805f80191681526020015f6001600160401b03168152602001613b5260405180604001604052805f81526020015f81525090565b905290565b6001600160a01b0381168114613b6b575f80fd5b50565b8035612a7681613b57565b5f60208284031215613b89575f80fd5b81356138df81613b57565b80356001600160601b0381168114612a76575f80fd5b5f8083601f840112613bba575f80fd5b5081356001600160401b03811115613bd0575f80fd5b602083019150836020828501011115613be7575f80fd5b9250929050565b5f805f805f8060a08789031215613c03575f80fd5b613c0c87613b94565b95506020870135613c1c81613b57565b945060408701356001600160401b03811115613c36575f80fd5b613c4289828a01613baa565b9095509350506060870135613c5681613b57565b80925050608087013590509295509295509295565b5f805f60608486031215613c7d575f80fd5b8335613c8881613b57565b95602085013595506040909401359392505050565b6001600160401b0381168114613b6b575f80fd5b5f60208284031215613cc1575f80fd5b81356138df81613c9d565b5f60608284031215613cdc575f80fd5b50919050565b5f805f805f805f60e0888a031215613cf8575f80fd5b613d028989613ccc565b96506060880135955060808801356001600160401b0380821115613d24575f80fd5b613d308b838c01613baa565b909750955060a08a01359150613d4582613b57565b90935060c08901359080821115613d5a575f80fd5b50613d678a828b01613baa565b989b979a50959850939692959293505050565b803563ffffffff81168114612a76575f80fd5b80356001600160801b0381168114612a76575f80fd5b5f8060408385031215613db4575f80fd5b613dbd83613d7a565b9150613dcb60208401613d8d565b90509250929050565b5f8060408385031215613de5575f80fd5b613dee83613d7a565b91506020830135613dfe81613b57565b809150509250929050565b5f8060408385031215613e1a575f80fd5b613e2383613d7a565b946020939093013593505050565b8015158114613b6b575f80fd5b5f805f805f60a08688031215613e52575f80fd5b613e5b86613d7a565b94506020860135613e6b81613e31565b93506040860135613e7b81613e31565b92506060860135613e8b81613b57565b9150613e9960808701613d8d565b90509295509295909350565b803560ff81168114612a76575f80fd5b5f805f805f805f60e0888a031215613ecb575f80fd5b8735613ed681613b57565b9650602088013595506040880135945060608801359350613ef960808901613ea5565b925060a0880135915060c0880135905092959891949750929550565b5f805f8060808587031215613f28575f80fd5b8435613f3381613b57565b935060208501359250604085013591506060850135613f5181613b57565b939692955090935050565b5f60208284031215613f6c575f80fd5b6138df82613d7a565b5f805f805f805f60e0888a031215613f8b575f80fd5b873596506020880135613f9d81613b57565b95506040880135613fad81613b57565b969995985095966060810135965060808101359560a0820135955060c0909101359350915050565b5f805f8060808587031215613fe8575f80fd5b8435613ff381613b57565b9350602085013561400381613e31565b9250604085013561401381613e31565b9150606085013561ffff81168114613f51575f80fd5b5f805f805f805f805f805f806101608d8f031215614045575f80fd5b61404f8d35613b57565b8c359b5060208d01359a5060408d0135995060608d0135985061407460808e01613ea5565b975060a08d0135965060c08d0135955061409160e08e0135613b57565b60e08d013594506001600160401b036101008e013511156140b0575f80fd5b6140c18e6101008f01358f01613baa565b90945092506140d36101208e01613b6e565b91506101408d013590509295989b509295989b509295989b565b5f602082840312156140fd575f80fd5b5035919050565b5f805f60608486031215614116575f80fd5b833561412181613b57565b9250602084013561413181613b57565b9150604084013561414181613b57565b809150509250925092565b5f805f6060848603121561415e575f80fd5b61416784613d7a565b9250602084013561417781613b57565b915061418560408501613d8d565b90509250925092565b5f805f805f805f8060e0898b0312156141a5575f80fd5b88356141b081613b57565b9750602089013596506040890135955060608901356141ce81613b57565b945060808901356001600160401b038111156141e8575f80fd5b6141f48b828c01613baa565b90955093505060a089013561420881613b57565b8092505060c089013590509295985092959890939650565b5f805f805f60808688031215614234575f80fd5b61423d86613b94565b9450602086013561424d81613b57565b935060408601356001600160401b03811115614267575f80fd5b61427388828901613baa565b909450925050606086013561428781613b57565b809150509295509295909350565b5f606082840312156142a5575f80fd5b6138df8383613ccc565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b6020808252600a90820152695245454e5452414e435960b01b604082015260600190565b5f60208284031215614309575f80fd5b5051919050565b6001600160a01b039586168152938516602085015260408401929092529092166060820152608081019190915260a00190565b634e487b7160e01b5f52601160045260245ffd5b81810381811115611dbe57611dbe614343565b6001600160a01b0393841681529190921660208201526001600160e01b0319909116604082015260600190565b5f602082840312156143a7575f80fd5b81516138df81613e31565b61ffff8281168282160390808211156143cd576143cd614343565b5092915050565b5f6001600160601b038083168181036143ef576143ef614343565b6001019392505050565b80820180821115611dbe57611dbe614343565b5f5b8381101561442657818101518382015260200161440e565b50505f910152565b5f815180845261444581602086016020860161440c565b601f01601f19169290920160200192915050565b6040815263ffffffff8351166040820152602083015160608201525f604084015160a0608084015261448e60e084018261442e565b90506060850151603f198483030160a08501526144ab828261442e565b60809690960151151560c08501525050506001600160a01b039190911660209091015290565b5f604082840312156144e1575f80fd5b604051604081018181106001600160401b038211171561450f57634e487b7160e01b5f52604160045260245ffd5b604052825181526020928301519281019290925250919050565b5f60408284031215614539575f80fd5b6138df83836144d1565b5f60808284031215614553575f80fd5b604051606081018181106001600160401b038211171561458157634e487b7160e01b5f52604160045260245ffd5b60405282518152602083015161459681613c9d565b60208201526145a884604085016144d1565b60408201529392505050565b61ffff8181168382160190808211156143cd576143cd614343565b5f86516145e0818460208b0161440c565b6001600160f81b031960f888811b82169285019283526001600160f01b031960f089901b16600184015286901b166003820152835161462681600484016020880161440c565b01600401979650505050505050565b5f60208284031215614645575f80fd5b81516138df81613b5756fea2646970667358221220095176b175aed07451463d0b227697a3f8371c90fee16f14bddd6277341e022c64736f6c63430008150033

Verified Source Code Partial Match

Compiler: v0.8.21+commit.d9974bed EVM: shanghai Optimization: Yes (200 runs)
LayerZeroTeller.sol 5248 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity <0.9.0 =0.8.21 >=0.8.0 ^0.8.0 ^0.8.20;

// lib/OAppAuth/lib/LayerZero-V2/packages/layerzero-v2/evm/protocol/contracts/interfaces/IMessageLibManager.sol

struct SetConfigParam {
    uint32 eid;
    uint32 configType;
    bytes config;
}

interface IMessageLibManager {
    struct Timeout {
        address lib;
        uint256 expiry;
    }

    event LibraryRegistered(address newLib);
    event DefaultSendLibrarySet(uint32 eid, address newLib);
    event DefaultReceiveLibrarySet(uint32 eid, address newLib);
    event DefaultReceiveLibraryTimeoutSet(uint32 eid, address oldLib, uint256 expiry);
    event SendLibrarySet(address sender, uint32 eid, address newLib);
    event ReceiveLibrarySet(address receiver, uint32 eid, address newLib);
    event ReceiveLibraryTimeoutSet(address receiver, uint32 eid, address oldLib, uint256 timeout);

    function registerLibrary(address _lib) external;

    function isRegisteredLibrary(address _lib) external view returns (bool);

    function getRegisteredLibraries() external view returns (address[] memory);

    function setDefaultSendLibrary(uint32 _eid, address _newLib) external;

    function defaultSendLibrary(uint32 _eid) external view returns (address);

    function setDefaultReceiveLibrary(uint32 _eid, address _newLib, uint256 _timeout) external;

    function defaultReceiveLibrary(uint32 _eid) external view returns (address);

    function setDefaultReceiveLibraryTimeout(uint32 _eid, address _lib, uint256 _expiry) external;

    function defaultReceiveLibraryTimeout(uint32 _eid) external view returns (address lib, uint256 expiry);

    function isSupportedEid(uint32 _eid) external view returns (bool);

    function isValidReceiveLibrary(address _receiver, uint32 _eid, address _lib) external view returns (bool);

    /// ------------------- OApp interfaces -------------------
    function setSendLibrary(address _oapp, uint32 _eid, address _newLib) external;

    function getSendLibrary(address _sender, uint32 _eid) external view returns (address lib);

    function isDefaultSendLibrary(address _sender, uint32 _eid) external view returns (bool);

    function setReceiveLibrary(address _oapp, uint32 _eid, address _newLib, uint256 _gracePeriod) external;

    function getReceiveLibrary(address _receiver, uint32 _eid) external view returns (address lib, bool isDefault);

    function setReceiveLibraryTimeout(address _oapp, uint32 _eid, address _lib, uint256 _gracePeriod) external;

    function receiveLibraryTimeout(address _receiver, uint32 _eid) external view returns (address lib, uint256 expiry);

    function setConfig(address _oapp, address _lib, SetConfigParam[] calldata _params) external;

    function getConfig(
        address _oapp,
        address _lib,
        uint32 _eid,
        uint32 _configType
    ) external view returns (bytes memory config);
}

// lib/OAppAuth/lib/LayerZero-V2/packages/layerzero-v2/evm/protocol/contracts/interfaces/IMessagingChannel.sol

interface IMessagingChannel {
    event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce);
    event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);
    event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash);

    function eid() external view returns (uint32);

    // this is an emergency function if a message cannot be verified for some reasons
    // required to provide _nextNonce to avoid race condition
    function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external;

    function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;

    function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external;

    function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32);

    function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);

    function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64);

    function inboundPayloadHash(
        address _receiver,
        uint32 _srcEid,
        bytes32 _sender,
        uint64 _nonce
    ) external view returns (bytes32);

    function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64);
}

// lib/OAppAuth/lib/LayerZero-V2/packages/layerzero-v2/evm/protocol/contracts/interfaces/IMessagingComposer.sol

interface IMessagingComposer {
    event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message);
    event ComposeDelivered(address from, address to, bytes32 guid, uint16 index);
    event LzComposeAlert(
        address indexed from,
        address indexed to,
        address indexed executor,
        bytes32 guid,
        uint16 index,
        uint256 gas,
        uint256 value,
        bytes message,
        bytes extraData,
        bytes reason
    );

    function composeQueue(
        address _from,
        address _to,
        bytes32 _guid,
        uint16 _index
    ) external view returns (bytes32 messageHash);

    function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external;

    function lzCompose(
        address _from,
        address _to,
        bytes32 _guid,
        uint16 _index,
        bytes calldata _message,
        bytes calldata _extraData
    ) external payable;
}

// lib/OAppAuth/lib/LayerZero-V2/packages/layerzero-v2/evm/protocol/contracts/interfaces/IMessagingContext.sol

interface IMessagingContext {
    function isSendingMessage() external view returns (bool);

    function getSendContext() external view returns (uint32 dstEid, address sender);
}

// lib/OAppAuth/lib/solidity-bytes-utils/contracts/BytesLib.sol

/*
 * @title Solidity Bytes Arrays Utils
 * @author Gonçalo Sá <[email protected]>
 *
 * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.
 *      The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.
 */

library BytesLib {
    function concat(
        bytes memory _preBytes,
        bytes memory _postBytes
    )
        internal
        pure
        returns (bytes memory)
    {
        bytes memory tempBytes;

        assembly {
            // Get a location of some free memory and store it in tempBytes as
            // Solidity does for memory variables.
            tempBytes := mload(0x40)

            // Store the length of the first bytes array at the beginning of
            // the memory for tempBytes.
            let length := mload(_preBytes)
            mstore(tempBytes, length)

            // Maintain a memory counter for the current write location in the
            // temp bytes array by adding the 32 bytes for the array length to
            // the starting location.
            let mc := add(tempBytes, 0x20)
            // Stop copying when the memory counter reaches the length of the
            // first bytes array.
            let end := add(mc, length)

            for {
                // Initialize a copy counter to the start of the _preBytes data,
                // 32 bytes into its memory.
                let cc := add(_preBytes, 0x20)
            } lt(mc, end) {
                // Increase both counters by 32 bytes each iteration.
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                // Write the _preBytes data into the tempBytes memory 32 bytes
                // at a time.
                mstore(mc, mload(cc))
            }

            // Add the length of _postBytes to the current length of tempBytes
            // and store it as the new length in the first 32 bytes of the
            // tempBytes memory.
            length := mload(_postBytes)
            mstore(tempBytes, add(length, mload(tempBytes)))

            // Move the memory counter back from a multiple of 0x20 to the
            // actual end of the _preBytes data.
            mc := end
            // Stop copying when the memory counter reaches the new combined
            // length of the arrays.
            end := add(mc, length)

            for {
                let cc := add(_postBytes, 0x20)
            } lt(mc, end) {
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                mstore(mc, mload(cc))
            }

            // Update the free-memory pointer by padding our last write location
            // to 32 bytes: add 31 bytes to the end of tempBytes to move to the
            // next 32 byte block, then round down to the nearest multiple of
            // 32. If the sum of the length of the two arrays is zero then add
            // one before rounding down to leave a blank 32 bytes (the length block with 0).
            mstore(0x40, and(
              add(add(end, iszero(add(length, mload(_preBytes)))), 31),
              not(31) // Round down to the nearest 32 bytes.
            ))
        }

        return tempBytes;
    }

    function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {
        assembly {
            // Read the first 32 bytes of _preBytes storage, which is the length
            // of the array. (We don't need to use the offset into the slot
            // because arrays use the entire slot.)
            let fslot := sload(_preBytes.slot)
            // Arrays of 31 bytes or less have an even value in their slot,
            // while longer arrays have an odd value. The actual length is
            // the slot divided by two for odd values, and the lowest order
            // byte divided by two for even values.
            // If the slot is even, bitwise and the slot with 255 and divide by
            // two to get the length. If the slot is odd, bitwise and the slot
            // with -1 and divide by two.
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)
            let newlength := add(slength, mlength)
            // slength can contain both the length and contents of the array
            // if length < 32 bytes so let's prepare for that
            // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
            switch add(lt(slength, 32), lt(newlength, 32))
            case 2 {
                // Since the new array still fits in the slot, we just need to
                // update the contents of the slot.
                // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length
                sstore(
                    _preBytes.slot,
                    // all the modifications to the slot are inside this
                    // next block
                    add(
                        // we can just add to the slot contents because the
                        // bytes we want to change are the LSBs
                        fslot,
                        add(
                            mul(
                                div(
                                    // load the bytes from memory
                                    mload(add(_postBytes, 0x20)),
                                    // zero all bytes to the right
                                    exp(0x100, sub(32, mlength))
                                ),
                                // and now shift left the number of bytes to
                                // leave space for the length in the slot
                                exp(0x100, sub(32, newlength))
                            ),
                            // increase length by the double of the memory
                            // bytes length
                            mul(mlength, 2)
                        )
                    )
                )
            }
            case 1 {
                // The stored value fits in the slot, but the combined value
                // will exceed it.
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // The contents of the _postBytes array start 32 bytes into
                // the structure. Our first read should obtain the `submod`
                // bytes that can fit into the unused space in the last word
                // of the stored array. To get this, we read 32 bytes starting
                // from `submod`, so the data we read overlaps with the array
                // contents by `submod` bytes. Masking the lowest-order
                // `submod` bytes allows us to add that value directly to the
                // stored value.

                let submod := sub(32, slength)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(
                    sc,
                    add(
                        and(
                            fslot,
                            0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00
                        ),
                        and(mload(mc), mask)
                    )
                )

                for {
                    mc := add(mc, 0x20)
                    sc := add(sc, 1)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
            default {
                // get the keccak hash to get the contents of the array
                mstore(0x0, _preBytes.slot)
                // Start copying to the last used word of the stored array.
                let sc := add(keccak256(0x0, 0x20), div(slength, 32))

                // save new length
                sstore(_preBytes.slot, add(mul(newlength, 2), 1))

                // Copy over the first `submod` bytes of the new data as in
                // case 1 above.
                let slengthmod := mod(slength, 32)
                let mlengthmod := mod(mlength, 32)
                let submod := sub(32, slengthmod)
                let mc := add(_postBytes, submod)
                let end := add(_postBytes, mlength)
                let mask := sub(exp(0x100, submod), 1)

                sstore(sc, add(sload(sc), and(mload(mc), mask)))

                for {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } lt(mc, end) {
                    sc := add(sc, 1)
                    mc := add(mc, 0x20)
                } {
                    sstore(sc, mload(mc))
                }

                mask := exp(0x100, sub(mc, end))

                sstore(sc, mul(div(mload(mc), mask), mask))
            }
        }
    }

    function slice(
        bytes memory _bytes,
        uint256 _start,
        uint256 _length
    )
        internal
        pure
        returns (bytes memory)
    {
        require(_length + 31 >= _length, "slice_overflow");
        require(_bytes.length >= _start + _length, "slice_outOfBounds");

        bytes memory tempBytes;

        assembly {
            switch iszero(_length)
            case 0 {
                // Get a location of some free memory and store it in tempBytes as
                // Solidity does for memory variables.
                tempBytes := mload(0x40)

                // The first word of the slice result is potentially a partial
                // word read from the original array. To read it, we calculate
                // the length of that partial word and start copying that many
                // bytes into the array. The first word we copy will start with
                // data we don't care about, but the last `lengthmod` bytes will
                // land at the beginning of the contents of the new array. When
                // we're done copying, we overwrite the full first word with
                // the actual length of the slice.
                let lengthmod := and(_length, 31)

                // The multiplication in the next line is necessary
                // because when slicing multiples of 32 bytes (lengthmod == 0)
                // the following copy loop was copying the origin's length
                // and then ending prematurely not copying everything it should.
                let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
                let end := add(mc, _length)

                for {
                    // The multiplication in the next line has the same exact purpose
                    // as the one above.
                    let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
                } lt(mc, end) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    mstore(mc, mload(cc))
                }

                mstore(tempBytes, _length)

                //update free-memory pointer
                //allocating the array padded to 32 bytes like the compiler does now
                mstore(0x40, and(add(mc, 31), not(31)))
            }
            //if we want a zero-length slice let's just return a zero-length array
            default {
                tempBytes := mload(0x40)
                //zero out the 32 bytes slice we are about to return
                //we need to do it because Solidity does not garbage collect
                mstore(tempBytes, 0)

                mstore(0x40, add(tempBytes, 0x20))
            }
        }

        return tempBytes;
    }

    function toAddress(bytes memory _bytes, uint256 _start) internal pure returns (address) {
        require(_bytes.length >= _start + 20, "toAddress_outOfBounds");
        address tempAddress;

        assembly {
            tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
        }

        return tempAddress;
    }

    function toUint8(bytes memory _bytes, uint256 _start) internal pure returns (uint8) {
        require(_bytes.length >= _start + 1 , "toUint8_outOfBounds");
        uint8 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x1), _start))
        }

        return tempUint;
    }

    function toUint16(bytes memory _bytes, uint256 _start) internal pure returns (uint16) {
        require(_bytes.length >= _start + 2, "toUint16_outOfBounds");
        uint16 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x2), _start))
        }

        return tempUint;
    }

    function toUint32(bytes memory _bytes, uint256 _start) internal pure returns (uint32) {
        require(_bytes.length >= _start + 4, "toUint32_outOfBounds");
        uint32 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x4), _start))
        }

        return tempUint;
    }

    function toUint64(bytes memory _bytes, uint256 _start) internal pure returns (uint64) {
        require(_bytes.length >= _start + 8, "toUint64_outOfBounds");
        uint64 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x8), _start))
        }

        return tempUint;
    }

    function toUint96(bytes memory _bytes, uint256 _start) internal pure returns (uint96) {
        require(_bytes.length >= _start + 12, "toUint96_outOfBounds");
        uint96 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0xc), _start))
        }

        return tempUint;
    }

    function toUint128(bytes memory _bytes, uint256 _start) internal pure returns (uint128) {
        require(_bytes.length >= _start + 16, "toUint128_outOfBounds");
        uint128 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x10), _start))
        }

        return tempUint;
    }

    function toUint256(bytes memory _bytes, uint256 _start) internal pure returns (uint256) {
        require(_bytes.length >= _start + 32, "toUint256_outOfBounds");
        uint256 tempUint;

        assembly {
            tempUint := mload(add(add(_bytes, 0x20), _start))
        }

        return tempUint;
    }

    function toBytes32(bytes memory _bytes, uint256 _start) internal pure returns (bytes32) {
        require(_bytes.length >= _start + 32, "toBytes32_outOfBounds");
        bytes32 tempBytes32;

        assembly {
            tempBytes32 := mload(add(add(_bytes, 0x20), _start))
        }

        return tempBytes32;
    }

    function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {
        bool success = true;

        assembly {
            let length := mload(_preBytes)

            // if lengths don't match the arrays are not equal
            switch eq(length, mload(_postBytes))
            case 1 {
                // cb is a circuit breaker in the for loop since there's
                //  no said feature for inline assembly loops
                // cb = 1 - don't breaker
                // cb = 0 - break
                let cb := 1

                let mc := add(_preBytes, 0x20)
                let end := add(mc, length)

                for {
                    let cc := add(_postBytes, 0x20)
                // the next line is the loop condition:
                // while(uint256(mc < end) + cb == 2)
                } eq(add(lt(mc, end), cb), 2) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    // if any of these checks fails then arrays are not equal
                    if iszero(eq(mload(mc), mload(cc))) {
                        // unsuccess:
                        success := 0
                        cb := 0
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }

    function equal_nonAligned(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {
        bool success = true;

        assembly {
            let length := mload(_preBytes)

            // if lengths don't match the arrays are not equal
            switch eq(length, mload(_postBytes))
            case 1 {
                // cb is a circuit breaker in the for loop since there's
                //  no said feature for inline assembly loops
                // cb = 1 - don't breaker
                // cb = 0 - break
                let cb := 1

                let endMinusWord := add(_preBytes, length)
                let mc := add(_preBytes, 0x20)
                let cc := add(_postBytes, 0x20)

                for {
                // the next line is the loop condition:
                // while(uint256(mc < endWord) + cb == 2)
                } eq(add(lt(mc, endMinusWord), cb), 2) {
                    mc := add(mc, 0x20)
                    cc := add(cc, 0x20)
                } {
                    // if any of these checks fails then arrays are not equal
                    if iszero(eq(mload(mc), mload(cc))) {
                        // unsuccess:
                        success := 0
                        cb := 0
                    }
                }

                // Only if still successful
                // For <1 word tail bytes
                if gt(success, 0) {
                    // Get the remainder of length/32
                    // length % 32 = AND(length, 32 - 1)
                    let numTailBytes := and(length, 0x1f)
                    let mcRem := mload(mc)
                    let ccRem := mload(cc)
                    for {
                        let i := 0
                    // the next line is the loop condition:
                    // while(uint256(i < numTailBytes) + cb == 2)
                    } eq(add(lt(i, numTailBytes), cb), 2) {
                        i := add(i, 1)
                    } {
                        if iszero(eq(byte(i, mcRem), byte(i, ccRem))) {
                            // unsuccess:
                            success := 0
                            cb := 0
                        }
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }

    function equalStorage(
        bytes storage _preBytes,
        bytes memory _postBytes
    )
        internal
        view
        returns (bool)
    {
        bool success = true;

        assembly {
            // we know _preBytes_offset is 0
            let fslot := sload(_preBytes.slot)
            // Decode the length of the stored array like in concatStorage().
            let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
            let mlength := mload(_postBytes)

            // if lengths don't match the arrays are not equal
            switch eq(slength, mlength)
            case 1 {
                // slength can contain both the length and contents of the array
                // if length < 32 bytes so let's prepare for that
                // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
                if iszero(iszero(slength)) {
                    switch lt(slength, 32)
                    case 1 {
                        // blank the last byte which is the length
                        fslot := mul(div(fslot, 0x100), 0x100)

                        if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {
                            // unsuccess:
                            success := 0
                        }
                    }
                    default {
                        // cb is a circuit breaker in the for loop since there's
                        //  no said feature for inline assembly loops
                        // cb = 1 - don't breaker
                        // cb = 0 - break
                        let cb := 1

                        // get the keccak hash to get the contents of the array
                        mstore(0x0, _preBytes.slot)
                        let sc := keccak256(0x0, 0x20)

                        let mc := add(_postBytes, 0x20)
                        let end := add(mc, mlength)

                        // the next line is the loop condition:
                        // while(uint256(mc < end) + cb == 2)
                        for {} eq(add(lt(mc, end), cb), 2) {
                            sc := add(sc, 1)
                            mc := add(mc, 0x20)
                        } {
                            if iszero(eq(sload(sc), mload(mc))) {
                                // unsuccess:
                                success := 0
                                cb := 0
                            }
                        }
                    }
                }
            }
            default {
                // unsuccess:
                success := 0
            }
        }

        return success;
    }
}

// lib/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol

// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)

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

// lib/openzeppelin-contracts/contracts/utils/Address.sol

// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // 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 FailedInnerCall();
        }
    }
}

// lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol

// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

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

// lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol

// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.

/**
 * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
 * checks.
 *
 * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
 * easily result in undesired exploitation or bugs, since developers usually
 * assume that overflows raise errors. `SafeCast` restores this intuition by
 * reverting the transaction when such an operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeCast {
    /**
     * @dev Value doesn't fit in an uint of `bits` size.
     */
    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);

    /**
     * @dev An int value doesn't fit in an uint of `bits` size.
     */
    error SafeCastOverflowedIntToUint(int256 value);

    /**
     * @dev Value doesn't fit in an int of `bits` size.
     */
    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);

    /**
     * @dev An uint value doesn't fit in an int of `bits` size.
     */
    error SafeCastOverflowedUintToInt(uint256 value);

    /**
     * @dev Returns the downcasted uint248 from uint256, reverting on
     * overflow (when the input is greater than largest uint248).
     *
     * Counterpart to Solidity's `uint248` operator.
     *
     * Requirements:
     *
     * - input must fit into 248 bits
     */
    function toUint248(uint256 value) internal pure returns (uint248) {
        if (value > type(uint248).max) {
            revert SafeCastOverflowedUintDowncast(248, value);
        }
        return uint248(value);
    }

    /**
     * @dev Returns the downcasted uint240 from uint256, reverting on
     * overflow (when the input is greater than largest uint240).
     *
     * Counterpart to Solidity's `uint240` operator.
     *
     * Requirements:
     *
     * - input must fit into 240 bits
     */
    function toUint240(uint256 value) internal pure returns (uint240) {
        if (value > type(uint240).max) {
            revert SafeCastOverflowedUintDowncast(240, value);
        }
        return uint240(value);
    }

    /**
     * @dev Returns the downcasted uint232 from uint256, reverting on
     * overflow (when the input is greater than largest uint232).
     *
     * Counterpart to Solidity's `uint232` operator.
     *
     * Requirements:
     *
     * - input must fit into 232 bits
     */
    function toUint232(uint256 value) internal pure returns (uint232) {
        if (value > type(uint232).max) {
            revert SafeCastOverflowedUintDowncast(232, value);
        }
        return uint232(value);
    }

    /**
     * @dev Returns the downcasted uint224 from uint256, reverting on
     * overflow (when the input is greater than largest uint224).
     *
     * Counterpart to Solidity's `uint224` operator.
     *
     * Requirements:
     *
     * - input must fit into 224 bits
     */
    function toUint224(uint256 value) internal pure returns (uint224) {
        if (value > type(uint224).max) {
            revert SafeCastOverflowedUintDowncast(224, value);
        }
        return uint224(value);
    }

    /**
     * @dev Returns the downcasted uint216 from uint256, reverting on
     * overflow (when the input is greater than largest uint216).
     *
     * Counterpart to Solidity's `uint216` operator.
     *
     * Requirements:
     *
     * - input must fit into 216 bits
     */
    function toUint216(uint256 value) internal pure returns (uint216) {
        if (value > type(uint216).max) {
            revert SafeCastOverflowedUintDowncast(216, value);
        }
        return uint216(value);
    }

    /**
     * @dev Returns the downcasted uint208 from uint256, reverting on
     * overflow (when the input is greater than largest uint208).
     *
     * Counterpart to Solidity's `uint208` operator.
     *
     * Requirements:
     *
     * - input must fit into 208 bits
     */
    function toUint208(uint256 value) internal pure returns (uint208) {
        if (value > type(uint208).max) {
            revert SafeCastOverflowedUintDowncast(208, value);
        }
        return uint208(value);
    }

    /**
     * @dev Returns the downcasted uint200 from uint256, reverting on
     * overflow (when the input is greater than largest uint200).
     *
     * Counterpart to Solidity's `uint200` operator.
     *
     * Requirements:
     *
     * - input must fit into 200 bits
     */
    function toUint200(uint256 value) internal pure returns (uint200) {
        if (value > type(uint200).max) {
            revert SafeCastOverflowedUintDowncast(200, value);
        }
        return uint200(value);
    }

    /**
     * @dev Returns the downcasted uint192 from uint256, reverting on
     * overflow (when the input is greater than largest uint192).
     *
     * Counterpart to Solidity's `uint192` operator.
     *
     * Requirements:
     *
     * - input must fit into 192 bits
     */
    function toUint192(uint256 value) internal pure returns (uint192) {
        if (value > type(uint192).max) {
            revert SafeCastOverflowedUintDowncast(192, value);
        }
        return uint192(value);
    }

    /**
     * @dev Returns the downcasted uint184 from uint256, reverting on
     * overflow (when the input is greater than largest uint184).
     *
     * Counterpart to Solidity's `uint184` operator.
     *
     * Requirements:
     *
     * - input must fit into 184 bits
     */
    function toUint184(uint256 value) internal pure returns (uint184) {
        if (value > type(uint184).max) {
            revert SafeCastOverflowedUintDowncast(184, value);
        }
        return uint184(value);
    }

    /**
     * @dev Returns the downcasted uint176 from uint256, reverting on
     * overflow (when the input is greater than largest uint176).
     *
     * Counterpart to Solidity's `uint176` operator.
     *
     * Requirements:
     *
     * - input must fit into 176 bits
     */
    function toUint176(uint256 value) internal pure returns (uint176) {
        if (value > type(uint176).max) {
            revert SafeCastOverflowedUintDowncast(176, value);
        }
        return uint176(value);
    }

    /**
     * @dev Returns the downcasted uint168 from uint256, reverting on
     * overflow (when the input is greater than largest uint168).
     *
     * Counterpart to Solidity's `uint168` operator.
     *
     * Requirements:
     *
     * - input must fit into 168 bits
     */
    function toUint168(uint256 value) internal pure returns (uint168) {
        if (value > type(uint168).max) {
            revert SafeCastOverflowedUintDowncast(168, value);
        }
        return uint168(value);
    }

    /**
     * @dev Returns the downcasted uint160 from uint256, reverting on
     * overflow (when the input is greater than largest uint160).
     *
     * Counterpart to Solidity's `uint160` operator.
     *
     * Requirements:
     *
     * - input must fit into 160 bits
     */
    function toUint160(uint256 value) internal pure returns (uint160) {
        if (value > type(uint160).max) {
            revert SafeCastOverflowedUintDowncast(160, value);
        }
        return uint160(value);
    }

    /**
     * @dev Returns the downcasted uint152 from uint256, reverting on
     * overflow (when the input is greater than largest uint152).
     *
     * Counterpart to Solidity's `uint152` operator.
     *
     * Requirements:
     *
     * - input must fit into 152 bits
     */
    function toUint152(uint256 value) internal pure returns (uint152) {
        if (value > type(uint152).max) {
            revert SafeCastOverflowedUintDowncast(152, value);
        }
        return uint152(value);
    }

    /**
     * @dev Returns the downcasted uint144 from uint256, reverting on
     * overflow (when the input is greater than largest uint144).
     *
     * Counterpart to Solidity's `uint144` operator.
     *
     * Requirements:
     *
     * - input must fit into 144 bits
     */
    function toUint144(uint256 value) internal pure returns (uint144) {
        if (value > type(uint144).max) {
            revert SafeCastOverflowedUintDowncast(144, value);
        }
        return uint144(value);
    }

    /**
     * @dev Returns the downcasted uint136 from uint256, reverting on
     * overflow (when the input is greater than largest uint136).
     *
     * Counterpart to Solidity's `uint136` operator.
     *
     * Requirements:
     *
     * - input must fit into 136 bits
     */
    function toUint136(uint256 value) internal pure returns (uint136) {
        if (value > type(uint136).max) {
            revert SafeCastOverflowedUintDowncast(136, value);
        }
        return uint136(value);
    }

    /**
     * @dev Returns the downcasted uint128 from uint256, reverting on
     * overflow (when the input is greater than largest uint128).
     *
     * Counterpart to Solidity's `uint128` operator.
     *
     * Requirements:
     *
     * - input must fit into 128 bits
     */
    function toUint128(uint256 value) internal pure returns (uint128) {
        if (value > type(uint128).max) {
            revert SafeCastOverflowedUintDowncast(128, value);
        }
        return uint128(value);
    }

    /**
     * @dev Returns the downcasted uint120 from uint256, reverting on
     * overflow (when the input is greater than largest uint120).
     *
     * Counterpart to Solidity's `uint120` operator.
     *
     * Requirements:
     *
     * - input must fit into 120 bits
     */
    function toUint120(uint256 value) internal pure returns (uint120) {
        if (value > type(uint120).max) {
            revert SafeCastOverflowedUintDowncast(120, value);
        }
        return uint120(value);
    }

    /**
     * @dev Returns the downcasted uint112 from uint256, reverting on
     * overflow (when the input is greater than largest uint112).
     *
     * Counterpart to Solidity's `uint112` operator.
     *
     * Requirements:
     *
     * - input must fit into 112 bits
     */
    function toUint112(uint256 value) internal pure returns (uint112) {
        if (value > type(uint112).max) {
            revert SafeCastOverflowedUintDowncast(112, value);
        }
        return uint112(value);
    }

    /**
     * @dev Returns the downcasted uint104 from uint256, reverting on
     * overflow (when the input is greater than largest uint104).
     *
     * Counterpart to Solidity's `uint104` operator.
     *
     * Requirements:
     *
     * - input must fit into 104 bits
     */
    function toUint104(uint256 value) internal pure returns (uint104) {
        if (value > type(uint104).max) {
            revert SafeCastOverflowedUintDowncast(104, value);
        }
        return uint104(value);
    }

    /**
     * @dev Returns the downcasted uint96 from uint256, reverting on
     * overflow (when the input is greater than largest uint96).
     *
     * Counterpart to Solidity's `uint96` operator.
     *
     * Requirements:
     *
     * - input must fit into 96 bits
     */
    function toUint96(uint256 value) internal pure returns (uint96) {
        if (value > type(uint96).max) {
            revert SafeCastOverflowedUintDowncast(96, value);
        }
        return uint96(value);
    }

    /**
     * @dev Returns the downcasted uint88 from uint256, reverting on
     * overflow (when the input is greater than largest uint88).
     *
     * Counterpart to Solidity's `uint88` operator.
     *
     * Requirements:
     *
     * - input must fit into 88 bits
     */
    function toUint88(uint256 value) internal pure returns (uint88) {
        if (value > type(uint88).max) {
            revert SafeCastOverflowedUintDowncast(88, value);
        }
        return uint88(value);
    }

    /**
     * @dev Returns the downcasted uint80 from uint256, reverting on
     * overflow (when the input is greater than largest uint80).
     *
     * Counterpart to Solidity's `uint80` operator.
     *
     * Requirements:
     *
     * - input must fit into 80 bits
     */
    function toUint80(uint256 value) internal pure returns (uint80) {
        if (value > type(uint80).max) {
            revert SafeCastOverflowedUintDowncast(80, value);
        }
        return uint80(value);
    }

    /**
     * @dev Returns the downcasted uint72 from uint256, reverting on
     * overflow (when the input is greater than largest uint72).
     *
     * Counterpart to Solidity's `uint72` operator.
     *
     * Requirements:
     *
     * - input must fit into 72 bits
     */
    function toUint72(uint256 value) internal pure returns (uint72) {
        if (value > type(uint72).max) {
            revert SafeCa...

// [truncated — 199167 bytes total]

Read Contract

accountant 0x4fb3ccc5 → address
allowInitializePath 0xbfe94e81 → bool
assetData 0x41fee44a → bool, bool, uint16
authority 0xbf7e214f → address
beforeTransfer 0xabd626b0
composeMsgSender 0xb92d0eff → address
depositNonce 0xde35f5cb → uint96
endpoint 0x5e280f11 → address
fromDenyList 0x26a64b40 → bool
idToChains 0xd1822216 → bool, bool, uint128
isPaused 0xb187bd26 → bool
nativeWrapper 0x0b48a8b8 → address
nextNonce 0x7d25a05e → uint64
oAppVersion 0x17442b70 → uint64, uint64
operatorDenyList 0xf07f287d → bool
owner 0x8da5cb5b → address
peers 0xbb0b6a53 → bytes32
previewFee 0xd7424e33 → uint256
publicDepositHistory 0x9a94d3d0 → bytes32
shareLockPeriod 0x9fdb11b6 → uint64
shareUnlockTime 0x1899ea81 → uint256
toDenyList 0x04ded84a → bool
vault 0xfbfa77cf → address

Write Contract 32 functions

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

addChain 0x34dafd6b
uint32 chainId
bool allowMessagesFrom
bool allowMessagesTo
address targetTeller
uint128 messageGasLimit
allowAll 0xc29d2f10
address user
allowFrom 0xa924bf61
address user
allowMessagesFromChain 0x202eac57
uint32 chainId
address targetTeller
allowMessagesToChain 0xb5ba6182
uint32 chainId
address targetTeller
uint128 messageGasLimit
allowOperator 0x1ba9a458
address user
allowTo 0x5f45bac8
address user
bridge 0x05921740
uint96 shareAmount
address to
bytes bridgeWildCard
address feeToken
uint256 maxFee
bulkDeposit 0x9d574420
address depositAsset
uint256 depositAmount
uint256 minimumMint
address to
returns: uint256
bulkWithdraw 0x3e64ce99
address withdrawAsset
uint256 shareAmount
uint256 minimumAssets
address to
returns: uint256
denyAll 0x18aed921
address user
denyFrom 0x2c524c42
address user
denyOperator 0x1b62636c
address user
denyTo 0x3b575407
address user
deposit 0x0efe6a8b
address depositAsset
uint256 depositAmount
uint256 minimumMint
returns: uint256
depositAndBridge 0xcab716e8
address depositAsset
uint256 depositAmount
uint256 minimumMint
address to
bytes bridgeWildCard
address feeToken
uint256 maxFee
returns: uint256
depositAndBridgeWithPermit 0x94f51289
address depositAsset
uint256 depositAmount
uint256 minimumMint
uint256 deadline
uint8 v
bytes32 r
bytes32 s
address to
bytes bridgeWildCard
address feeToken
uint256 maxFee
returns: uint256
depositWithPermit 0x3d935d9e
address depositAsset
uint256 depositAmount
uint256 minimumMint
uint256 deadline
uint8 v
bytes32 r
bytes32 s
returns: uint256
lzReceive 0xbf282d99
tuple _origin
bytes32 _guid
bytes _message
address _executor
bytes _extraData
pause 0x8456cb59
No parameters
refundDeposit 0x46b563f4
uint256 nonce
address receiver
address depositAsset
uint256 depositAmount
uint256 shareAmount
uint256 depositTimestamp
uint256 shareLockUpPeriodAtTimeOfDeposit
removeChain 0x55a2d64d
uint32 chainId
setAuthority 0x7a9e5e4b
address newAuthority
setChainGasLimit 0x1568fc58
uint32 chainId
uint128 messageGasLimit
setDelegate 0xca5eb5e1
address _delegate
setPeer 0x3400288b
uint32 _eid
bytes32 _peer
setShareLockPeriod 0x12056e2d
uint64 _shareLockPeriod
stopMessagesFromChain 0xd555f368
uint32 chainId
stopMessagesToChain 0x45ad6063
uint32 chainId
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
updateAssetData 0x8dfd8ba1
address asset
bool allowDeposits
bool allowWithdraws
uint16 sharePremium

Recent Transactions

No transactions found for this address