From a2f89fa8cba752c61cb1507b9ebed2ea26a84965 Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:13:26 +0800 Subject: [PATCH] update locker contract, add method: unlock from svr --- build/contracts/NFTLock.json | 132 ++- contracts/game/NFTLock.sol | 65 +- deployments/imtbl_test/AirdropToken.json | 278 ----- deployments/imtbl_test/NFTLock.json | 994 ++++++++++++++++++ .../62f20d373cd10a7adc6f55deaeb127c0.json | 72 ++ .../7eceef62c89a38c4c392c8e1623702eb.json | 54 - out/imtbl_test_dev.json | 12 +- test/testNFTLocker.ts | 36 +- 8 files changed, 1257 insertions(+), 386 deletions(-) delete mode 100644 deployments/imtbl_test/AirdropToken.json create mode 100644 deployments/imtbl_test/NFTLock.json create mode 100644 deployments/imtbl_test/solcInputs/62f20d373cd10a7adc6f55deaeb127c0.json delete mode 100644 deployments/imtbl_test/solcInputs/7eceef62c89a38c4c392c8e1623702eb.json diff --git a/build/contracts/NFTLock.json b/build/contracts/NFTLock.json index f1283f3..b5795fd 100644 --- a/build/contracts/NFTLock.json +++ b/build/contracts/NFTLock.json @@ -44,7 +44,13 @@ { "indexed": true, "internalType": "address", - "name": "user", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", "type": "address" }, { @@ -117,6 +123,11 @@ "name": "tokenId", "type": "uint256" }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, { "internalType": "bool", "name": "isMint", @@ -197,6 +208,30 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "nft", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "addressOriginal", + "outputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -252,6 +287,11 @@ "name": "tokenId", "type": "uint256" }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, { "internalType": "bool", "name": "isMint", @@ -301,6 +341,11 @@ "name": "nft", "type": "address" }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, { "internalType": "uint256[]", "name": "tokenIds", @@ -361,24 +406,13 @@ "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "nft", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "lockedOriginal", + "inputs": [], + "name": "maxBatch", "outputs": [ { - "internalType": "address", - "name": "user", - "type": "address" + "internalType": "uint256", + "name": "", + "type": "uint256" } ], "stateMutability": "view", @@ -444,6 +478,30 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "nft", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "passportOriginal", + "outputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "paused", @@ -523,6 +581,11 @@ "name": "tokenId", "type": "uint256" }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, { "internalType": "bool", "name": "isMint", @@ -554,6 +617,37 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "nft", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "name": "unlockWithSvr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxBatch", + "type": "uint256" + } + ], + "name": "updateBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -594,8 +688,8 @@ "type": "function" } ], - "bytecode": "0x60c0346100f657601f61194e38819003918201601f19168301916001600160401b038311848410176100fb5780849260409485528339810103126100f65780516020909101516001600160a01b039182821682036100f6576000543360018060a01b0319821617600055604051933391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a360025561070860035560048054466080523060a0526001600160a81b03191660089290921b610100600160a81b031691909117905561183c908161011282396080518181816103660152610eec015260a05181818161038801526108160152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001357600080fd5b60003560e01c9081630fb5a6b414610fa3575080631275029214610f64578063150b7a0214610f0f5780632b437d4814610ed45780632b7ac3f314610ea75780634d8d0ac714610e5f5780635671576114610e415780635c975abb14610e1e5780635fb110ca14610d955780636d04319414610d4d578063715018a614610cf4578063799048fa14610c675780637f9d309614610bdc5780638da5cb5b14610bb35780638e47f63f14610a3057806397fc007c14610961578063a063472414610910578063d13344c914610845578063da28b52714610800578063dbfaa5801461025f578063f2fde38b1461019b5763f36b61d31461011157600080fd5b346101965760e03660031901126101965761012a610fbe565b610132610fd4565b6044356001600160401b0381116101965736602382011215610196576101629036906024816004013591016110f0565b606435916001600160a01b03831683036101965760209361018e9360c4359360a4359360843593611727565b604051908152f35b600080fd5b34610196576020366003190112610196576101b4610fbe565b6101bc611193565b6001600160a01b0390811690811561020b57600054826001600160601b0360a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346101965760a036600319011261019657610278610fbe565b6001600160401b03806024351161019657366023602435011215610196578060243560040135116101965736602480356004013560061b81350101116101965760843590808211610196573660238301121561019657816004013511610196573660248260040135830101116101965760ff6040518260040135602484018237602081846004013581016001815203019020541661078a576002546044350180604435116107745742116107095761032e6114d0565b610341606460243560040135111561145b565b6103d96103af61035c366024356004013560248035016110f0565b60643590604435907f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000908833611727565b6004805460081c6001600160a01b031691906103d39036908601356024870161104f565b916111eb565b60005b6024356004013581106104dd575060ff60405182600401356024840182376020818460040135810160018152030190205416156104ac575b50604051604081016064358252604060208301526024356004013590526060810190602480350160005b602435600401358110610483575033936001600160a01b0316927ff3d71d6c5e51ea460dbafab10ee101a0f4be26a888e6b04a5b636173d63b322292908190039150a3005b90926040806001928635815261049b602088016110e3565b15156020820152019401910161043e565b6020604051828193600401356024820183376004013581016001815203019020600160ff1982541617905581610414565b60206104f4826024356004013560248035016115b6565b013580151581036101965715610587576001600160a01b038316906105238160248035600481013591016115b6565b35823b15610196576000926044849260405195869384926340c10f1960e01b845233600485015260248401525af191821561057b576105679261056c575b5061149b565b6103dc565b61057590610fea565b84610561565b6040513d6000823e3d90fd5b6001600160a01b03831660009081526005602052604090206105b38260248035600481013591016115b6565b356000526020523360018060a01b0360406000205416036106d8576105e3816024356004013560248035016115b6565b35906001600160a01b0384163b15610196576040516323b872dd60e01b81523060048201523360248201526044810192909252600082606481836001600160a01b0389165af191821561057b57610567926106c9575b5060018060a01b038416600052600660205260406000203360005260205261067b6040600020610674836024356004013560248035016115b6565b35906115c6565b506001600160a01b03841660009081526005602052604090206106a88260248035600481013591016115b6565b3560005260205260406000206001600160601b0360a01b815416905561149b565b6106d290610fea565b84610639565b60405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606490fd5b60405162461bcd60e51b815260206004820152603b60248201527f657870697265642c20706c656173652073656e6420616e6f746865722074726160448201527f6e73616374696f6e2077697468206e6577207369676e617475726500000000006064820152608490fd5b634e487b7160e01b600052601160045260246000fd5b60405162461bcd60e51b815260206004820152604260248201527f7369676e617475726520757365642e20706c656173652073656e6420616e6f7460448201527f686572207472616e73616374696f6e2077697468206e6577207369676e617475606482015261726560f01b608482015260a490fd5b34610196576000366003190112610196576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101965760403660031901126101965761085e610fbe565b610866610fd4565b60018060a01b0380921660005260209160068352604060002091166000528152604060002060405190818382549182815201908192600052846000209060005b868282106108fc5786866108bc8288038361102e565b604051928392818401908285525180915260408401929160005b8281106108e557505050500390f35b8351855286955093810193928101926001016108d6565b8354855290930192600192830192016108a6565b3461019657604036600319011261019657610929610fbe565b610931610fd4565b9060018060a01b038091166000526006602052604060002091166000526020526020604060002054604051908152f35b346101965760203660031901126101965761097a610fbe565b610982611193565b6001600160a01b0381169081156109df5760048054610100600160a81b03191660089290921b610100600160a81b03169190911790557fd24015cc99cc1700cafca3042840a1d8ac1e3964fd2e0e37ea29c654056ee327600080a2005b60405162461bcd60e51b815260206004820152602360248201527f4e4654436c61696d65723a20616464726573732063616e206e6f74206265207a60448201526265726f60e81b6064820152608490fd5b3461019657604036600319011261019657610a49610fbe565b6024356001600160401b03811161019657610a689036906004016110b3565b610a739291926114d0565b610a80606482111561145b565b6001600160a01b039091169060005b818110610aeb5750604051602080825281018290526001600160fb1b038211610196577ffa4fcf9122678b647ff5d9f7e030079388041514b1b489b702346021b4e4344e9160051b8094604083013760408133958101030190a3005b610af68183866114aa565b3590833b15610196576040516323b872dd60e01b8152336004820152306024820152604481019290925260008260648183885af191821561057b57610b9f92610ba4575b50836000526020600581526040600020610b558386896114aa565b3560005281526040600020336001600160601b0360a01b825416179055846000526006815260406000209033600052526105616040600020610b988386896114aa565b359061152c565b610a8f565b610bad90610fea565b85610b3a565b34610196576000366003190112610196576000546040516001600160a01b039091168152602090f35b3461019657602036600319011261019657600435610bf8611193565b600354811115610c2d57806002557f91abcc2d6823e3a3f11d31b208dd3065d2c6a791f1c7c9fe96a42ce12897eac5600080a2005b60405162461bcd60e51b8152602060048201526012602482015271191d5c985d1a5bdb881d1bdbc81cda1bdc9d60721b6044820152606490fd5b3461019657602036600319011261019657610c80610fbe565b610c88611193565b6001600160a01b031660008181526007602052604090205460ff1615610cc0576000908152600760205260409020805460ff19169055005b60405162461bcd60e51b815260206004820152600c60248201526b63616e27742072656d6f766560a01b6044820152606490fd5b3461019657600036600319011261019657610d0d611193565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461019657606036600319011261019657610d66610fbe565b604435906001600160401b03821161019657610d89610d93923690600401611095565b90602435906111eb565b005b3461019657602080600319360112610196576004356001600160401b03811161019657610dc69036906004016110b3565b610dce611193565b60005b818110610dda57005b610de58183856114aa565b356001600160a01b038116919082900361019657610e1991600052600785526040600020600160ff1982541617905561149b565b610dd1565b3461019657600036600319011261019657602060ff600454166040519015158152f35b34610196576000366003190112610196576020600354604051908152f35b346101965760403660031901126101965760206001600160a01b0380610e83610fbe565b16600052600582526040600020602435600052825260406000205416604051908152f35b346101965760003660031901126101965760045460405160089190911c6001600160a01b03168152602090f35b346101965760003660031901126101965760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461019657608036600319011261019657610f28610fbe565b50610f31610fd4565b506064356001600160401b03811161019657610f51903690600401611095565b50604051630a85bd0160e11b8152602090f35b34610196576020366003190112610196576001600160a01b03610f85610fbe565b166000526007602052602060ff604060002054166040519015158152f35b34610196576000366003190112610196576020906002548152f35b600435906001600160a01b038216820361019657565b602435906001600160a01b038216820361019657565b6001600160401b038111610ffd57604052565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b03821117610ffd57604052565b90601f801991011681019081106001600160401b03821117610ffd57604052565b9291926001600160401b038211610ffd5760405191611078601f8201601f19166020018461102e565b829481845281830111610196578281602093846000960137010152565b9080601f83011215610196578160206110b09335910161104f565b90565b9181601f84011215610196578235916001600160401b038311610196576020808501948460051b01011161019657565b3590811515820361019657565b6001600160401b039392848311610ffd57604092835195602092611119848460051b018961102e565b8388848152019260061b85019481861161019657925b85841061113f5750505050505050565b868483031261019657865190878201908282108583111761117e578892879284528635815261116f8388016110e3565b8382015281520193019261112f565b60246000634e487b7160e01b81526041600452fd5b6000546001600160a01b031633036111a757565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b9061122d92611225917f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c600020611394565b92909261127a565b6001600160a01b0390811691160361124157565b60405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606490fd5b600581101561137e578061128b5750565b600181036112d85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036113255760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b60031461132e57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9060418151146000146113c2576113be916020820151906060604084015193015160001a906113cc565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831161144f5791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156114425781516001600160a01b0381161561143c579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b1561146257565b60405162461bcd60e51b8152602060048201526011602482015270746f6b656e49647320746f6f206d616e7960781b6044820152606490fd5b60001981146107745760010190565b91908110156114ba5760051b0190565b634e487b7160e01b600052603260045260246000fd5b60ff600454166114dc57565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b80548210156114ba5760005260206000200190600090565b919060018301600090828252806020526040822054156000146115b0578454946801000000000000000086101561159c578361158c611575886001604098999a01855584611514565b819391549060031b91821b91600019901b19161790565b9055549382526020522055600190565b634e487b7160e01b83526041600452602483fd5b50925050565b91908110156114ba5760061b0190565b906001820190600092818452826020526040842054908115156000146116af576000199180830181811161169b5782549084820191821161168757808203611652575b5050508054801561163e578201916116218383611514565b909182549160031b1b191690555582526020526040812055600190565b634e487b7160e01b86526031600452602486fd5b6116726116626115759386611514565b90549060031b1c92839286611514565b90558652846020526040862055388080611609565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b87526011600452602487fd5b5050505090565b80518210156114ba5760209160051b010190565b9081519160005b8381106116e2575050016000815290565b80602080928401015181850152016116d1565b61172590611717611711949360405195869360208501906116ca565b906116ca565b03601f19810184528361102e565b565b939695919490966040978851946001600160601b031980928160209960601b168989015260601b16603487015260601b166048850152605c840152607c830152609c820152609c815260c081018181106001600160401b03821117610ffd5785526000905b83518210156117f8576117ec6117c46117f2926117a985886116b6565b515190895191878301528682526117bf82611013565b6116f5565b846117cf85886116b6565b51015115159088519160f81b86830152600182526117bf82611013565b9161149b565b9061178c565b93945050905081519101209056fea2646970667358221220a9a53469c4b1432f9ddf9ae806bec7d819ee6cd7d600b0c9c5c578fc102eaf0a64736f6c63430008130033", - "deployedBytecode": "0x608080604052600436101561001357600080fd5b60003560e01c9081630fb5a6b414610fa3575080631275029214610f64578063150b7a0214610f0f5780632b437d4814610ed45780632b7ac3f314610ea75780634d8d0ac714610e5f5780635671576114610e415780635c975abb14610e1e5780635fb110ca14610d955780636d04319414610d4d578063715018a614610cf4578063799048fa14610c675780637f9d309614610bdc5780638da5cb5b14610bb35780638e47f63f14610a3057806397fc007c14610961578063a063472414610910578063d13344c914610845578063da28b52714610800578063dbfaa5801461025f578063f2fde38b1461019b5763f36b61d31461011157600080fd5b346101965760e03660031901126101965761012a610fbe565b610132610fd4565b6044356001600160401b0381116101965736602382011215610196576101629036906024816004013591016110f0565b606435916001600160a01b03831683036101965760209361018e9360c4359360a4359360843593611727565b604051908152f35b600080fd5b34610196576020366003190112610196576101b4610fbe565b6101bc611193565b6001600160a01b0390811690811561020b57600054826001600160601b0360a01b821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3005b60405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608490fd5b346101965760a036600319011261019657610278610fbe565b6001600160401b03806024351161019657366023602435011215610196578060243560040135116101965736602480356004013560061b81350101116101965760843590808211610196573660238301121561019657816004013511610196573660248260040135830101116101965760ff6040518260040135602484018237602081846004013581016001815203019020541661078a576002546044350180604435116107745742116107095761032e6114d0565b610341606460243560040135111561145b565b6103d96103af61035c366024356004013560248035016110f0565b60643590604435907f0000000000000000000000000000000000000000000000000000000000000000907f0000000000000000000000000000000000000000000000000000000000000000908833611727565b6004805460081c6001600160a01b031691906103d39036908601356024870161104f565b916111eb565b60005b6024356004013581106104dd575060ff60405182600401356024840182376020818460040135810160018152030190205416156104ac575b50604051604081016064358252604060208301526024356004013590526060810190602480350160005b602435600401358110610483575033936001600160a01b0316927ff3d71d6c5e51ea460dbafab10ee101a0f4be26a888e6b04a5b636173d63b322292908190039150a3005b90926040806001928635815261049b602088016110e3565b15156020820152019401910161043e565b6020604051828193600401356024820183376004013581016001815203019020600160ff1982541617905581610414565b60206104f4826024356004013560248035016115b6565b013580151581036101965715610587576001600160a01b038316906105238160248035600481013591016115b6565b35823b15610196576000926044849260405195869384926340c10f1960e01b845233600485015260248401525af191821561057b576105679261056c575b5061149b565b6103dc565b61057590610fea565b84610561565b6040513d6000823e3d90fd5b6001600160a01b03831660009081526005602052604090206105b38260248035600481013591016115b6565b356000526020523360018060a01b0360406000205416036106d8576105e3816024356004013560248035016115b6565b35906001600160a01b0384163b15610196576040516323b872dd60e01b81523060048201523360248201526044810192909252600082606481836001600160a01b0389165af191821561057b57610567926106c9575b5060018060a01b038416600052600660205260406000203360005260205261067b6040600020610674836024356004013560248035016115b6565b35906115c6565b506001600160a01b03841660009081526005602052604090206106a88260248035600481013591016115b6565b3560005260205260406000206001600160601b0360a01b815416905561149b565b6106d290610fea565b84610639565b60405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606490fd5b60405162461bcd60e51b815260206004820152603b60248201527f657870697265642c20706c656173652073656e6420616e6f746865722074726160448201527f6e73616374696f6e2077697468206e6577207369676e617475726500000000006064820152608490fd5b634e487b7160e01b600052601160045260246000fd5b60405162461bcd60e51b815260206004820152604260248201527f7369676e617475726520757365642e20706c656173652073656e6420616e6f7460448201527f686572207472616e73616374696f6e2077697468206e6577207369676e617475606482015261726560f01b608482015260a490fd5b34610196576000366003190112610196576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101965760403660031901126101965761085e610fbe565b610866610fd4565b60018060a01b0380921660005260209160068352604060002091166000528152604060002060405190818382549182815201908192600052846000209060005b868282106108fc5786866108bc8288038361102e565b604051928392818401908285525180915260408401929160005b8281106108e557505050500390f35b8351855286955093810193928101926001016108d6565b8354855290930192600192830192016108a6565b3461019657604036600319011261019657610929610fbe565b610931610fd4565b9060018060a01b038091166000526006602052604060002091166000526020526020604060002054604051908152f35b346101965760203660031901126101965761097a610fbe565b610982611193565b6001600160a01b0381169081156109df5760048054610100600160a81b03191660089290921b610100600160a81b03169190911790557fd24015cc99cc1700cafca3042840a1d8ac1e3964fd2e0e37ea29c654056ee327600080a2005b60405162461bcd60e51b815260206004820152602360248201527f4e4654436c61696d65723a20616464726573732063616e206e6f74206265207a60448201526265726f60e81b6064820152608490fd5b3461019657604036600319011261019657610a49610fbe565b6024356001600160401b03811161019657610a689036906004016110b3565b610a739291926114d0565b610a80606482111561145b565b6001600160a01b039091169060005b818110610aeb5750604051602080825281018290526001600160fb1b038211610196577ffa4fcf9122678b647ff5d9f7e030079388041514b1b489b702346021b4e4344e9160051b8094604083013760408133958101030190a3005b610af68183866114aa565b3590833b15610196576040516323b872dd60e01b8152336004820152306024820152604481019290925260008260648183885af191821561057b57610b9f92610ba4575b50836000526020600581526040600020610b558386896114aa565b3560005281526040600020336001600160601b0360a01b825416179055846000526006815260406000209033600052526105616040600020610b988386896114aa565b359061152c565b610a8f565b610bad90610fea565b85610b3a565b34610196576000366003190112610196576000546040516001600160a01b039091168152602090f35b3461019657602036600319011261019657600435610bf8611193565b600354811115610c2d57806002557f91abcc2d6823e3a3f11d31b208dd3065d2c6a791f1c7c9fe96a42ce12897eac5600080a2005b60405162461bcd60e51b8152602060048201526012602482015271191d5c985d1a5bdb881d1bdbc81cda1bdc9d60721b6044820152606490fd5b3461019657602036600319011261019657610c80610fbe565b610c88611193565b6001600160a01b031660008181526007602052604090205460ff1615610cc0576000908152600760205260409020805460ff19169055005b60405162461bcd60e51b815260206004820152600c60248201526b63616e27742072656d6f766560a01b6044820152606490fd5b3461019657600036600319011261019657610d0d611193565b600080546001600160a01b0319811682556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b3461019657606036600319011261019657610d66610fbe565b604435906001600160401b03821161019657610d89610d93923690600401611095565b90602435906111eb565b005b3461019657602080600319360112610196576004356001600160401b03811161019657610dc69036906004016110b3565b610dce611193565b60005b818110610dda57005b610de58183856114aa565b356001600160a01b038116919082900361019657610e1991600052600785526040600020600160ff1982541617905561149b565b610dd1565b3461019657600036600319011261019657602060ff600454166040519015158152f35b34610196576000366003190112610196576020600354604051908152f35b346101965760403660031901126101965760206001600160a01b0380610e83610fbe565b16600052600582526040600020602435600052825260406000205416604051908152f35b346101965760003660031901126101965760045460405160089190911c6001600160a01b03168152602090f35b346101965760003660031901126101965760206040517f00000000000000000000000000000000000000000000000000000000000000008152f35b3461019657608036600319011261019657610f28610fbe565b50610f31610fd4565b506064356001600160401b03811161019657610f51903690600401611095565b50604051630a85bd0160e11b8152602090f35b34610196576020366003190112610196576001600160a01b03610f85610fbe565b166000526007602052602060ff604060002054166040519015158152f35b34610196576000366003190112610196576020906002548152f35b600435906001600160a01b038216820361019657565b602435906001600160a01b038216820361019657565b6001600160401b038111610ffd57604052565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b03821117610ffd57604052565b90601f801991011681019081106001600160401b03821117610ffd57604052565b9291926001600160401b038211610ffd5760405191611078601f8201601f19166020018461102e565b829481845281830111610196578281602093846000960137010152565b9080601f83011215610196578160206110b09335910161104f565b90565b9181601f84011215610196578235916001600160401b038311610196576020808501948460051b01011161019657565b3590811515820361019657565b6001600160401b039392848311610ffd57604092835195602092611119848460051b018961102e565b8388848152019260061b85019481861161019657925b85841061113f5750505050505050565b868483031261019657865190878201908282108583111761117e578892879284528635815261116f8388016110e3565b8382015281520193019261112f565b60246000634e487b7160e01b81526041600452fd5b6000546001600160a01b031633036111a757565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b9061122d92611225917f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c600020611394565b92909261127a565b6001600160a01b0390811691160361124157565b60405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606490fd5b600581101561137e578061128b5750565b600181036112d85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036113255760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b60031461132e57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9060418151146000146113c2576113be916020820151906060604084015193015160001a906113cc565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831161144f5791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156114425781516001600160a01b0381161561143c579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b1561146257565b60405162461bcd60e51b8152602060048201526011602482015270746f6b656e49647320746f6f206d616e7960781b6044820152606490fd5b60001981146107745760010190565b91908110156114ba5760051b0190565b634e487b7160e01b600052603260045260246000fd5b60ff600454166114dc57565b60405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b80548210156114ba5760005260206000200190600090565b919060018301600090828252806020526040822054156000146115b0578454946801000000000000000086101561159c578361158c611575886001604098999a01855584611514565b819391549060031b91821b91600019901b19161790565b9055549382526020522055600190565b634e487b7160e01b83526041600452602483fd5b50925050565b91908110156114ba5760061b0190565b906001820190600092818452826020526040842054908115156000146116af576000199180830181811161169b5782549084820191821161168757808203611652575b5050508054801561163e578201916116218383611514565b909182549160031b1b191690555582526020526040812055600190565b634e487b7160e01b86526031600452602486fd5b6116726116626115759386611514565b90549060031b1c92839286611514565b90558652846020526040862055388080611609565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b87526011600452602487fd5b5050505090565b80518210156114ba5760209160051b010190565b9081519160005b8381106116e2575050016000815290565b80602080928401015181850152016116d1565b61172590611717611711949360405195869360208501906116ca565b906116ca565b03601f19810184528361102e565b565b939695919490966040978851946001600160601b031980928160209960601b168989015260601b16603487015260601b166048850152605c840152607c830152609c820152609c815260c081018181106001600160401b03821117610ffd5785526000905b83518210156117f8576117ec6117c46117f2926117a985886116b6565b515190895191878301528682526117bf82611013565b6116f5565b846117cf85886116b6565b51015115159088519160f81b86830152600182526117bf82611013565b9161149b565b9061178c565b93945050905081519101209056fea2646970667358221220a9a53469c4b1432f9ddf9ae806bec7d819ee6cd7d600b0c9c5c578fc102eaf0a64736f6c63430008130033", + "bytecode": "0x60c0346100fb57601f611c6b38819003918201601f19168301916001600160401b038311848410176101005780849260409485528339810103126100fb5780516020909101516001600160a01b039182821682036100fb576000543360018060a01b0319821617600055604051933391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3600255610708600355600480546064600555466080523060a0526001600160a81b03191660089290921b610100600160a81b0316919091179055611b54908161011782396080518181816109840152610fd7015260a05181818161021b01526109a60152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604081815260048036101561001557600080fd5b600092833560e01c9081630fb5a6b4146112015750806312750292146111c3578063150b7a021461116e578063230fb7fe14610ffa5780632b437d4814610fbf5780632b7ac3f314610f9457806338e2c2eb14610f725780635671576114610f535780635c975abb14610f305780635fb110ca14610ea957806367765b8714610e8a5780636d04319414610e3d578063715018a614610de357806376bd0cfd14610890578063799048fa146108075780637f9d30961461077b5780638da5cb5b1461075357806397fc007c1461068a5780639a14da5814610646578063a0634724146105fd578063bdfe78c9146105b9578063c419028f146103a0578063ce3d1b2d14610313578063d13344c91461024e578063da28b527146102065763f2fde38b1461014157600080fd5b346102025760203660031901126102025761015a61121d565b9061016361141d565b6001600160a01b039182169283156101b057505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b50503461024a578160031936011261024a57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5080fd5b8284346103105781600319360112610310579061026961121d565b91610272611238565b6001600160a01b039384168252600860209081528383209190941682528352818120825181548082529183528483208186019392849190845b8181106102fc57505050816102c19103826112a6565b83519485948186019282875251809352850193925b8281106102e557505050500390f35b8351855286955093810193928101926001016102d6565b8254845292880192600192830192016102ab565b80fd5b50346102025760e03660031901126102025761032d61121d565b610335611238565b91604435906001600160401b03821161039c573660238301121561039c5781602461036593369301359101611368565b93606435906001600160a01b0382168203610310575091602094916103959360c4359360a4359360843593611a0d565b9051908152f35b8580fd5b5034610202576060366003190112610202576103ba61121d565b916103c3611238565b916044356001600160401b03811161039c576103e2903690830161132b565b91909360ff825416610583576103fc6005548411156116e5565b6001600160a01b0390811695610413871515611725565b16928387526020916009835261042e60ff838a205416611725565b875b84811061048d57505080518281529182018390526001600160fb1b038311610489577f356278d4d01db4ac9a53decc4eeeceecfb494d3bd0c463b305d33e65305e2bf29260051b8095828401378133958101030190a480f35b8680fd5b858952600684528289206104a282878a611788565b358a52845282892080546001600160a01b03199081168a17909155868a5260078552838a206104d283888b611788565b358b528552838a2090339082541617905585895260088452828920888a52845261050a838a2061050383888b611788565b35906117c6565b50610516818689611788565b3589873b156103105784516323b872dd60e01b815233858201908152306020820152604081019390935291829081906060010381838b5af180156105795790610565929161056a575b50611763565b610430565b61057390611262565b3861055f565b84513d8c823e3d90fd5b835162461bcd60e51b8152602081840152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b50503461024a578060031936011261024a576020916001600160a01b03908290826105e261121d565b16815260078552818120602435825285522054169051908152f35b50503461024a578060031936011261024a578060209261061b61121d565b610623611238565b6001600160a01b0391821683526008865283832091168252845220549051908152f35b50503461024a578060031936011261024a576020916001600160a01b039082908261066f61121d565b16815260068552818120602435825285522054169051908152f35b5034610202576020366003190112610202576106a461121d565b6106ac61141d565b6001600160a01b03811692831561070557508154610100600160a81b03191660089190911b610100600160a81b03161790557fd24015cc99cc1700cafca3042840a1d8ac1e3964fd2e0e37ea29c654056ee3278280a280f35b5162461bcd60e51b8152602081840152602360248201527f4e4654436c61696d65723a20616464726573732063616e206e6f74206265207a60448201526265726f60e81b6064820152608490fd5b50503461024a578160031936011261024a57905490516001600160a01b039091168152602090f35b50346102025760203660031901126102025780359161079861141d565b6003548311156107cf575050806002557f91abcc2d6823e3a3f11d31b208dd3065d2c6a791f1c7c9fe96a42ce12897eac58280a280f35b906020606492519162461bcd60e51b83528201526012602482015271191d5c985d1a5bdb881d1bdbc81cda1bdc9d60721b6044820152fd5b50346102025760203660031901126102025761082161121d565b61082961141d565b6001600160a01b031680845260096020528284205490919060ff161561085e5750825260096020528120805460ff1916905580f35b606490602084519162461bcd60e51b8352820152600c60248201526b63616e27742072656d6f766560a01b6044820152fd5b5090346102025760a0366003190112610202576108ab61121d565b916024916001600160401b039083358281116104895736602382011215610489578084013590838211610ddf5785810195606091813691848602010111610ddb576044938435946064359760843591888311610dd75736602384011215610dd75782820135988911610dd75784830192858a3692010111610dd757835194898487378986019860ff8760019b8c81526020998a91030190205416610d65576002548101808211610d52574211610ceb57908d8f93928d908f6005548d1115610972906116e5565b8c369061097e92611368565b6109cc937f0000000000000000000000000000000000000000000000000000000000000000917f00000000000000000000000000000000000000000000000000000000000000009133611a0d565b9a87855496366109dd9084836112c7565b9d600160a01b600190039e8f60089a8b1c16916109f992611475565b885182818f86858337868201908152030190205460ff1615610cc8575b505050829998979695995b8d898210610abc57505050505050508285519786890190895286838a01525281870197948a915b848310610a7d578b33898d167f9a5ba7d70cc7e1cd613eb99e6ed8ea301d889773c9d4517218560eee5153803e8c8e038da380f35b90919293948480889b610aa7868b869c3584528d610a9c89830161124e565b16888501520161135b565b151581870152019a0196959493019190610a48565b9a610acd828b839a9b9c9d9e611850565b01358015158103610cc4578f8f9190898f928e8d878b93600014610b6757505050505016610b11838d610b0b8d610b05848489611850565b01611898565b94611850565b3591813b1561048957858f918880948d5196879586946340c10f1960e01b8652168d850152898401525af18015610b5d5790610b52929161056a5750611763565b999897969599610a21565b88513d87823e3d90fd5b8691610b05610bd1928487999a610bd898999c9b169b8c8a528b610b94848a8460069e8f8b522093611850565b358c528552610baa8b8383339220541614611860565b8c8b5260079a8b86528c610bc2858b85852093611850565b3582528652205416958a611850565b1614611860565b8388528b52898720610beb858f85611850565b3588528b5289872080546001600160a01b0319908116909155838852908b52898720610c18858f85611850565b3588528b52898720908154169055818652878a528886203387528a52610c4d8c610c46858c8a209285611850565b35906118ac565b50610c68838d610c628d610b05848488611850565b93611850565b35823b156104895789516323b872dd60e01b815230818a019081526001600160a01b039093166020840152604083019190915291869183919082908490829060600103925af18015610b5d5790610b52929161056a5750611763565b8480fd5b828951938492833781018d815203019020805460ff19168b179055388781610a16565b855162461bcd60e51b8152808501889052603b818401527f657870697265642c20706c656173652073656e6420616e6f7468657220747261818501527f6e73616374696f6e2077697468206e6577207369676e617475726500000000006064820152608490fd5b5050634e487b7160e01b8e52601183528dfd5b855162461bcd60e51b81528085018890526042818401527f7369676e617475726520757365642e20706c656173652073656e6420616e6f74818501527f686572207472616e73616374696f6e2077697468206e6577207369676e617475606482015261726560f01b608482015260a490fd5b8c80fd5b8880fd5b8780fd5b8334610310578060031936011261031057610dfc61141d565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b83823461024a57606036600319011261024a57610e5861121d565b6044356001600160401b038111610e8657610e8392610e799136910161130d565b9060243590611475565b80f35b8380fd5b50503461024a578160031936011261024a576020906005549051908152f35b5090346102025760209182600319360112610e86578035906001600160401b038211610cc457610edb9136910161132b565b9290610ee561141d565b845b848110610ef2578580f35b610f2b906001600160a01b03610f11610f0c838987611788565b611898565b16875260098452848720805460ff19166001179055611763565b610ee7565b5091346103105780600319360112610310575060ff602092541690519015158152f35b50503461024a578160031936011261024a576020906003549051908152f35b83823461024a57602036600319011261024a57610f8d61141d565b3560055580f35b503461020257826003193601126102025754905160089190911c6001600160a01b0316815260209150f35b50503461024a578160031936011261024a57602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b503461020257816003193601126102025761101361121d565b91836024356001600160401b03811161024a57611033903690850161132b565b61103e95919561141d565b61104c6005548211156116e5565b6001600160a01b0391821690835b818110611065578480f35b8285526007602081815287872061107d84868d611788565b358852815285888820541691858852600682528a61109f85878c8c2093611788565b358952825288882080546001600160a01b03199081169091558689529082528888206110cc85878e611788565b35895282528888209081541690558487526008815287872090828852526110fa878720610c4684868d611788565b5061110682848b611788565b3590843b156104895787516323b872dd60e01b8152308a82019081526001600160a01b0390921660208301526040820192909252869082908190606001038183885af18015611164579061115f929161056a5750611763565b61105a565b87513d88823e3d90fd5b5091346103105760803660031901126103105761118961121d565b50611192611238565b50606435906001600160401b03821161031057506020926111b59136910161130d565b5051630a85bd0160e11b8152f35b50503461024a57602036600319011261024a5760209160ff9082906001600160a01b036111ee61121d565b1681526009855220541690519015158152f35b84903461024a578160031936011261024a576020906002548152f35b600435906001600160a01b038216820361123357565b600080fd5b602435906001600160a01b038216820361123357565b35906001600160a01b038216820361123357565b6001600160401b03811161127557604052565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b0382111761127557604052565b90601f801991011681019081106001600160401b0382111761127557604052565b9291926001600160401b03821161127557604051916112f0601f8201601f1916602001846112a6565b829481845281830111611233578281602093846000960137010152565b9080601f8301121561123357816020611328933591016112c7565b90565b9181601f84011215611233578235916001600160401b038311611233576020808501948460051b01011161123357565b3590811515820361123357565b6001600160401b03939284831161127557604090815195602092611391848760051b01896112a6565b83888781520192606080970286019581871161123357935b8685106113ba575050505050505050565b878583031261123357825190888201908282108683111761140857899288928652873581526113ea83890161124e565b838201526113f986890161135b565b868201528152019401936113a9565b60246000634e487b7160e01b81526041600452fd5b6000546001600160a01b0316330361143157565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b906114b7926114af917f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c60002061161e565b929092611504565b6001600160a01b039081169116036114cb57565b60405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606490fd5b600581101561160857806115155750565b600181036115625760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036115af5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003146115b857565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b90604181511460001461164c57611648916020820151906060604084015193015160001a90611656565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116116d95791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156116cc5781516001600160a01b038116156116c6579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b156116ec57565b60405162461bcd60e51b8152602060048201526011602482015270746f6b656e49647320746f6f206d616e7960781b6044820152606490fd5b1561172c57565b60405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081cdd5c1c1bdc9d081b999d608a1b6044820152606490fd5b60001981146117725760010190565b634e487b7160e01b600052601160045260246000fd5b91908110156117985760051b0190565b634e487b7160e01b600052603260045260246000fd5b80548210156117985760005260206000200190600090565b9190600183016000908282528060205260408220541560001461184a5784549468010000000000000000861015611836578361182661180f886001604098999a018555846117ae565b819391549060031b91821b91600019901b19161790565b9055549382526020522055600190565b634e487b7160e01b83526041600452602483fd5b50925050565b9190811015611798576060020190565b1561186757565b60405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606490fd5b356001600160a01b03811681036112335790565b9060018201906000928184528260205260408420549081151560001461199557600019918083018181116119815782549084820191821161196d57808203611938575b505050805480156119245782019161190783836117ae565b909182549160031b1b191690555582526020526040812055600190565b634e487b7160e01b86526031600452602486fd5b61195861194861180f93866117ae565b90549060031b1c928392866117ae565b905586528460205260408620553880806118ef565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b87526011600452602487fd5b5050505090565b80518210156117985760209160051b010190565b9081519160005b8381106119c8575050016000815290565b80602080928401015181850152016119b7565b611a0b906119fd6119f7949360405195869360208501906119b0565b906119b0565b03601f1981018452836112a6565b565b939092919496956040978851926bffffffffffffffffffffffff198095816060988160209b8b1b168b890152891b166034870152871b166048850152605c840152607c830152609c820152609c815260c081018181106001600160401b038211176112755787526000905b8551821015611b0e57611b02611ada611ab3611b0893611a98868b61199c565b5151908c51918a830152898252611aae8261128b565b6119db565b87611abe868b61199c565b51015190868c5192891b168983015260148252611aae8261128b565b89611ae5858a61199c565b5101511515908a519160f81b8883015260018252611aae8261128b565b91611763565b90611a78565b959650505050905081519101209056fea26469706673582212204df81a40146b35145a1aaf317e45e744a017c0c04f6c3c5b83b9ede89338a92f64736f6c63430008130033", + "deployedBytecode": "0x6080604081815260048036101561001557600080fd5b600092833560e01c9081630fb5a6b4146112015750806312750292146111c3578063150b7a021461116e578063230fb7fe14610ffa5780632b437d4814610fbf5780632b7ac3f314610f9457806338e2c2eb14610f725780635671576114610f535780635c975abb14610f305780635fb110ca14610ea957806367765b8714610e8a5780636d04319414610e3d578063715018a614610de357806376bd0cfd14610890578063799048fa146108075780637f9d30961461077b5780638da5cb5b1461075357806397fc007c1461068a5780639a14da5814610646578063a0634724146105fd578063bdfe78c9146105b9578063c419028f146103a0578063ce3d1b2d14610313578063d13344c91461024e578063da28b527146102065763f2fde38b1461014157600080fd5b346102025760203660031901126102025761015a61121d565b9061016361141d565b6001600160a01b039182169283156101b057505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b50503461024a578160031936011261024a57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5080fd5b8284346103105781600319360112610310579061026961121d565b91610272611238565b6001600160a01b039384168252600860209081528383209190941682528352818120825181548082529183528483208186019392849190845b8181106102fc57505050816102c19103826112a6565b83519485948186019282875251809352850193925b8281106102e557505050500390f35b8351855286955093810193928101926001016102d6565b8254845292880192600192830192016102ab565b80fd5b50346102025760e03660031901126102025761032d61121d565b610335611238565b91604435906001600160401b03821161039c573660238301121561039c5781602461036593369301359101611368565b93606435906001600160a01b0382168203610310575091602094916103959360c4359360a4359360843593611a0d565b9051908152f35b8580fd5b5034610202576060366003190112610202576103ba61121d565b916103c3611238565b916044356001600160401b03811161039c576103e2903690830161132b565b91909360ff825416610583576103fc6005548411156116e5565b6001600160a01b0390811695610413871515611725565b16928387526020916009835261042e60ff838a205416611725565b875b84811061048d57505080518281529182018390526001600160fb1b038311610489577f356278d4d01db4ac9a53decc4eeeceecfb494d3bd0c463b305d33e65305e2bf29260051b8095828401378133958101030190a480f35b8680fd5b858952600684528289206104a282878a611788565b358a52845282892080546001600160a01b03199081168a17909155868a5260078552838a206104d283888b611788565b358b528552838a2090339082541617905585895260088452828920888a52845261050a838a2061050383888b611788565b35906117c6565b50610516818689611788565b3589873b156103105784516323b872dd60e01b815233858201908152306020820152604081019390935291829081906060010381838b5af180156105795790610565929161056a575b50611763565b610430565b61057390611262565b3861055f565b84513d8c823e3d90fd5b835162461bcd60e51b8152602081840152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b50503461024a578060031936011261024a576020916001600160a01b03908290826105e261121d565b16815260078552818120602435825285522054169051908152f35b50503461024a578060031936011261024a578060209261061b61121d565b610623611238565b6001600160a01b0391821683526008865283832091168252845220549051908152f35b50503461024a578060031936011261024a576020916001600160a01b039082908261066f61121d565b16815260068552818120602435825285522054169051908152f35b5034610202576020366003190112610202576106a461121d565b6106ac61141d565b6001600160a01b03811692831561070557508154610100600160a81b03191660089190911b610100600160a81b03161790557fd24015cc99cc1700cafca3042840a1d8ac1e3964fd2e0e37ea29c654056ee3278280a280f35b5162461bcd60e51b8152602081840152602360248201527f4e4654436c61696d65723a20616464726573732063616e206e6f74206265207a60448201526265726f60e81b6064820152608490fd5b50503461024a578160031936011261024a57905490516001600160a01b039091168152602090f35b50346102025760203660031901126102025780359161079861141d565b6003548311156107cf575050806002557f91abcc2d6823e3a3f11d31b208dd3065d2c6a791f1c7c9fe96a42ce12897eac58280a280f35b906020606492519162461bcd60e51b83528201526012602482015271191d5c985d1a5bdb881d1bdbc81cda1bdc9d60721b6044820152fd5b50346102025760203660031901126102025761082161121d565b61082961141d565b6001600160a01b031680845260096020528284205490919060ff161561085e5750825260096020528120805460ff1916905580f35b606490602084519162461bcd60e51b8352820152600c60248201526b63616e27742072656d6f766560a01b6044820152fd5b5090346102025760a0366003190112610202576108ab61121d565b916024916001600160401b039083358281116104895736602382011215610489578084013590838211610ddf5785810195606091813691848602010111610ddb576044938435946064359760843591888311610dd75736602384011215610dd75782820135988911610dd75784830192858a3692010111610dd757835194898487378986019860ff8760019b8c81526020998a91030190205416610d65576002548101808211610d52574211610ceb57908d8f93928d908f6005548d1115610972906116e5565b8c369061097e92611368565b6109cc937f0000000000000000000000000000000000000000000000000000000000000000917f00000000000000000000000000000000000000000000000000000000000000009133611a0d565b9a87855496366109dd9084836112c7565b9d600160a01b600190039e8f60089a8b1c16916109f992611475565b885182818f86858337868201908152030190205460ff1615610cc8575b505050829998979695995b8d898210610abc57505050505050508285519786890190895286838a01525281870197948a915b848310610a7d578b33898d167f9a5ba7d70cc7e1cd613eb99e6ed8ea301d889773c9d4517218560eee5153803e8c8e038da380f35b90919293948480889b610aa7868b869c3584528d610a9c89830161124e565b16888501520161135b565b151581870152019a0196959493019190610a48565b9a610acd828b839a9b9c9d9e611850565b01358015158103610cc4578f8f9190898f928e8d878b93600014610b6757505050505016610b11838d610b0b8d610b05848489611850565b01611898565b94611850565b3591813b1561048957858f918880948d5196879586946340c10f1960e01b8652168d850152898401525af18015610b5d5790610b52929161056a5750611763565b999897969599610a21565b88513d87823e3d90fd5b8691610b05610bd1928487999a610bd898999c9b169b8c8a528b610b94848a8460069e8f8b522093611850565b358c528552610baa8b8383339220541614611860565b8c8b5260079a8b86528c610bc2858b85852093611850565b3582528652205416958a611850565b1614611860565b8388528b52898720610beb858f85611850565b3588528b5289872080546001600160a01b0319908116909155838852908b52898720610c18858f85611850565b3588528b52898720908154169055818652878a528886203387528a52610c4d8c610c46858c8a209285611850565b35906118ac565b50610c68838d610c628d610b05848488611850565b93611850565b35823b156104895789516323b872dd60e01b815230818a019081526001600160a01b039093166020840152604083019190915291869183919082908490829060600103925af18015610b5d5790610b52929161056a5750611763565b8480fd5b828951938492833781018d815203019020805460ff19168b179055388781610a16565b855162461bcd60e51b8152808501889052603b818401527f657870697265642c20706c656173652073656e6420616e6f7468657220747261818501527f6e73616374696f6e2077697468206e6577207369676e617475726500000000006064820152608490fd5b5050634e487b7160e01b8e52601183528dfd5b855162461bcd60e51b81528085018890526042818401527f7369676e617475726520757365642e20706c656173652073656e6420616e6f74818501527f686572207472616e73616374696f6e2077697468206e6577207369676e617475606482015261726560f01b608482015260a490fd5b8c80fd5b8880fd5b8780fd5b8334610310578060031936011261031057610dfc61141d565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b83823461024a57606036600319011261024a57610e5861121d565b6044356001600160401b038111610e8657610e8392610e799136910161130d565b9060243590611475565b80f35b8380fd5b50503461024a578160031936011261024a576020906005549051908152f35b5090346102025760209182600319360112610e86578035906001600160401b038211610cc457610edb9136910161132b565b9290610ee561141d565b845b848110610ef2578580f35b610f2b906001600160a01b03610f11610f0c838987611788565b611898565b16875260098452848720805460ff19166001179055611763565b610ee7565b5091346103105780600319360112610310575060ff602092541690519015158152f35b50503461024a578160031936011261024a576020906003549051908152f35b83823461024a57602036600319011261024a57610f8d61141d565b3560055580f35b503461020257826003193601126102025754905160089190911c6001600160a01b0316815260209150f35b50503461024a578160031936011261024a57602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b503461020257816003193601126102025761101361121d565b91836024356001600160401b03811161024a57611033903690850161132b565b61103e95919561141d565b61104c6005548211156116e5565b6001600160a01b0391821690835b818110611065578480f35b8285526007602081815287872061107d84868d611788565b358852815285888820541691858852600682528a61109f85878c8c2093611788565b358952825288882080546001600160a01b03199081169091558689529082528888206110cc85878e611788565b35895282528888209081541690558487526008815287872090828852526110fa878720610c4684868d611788565b5061110682848b611788565b3590843b156104895787516323b872dd60e01b8152308a82019081526001600160a01b0390921660208301526040820192909252869082908190606001038183885af18015611164579061115f929161056a5750611763565b61105a565b87513d88823e3d90fd5b5091346103105760803660031901126103105761118961121d565b50611192611238565b50606435906001600160401b03821161031057506020926111b59136910161130d565b5051630a85bd0160e11b8152f35b50503461024a57602036600319011261024a5760209160ff9082906001600160a01b036111ee61121d565b1681526009855220541690519015158152f35b84903461024a578160031936011261024a576020906002548152f35b600435906001600160a01b038216820361123357565b600080fd5b602435906001600160a01b038216820361123357565b35906001600160a01b038216820361123357565b6001600160401b03811161127557604052565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b0382111761127557604052565b90601f801991011681019081106001600160401b0382111761127557604052565b9291926001600160401b03821161127557604051916112f0601f8201601f1916602001846112a6565b829481845281830111611233578281602093846000960137010152565b9080601f8301121561123357816020611328933591016112c7565b90565b9181601f84011215611233578235916001600160401b038311611233576020808501948460051b01011161123357565b3590811515820361123357565b6001600160401b03939284831161127557604090815195602092611391848760051b01896112a6565b83888781520192606080970286019581871161123357935b8685106113ba575050505050505050565b878583031261123357825190888201908282108683111761140857899288928652873581526113ea83890161124e565b838201526113f986890161135b565b868201528152019401936113a9565b60246000634e487b7160e01b81526041600452fd5b6000546001600160a01b0316330361143157565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b906114b7926114af917f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c60002061161e565b929092611504565b6001600160a01b039081169116036114cb57565b60405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606490fd5b600581101561160857806115155750565b600181036115625760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036115af5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003146115b857565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b90604181511460001461164c57611648916020820151906060604084015193015160001a90611656565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116116d95791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156116cc5781516001600160a01b038116156116c6579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b156116ec57565b60405162461bcd60e51b8152602060048201526011602482015270746f6b656e49647320746f6f206d616e7960781b6044820152606490fd5b1561172c57565b60405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081cdd5c1c1bdc9d081b999d608a1b6044820152606490fd5b60001981146117725760010190565b634e487b7160e01b600052601160045260246000fd5b91908110156117985760051b0190565b634e487b7160e01b600052603260045260246000fd5b80548210156117985760005260206000200190600090565b9190600183016000908282528060205260408220541560001461184a5784549468010000000000000000861015611836578361182661180f886001604098999a018555846117ae565b819391549060031b91821b91600019901b19161790565b9055549382526020522055600190565b634e487b7160e01b83526041600452602483fd5b50925050565b9190811015611798576060020190565b1561186757565b60405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606490fd5b356001600160a01b03811681036112335790565b9060018201906000928184528260205260408420549081151560001461199557600019918083018181116119815782549084820191821161196d57808203611938575b505050805480156119245782019161190783836117ae565b909182549160031b1b191690555582526020526040812055600190565b634e487b7160e01b86526031600452602486fd5b61195861194861180f93866117ae565b90549060031b1c928392866117ae565b905586528460205260408620553880806118ef565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b87526011600452602487fd5b5050505090565b80518210156117985760209160051b010190565b9081519160005b8381106119c8575050016000815290565b80602080928401015181850152016119b7565b611a0b906119fd6119f7949360405195869360208501906119b0565b906119b0565b03601f1981018452836112a6565b565b939092919496956040978851926bffffffffffffffffffffffff198095816060988160209b8b1b168b890152891b166034870152871b166048850152605c840152607c830152609c820152609c815260c081018181106001600160401b038211176112755787526000905b8551821015611b0e57611b02611ada611ab3611b0893611a98868b61199c565b5151908c51918a830152898252611aae8261128b565b6119db565b87611abe868b61199c565b51015190868c5192891b168983015260148252611aae8261128b565b89611ae5858a61199c565b5101511515908a519160f81b8883015260018252611aae8261128b565b91611763565b90611a78565b959650505050905081519101209056fea26469706673582212204df81a40146b35145a1aaf317e45e744a017c0c04f6c3c5b83b9ede89338a92f64736f6c63430008130033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/contracts/game/NFTLock.sol b/contracts/game/NFTLock.sol index bbb623d..2d299d0 100644 --- a/contracts/game/NFTLock.sol +++ b/contracts/game/NFTLock.sol @@ -17,17 +17,20 @@ contract NFTLock is ERC721Holder, HasSignature, TimeChecker, Pausable { uint256 public immutable _CACHED_CHAIN_ID; address public immutable _CACHED_THIS; address public verifier; + uint256 public maxBatch = 100; struct NFTInfo { uint256 tokenId; + address to; bool isMint; } - mapping(address nft => mapping(uint256 tokenId => address user)) public lockedOriginal; + mapping(address nft => mapping(uint256 tokenId => address user)) public passportOriginal; + mapping(address nft => mapping(uint256 tokenId => address user)) public addressOriginal; mapping(address nft => mapping(address user => EnumerableSet.UintSet tokenIdSet)) private lockedRecords; mapping(address nft => bool status) public supportNftList; event UnLock(address indexed nft, address indexed user, uint256 nonce, NFTInfo[] nftList); - event Lock(address indexed nft, address indexed owner, address indexed to, uint256[] tokenIds); + event Lock(address indexed nft, address indexed sender, address indexed to, uint256[] tokenIds); event VerifierUpdated(address indexed verifier); constructor(uint256 _duration, address _verifier) TimeChecker(_duration) { @@ -35,21 +38,25 @@ contract NFTLock is ERC721Holder, HasSignature, TimeChecker, Pausable { _CACHED_THIS = address(this); verifier = _verifier; } - + /** + * from eoa or passport + */ function lock(address nft, address to, uint256[] calldata tokenIds) external whenNotPaused{ - require(tokenIds.length <= 100, "tokenIds too many"); + require(tokenIds.length <= maxBatch, "tokenIds too many"); require(to != address(0), "not support nft"); require(supportNftList[nft], "not support nft"); - address owner = _msgSender(); + address _sender = _msgSender(); for (uint256 i = 0; i < tokenIds.length; i++) { - lockedOriginal[nft][tokenIds[i]] = to; + passportOriginal[nft][tokenIds[i]] = to; + addressOriginal[nft][tokenIds[i]] = _sender; lockedRecords[nft][to].add(tokenIds[i]); - INFT(nft).transferFrom(owner, address(this), tokenIds[i]); + INFT(nft).transferFrom(_sender, address(this), tokenIds[i]); } - emit Lock(nft, owner, to, tokenIds); + emit Lock(nft, _sender, to, tokenIds); } /** * @dev unlock or mint nft + * from passport only * if tokenId not exists, mint it * if exists and user is owner, unlock it */ @@ -59,23 +66,40 @@ contract NFTLock is ERC721Holder, HasSignature, TimeChecker, Pausable { uint256 signTime, uint256 saltNonce, bytes calldata signature - ) external signatureValid(signature) timeValid(signTime) whenNotPaused { - require(nftList.length <= 100, "tokenIds too many"); - address to = _msgSender(); - bytes32 messageHash = getMessageHash(to, nft, nftList, _CACHED_THIS, _CACHED_CHAIN_ID, signTime, saltNonce); + ) external signatureValid(signature) timeValid(signTime) { + require(nftList.length <= maxBatch, "tokenIds too many"); + address _sender = _msgSender(); + bytes32 messageHash = getMessageHash(_sender, nft, nftList, _CACHED_THIS, _CACHED_CHAIN_ID, signTime, saltNonce); checkSigner(verifier, messageHash, signature); _useSignature(signature); for (uint256 i = 0; i < nftList.length; i++) { if (nftList[i].isMint) { - INFT(nft).mint(to, nftList[i].tokenId); + INFT(nft).mint(nftList[i].to, nftList[i].tokenId); } else { - require(lockedOriginal[nft][nftList[i].tokenId] == to, "not owner"); - delete lockedOriginal[nft][nftList[i].tokenId]; - lockedRecords[nft][to].remove(nftList[i].tokenId); - INFT(nft).transferFrom(address(this), to, nftList[i].tokenId); + require(passportOriginal[nft][nftList[i].tokenId] == _sender, "not owner"); + require(addressOriginal[nft][nftList[i].tokenId] == nftList[i].to, "not owner"); + delete passportOriginal[nft][nftList[i].tokenId]; + delete addressOriginal[nft][nftList[i].tokenId]; + lockedRecords[nft][_sender].remove(nftList[i].tokenId); + INFT(nft).transferFrom(address(this), nftList[i].to, nftList[i].tokenId); } } - emit UnLock(nft, to, saltNonce, nftList); + emit UnLock(nft, _sender, saltNonce, nftList); + } + + /** + * @dev unlock nft + * from game svr only + */ + function unlockWithSvr(address nft, uint256[] calldata tokenIds) external onlyOwner(){ + require(tokenIds.length <= maxBatch, "tokenIds too many"); + for (uint256 i = 0; i < tokenIds.length; i++) { + address _sender = addressOriginal[nft][tokenIds[i]]; + delete passportOriginal[nft][tokenIds[i]]; + delete addressOriginal[nft][tokenIds[i]]; + lockedRecords[nft][_sender].remove(tokenIds[i]); + INFT(nft).transferFrom(address(this), _sender, tokenIds[i]); + } } /** ------get------- **/ @@ -87,6 +111,10 @@ contract NFTLock is ERC721Holder, HasSignature, TimeChecker, Pausable { return lockedRecords[token][user].values(); } + function updateBatch(uint256 _maxBatch) external onlyOwner { + maxBatch = _maxBatch; + } + function addSupportNftList(address[] calldata nftList) external onlyOwner { for (uint256 i = 0; i < nftList.length; i++) { supportNftList[nftList[i]] = true; @@ -118,6 +146,7 @@ contract NFTLock is ERC721Holder, HasSignature, TimeChecker, Pausable { bytes memory encoded = abi.encodePacked(_to, _nft, _contract, _chainId, _signTime, _saltNonce); for (uint256 i = 0; i < _ids.length; ++i) { encoded = bytes.concat(encoded, abi.encodePacked(_ids[i].tokenId)); + encoded = bytes.concat(encoded, abi.encodePacked(_ids[i].to)); encoded = bytes.concat(encoded, abi.encodePacked(_ids[i].isMint)); } return keccak256(encoded); diff --git a/deployments/imtbl_test/AirdropToken.json b/deployments/imtbl_test/AirdropToken.json deleted file mode 100644 index 4cc2780..0000000 --- a/deployments/imtbl_test/AirdropToken.json +++ /dev/null @@ -1,278 +0,0 @@ -{ - "address": "0x02B244Ba62f84ff518a4797b1859977D1fcdBBA8", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - } - ], - "name": "failTransferList", - "outputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "_arr", - "type": "uint256[]" - } - ], - "name": "getSum", - "outputs": [ - { - "internalType": "uint256", - "name": "sum", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_addresses", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "_tokenIds", - "type": "uint256[]" - } - ], - "name": "multiMintERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_addresses", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "_amounts", - "type": "uint256[]" - } - ], - "name": "multiTransferERC20", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_token", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_addresses", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "_tokenIds", - "type": "uint256[]" - } - ], - "name": "multiTransferERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address payable[]", - "name": "_addresses", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "_amounts", - "type": "uint256[]" - } - ], - "name": "multiTransferETH", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xa7b9f2911b327a71b79edb0a028b84789dee529554d04e6fae587a10aaee66a0", - "receipt": { - "to": null, - "from": "0x50A8e60041A206AcaA5F844a1104896224be6F39", - "contractAddress": "0x02B244Ba62f84ff518a4797b1859977D1fcdBBA8", - "transactionIndex": 0, - "gasUsed": "670154", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000040000000000000000000000000000000020000000000000000000800000100000000000000000000040000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000020000000000000000000000000000000000000020000000000000000000000000000", - "blockHash": "0xa5558c1f59e70b00b02383265f162f2a5a4f9af9a9b208492f505b0197af5e09", - "transactionHash": "0xa7b9f2911b327a71b79edb0a028b84789dee529554d04e6fae587a10aaee66a0", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 10250188, - "transactionHash": "0xa7b9f2911b327a71b79edb0a028b84789dee529554d04e6fae587a10aaee66a0", - "address": "0x02B244Ba62f84ff518a4797b1859977D1fcdBBA8", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000050a8e60041a206acaa5f844a1104896224be6f39" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0xa5558c1f59e70b00b02383265f162f2a5a4f9af9a9b208492f505b0197af5e09" - } - ], - "blockNumber": 10250188, - "cumulativeGasUsed": "670154", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 1, - "solcInputHash": "7eceef62c89a38c4c392c8e1623702eb", - "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"failTransferList\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"_arr\",\"type\":\"uint256[]\"}],\"name\":\"getSum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"sum\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_addresses\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_tokenIds\",\"type\":\"uint256[]\"}],\"name\":\"multiMintERC721\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_addresses\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_amounts\",\"type\":\"uint256[]\"}],\"name\":\"multiTransferERC20\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_addresses\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_tokenIds\",\"type\":\"uint256[]\"}],\"name\":\"multiTransferERC721\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable[]\",\"name\":\"_addresses\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_amounts\",\"type\":\"uint256[]\"}],\"name\":\"multiTransferETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/tools/AirdropToken.sol\":\"AirdropToken\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xba43b97fba0d32eb4254f6a5a297b39a19a247082a02d6e69349e071e2946218\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * ==== Security Considerations\\n *\\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\\n * generally recommended is:\\n *\\n * ```solidity\\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\\n * doThing(..., value);\\n * }\\n *\\n * function doThing(..., uint256 value) public {\\n * token.safeTransferFrom(msg.sender, address(this), value);\\n * ...\\n * }\\n * ```\\n *\\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\\n * {SafeERC20-safeTransferFrom}).\\n *\\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\\n * contracts should have entry points that don't rely on permit.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n *\\n * CAUTION: See Security Considerations above.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xb264c03a3442eb37a68ad620cefd1182766b58bee6cec40343480392d6b14d69\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../extensions/IERC20Permit.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20Permit token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n *\\n * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xa92e4fa126feb6907daa0513ddd816b2eb91f30a808de54f63c17d0e162c3439\",\"license\":\"MIT\"},\"contracts/tools/AirdropToken.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ninterface IERC721 {\\n function mint(address to, uint256 tokenID) external;\\n function transferFrom(address from, address to, uint256 tokenId) external;\\n}\\n\\ncontract AirdropToken is Ownable{\\n using SafeERC20 for IERC20;\\n mapping(address user => uint256 amount) public failTransferList;\\n\\n function getSum(uint256[] calldata _arr) public pure returns (uint256 sum) {\\n for (uint256 i = 0; i < _arr.length; i++) sum = sum + _arr[i];\\n }\\n\\n function multiTransferETH(address payable[] calldata _addresses, uint256[] calldata _amounts) public payable {\\n require(_addresses.length == _amounts.length, \\\"Lengths of Addresses and Amounts NOT EQUAL\\\");\\n uint256 _amountSum = getSum(_amounts);\\n require(msg.value == _amountSum, \\\"Transfer amount error\\\");\\n for (uint256 i = 0; i < _addresses.length; i++) {\\n (bool success, ) = _addresses[i].call{value: _amounts[i]}(\\\"\\\");\\n if (!success) {\\n failTransferList[_addresses[i]] = _amounts[i];\\n }\\n }\\n }\\n\\n function multiTransferERC20(address _token, address[] calldata _addresses, uint256[] calldata _amounts) external {\\n require(_addresses.length == _amounts.length, \\\"Lengths of Addresses and Amounts NOT EQUAL\\\");\\n IERC20 token = IERC20(_token);\\n for (uint256 i; i < _addresses.length; i++) {\\n token.safeTransferFrom(msg.sender, _addresses[i], _amounts[i]);\\n }\\n }\\n\\n function multiTransferERC721(address _token, address[] calldata _addresses, uint256[] calldata _tokenIds) external {\\n require(_addresses.length == _tokenIds.length, \\\"Lengths of Addresses and TokenIds NOT EQUAL\\\");\\n IERC721 token = IERC721(_token);\\n for (uint256 i; i < _addresses.length; i++) {\\n token.transferFrom(msg.sender, _addresses[i], _tokenIds[i]);\\n }\\n }\\n\\n function multiMintERC721(address _token, address[] calldata _addresses, uint256[] calldata _tokenIds) external onlyOwner(){\\n require(_addresses.length == _tokenIds.length, \\\"Lengths of Addresses and TokenIds NOT EQUAL\\\");\\n IERC721 token = IERC721(_token);\\n for (uint256 i; i < _addresses.length; i++) {\\n token.mint(_addresses[i], _tokenIds[i]);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8a72e11a54e8dd6e87a98bac9561a765e544778312e3f84b82efcb8ffe0c45df\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6080806040523461005b5760008054336001600160a01b0319821681178355916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3610ab390816100618239f35b600080fdfe6040608081526004908136101561001557600080fd5b600091823560e01c8381630335e943146105f757508063715018a61461059d57806377988cf8146104705780638da5cb5b14610448578063ccb8c1e014610400578063daa8ce9a1461025d578063f2fde38b14610197578063fe53c53c1461015b5763ffbe87811461008657600080fd5b82913461015757610096366106ee565b96936100a6888495939514610a1d565b6001600160a01b031691845b8181106100bd578580f35b6100d06100cb8284866107cb565b6108a9565b6100db828b886107cb565b3590853b156101535788516323b872dd60e01b815233818c019081526001600160a01b0390921660208301526040820192909252879082908190606001038183895af180156101495790610135929161013a575b506107a6565b6100b2565b610143906108bd565b3861012f565b88513d89823e3d90fd5b8780fd5b5050fd5b5050346101935760203660031901126101935760209181906001600160a01b036101836106a2565b1681526001845220549051908152f35b5080fd5b5034610259576020366003190112610259576101b16106a2565b906101ba61074e565b6001600160a01b0391821692831561020757505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b50346102595761026c366106ee565b9092949361027b82841461084a565b6001600160a01b031691875b818110610292578880f35b6102a06100cb82848a6107cb565b6102ab8285886107cb565b89516323b872dd60e01b6020808301918252336024808501919091526001600160a01b03959095166044840152923560648084019190915282526102f06084836108e7565b8b51918c830183811067ffffffffffffffff8211176103ee578d528383527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564848401525161035092918e918291828c5af1610349610909565b9089610949565b80518281159182156103ca575b5050905015610376575050610371906107a6565b610287565b602a60849289928c519362461bcd60e51b85528401528201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b83809293500103126103ea5781015180151581036103ea5780823861035d565b8b80fd5b634e487b7160e01b8f5260418c52858ffd5b5091346104455760203660031901126104455782359067ffffffffffffffff8211610445575061043860209361043e923691016106bd565b906107f1565b9051908152f35b80fd5b505034610193578160031936011261019357905490516001600160a01b039091168152602090f35b5090806003193601126102595767ffffffffffffffff9082358281116105995761049d90369085016106bd565b9092602435908111610595576104b690369086016106bd565b90946104c382841461084a565b6104cd82876107f1565b340361055a575085805b8381106104e2575080f35b83828080610526958b61050e878a8e6105076100cb8460018060a01b039c8d946107cb565b16936107cb565b35905af161051a610909565b501561052d57506107a6565b86906104d7565b61053882858a6107cb565b35906105486100cb84888b6107cb565b1689526001602052858920553861012f565b606490602085519162461bcd60e51b835282015260156024820152742a3930b739b332b91030b6b7bab73a1032b93937b960591b6044820152fd5b8580fd5b8480fd5b83346104455780600319360112610445576105b661074e565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b9290503461015757610608366106ee565b96939261061361074e565b61061e888414610a1d565b6001600160a01b0393841692855b818110610637578680f35b6106456100cb8284866107cb565b610650828c876107cb565b35863b1561069e5789516340c10f1960e01b81529188168b83015260248201528781604481838a5af18015610694579061068f929161013a57506107a6565b61062c565b89513d8a823e3d90fd5b8880fd5b600435906001600160a01b03821682036106b857565b600080fd5b9181601f840112156106b85782359167ffffffffffffffff83116106b8576020808501948460051b0101116106b857565b9060606003198301126106b8576004356001600160a01b03811681036106b8579167ffffffffffffffff916024358381116106b85782610730916004016106bd565b939093926044359182116106b85761074a916004016106bd565b9091565b6000546001600160a01b0316330361076257565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60001981146107b55760010190565b634e487b7160e01b600052601160045260246000fd5b91908110156107db5760051b0190565b634e487b7160e01b600052603260045260246000fd5b60009291839081905b8083106108075750505050565b90919392946108178583886107cb565b3581018091116108365761082b90946107a6565b9190949293946107fa565b634e487b7160e01b83526011600452602483fd5b1561085157565b60405162461bcd60e51b815260206004820152602a60248201527f4c656e67746873206f662041646472657373657320616e6420416d6f756e7473604482015269081393d508115455505360b21b6064820152608490fd5b356001600160a01b03811681036106b85790565b67ffffffffffffffff81116108d157604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff8211176108d157604052565b3d15610944573d9067ffffffffffffffff82116108d15760405191610938601f8201601f1916602001846108e7565b82523d6000602084013e565b606090565b919290156109ab575081511561095d575090565b3b156109665790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156109be5750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610a04575050604492506000838284010152601f80199101168101030190fd5b84810182015186860160440152938101938593506109e1565b15610a2457565b60405162461bcd60e51b815260206004820152602b60248201527f4c656e67746873206f662041646472657373657320616e6420546f6b656e496460448201526a1cc81393d508115455505360aa1b6064820152608490fdfea264697066735822122047decf02a8598f52706e7c0fd6ef586113fba1e81ff394ebee3bb02dae79dfd364736f6c63430008130033", - "deployedBytecode": "0x6040608081526004908136101561001557600080fd5b600091823560e01c8381630335e943146105f757508063715018a61461059d57806377988cf8146104705780638da5cb5b14610448578063ccb8c1e014610400578063daa8ce9a1461025d578063f2fde38b14610197578063fe53c53c1461015b5763ffbe87811461008657600080fd5b82913461015757610096366106ee565b96936100a6888495939514610a1d565b6001600160a01b031691845b8181106100bd578580f35b6100d06100cb8284866107cb565b6108a9565b6100db828b886107cb565b3590853b156101535788516323b872dd60e01b815233818c019081526001600160a01b0390921660208301526040820192909252879082908190606001038183895af180156101495790610135929161013a575b506107a6565b6100b2565b610143906108bd565b3861012f565b88513d89823e3d90fd5b8780fd5b5050fd5b5050346101935760203660031901126101935760209181906001600160a01b036101836106a2565b1681526001845220549051908152f35b5080fd5b5034610259576020366003190112610259576101b16106a2565b906101ba61074e565b6001600160a01b0391821692831561020757505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b50346102595761026c366106ee565b9092949361027b82841461084a565b6001600160a01b031691875b818110610292578880f35b6102a06100cb82848a6107cb565b6102ab8285886107cb565b89516323b872dd60e01b6020808301918252336024808501919091526001600160a01b03959095166044840152923560648084019190915282526102f06084836108e7565b8b51918c830183811067ffffffffffffffff8211176103ee578d528383527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564848401525161035092918e918291828c5af1610349610909565b9089610949565b80518281159182156103ca575b5050905015610376575050610371906107a6565b610287565b602a60849289928c519362461bcd60e51b85528401528201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b83809293500103126103ea5781015180151581036103ea5780823861035d565b8b80fd5b634e487b7160e01b8f5260418c52858ffd5b5091346104455760203660031901126104455782359067ffffffffffffffff8211610445575061043860209361043e923691016106bd565b906107f1565b9051908152f35b80fd5b505034610193578160031936011261019357905490516001600160a01b039091168152602090f35b5090806003193601126102595767ffffffffffffffff9082358281116105995761049d90369085016106bd565b9092602435908111610595576104b690369086016106bd565b90946104c382841461084a565b6104cd82876107f1565b340361055a575085805b8381106104e2575080f35b83828080610526958b61050e878a8e6105076100cb8460018060a01b039c8d946107cb565b16936107cb565b35905af161051a610909565b501561052d57506107a6565b86906104d7565b61053882858a6107cb565b35906105486100cb84888b6107cb565b1689526001602052858920553861012f565b606490602085519162461bcd60e51b835282015260156024820152742a3930b739b332b91030b6b7bab73a1032b93937b960591b6044820152fd5b8580fd5b8480fd5b83346104455780600319360112610445576105b661074e565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b9290503461015757610608366106ee565b96939261061361074e565b61061e888414610a1d565b6001600160a01b0393841692855b818110610637578680f35b6106456100cb8284866107cb565b610650828c876107cb565b35863b1561069e5789516340c10f1960e01b81529188168b83015260248201528781604481838a5af18015610694579061068f929161013a57506107a6565b61062c565b89513d8a823e3d90fd5b8880fd5b600435906001600160a01b03821682036106b857565b600080fd5b9181601f840112156106b85782359167ffffffffffffffff83116106b8576020808501948460051b0101116106b857565b9060606003198301126106b8576004356001600160a01b03811681036106b8579167ffffffffffffffff916024358381116106b85782610730916004016106bd565b939093926044359182116106b85761074a916004016106bd565b9091565b6000546001600160a01b0316330361076257565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60001981146107b55760010190565b634e487b7160e01b600052601160045260246000fd5b91908110156107db5760051b0190565b634e487b7160e01b600052603260045260246000fd5b60009291839081905b8083106108075750505050565b90919392946108178583886107cb565b3581018091116108365761082b90946107a6565b9190949293946107fa565b634e487b7160e01b83526011600452602483fd5b1561085157565b60405162461bcd60e51b815260206004820152602a60248201527f4c656e67746873206f662041646472657373657320616e6420416d6f756e7473604482015269081393d508115455505360b21b6064820152608490fd5b356001600160a01b03811681036106b85790565b67ffffffffffffffff81116108d157604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff8211176108d157604052565b3d15610944573d9067ffffffffffffffff82116108d15760405191610938601f8201601f1916602001846108e7565b82523d6000602084013e565b606090565b919290156109ab575081511561095d575090565b3b156109665790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b8251909150156109be5750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610a04575050604492506000838284010152601f80199101168101030190fd5b84810182015186860160440152938101938593506109e1565b15610a2457565b60405162461bcd60e51b815260206004820152602b60248201527f4c656e67746873206f662041646472657373657320616e6420546f6b656e496460448201526a1cc81393d508115455505360aa1b6064820152608490fdfea264697066735822122047decf02a8598f52706e7c0fd6ef586113fba1e81ff394ebee3bb02dae79dfd364736f6c63430008130033", - "devdoc": { - "kind": "dev", - "methods": { - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 7, - "contract": "contracts/tools/AirdropToken.sol:AirdropToken", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 997, - "contract": "contracts/tools/AirdropToken.sol:AirdropToken", - "label": "failTransferList", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_uint256)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/imtbl_test/NFTLock.json b/deployments/imtbl_test/NFTLock.json new file mode 100644 index 0000000..26bf90d --- /dev/null +++ b/deployments/imtbl_test/NFTLock.json @@ -0,0 +1,994 @@ +{ + "address": "0xc63ed18feE4C3D62b87DfCE5b5F4DafD8905D9B2", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_duration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_verifier", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "duration", + "type": "uint256" + } + ], + "name": "DurationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "nft", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "name": "Lock", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "nft", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bool", + "name": "isMint", + "type": "bool" + } + ], + "indexed": false, + "internalType": "struct NFTLock.NFTInfo[]", + "name": "nftList", + "type": "tuple[]" + } + ], + "name": "UnLock", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "VerifierUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "_CACHED_CHAIN_ID", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "_CACHED_THIS", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "nftList", + "type": "address[]" + } + ], + "name": "addSupportNftList", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nft", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "addressOriginal", + "outputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "checkSigner", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "duration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "address", + "name": "_nft", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bool", + "name": "isMint", + "type": "bool" + } + ], + "internalType": "struct NFTLock.NFTInfo[]", + "name": "_ids", + "type": "tuple[]" + }, + { + "internalType": "address", + "name": "_contract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_signTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "getMessageHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nft", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "name": "lock", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "lockedNft", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "lockedNum", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxBatch", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC721Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nft", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "passportOriginal", + "outputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nftAddress", + "type": "address" + } + ], + "name": "removeSupportNft", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nft", + "type": "address" + } + ], + "name": "supportNftList", + "outputs": [ + { + "internalType": "bool", + "name": "status", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nft", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bool", + "name": "isMint", + "type": "bool" + } + ], + "internalType": "struct NFTLock.NFTInfo[]", + "name": "nftList", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "signTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "unlockOrMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "nft", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "name": "unlockWithSvr", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_maxBatch", + "type": "uint256" + } + ], + "name": "updateBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "valNew", + "type": "uint256" + } + ], + "name": "updateDuation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_verifier", + "type": "address" + } + ], + "name": "updateVerifier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "verifier", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x3f71c0866231bfc2794c81de291f9774338daac846759136565893276163f3e8", + "receipt": { + "to": null, + "from": "0x50A8e60041A206AcaA5F844a1104896224be6F39", + "contractAddress": "0xc63ed18feE4C3D62b87DfCE5b5F4DafD8905D9B2", + "transactionIndex": 0, + "gasUsed": "1680994", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000800000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000080020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000080000000000020000000000000000000000000000000000000020000000000000000000000000000", + "blockHash": "0x13c4b300dd62f61b716d6bf500c714fcc452b571d76cd3ecda35a4014361f5d4", + "transactionHash": "0x3f71c0866231bfc2794c81de291f9774338daac846759136565893276163f3e8", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 10416969, + "transactionHash": "0x3f71c0866231bfc2794c81de291f9774338daac846759136565893276163f3e8", + "address": "0xc63ed18feE4C3D62b87DfCE5b5F4DafD8905D9B2", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000050a8e60041a206acaa5f844a1104896224be6f39" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x13c4b300dd62f61b716d6bf500c714fcc452b571d76cd3ecda35a4014361f5d4" + } + ], + "blockNumber": 10416969, + "cumulativeGasUsed": "1680994", + "status": 1, + "byzantium": true + }, + "args": [ + 3600, + "0x50A8e60041A206AcaA5F844a1104896224be6F39" + ], + "numDeployments": 1, + "solcInputHash": "62f20d373cd10a7adc6f55deaeb127c0", + "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_duration\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_verifier\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"DurationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nft\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"}],\"name\":\"Lock\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nft\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isMint\",\"type\":\"bool\"}],\"indexed\":false,\"internalType\":\"struct NFTLock.NFTInfo[]\",\"name\":\"nftList\",\"type\":\"tuple[]\"}],\"name\":\"UnLock\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"VerifierUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"_CACHED_CHAIN_ID\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_CACHED_THIS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"nftList\",\"type\":\"address[]\"}],\"name\":\"addSupportNftList\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nft\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"addressOriginal\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"checkSigner\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_nft\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isMint\",\"type\":\"bool\"}],\"internalType\":\"struct NFTLock.NFTInfo[]\",\"name\":\"_ids\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"_contract\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_signTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_saltNonce\",\"type\":\"uint256\"}],\"name\":\"getMessageHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nft\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"}],\"name\":\"lock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"lockedNft\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"lockedNum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxBatch\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nft\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"passportOriginal\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nftAddress\",\"type\":\"address\"}],\"name\":\"removeSupportNft\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nft\",\"type\":\"address\"}],\"name\":\"supportNftList\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nft\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isMint\",\"type\":\"bool\"}],\"internalType\":\"struct NFTLock.NFTInfo[]\",\"name\":\"nftList\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"signTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"saltNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"unlockOrMint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"nft\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"}],\"name\":\"unlockWithSvr\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxBatch\",\"type\":\"uint256\"}],\"name\":\"updateBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"valNew\",\"type\":\"uint256\"}],\"name\":\"updateDuation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_verifier\",\"type\":\"address\"}],\"name\":\"updateVerifier\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"verifier\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"events\":{\"Paused(address)\":{\"details\":\"Emitted when the pause is triggered by `account`.\"},\"Unpaused(address)\":{\"details\":\"Emitted when the pause is lifted by `account`.\"}},\"kind\":\"dev\",\"methods\":{\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"See {IERC721Receiver-onERC721Received}. Always returns `IERC721Receiver.onERC721Received.selector`.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unlockOrMint(address,(uint256,address,bool)[],uint256,uint256,bytes)\":{\"details\":\"unlock or mint nft from passport only if tokenId not exists, mint it if exists and user is owner, unlock it\"},\"unlockWithSvr(address,uint256[])\":{\"details\":\"unlock nft from game svr only\"},\"updateDuation(uint256)\":{\"details\":\"Change duration value\"},\"updateVerifier(address)\":{\"details\":\"update verifier address\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"lock(address,address,uint256[])\":{\"notice\":\"from eoa or passport\"},\"lockedNum(address,address)\":{\"notice\":\"------get------- *\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/game/NFTLock.sol\":\"NFTLock\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xba43b97fba0d32eb4254f6a5a297b39a19a247082a02d6e69349e071e2946218\",\"license\":\"MIT\"},\"@openzeppelin/contracts/security/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract Pausable is Context {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x0849d93b16c9940beb286a7864ed02724b248b93e0d80ef6355af5ef15c64773\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title ERC721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xa82b58eca1ee256be466e536706850163d2ec7821945abd6b4778cfb3bee37da\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/utils/ERC721Holder.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC721Receiver.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC721Receiver} interface.\\n *\\n * Accepts all token transfers.\\n * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.\\n */\\ncontract ERC721Holder is IERC721Receiver {\\n /**\\n * @dev See {IERC721Receiver-onERC721Received}.\\n *\\n * Always returns `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {\\n return this.onERC721Received.selector;\\n }\\n}\\n\",\"keccak256\":\"0x67ef46fef257faae47adb630aad49694dda0334e5f7a7c5fb386243b974886b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xa92e4fa126feb6907daa0513ddd816b2eb91f30a808de54f63c17d0e162c3439\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\nimport \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\\n */\\n function toString(int256 value) internal pure returns (string memory) {\\n return string(abi.encodePacked(value < 0 ? \\\"-\\\" : \\\"\\\", toString(SignedMath.abs(value))));\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n\\n /**\\n * @dev Returns true if the two strings are equal.\\n */\\n function equal(string memory a, string memory b) internal pure returns (bool) {\\n return keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x3088eb2868e8d13d89d16670b5f8612c4ab9ff8956272837d8e90106c59c14a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n enum RecoverError {\\n NoError,\\n InvalidSignature,\\n InvalidSignatureLength,\\n InvalidSignatureS,\\n InvalidSignatureV // Deprecated in v4.8\\n }\\n\\n function _throwError(RecoverError error) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert(\\\"ECDSA: invalid signature\\\");\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert(\\\"ECDSA: invalid signature length\\\");\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert(\\\"ECDSA: invalid signature 's' value\\\");\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature` or error string. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n *\\n * Documentation for signature generation:\\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n if (signature.length == 65) {\\n bytes32 r;\\n bytes32 s;\\n uint8 v;\\n // ecrecover takes the signature parameters, and the only way to get them\\n // currently is to use assembly.\\n /// @solidity memory-safe-assembly\\n assembly {\\n r := mload(add(signature, 0x20))\\n s := mload(add(signature, 0x40))\\n v := byte(0, mload(add(signature, 0x60)))\\n }\\n return tryRecover(hash, v, r, s);\\n } else {\\n return (address(0), RecoverError.InvalidSignatureLength);\\n }\\n }\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with\\n * `signature`. This address can then be used for verification purposes.\\n *\\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n * this function rejects them by requiring the `s` value to be in the lower\\n * half order, and the `v` value to be either 27 or 28.\\n *\\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n * verification to be secure: it is possible to craft signatures that\\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n * this is by receiving a hash of the original message (which may otherwise\\n * be too long), and then calling {toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, signature);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n *\\n * _Available since v4.2._\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n *\\n * _Available since v4.3._\\n */\\n function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {\\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n //\\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n // these malleable signatures as well.\\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n return (address(0), RecoverError.InvalidSignatureS);\\n }\\n\\n // If the signature is valid (and not malleable), return the signer address\\n address signer = ecrecover(hash, v, r, s);\\n if (signer == address(0)) {\\n return (address(0), RecoverError.InvalidSignature);\\n }\\n\\n return (signer, RecoverError.NoError);\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `v`,\\n * `r` and `s` signature fields separately.\\n */\\n function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n _throwError(error);\\n return recovered;\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {\\n // 32 is the length in bytes of hash,\\n // enforced by the type signature above\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\")\\n mstore(0x1c, hash)\\n message := keccak256(0x00, 0x3c)\\n }\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Message, created from `s`. This\\n * produces hash corresponding to the one signed with the\\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n * JSON-RPC method as part of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Typed Data, created from a\\n * `domainSeparator` and a `structHash`. This produces hash corresponding\\n * to the one signed with the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n * JSON-RPC method as part of EIP-712.\\n *\\n * See {recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n let ptr := mload(0x40)\\n mstore(ptr, \\\"\\\\x19\\\\x01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n data := keccak256(ptr, 0x42)\\n }\\n }\\n\\n /**\\n * @dev Returns an Ethereum Signed Data with intended validator, created from a\\n * `validator` and `data` according to the version 0 of EIP-191.\\n *\\n * See {recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x00\\\", validator, data));\\n }\\n}\\n\",\"keccak256\":\"0x809bc3edb4bcbef8263fa616c1b60ee0004b50a8a1bfa164d8f57fd31f520c58\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\\n // The surrounding unchecked block does not change this fact.\\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1, \\\"Math: mulDiv overflow\\\");\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10 ** 64) {\\n value /= 10 ** 64;\\n result += 64;\\n }\\n if (value >= 10 ** 32) {\\n value /= 10 ** 32;\\n result += 32;\\n }\\n if (value >= 10 ** 16) {\\n value /= 10 ** 16;\\n result += 16;\\n }\\n if (value >= 10 ** 8) {\\n value /= 10 ** 8;\\n result += 8;\\n }\\n if (value >= 10 ** 4) {\\n value /= 10 ** 4;\\n result += 4;\\n }\\n if (value >= 10 ** 2) {\\n value /= 10 ** 2;\\n result += 2;\\n }\\n if (value >= 10 ** 1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xe4455ac1eb7fc497bb7402579e7b4d64d928b846fce7d2b6fde06d366f21c2b3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two signed numbers.\\n */\\n function min(int256 a, int256 b) internal pure returns (int256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two signed numbers without overflow.\\n * The result is rounded towards zero.\\n */\\n function average(int256 a, int256 b) internal pure returns (int256) {\\n // Formula from the book \\\"Hacker's Delight\\\"\\n int256 x = (a & b) + ((a ^ b) >> 1);\\n return x + (int256(uint256(x) >> 255) & (a ^ b));\\n }\\n\\n /**\\n * @dev Returns the absolute unsigned value of a signed value.\\n */\\n function abs(int256 n) internal pure returns (uint256) {\\n unchecked {\\n // must be unchecked in order to support `n = type(int256).min`\\n return uint256(n >= 0 ? n : -n);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf92515413956f529d95977adc9b0567d583c6203fc31ab1c23824c35187e3ddc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```solidity\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\\n * unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\\n * array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n bytes32[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x9f4357008a8f7d8c8bf5d48902e789637538d8c016be5766610901b4bba81514\",\"license\":\"MIT\"},\"contracts/core/HasSignature.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\nimport {ECDSA} from \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract HasSignature is Ownable {\\n mapping(bytes signature => bool status) private _usedSignatures;\\n\\n function checkSigner(\\n address signer,\\n bytes32 hash,\\n bytes memory signature\\n ) public pure {\\n bytes32 ethSignedMessageHash = ECDSA.toEthSignedMessageHash(hash);\\n\\n address recovered = ECDSA.recover(ethSignedMessageHash, signature);\\n require(recovered == signer, \\\"invalid signature\\\");\\n }\\n\\n modifier signatureValid(bytes calldata signature) {\\n require(\\n !_usedSignatures[signature],\\n \\\"signature used. please send another transaction with new signature\\\"\\n );\\n _;\\n }\\n\\n function _useSignature(bytes calldata signature) internal {\\n if (!_usedSignatures[signature]) {\\n _usedSignatures[signature] = true;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x1999478f082b3dac416b579ea9385736e3015aa27ac7173c67555e21426ede51\",\"license\":\"MIT\"},\"contracts/game/NFTLock.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\nimport {ERC721Holder} from \\\"@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol\\\";\\nimport {EnumerableSet} from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\nimport {Pausable} from \\\"@openzeppelin/contracts/security/Pausable.sol\\\";\\nimport {HasSignature} from \\\"../core/HasSignature.sol\\\";\\nimport {TimeChecker} from \\\"../utils/TimeChecker.sol\\\";\\n\\ninterface INFT {\\n function mint(address to, uint256 tokenID) external;\\n function transferFrom(address from, address to, uint256 tokenId) external;\\n}\\n\\ncontract NFTLock is ERC721Holder, HasSignature, TimeChecker, Pausable {\\n using EnumerableSet for EnumerableSet.UintSet;\\n\\n uint256 public immutable _CACHED_CHAIN_ID;\\n address public immutable _CACHED_THIS;\\n address public verifier;\\n uint256 public maxBatch = 100;\\n\\n struct NFTInfo {\\n uint256 tokenId;\\n address to;\\n bool isMint;\\n }\\n mapping(address nft => mapping(uint256 tokenId => address user)) public passportOriginal;\\n mapping(address nft => mapping(uint256 tokenId => address user)) public addressOriginal;\\n mapping(address nft => mapping(address user => EnumerableSet.UintSet tokenIdSet)) private lockedRecords;\\n mapping(address nft => bool status) public supportNftList;\\n\\n event UnLock(address indexed nft, address indexed user, uint256 nonce, NFTInfo[] nftList);\\n event Lock(address indexed nft, address indexed sender, address indexed to, uint256[] tokenIds);\\n event VerifierUpdated(address indexed verifier);\\n\\n constructor(uint256 _duration, address _verifier) TimeChecker(_duration) {\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_THIS = address(this);\\n verifier = _verifier;\\n }\\n /**\\n * from eoa or passport\\n */\\n function lock(address nft, address to, uint256[] calldata tokenIds) external whenNotPaused{\\n require(tokenIds.length <= maxBatch, \\\"tokenIds too many\\\");\\n require(to != address(0), \\\"not support nft\\\");\\n require(supportNftList[nft], \\\"not support nft\\\");\\n address _sender = _msgSender();\\n for (uint256 i = 0; i < tokenIds.length; i++) {\\n passportOriginal[nft][tokenIds[i]] = to;\\n addressOriginal[nft][tokenIds[i]] = _sender;\\n lockedRecords[nft][to].add(tokenIds[i]);\\n INFT(nft).transferFrom(_sender, address(this), tokenIds[i]);\\n }\\n emit Lock(nft, _sender, to, tokenIds);\\n }\\n /**\\n * @dev unlock or mint nft\\n * from passport only\\n * if tokenId not exists, mint it\\n * if exists and user is owner, unlock it\\n */\\n function unlockOrMint(\\n address nft,\\n NFTInfo[] calldata nftList,\\n uint256 signTime,\\n uint256 saltNonce,\\n bytes calldata signature\\n ) external signatureValid(signature) timeValid(signTime) {\\n require(nftList.length <= maxBatch, \\\"tokenIds too many\\\");\\n address _sender = _msgSender();\\n bytes32 messageHash = getMessageHash(_sender, nft, nftList, _CACHED_THIS, _CACHED_CHAIN_ID, signTime, saltNonce);\\n checkSigner(verifier, messageHash, signature);\\n _useSignature(signature);\\n for (uint256 i = 0; i < nftList.length; i++) {\\n if (nftList[i].isMint) {\\n INFT(nft).mint(nftList[i].to, nftList[i].tokenId);\\n } else {\\n require(passportOriginal[nft][nftList[i].tokenId] == _sender, \\\"not owner\\\");\\n require(addressOriginal[nft][nftList[i].tokenId] == nftList[i].to, \\\"not owner\\\");\\n delete passportOriginal[nft][nftList[i].tokenId];\\n delete addressOriginal[nft][nftList[i].tokenId];\\n lockedRecords[nft][_sender].remove(nftList[i].tokenId);\\n INFT(nft).transferFrom(address(this), nftList[i].to, nftList[i].tokenId);\\n }\\n }\\n emit UnLock(nft, _sender, saltNonce, nftList);\\n }\\n\\n /**\\n * @dev unlock nft\\n * from game svr only\\n */\\n function unlockWithSvr(address nft, uint256[] calldata tokenIds) external onlyOwner(){\\n require(tokenIds.length <= maxBatch, \\\"tokenIds too many\\\");\\n for (uint256 i = 0; i < tokenIds.length; i++) {\\n address _sender = addressOriginal[nft][tokenIds[i]];\\n delete passportOriginal[nft][tokenIds[i]];\\n delete addressOriginal[nft][tokenIds[i]];\\n lockedRecords[nft][_sender].remove(tokenIds[i]);\\n INFT(nft).transferFrom(address(this), _sender, tokenIds[i]);\\n }\\n }\\n\\n /** ------get------- **/\\n function lockedNum(address token, address user) public view returns (uint256) {\\n return lockedRecords[token][user].length();\\n }\\n\\n function lockedNft(address token, address user) public view returns (uint256[] memory) {\\n return lockedRecords[token][user].values();\\n }\\n\\n function updateBatch(uint256 _maxBatch) external onlyOwner {\\n maxBatch = _maxBatch;\\n }\\n\\n function addSupportNftList(address[] calldata nftList) external onlyOwner {\\n for (uint256 i = 0; i < nftList.length; i++) {\\n supportNftList[nftList[i]] = true;\\n }\\n }\\n function removeSupportNft(address nftAddress) external onlyOwner {\\n require(supportNftList[nftAddress], \\\"can't remove\\\");\\n delete supportNftList[nftAddress];\\n }\\n\\n /**\\n * @dev update verifier address\\n */\\n function updateVerifier(address _verifier) external onlyOwner {\\n require(_verifier != address(0), \\\"NFTClaimer: address can not be zero\\\");\\n verifier = _verifier;\\n emit VerifierUpdated(_verifier);\\n }\\n\\n function getMessageHash(\\n address _to,\\n address _nft,\\n NFTInfo[] memory _ids,\\n address _contract,\\n uint256 _chainId,\\n uint256 _signTime,\\n uint256 _saltNonce\\n ) public pure returns (bytes32) {\\n bytes memory encoded = abi.encodePacked(_to, _nft, _contract, _chainId, _signTime, _saltNonce);\\n for (uint256 i = 0; i < _ids.length; ++i) {\\n encoded = bytes.concat(encoded, abi.encodePacked(_ids[i].tokenId));\\n encoded = bytes.concat(encoded, abi.encodePacked(_ids[i].to));\\n encoded = bytes.concat(encoded, abi.encodePacked(_ids[i].isMint));\\n }\\n return keccak256(encoded);\\n }\\n}\\n\",\"keccak256\":\"0xf7a3f64c423e9d2e4aaf4e6751589c7347e849ac1bd7ec87228ae08baae2cb2e\",\"license\":\"MIT\"},\"contracts/utils/TimeChecker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract TimeChecker is Ownable {\\n uint256 public duration;\\n uint256 public minDuration;\\n\\n event DurationUpdated(uint256 indexed duration);\\n\\n constructor(uint256 _duration) {\\n duration = _duration;\\n minDuration = 30 minutes;\\n }\\n\\n /**\\n * @dev Check if the time is valid\\n */\\n modifier timeValid(uint256 time) {\\n require(\\n time + duration >= block.timestamp,\\n \\\"expired, please send another transaction with new signature\\\"\\n );\\n _;\\n }\\n\\n\\n /**\\n * @dev Change duration value\\n */\\n function updateDuation(uint256 valNew) external onlyOwner {\\n require(valNew > minDuration, \\\"duration too short\\\");\\n duration = valNew;\\n emit DurationUpdated(valNew);\\n }\\n}\\n\",\"keccak256\":\"0xeb1278f24da69d97bd3d0da549e0673fdfa0b319bf4ba2ed6b24fefa870f3af9\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60c0346100fb57601f611c6b38819003918201601f19168301916001600160401b038311848410176101005780849260409485528339810103126100fb5780516020909101516001600160a01b039182821682036100fb576000543360018060a01b0319821617600055604051933391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3600255610708600355600480546064600555466080523060a0526001600160a81b03191660089290921b610100600160a81b0316919091179055611b54908161011782396080518181816109840152610fd7015260a05181818161021b01526109a60152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604081815260048036101561001557600080fd5b600092833560e01c9081630fb5a6b4146112015750806312750292146111c3578063150b7a021461116e578063230fb7fe14610ffa5780632b437d4814610fbf5780632b7ac3f314610f9457806338e2c2eb14610f725780635671576114610f535780635c975abb14610f305780635fb110ca14610ea957806367765b8714610e8a5780636d04319414610e3d578063715018a614610de357806376bd0cfd14610890578063799048fa146108075780637f9d30961461077b5780638da5cb5b1461075357806397fc007c1461068a5780639a14da5814610646578063a0634724146105fd578063bdfe78c9146105b9578063c419028f146103a0578063ce3d1b2d14610313578063d13344c91461024e578063da28b527146102065763f2fde38b1461014157600080fd5b346102025760203660031901126102025761015a61121d565b9061016361141d565b6001600160a01b039182169283156101b057505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b50503461024a578160031936011261024a57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5080fd5b8284346103105781600319360112610310579061026961121d565b91610272611238565b6001600160a01b039384168252600860209081528383209190941682528352818120825181548082529183528483208186019392849190845b8181106102fc57505050816102c19103826112a6565b83519485948186019282875251809352850193925b8281106102e557505050500390f35b8351855286955093810193928101926001016102d6565b8254845292880192600192830192016102ab565b80fd5b50346102025760e03660031901126102025761032d61121d565b610335611238565b91604435906001600160401b03821161039c573660238301121561039c5781602461036593369301359101611368565b93606435906001600160a01b0382168203610310575091602094916103959360c4359360a4359360843593611a0d565b9051908152f35b8580fd5b5034610202576060366003190112610202576103ba61121d565b916103c3611238565b916044356001600160401b03811161039c576103e2903690830161132b565b91909360ff825416610583576103fc6005548411156116e5565b6001600160a01b0390811695610413871515611725565b16928387526020916009835261042e60ff838a205416611725565b875b84811061048d57505080518281529182018390526001600160fb1b038311610489577f356278d4d01db4ac9a53decc4eeeceecfb494d3bd0c463b305d33e65305e2bf29260051b8095828401378133958101030190a480f35b8680fd5b858952600684528289206104a282878a611788565b358a52845282892080546001600160a01b03199081168a17909155868a5260078552838a206104d283888b611788565b358b528552838a2090339082541617905585895260088452828920888a52845261050a838a2061050383888b611788565b35906117c6565b50610516818689611788565b3589873b156103105784516323b872dd60e01b815233858201908152306020820152604081019390935291829081906060010381838b5af180156105795790610565929161056a575b50611763565b610430565b61057390611262565b3861055f565b84513d8c823e3d90fd5b835162461bcd60e51b8152602081840152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b50503461024a578060031936011261024a576020916001600160a01b03908290826105e261121d565b16815260078552818120602435825285522054169051908152f35b50503461024a578060031936011261024a578060209261061b61121d565b610623611238565b6001600160a01b0391821683526008865283832091168252845220549051908152f35b50503461024a578060031936011261024a576020916001600160a01b039082908261066f61121d565b16815260068552818120602435825285522054169051908152f35b5034610202576020366003190112610202576106a461121d565b6106ac61141d565b6001600160a01b03811692831561070557508154610100600160a81b03191660089190911b610100600160a81b03161790557fd24015cc99cc1700cafca3042840a1d8ac1e3964fd2e0e37ea29c654056ee3278280a280f35b5162461bcd60e51b8152602081840152602360248201527f4e4654436c61696d65723a20616464726573732063616e206e6f74206265207a60448201526265726f60e81b6064820152608490fd5b50503461024a578160031936011261024a57905490516001600160a01b039091168152602090f35b50346102025760203660031901126102025780359161079861141d565b6003548311156107cf575050806002557f91abcc2d6823e3a3f11d31b208dd3065d2c6a791f1c7c9fe96a42ce12897eac58280a280f35b906020606492519162461bcd60e51b83528201526012602482015271191d5c985d1a5bdb881d1bdbc81cda1bdc9d60721b6044820152fd5b50346102025760203660031901126102025761082161121d565b61082961141d565b6001600160a01b031680845260096020528284205490919060ff161561085e5750825260096020528120805460ff1916905580f35b606490602084519162461bcd60e51b8352820152600c60248201526b63616e27742072656d6f766560a01b6044820152fd5b5090346102025760a0366003190112610202576108ab61121d565b916024916001600160401b039083358281116104895736602382011215610489578084013590838211610ddf5785810195606091813691848602010111610ddb576044938435946064359760843591888311610dd75736602384011215610dd75782820135988911610dd75784830192858a3692010111610dd757835194898487378986019860ff8760019b8c81526020998a91030190205416610d65576002548101808211610d52574211610ceb57908d8f93928d908f6005548d1115610972906116e5565b8c369061097e92611368565b6109cc937f0000000000000000000000000000000000000000000000000000000000000000917f00000000000000000000000000000000000000000000000000000000000000009133611a0d565b9a87855496366109dd9084836112c7565b9d600160a01b600190039e8f60089a8b1c16916109f992611475565b885182818f86858337868201908152030190205460ff1615610cc8575b505050829998979695995b8d898210610abc57505050505050508285519786890190895286838a01525281870197948a915b848310610a7d578b33898d167f9a5ba7d70cc7e1cd613eb99e6ed8ea301d889773c9d4517218560eee5153803e8c8e038da380f35b90919293948480889b610aa7868b869c3584528d610a9c89830161124e565b16888501520161135b565b151581870152019a0196959493019190610a48565b9a610acd828b839a9b9c9d9e611850565b01358015158103610cc4578f8f9190898f928e8d878b93600014610b6757505050505016610b11838d610b0b8d610b05848489611850565b01611898565b94611850565b3591813b1561048957858f918880948d5196879586946340c10f1960e01b8652168d850152898401525af18015610b5d5790610b52929161056a5750611763565b999897969599610a21565b88513d87823e3d90fd5b8691610b05610bd1928487999a610bd898999c9b169b8c8a528b610b94848a8460069e8f8b522093611850565b358c528552610baa8b8383339220541614611860565b8c8b5260079a8b86528c610bc2858b85852093611850565b3582528652205416958a611850565b1614611860565b8388528b52898720610beb858f85611850565b3588528b5289872080546001600160a01b0319908116909155838852908b52898720610c18858f85611850565b3588528b52898720908154169055818652878a528886203387528a52610c4d8c610c46858c8a209285611850565b35906118ac565b50610c68838d610c628d610b05848488611850565b93611850565b35823b156104895789516323b872dd60e01b815230818a019081526001600160a01b039093166020840152604083019190915291869183919082908490829060600103925af18015610b5d5790610b52929161056a5750611763565b8480fd5b828951938492833781018d815203019020805460ff19168b179055388781610a16565b855162461bcd60e51b8152808501889052603b818401527f657870697265642c20706c656173652073656e6420616e6f7468657220747261818501527f6e73616374696f6e2077697468206e6577207369676e617475726500000000006064820152608490fd5b5050634e487b7160e01b8e52601183528dfd5b855162461bcd60e51b81528085018890526042818401527f7369676e617475726520757365642e20706c656173652073656e6420616e6f74818501527f686572207472616e73616374696f6e2077697468206e6577207369676e617475606482015261726560f01b608482015260a490fd5b8c80fd5b8880fd5b8780fd5b8334610310578060031936011261031057610dfc61141d565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b83823461024a57606036600319011261024a57610e5861121d565b6044356001600160401b038111610e8657610e8392610e799136910161130d565b9060243590611475565b80f35b8380fd5b50503461024a578160031936011261024a576020906005549051908152f35b5090346102025760209182600319360112610e86578035906001600160401b038211610cc457610edb9136910161132b565b9290610ee561141d565b845b848110610ef2578580f35b610f2b906001600160a01b03610f11610f0c838987611788565b611898565b16875260098452848720805460ff19166001179055611763565b610ee7565b5091346103105780600319360112610310575060ff602092541690519015158152f35b50503461024a578160031936011261024a576020906003549051908152f35b83823461024a57602036600319011261024a57610f8d61141d565b3560055580f35b503461020257826003193601126102025754905160089190911c6001600160a01b0316815260209150f35b50503461024a578160031936011261024a57602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b503461020257816003193601126102025761101361121d565b91836024356001600160401b03811161024a57611033903690850161132b565b61103e95919561141d565b61104c6005548211156116e5565b6001600160a01b0391821690835b818110611065578480f35b8285526007602081815287872061107d84868d611788565b358852815285888820541691858852600682528a61109f85878c8c2093611788565b358952825288882080546001600160a01b03199081169091558689529082528888206110cc85878e611788565b35895282528888209081541690558487526008815287872090828852526110fa878720610c4684868d611788565b5061110682848b611788565b3590843b156104895787516323b872dd60e01b8152308a82019081526001600160a01b0390921660208301526040820192909252869082908190606001038183885af18015611164579061115f929161056a5750611763565b61105a565b87513d88823e3d90fd5b5091346103105760803660031901126103105761118961121d565b50611192611238565b50606435906001600160401b03821161031057506020926111b59136910161130d565b5051630a85bd0160e11b8152f35b50503461024a57602036600319011261024a5760209160ff9082906001600160a01b036111ee61121d565b1681526009855220541690519015158152f35b84903461024a578160031936011261024a576020906002548152f35b600435906001600160a01b038216820361123357565b600080fd5b602435906001600160a01b038216820361123357565b35906001600160a01b038216820361123357565b6001600160401b03811161127557604052565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b0382111761127557604052565b90601f801991011681019081106001600160401b0382111761127557604052565b9291926001600160401b03821161127557604051916112f0601f8201601f1916602001846112a6565b829481845281830111611233578281602093846000960137010152565b9080601f8301121561123357816020611328933591016112c7565b90565b9181601f84011215611233578235916001600160401b038311611233576020808501948460051b01011161123357565b3590811515820361123357565b6001600160401b03939284831161127557604090815195602092611391848760051b01896112a6565b83888781520192606080970286019581871161123357935b8685106113ba575050505050505050565b878583031261123357825190888201908282108683111761140857899288928652873581526113ea83890161124e565b838201526113f986890161135b565b868201528152019401936113a9565b60246000634e487b7160e01b81526041600452fd5b6000546001600160a01b0316330361143157565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b906114b7926114af917f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c60002061161e565b929092611504565b6001600160a01b039081169116036114cb57565b60405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606490fd5b600581101561160857806115155750565b600181036115625760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036115af5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003146115b857565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b90604181511460001461164c57611648916020820151906060604084015193015160001a90611656565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116116d95791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156116cc5781516001600160a01b038116156116c6579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b156116ec57565b60405162461bcd60e51b8152602060048201526011602482015270746f6b656e49647320746f6f206d616e7960781b6044820152606490fd5b1561172c57565b60405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081cdd5c1c1bdc9d081b999d608a1b6044820152606490fd5b60001981146117725760010190565b634e487b7160e01b600052601160045260246000fd5b91908110156117985760051b0190565b634e487b7160e01b600052603260045260246000fd5b80548210156117985760005260206000200190600090565b9190600183016000908282528060205260408220541560001461184a5784549468010000000000000000861015611836578361182661180f886001604098999a018555846117ae565b819391549060031b91821b91600019901b19161790565b9055549382526020522055600190565b634e487b7160e01b83526041600452602483fd5b50925050565b9190811015611798576060020190565b1561186757565b60405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606490fd5b356001600160a01b03811681036112335790565b9060018201906000928184528260205260408420549081151560001461199557600019918083018181116119815782549084820191821161196d57808203611938575b505050805480156119245782019161190783836117ae565b909182549160031b1b191690555582526020526040812055600190565b634e487b7160e01b86526031600452602486fd5b61195861194861180f93866117ae565b90549060031b1c928392866117ae565b905586528460205260408620553880806118ef565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b87526011600452602487fd5b5050505090565b80518210156117985760209160051b010190565b9081519160005b8381106119c8575050016000815290565b80602080928401015181850152016119b7565b611a0b906119fd6119f7949360405195869360208501906119b0565b906119b0565b03601f1981018452836112a6565b565b939092919496956040978851926bffffffffffffffffffffffff198095816060988160209b8b1b168b890152891b166034870152871b166048850152605c840152607c830152609c820152609c815260c081018181106001600160401b038211176112755787526000905b8551821015611b0e57611b02611ada611ab3611b0893611a98868b61199c565b5151908c51918a830152898252611aae8261128b565b6119db565b87611abe868b61199c565b51015190868c5192891b168983015260148252611aae8261128b565b89611ae5858a61199c565b5101511515908a519160f81b8883015260018252611aae8261128b565b91611763565b90611a78565b959650505050905081519101209056fea26469706673582212204df81a40146b35145a1aaf317e45e744a017c0c04f6c3c5b83b9ede89338a92f64736f6c63430008130033", + "deployedBytecode": "0x6080604081815260048036101561001557600080fd5b600092833560e01c9081630fb5a6b4146112015750806312750292146111c3578063150b7a021461116e578063230fb7fe14610ffa5780632b437d4814610fbf5780632b7ac3f314610f9457806338e2c2eb14610f725780635671576114610f535780635c975abb14610f305780635fb110ca14610ea957806367765b8714610e8a5780636d04319414610e3d578063715018a614610de357806376bd0cfd14610890578063799048fa146108075780637f9d30961461077b5780638da5cb5b1461075357806397fc007c1461068a5780639a14da5814610646578063a0634724146105fd578063bdfe78c9146105b9578063c419028f146103a0578063ce3d1b2d14610313578063d13344c91461024e578063da28b527146102065763f2fde38b1461014157600080fd5b346102025760203660031901126102025761015a61121d565b9061016361141d565b6001600160a01b039182169283156101b057505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b50503461024a578160031936011261024a57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5080fd5b8284346103105781600319360112610310579061026961121d565b91610272611238565b6001600160a01b039384168252600860209081528383209190941682528352818120825181548082529183528483208186019392849190845b8181106102fc57505050816102c19103826112a6565b83519485948186019282875251809352850193925b8281106102e557505050500390f35b8351855286955093810193928101926001016102d6565b8254845292880192600192830192016102ab565b80fd5b50346102025760e03660031901126102025761032d61121d565b610335611238565b91604435906001600160401b03821161039c573660238301121561039c5781602461036593369301359101611368565b93606435906001600160a01b0382168203610310575091602094916103959360c4359360a4359360843593611a0d565b9051908152f35b8580fd5b5034610202576060366003190112610202576103ba61121d565b916103c3611238565b916044356001600160401b03811161039c576103e2903690830161132b565b91909360ff825416610583576103fc6005548411156116e5565b6001600160a01b0390811695610413871515611725565b16928387526020916009835261042e60ff838a205416611725565b875b84811061048d57505080518281529182018390526001600160fb1b038311610489577f356278d4d01db4ac9a53decc4eeeceecfb494d3bd0c463b305d33e65305e2bf29260051b8095828401378133958101030190a480f35b8680fd5b858952600684528289206104a282878a611788565b358a52845282892080546001600160a01b03199081168a17909155868a5260078552838a206104d283888b611788565b358b528552838a2090339082541617905585895260088452828920888a52845261050a838a2061050383888b611788565b35906117c6565b50610516818689611788565b3589873b156103105784516323b872dd60e01b815233858201908152306020820152604081019390935291829081906060010381838b5af180156105795790610565929161056a575b50611763565b610430565b61057390611262565b3861055f565b84513d8c823e3d90fd5b835162461bcd60e51b8152602081840152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606490fd5b50503461024a578060031936011261024a576020916001600160a01b03908290826105e261121d565b16815260078552818120602435825285522054169051908152f35b50503461024a578060031936011261024a578060209261061b61121d565b610623611238565b6001600160a01b0391821683526008865283832091168252845220549051908152f35b50503461024a578060031936011261024a576020916001600160a01b039082908261066f61121d565b16815260068552818120602435825285522054169051908152f35b5034610202576020366003190112610202576106a461121d565b6106ac61141d565b6001600160a01b03811692831561070557508154610100600160a81b03191660089190911b610100600160a81b03161790557fd24015cc99cc1700cafca3042840a1d8ac1e3964fd2e0e37ea29c654056ee3278280a280f35b5162461bcd60e51b8152602081840152602360248201527f4e4654436c61696d65723a20616464726573732063616e206e6f74206265207a60448201526265726f60e81b6064820152608490fd5b50503461024a578160031936011261024a57905490516001600160a01b039091168152602090f35b50346102025760203660031901126102025780359161079861141d565b6003548311156107cf575050806002557f91abcc2d6823e3a3f11d31b208dd3065d2c6a791f1c7c9fe96a42ce12897eac58280a280f35b906020606492519162461bcd60e51b83528201526012602482015271191d5c985d1a5bdb881d1bdbc81cda1bdc9d60721b6044820152fd5b50346102025760203660031901126102025761082161121d565b61082961141d565b6001600160a01b031680845260096020528284205490919060ff161561085e5750825260096020528120805460ff1916905580f35b606490602084519162461bcd60e51b8352820152600c60248201526b63616e27742072656d6f766560a01b6044820152fd5b5090346102025760a0366003190112610202576108ab61121d565b916024916001600160401b039083358281116104895736602382011215610489578084013590838211610ddf5785810195606091813691848602010111610ddb576044938435946064359760843591888311610dd75736602384011215610dd75782820135988911610dd75784830192858a3692010111610dd757835194898487378986019860ff8760019b8c81526020998a91030190205416610d65576002548101808211610d52574211610ceb57908d8f93928d908f6005548d1115610972906116e5565b8c369061097e92611368565b6109cc937f0000000000000000000000000000000000000000000000000000000000000000917f00000000000000000000000000000000000000000000000000000000000000009133611a0d565b9a87855496366109dd9084836112c7565b9d600160a01b600190039e8f60089a8b1c16916109f992611475565b885182818f86858337868201908152030190205460ff1615610cc8575b505050829998979695995b8d898210610abc57505050505050508285519786890190895286838a01525281870197948a915b848310610a7d578b33898d167f9a5ba7d70cc7e1cd613eb99e6ed8ea301d889773c9d4517218560eee5153803e8c8e038da380f35b90919293948480889b610aa7868b869c3584528d610a9c89830161124e565b16888501520161135b565b151581870152019a0196959493019190610a48565b9a610acd828b839a9b9c9d9e611850565b01358015158103610cc4578f8f9190898f928e8d878b93600014610b6757505050505016610b11838d610b0b8d610b05848489611850565b01611898565b94611850565b3591813b1561048957858f918880948d5196879586946340c10f1960e01b8652168d850152898401525af18015610b5d5790610b52929161056a5750611763565b999897969599610a21565b88513d87823e3d90fd5b8691610b05610bd1928487999a610bd898999c9b169b8c8a528b610b94848a8460069e8f8b522093611850565b358c528552610baa8b8383339220541614611860565b8c8b5260079a8b86528c610bc2858b85852093611850565b3582528652205416958a611850565b1614611860565b8388528b52898720610beb858f85611850565b3588528b5289872080546001600160a01b0319908116909155838852908b52898720610c18858f85611850565b3588528b52898720908154169055818652878a528886203387528a52610c4d8c610c46858c8a209285611850565b35906118ac565b50610c68838d610c628d610b05848488611850565b93611850565b35823b156104895789516323b872dd60e01b815230818a019081526001600160a01b039093166020840152604083019190915291869183919082908490829060600103925af18015610b5d5790610b52929161056a5750611763565b8480fd5b828951938492833781018d815203019020805460ff19168b179055388781610a16565b855162461bcd60e51b8152808501889052603b818401527f657870697265642c20706c656173652073656e6420616e6f7468657220747261818501527f6e73616374696f6e2077697468206e6577207369676e617475726500000000006064820152608490fd5b5050634e487b7160e01b8e52601183528dfd5b855162461bcd60e51b81528085018890526042818401527f7369676e617475726520757365642e20706c656173652073656e6420616e6f74818501527f686572207472616e73616374696f6e2077697468206e6577207369676e617475606482015261726560f01b608482015260a490fd5b8c80fd5b8880fd5b8780fd5b8334610310578060031936011261031057610dfc61141d565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b83823461024a57606036600319011261024a57610e5861121d565b6044356001600160401b038111610e8657610e8392610e799136910161130d565b9060243590611475565b80f35b8380fd5b50503461024a578160031936011261024a576020906005549051908152f35b5090346102025760209182600319360112610e86578035906001600160401b038211610cc457610edb9136910161132b565b9290610ee561141d565b845b848110610ef2578580f35b610f2b906001600160a01b03610f11610f0c838987611788565b611898565b16875260098452848720805460ff19166001179055611763565b610ee7565b5091346103105780600319360112610310575060ff602092541690519015158152f35b50503461024a578160031936011261024a576020906003549051908152f35b83823461024a57602036600319011261024a57610f8d61141d565b3560055580f35b503461020257826003193601126102025754905160089190911c6001600160a01b0316815260209150f35b50503461024a578160031936011261024a57602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b503461020257816003193601126102025761101361121d565b91836024356001600160401b03811161024a57611033903690850161132b565b61103e95919561141d565b61104c6005548211156116e5565b6001600160a01b0391821690835b818110611065578480f35b8285526007602081815287872061107d84868d611788565b358852815285888820541691858852600682528a61109f85878c8c2093611788565b358952825288882080546001600160a01b03199081169091558689529082528888206110cc85878e611788565b35895282528888209081541690558487526008815287872090828852526110fa878720610c4684868d611788565b5061110682848b611788565b3590843b156104895787516323b872dd60e01b8152308a82019081526001600160a01b0390921660208301526040820192909252869082908190606001038183885af18015611164579061115f929161056a5750611763565b61105a565b87513d88823e3d90fd5b5091346103105760803660031901126103105761118961121d565b50611192611238565b50606435906001600160401b03821161031057506020926111b59136910161130d565b5051630a85bd0160e11b8152f35b50503461024a57602036600319011261024a5760209160ff9082906001600160a01b036111ee61121d565b1681526009855220541690519015158152f35b84903461024a578160031936011261024a576020906002548152f35b600435906001600160a01b038216820361123357565b600080fd5b602435906001600160a01b038216820361123357565b35906001600160a01b038216820361123357565b6001600160401b03811161127557604052565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b0382111761127557604052565b90601f801991011681019081106001600160401b0382111761127557604052565b9291926001600160401b03821161127557604051916112f0601f8201601f1916602001846112a6565b829481845281830111611233578281602093846000960137010152565b9080601f8301121561123357816020611328933591016112c7565b90565b9181601f84011215611233578235916001600160401b038311611233576020808501948460051b01011161123357565b3590811515820361123357565b6001600160401b03939284831161127557604090815195602092611391848760051b01896112a6565b83888781520192606080970286019581871161123357935b8685106113ba575050505050505050565b878583031261123357825190888201908282108683111761140857899288928652873581526113ea83890161124e565b838201526113f986890161135b565b868201528152019401936113a9565b60246000634e487b7160e01b81526041600452fd5b6000546001600160a01b0316330361143157565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b906114b7926114af917f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c60002061161e565b929092611504565b6001600160a01b039081169116036114cb57565b60405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606490fd5b600581101561160857806115155750565b600181036115625760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036115af5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003146115b857565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b90604181511460001461164c57611648916020820151906060604084015193015160001a90611656565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116116d95791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156116cc5781516001600160a01b038116156116c6579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b156116ec57565b60405162461bcd60e51b8152602060048201526011602482015270746f6b656e49647320746f6f206d616e7960781b6044820152606490fd5b1561172c57565b60405162461bcd60e51b815260206004820152600f60248201526e1b9bdd081cdd5c1c1bdc9d081b999d608a1b6044820152606490fd5b60001981146117725760010190565b634e487b7160e01b600052601160045260246000fd5b91908110156117985760051b0190565b634e487b7160e01b600052603260045260246000fd5b80548210156117985760005260206000200190600090565b9190600183016000908282528060205260408220541560001461184a5784549468010000000000000000861015611836578361182661180f886001604098999a018555846117ae565b819391549060031b91821b91600019901b19161790565b9055549382526020522055600190565b634e487b7160e01b83526041600452602483fd5b50925050565b9190811015611798576060020190565b1561186757565b60405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606490fd5b356001600160a01b03811681036112335790565b9060018201906000928184528260205260408420549081151560001461199557600019918083018181116119815782549084820191821161196d57808203611938575b505050805480156119245782019161190783836117ae565b909182549160031b1b191690555582526020526040812055600190565b634e487b7160e01b86526031600452602486fd5b61195861194861180f93866117ae565b90549060031b1c928392866117ae565b905586528460205260408620553880806118ef565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b87526011600452602487fd5b5050505090565b80518210156117985760209160051b010190565b9081519160005b8381106119c8575050016000815290565b80602080928401015181850152016119b7565b611a0b906119fd6119f7949360405195869360208501906119b0565b906119b0565b03601f1981018452836112a6565b565b939092919496956040978851926bffffffffffffffffffffffff198095816060988160209b8b1b168b890152891b166034870152871b166048850152605c840152607c830152609c820152609c815260c081018181106001600160401b038211176112755787526000905b8551821015611b0e57611b02611ada611ab3611b0893611a98868b61199c565b5151908c51918a830152898252611aae8261128b565b6119db565b87611abe868b61199c565b51015190868c5192891b168983015260148252611aae8261128b565b89611ae5858a61199c565b5101511515908a519160f81b8883015260018252611aae8261128b565b91611763565b90611a78565b959650505050905081519101209056fea26469706673582212204df81a40146b35145a1aaf317e45e744a017c0c04f6c3c5b83b9ede89338a92f64736f6c63430008130033", + "devdoc": { + "events": { + "Paused(address)": { + "details": "Emitted when the pause is triggered by `account`." + }, + "Unpaused(address)": { + "details": "Emitted when the pause is lifted by `account`." + } + }, + "kind": "dev", + "methods": { + "onERC721Received(address,address,uint256,bytes)": { + "details": "See {IERC721Receiver-onERC721Received}. Always returns `IERC721Receiver.onERC721Received.selector`." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "paused()": { + "details": "Returns true if the contract is paused, and false otherwise." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "unlockOrMint(address,(uint256,address,bool)[],uint256,uint256,bytes)": { + "details": "unlock or mint nft from passport only if tokenId not exists, mint it if exists and user is owner, unlock it" + }, + "unlockWithSvr(address,uint256[])": { + "details": "unlock nft from game svr only" + }, + "updateDuation(uint256)": { + "details": "Change duration value" + }, + "updateVerifier(address)": { + "details": "update verifier address" + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "lock(address,address,uint256[])": { + "notice": "from eoa or passport" + }, + "lockedNum(address,address)": { + "notice": "------get------- *" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2486, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "_usedSignatures", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes_memory_ptr,t_bool)" + }, + { + "astId": 3292, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "duration", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 3294, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "minDuration", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 130, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "_paused", + "offset": 0, + "slot": "4", + "type": "t_bool" + }, + { + "astId": 2598, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "verifier", + "offset": 1, + "slot": "4", + "type": "t_address" + }, + { + "astId": 2601, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "maxBatch", + "offset": 0, + "slot": "5", + "type": "t_uint256" + }, + { + "astId": 2614, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "passportOriginal", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_address))" + }, + { + "astId": 2620, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "addressOriginal", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_address))" + }, + { + "astId": 2627, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "lockedRecords", + "offset": 0, + "slot": "8", + "type": "t_mapping(t_address,t_mapping(t_address,t_struct(UintSet)2344_storage))" + }, + { + "astId": 2631, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "supportNftList", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_address,t_bool)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_bytes32)dyn_storage": { + "base": "t_bytes32", + "encoding": "dynamic_array", + "label": "bytes32[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_bytes_memory_ptr": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_mapping(t_address,t_struct(UintSet)2344_storage))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => struct EnumerableSet.UintSet))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_struct(UintSet)2344_storage)" + }, + "t_mapping(t_address,t_mapping(t_uint256,t_address))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(uint256 => address))", + "numberOfBytes": "32", + "value": "t_mapping(t_uint256,t_address)" + }, + "t_mapping(t_address,t_struct(UintSet)2344_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct EnumerableSet.UintSet)", + "numberOfBytes": "32", + "value": "t_struct(UintSet)2344_storage" + }, + "t_mapping(t_bytes32,t_uint256)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes_memory_ptr,t_bool)": { + "encoding": "mapping", + "key": "t_bytes_memory_ptr", + "label": "mapping(bytes => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_uint256,t_address)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_struct(Set)1872_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.Set", + "members": [ + { + "astId": 1867, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "_values", + "offset": 0, + "slot": "0", + "type": "t_array(t_bytes32)dyn_storage" + }, + { + "astId": 1871, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "_indexes", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes32,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_struct(UintSet)2344_storage": { + "encoding": "inplace", + "label": "struct EnumerableSet.UintSet", + "members": [ + { + "astId": 2343, + "contract": "contracts/game/NFTLock.sol:NFTLock", + "label": "_inner", + "offset": 0, + "slot": "0", + "type": "t_struct(Set)1872_storage" + } + ], + "numberOfBytes": "64" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/imtbl_test/solcInputs/62f20d373cd10a7adc6f55deaeb127c0.json b/deployments/imtbl_test/solcInputs/62f20d373cd10a7adc6f55deaeb127c0.json new file mode 100644 index 0000000..841909f --- /dev/null +++ b/deployments/imtbl_test/solcInputs/62f20d373cd10a7adc6f55deaeb127c0.json @@ -0,0 +1,72 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/security/Pausable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/utils/ERC721Holder.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721Receiver.sol\";\n\n/**\n * @dev Implementation of the {IERC721Receiver} interface.\n *\n * Accepts all token transfers.\n * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.\n */\ncontract ERC721Holder is IERC721Receiver {\n /**\n * @dev See {IERC721Receiver-onERC721Received}.\n *\n * Always returns `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {\n return this.onERC721Received.selector;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Strings.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n enum RecoverError {\n NoError,\n InvalidSignature,\n InvalidSignatureLength,\n InvalidSignatureS,\n InvalidSignatureV // Deprecated in v4.8\n }\n\n function _throwError(RecoverError error) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert(\"ECDSA: invalid signature\");\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert(\"ECDSA: invalid signature length\");\n } else if (error == RecoverError.InvalidSignatureS) {\n revert(\"ECDSA: invalid signature 's' value\");\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature` or error string. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n *\n * Documentation for signature generation:\n * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n if (signature.length == 65) {\n bytes32 r;\n bytes32 s;\n uint8 v;\n // ecrecover takes the signature parameters, and the only way to get them\n // currently is to use assembly.\n /// @solidity memory-safe-assembly\n assembly {\n r := mload(add(signature, 0x20))\n s := mload(add(signature, 0x40))\n v := byte(0, mload(add(signature, 0x60)))\n }\n return tryRecover(hash, v, r, s);\n } else {\n return (address(0), RecoverError.InvalidSignatureLength);\n }\n }\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with\n * `signature`. This address can then be used for verification purposes.\n *\n * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n * this function rejects them by requiring the `s` value to be in the lower\n * half order, and the `v` value to be either 27 or 28.\n *\n * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n * verification to be secure: it is possible to craft signatures that\n * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n * this is by receiving a hash of the original message (which may otherwise\n * be too long), and then calling {toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, signature);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n *\n * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n *\n * _Available since v4.2._\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n * `r` and `s` signature fields separately.\n *\n * _Available since v4.3._\n */\n function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS);\n }\n\n // If the signature is valid (and not malleable), return the signer address\n address signer = ecrecover(hash, v, r, s);\n if (signer == address(0)) {\n return (address(0), RecoverError.InvalidSignature);\n }\n\n return (signer, RecoverError.NoError);\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `v`,\n * `r` and `s` signature fields separately.\n */\n function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n _throwError(error);\n return recovered;\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {\n // 32 is the length in bytes of hash,\n // enforced by the type signature above\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\")\n mstore(0x1c, hash)\n message := keccak256(0x00, 0x3c)\n }\n }\n\n /**\n * @dev Returns an Ethereum Signed Message, created from `s`. This\n * produces hash corresponding to the one signed with the\n * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n * JSON-RPC method as part of EIP-191.\n *\n * See {recover}.\n */\n function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", Strings.toString(s.length), s));\n }\n\n /**\n * @dev Returns an Ethereum Signed Typed Data, created from a\n * `domainSeparator` and a `structHash`. This produces hash corresponding\n * to the one signed with the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n * JSON-RPC method as part of EIP-712.\n *\n * See {recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40)\n mstore(ptr, \"\\x19\\x01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n data := keccak256(ptr, 0x42)\n }\n }\n\n /**\n * @dev Returns an Ethereum Signed Data with intended validator, created from a\n * `validator` and `data` according to the version 0 of EIP-191.\n *\n * See {recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(\"\\x19\\x00\", validator, data));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, \"Math: mulDiv overflow\");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\nimport \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? \"-\" : \"\", toString(SignedMath.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/EnumerableSet.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" + }, + "contracts/core/HasSignature.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\nimport {ECDSA} from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract HasSignature is Ownable {\n mapping(bytes signature => bool status) private _usedSignatures;\n\n function checkSigner(\n address signer,\n bytes32 hash,\n bytes memory signature\n ) public pure {\n bytes32 ethSignedMessageHash = ECDSA.toEthSignedMessageHash(hash);\n\n address recovered = ECDSA.recover(ethSignedMessageHash, signature);\n require(recovered == signer, \"invalid signature\");\n }\n\n modifier signatureValid(bytes calldata signature) {\n require(\n !_usedSignatures[signature],\n \"signature used. please send another transaction with new signature\"\n );\n _;\n }\n\n function _useSignature(bytes calldata signature) internal {\n if (!_usedSignatures[signature]) {\n _usedSignatures[signature] = true;\n }\n }\n}\n" + }, + "contracts/game/NFTLock.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\nimport {ERC721Holder} from \"@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol\";\nimport {EnumerableSet} from \"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\";\nimport {Pausable} from \"@openzeppelin/contracts/security/Pausable.sol\";\nimport {HasSignature} from \"../core/HasSignature.sol\";\nimport {TimeChecker} from \"../utils/TimeChecker.sol\";\n\ninterface INFT {\n function mint(address to, uint256 tokenID) external;\n function transferFrom(address from, address to, uint256 tokenId) external;\n}\n\ncontract NFTLock is ERC721Holder, HasSignature, TimeChecker, Pausable {\n using EnumerableSet for EnumerableSet.UintSet;\n\n uint256 public immutable _CACHED_CHAIN_ID;\n address public immutable _CACHED_THIS;\n address public verifier;\n uint256 public maxBatch = 100;\n\n struct NFTInfo {\n uint256 tokenId;\n address to;\n bool isMint;\n }\n mapping(address nft => mapping(uint256 tokenId => address user)) public passportOriginal;\n mapping(address nft => mapping(uint256 tokenId => address user)) public addressOriginal;\n mapping(address nft => mapping(address user => EnumerableSet.UintSet tokenIdSet)) private lockedRecords;\n mapping(address nft => bool status) public supportNftList;\n\n event UnLock(address indexed nft, address indexed user, uint256 nonce, NFTInfo[] nftList);\n event Lock(address indexed nft, address indexed sender, address indexed to, uint256[] tokenIds);\n event VerifierUpdated(address indexed verifier);\n\n constructor(uint256 _duration, address _verifier) TimeChecker(_duration) {\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_THIS = address(this);\n verifier = _verifier;\n }\n /**\n * from eoa or passport\n */\n function lock(address nft, address to, uint256[] calldata tokenIds) external whenNotPaused{\n require(tokenIds.length <= maxBatch, \"tokenIds too many\");\n require(to != address(0), \"not support nft\");\n require(supportNftList[nft], \"not support nft\");\n address _sender = _msgSender();\n for (uint256 i = 0; i < tokenIds.length; i++) {\n passportOriginal[nft][tokenIds[i]] = to;\n addressOriginal[nft][tokenIds[i]] = _sender;\n lockedRecords[nft][to].add(tokenIds[i]);\n INFT(nft).transferFrom(_sender, address(this), tokenIds[i]);\n }\n emit Lock(nft, _sender, to, tokenIds);\n }\n /**\n * @dev unlock or mint nft\n * from passport only\n * if tokenId not exists, mint it\n * if exists and user is owner, unlock it\n */\n function unlockOrMint(\n address nft,\n NFTInfo[] calldata nftList,\n uint256 signTime,\n uint256 saltNonce,\n bytes calldata signature\n ) external signatureValid(signature) timeValid(signTime) {\n require(nftList.length <= maxBatch, \"tokenIds too many\");\n address _sender = _msgSender();\n bytes32 messageHash = getMessageHash(_sender, nft, nftList, _CACHED_THIS, _CACHED_CHAIN_ID, signTime, saltNonce);\n checkSigner(verifier, messageHash, signature);\n _useSignature(signature);\n for (uint256 i = 0; i < nftList.length; i++) {\n if (nftList[i].isMint) {\n INFT(nft).mint(nftList[i].to, nftList[i].tokenId);\n } else {\n require(passportOriginal[nft][nftList[i].tokenId] == _sender, \"not owner\");\n require(addressOriginal[nft][nftList[i].tokenId] == nftList[i].to, \"not owner\");\n delete passportOriginal[nft][nftList[i].tokenId];\n delete addressOriginal[nft][nftList[i].tokenId];\n lockedRecords[nft][_sender].remove(nftList[i].tokenId);\n INFT(nft).transferFrom(address(this), nftList[i].to, nftList[i].tokenId);\n }\n }\n emit UnLock(nft, _sender, saltNonce, nftList);\n }\n\n /**\n * @dev unlock nft\n * from game svr only\n */\n function unlockWithSvr(address nft, uint256[] calldata tokenIds) external onlyOwner(){\n require(tokenIds.length <= maxBatch, \"tokenIds too many\");\n for (uint256 i = 0; i < tokenIds.length; i++) {\n address _sender = addressOriginal[nft][tokenIds[i]];\n delete passportOriginal[nft][tokenIds[i]];\n delete addressOriginal[nft][tokenIds[i]];\n lockedRecords[nft][_sender].remove(tokenIds[i]);\n INFT(nft).transferFrom(address(this), _sender, tokenIds[i]);\n }\n }\n\n /** ------get------- **/\n function lockedNum(address token, address user) public view returns (uint256) {\n return lockedRecords[token][user].length();\n }\n\n function lockedNft(address token, address user) public view returns (uint256[] memory) {\n return lockedRecords[token][user].values();\n }\n\n function updateBatch(uint256 _maxBatch) external onlyOwner {\n maxBatch = _maxBatch;\n }\n\n function addSupportNftList(address[] calldata nftList) external onlyOwner {\n for (uint256 i = 0; i < nftList.length; i++) {\n supportNftList[nftList[i]] = true;\n }\n }\n function removeSupportNft(address nftAddress) external onlyOwner {\n require(supportNftList[nftAddress], \"can't remove\");\n delete supportNftList[nftAddress];\n }\n\n /**\n * @dev update verifier address\n */\n function updateVerifier(address _verifier) external onlyOwner {\n require(_verifier != address(0), \"NFTClaimer: address can not be zero\");\n verifier = _verifier;\n emit VerifierUpdated(_verifier);\n }\n\n function getMessageHash(\n address _to,\n address _nft,\n NFTInfo[] memory _ids,\n address _contract,\n uint256 _chainId,\n uint256 _signTime,\n uint256 _saltNonce\n ) public pure returns (bytes32) {\n bytes memory encoded = abi.encodePacked(_to, _nft, _contract, _chainId, _signTime, _saltNonce);\n for (uint256 i = 0; i < _ids.length; ++i) {\n encoded = bytes.concat(encoded, abi.encodePacked(_ids[i].tokenId));\n encoded = bytes.concat(encoded, abi.encodePacked(_ids[i].to));\n encoded = bytes.concat(encoded, abi.encodePacked(_ids[i].isMint));\n }\n return keccak256(encoded);\n }\n}\n" + }, + "contracts/utils/TimeChecker.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract TimeChecker is Ownable {\n uint256 public duration;\n uint256 public minDuration;\n\n event DurationUpdated(uint256 indexed duration);\n\n constructor(uint256 _duration) {\n duration = _duration;\n minDuration = 30 minutes;\n }\n\n /**\n * @dev Check if the time is valid\n */\n modifier timeValid(uint256 time) {\n require(\n time + duration >= block.timestamp,\n \"expired, please send another transaction with new signature\"\n );\n _;\n }\n\n\n /**\n * @dev Change duration value\n */\n function updateDuation(uint256 valNew) external onlyOwner {\n require(valNew > minDuration, \"duration too short\");\n duration = valNew;\n emit DurationUpdated(valNew);\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "viaIR": true, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/deployments/imtbl_test/solcInputs/7eceef62c89a38c4c392c8e1623702eb.json b/deployments/imtbl_test/solcInputs/7eceef62c89a38c4c392c8e1623702eb.json deleted file mode 100644 index 3a27b05..0000000 --- a/deployments/imtbl_test/solcInputs/7eceef62c89a38c4c392c8e1623702eb.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/IERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" - }, - "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../extensions/IERC20Permit.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n \"SafeERC20: approve from non-zero to non-zero allowance\"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20Permit token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, \"SafeERC20: permit did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" - }, - "contracts/tools/AirdropToken.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {SafeERC20} from \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport {Ownable} from \"@openzeppelin/contracts/access/Ownable.sol\";\n\ninterface IERC721 {\n function mint(address to, uint256 tokenID) external;\n function transferFrom(address from, address to, uint256 tokenId) external;\n}\n\ncontract AirdropToken is Ownable{\n using SafeERC20 for IERC20;\n mapping(address user => uint256 amount) public failTransferList;\n\n function getSum(uint256[] calldata _arr) public pure returns (uint256 sum) {\n for (uint256 i = 0; i < _arr.length; i++) sum = sum + _arr[i];\n }\n\n function multiTransferETH(address payable[] calldata _addresses, uint256[] calldata _amounts) public payable {\n require(_addresses.length == _amounts.length, \"Lengths of Addresses and Amounts NOT EQUAL\");\n uint256 _amountSum = getSum(_amounts);\n require(msg.value == _amountSum, \"Transfer amount error\");\n for (uint256 i = 0; i < _addresses.length; i++) {\n (bool success, ) = _addresses[i].call{value: _amounts[i]}(\"\");\n if (!success) {\n failTransferList[_addresses[i]] = _amounts[i];\n }\n }\n }\n\n function multiTransferERC20(address _token, address[] calldata _addresses, uint256[] calldata _amounts) external {\n require(_addresses.length == _amounts.length, \"Lengths of Addresses and Amounts NOT EQUAL\");\n IERC20 token = IERC20(_token);\n for (uint256 i; i < _addresses.length; i++) {\n token.safeTransferFrom(msg.sender, _addresses[i], _amounts[i]);\n }\n }\n\n function multiTransferERC721(address _token, address[] calldata _addresses, uint256[] calldata _tokenIds) external {\n require(_addresses.length == _tokenIds.length, \"Lengths of Addresses and TokenIds NOT EQUAL\");\n IERC721 token = IERC721(_token);\n for (uint256 i; i < _addresses.length; i++) {\n token.transferFrom(msg.sender, _addresses[i], _tokenIds[i]);\n }\n }\n\n function multiMintERC721(address _token, address[] calldata _addresses, uint256[] calldata _tokenIds) external onlyOwner(){\n require(_addresses.length == _tokenIds.length, \"Lengths of Addresses and TokenIds NOT EQUAL\");\n IERC721 token = IERC721(_token);\n for (uint256 i; i < _addresses.length; i++) {\n token.mint(_addresses[i], _tokenIds[i]);\n }\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "viaIR": true, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/out/imtbl_test_dev.json b/out/imtbl_test_dev.json index e4aa80b..ae72f2f 100644 --- a/out/imtbl_test_dev.json +++ b/out/imtbl_test_dev.json @@ -11,12 +11,6 @@ "json": "assets/contracts/NFTClaimStage2.json", "address": "0xf45702180314187a3549FEDac3B78349b47ca6A0" }, - { - "name": "NFTLock", - "type": "logic", - "json": "assets/contracts/NFTLock.json", - "address": "0x59e751c2037B710090035B6ea928e0cce80aC03f" - }, { "name": "CFHero", "type": "erc721", @@ -40,5 +34,11 @@ "type": "logic", "json": "assets/contracts/AirdropToken.json", "address": "0x02B244Ba62f84ff518a4797b1859977D1fcdBBA8" + }, + { + "name": "NFTLock", + "type": "logic", + "json": "assets/contracts/NFTLock.json", + "address": "0xc63ed18feE4C3D62b87DfCE5b5F4DafD8905D9B2" } ] \ No newline at end of file diff --git a/test/testNFTLocker.ts b/test/testNFTLocker.ts index 7dc2c88..6d23322 100644 --- a/test/testNFTLocker.ts +++ b/test/testNFTLocker.ts @@ -50,7 +50,7 @@ describe('NFTLock', function() { //@ts-ignore await nftLock.connect(otherAccount).lock(nft.target, owner.address, [tokenId]); expect(await nft.balanceOf(nftLock.target)).to.equal(1); - expect(await nftLock.lockedOriginal(nft.target, tokenId)).to.equal(owner.address); + expect(await nftLock.passportOriginal(nft.target, tokenId)).to.equal(owner.address); expect(await nft.ownerOf(tokenId)).to.equal(nftLock.target); }); @@ -67,13 +67,13 @@ describe('NFTLock', function() { await nftLock.connect(otherAccount).lock(nft.target, owner.address, [tokenId]); const nonce = (Math.random() * 1000) | 0; const now = Date.now() / 1000 | 0; - let localMsgHash = solidityPackedKeccak256(["address", "address", "address", "uint256", "uint256", "uint256", "uint256", "bool"], - [owner.address, nft.target, nftLock.target, chainId, now, nonce, tokenId, false]); + let localMsgHash = solidityPackedKeccak256(["address", "address", "address", "uint256", "uint256", "uint256", "uint256", "address", "bool"], + [owner.address, nft.target, nftLock.target, chainId, now, nonce, tokenId, otherAccount.address, false]); const signature = await owner.signMessage(getBytes(localMsgHash)); //@ts-ignore - await nftLock.unlockOrMint(nft.target, [[tokenId, false]], now, nonce, signature); + await nftLock.unlockOrMint(nft.target, [[tokenId, otherAccount.address, false]], now, nonce, signature); // await nftLock.connect(otherAccount).unlockOrMint(nft.target, [[tokenId, false]], now, nonce, signature); - expect(await nft.ownerOf(tokenId)).to.equal(owner.address); + expect(await nft.ownerOf(tokenId)).to.equal(otherAccount.address); }); it('should mint NFT from lock', async function() { @@ -83,11 +83,11 @@ describe('NFTLock', function() { const nonce = (Math.random() * 1000) | 0; const now = Date.now() / 1000 | 0; - let localMsgHash = solidityPackedKeccak256(["address", "address", "address", "uint256", "uint256", "uint256", "uint256", "bool"], - [otherAccount.address, nft.target, nftLock.target, chainId, now, nonce, tokenId, isMint]); + let localMsgHash = solidityPackedKeccak256(["address", "address", "address", "uint256", "uint256", "uint256", "uint256", "address", "bool"], + [otherAccount.address, nft.target, nftLock.target, chainId, now, nonce, tokenId, otherAccount.address, isMint]); const signature = await owner.signMessage(getBytes(localMsgHash)); //@ts-ignore - await nftLock.connect(otherAccount).unlockOrMint(nft.target, [[tokenId, isMint]], now, nonce, signature); + await nftLock.connect(otherAccount).unlockOrMint(nft.target, [[tokenId, otherAccount.address, isMint]], now, nonce, signature); expect(await nft.ownerOf(tokenId)).to.equal(otherAccount.address); }); @@ -98,14 +98,28 @@ describe('NFTLock', function() { const nonce = (Math.random() * 1000) | 0; const now = Date.now() / 1000 | 0; - let localMsgHash = solidityPackedKeccak256(["address", "address", "address", "uint256", "uint256", "uint256", "uint256", "bool"], - [otherAccount.address, nft.target, nftLock.target, chainId, now, nonce, tokenId, isMint]); + let localMsgHash = solidityPackedKeccak256(["address", "address", "address", "uint256", "uint256", "uint256", "uint256", "address", "bool"], + [otherAccount.address, nft.target, nftLock.target, chainId, now, nonce, tokenId, otherAccount.address, isMint]); const signature = await owner.signMessage(getBytes(localMsgHash)); //@ts-ignore - await expect(nftLock.connect(otherAccount).unlockOrMint(nft.target, [[tokenId, isMint]], now, nonce, signature)).to.be.revertedWith( + await expect(nftLock.connect(otherAccount).unlockOrMint(nft.target, [[tokenId, otherAccount.address, isMint]], now, nonce, signature)).to.be.revertedWith( "ERC721: token already minted" ); }); + + it('should unlock NFT with svr', async function() { + const { nftLock, nft, otherAccount, chainId, owner } = await loadFixture(deployOneContract); + const tokenId = '1001' + // @ts-ignore + await nft.connect(otherAccount).approve(nftLock.target, tokenId); + //@ts-ignore + await nftLock.connect(otherAccount).lock(nft.target, owner.address, [tokenId]); + + //@ts-ignore + await nftLock.unlockWithSvr(nft.target, [tokenId]); + // await nftLock.connect(otherAccount).unlockOrMint(nft.target, [[tokenId, false]], now, nonce, signature); + expect(await nft.ownerOf(tokenId)).to.equal(otherAccount.address); + }); });