diff --git a/.gitignore b/.gitignore index 71abd64..cbaa9a2 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,5 @@ ignition/deployments/chain-31337 .DS_Store /contracts/dist/ /contracts/types/ -openzeppelin \ No newline at end of file +openzeppelin +imtbl \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 0a58f20..b69c7d2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "solidity.compileUsingRemoteVersion": "v0.8.23+commit.f704f362" + "solidity.compileUsingRemoteVersion": "v0.8.19+commit.7dd6d404" } \ No newline at end of file diff --git a/build/contracts/CFNFTGame.json b/build/contracts/CFNFTGame.json new file mode 100644 index 0000000..a12a1c1 --- /dev/null +++ b/build/contracts/CFNFTGame.json @@ -0,0 +1,1339 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "CFNFTGame", + "sourceName": "contracts/tokens/erc721/CFNFTGame.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "owner_", + "type": "address" + }, + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + }, + { + "internalType": "string", + "name": "baseURI_", + "type": "string" + }, + { + "internalType": "string", + "name": "contractURI_", + "type": "string" + }, + { + "internalType": "address", + "name": "operatorAllowlist_", + "type": "address" + }, + { + "internalType": "address", + "name": "royaltyReceiver_", + "type": "address" + }, + { + "internalType": "uint96", + "name": "feeNumerator_", + "type": "uint96" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "AllowlistDoesNotImplementIOperatorAllowlist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "ApproveTargetNotInAllowlist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ApproverNotInAllowlist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "CallerNotInAllowlist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "IImmutableERC721IDAboveThreshold", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "currentOwner", + "type": "address" + } + ], + "name": "IImmutableERC721MismatchedTokenOwner", + "type": "error" + }, + { + "inputs": [], + "name": "IImmutableERC721MismatchedTransferLengths", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "IImmutableERC721NotOwnerOrOperator", + "type": "error" + }, + { + "inputs": [], + "name": "IImmutableERC721SendingToZerothAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "IImmutableERC721TokenAlreadyBurned", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidShortString", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidSignature", + "type": "error" + }, + { + "inputs": [], + "name": "PermitExpired", + "type": "error" + }, + { + "inputs": [], + "name": "SignerCannotBeZerothAddress", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "StringTooLong", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + } + ], + "name": "TransferFromNotInAllowlist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "TransferToNotInAllowlist", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "ApprovalForAll", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "oldRegistry", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newRegistry", + "type": "address" + } + ], + "name": "OperatorAllowlistRegistryUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MINTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "internalType": "struct ImmutableERC721Base.IDBurn[]", + "name": "burns", + "type": "tuple[]" + } + ], + "name": "_safeBurnBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "_totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "baseURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "tokenIDs", + "type": "uint256[]" + } + ], + "name": "burnBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "contractURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAdmins", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "getApproved", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "grantMinterRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isApprovedForAll", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "internalType": "struct ImmutableERC721Base.IDMint[]", + "name": "mintRequests", + "type": "tuple[]" + } + ], + "name": "mintBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "operatorAllowlist", + "outputs": [ + { + "internalType": "contract IOperatorAllowlist", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ownerOf", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "sig", + "type": "bytes" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "revokeMinterRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "salePrice", + "type": "uint256" + } + ], + "name": "royaltyInfo", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "internalType": "struct ImmutableERC721Base.IDBurn[]", + "name": "burns", + "type": "tuple[]" + } + ], + "name": "safeBurnBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenID", + "type": "uint256" + } + ], + "name": "safeMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "internalType": "struct ImmutableERC721Base.IDMint[]", + "name": "mintRequests", + "type": "tuple[]" + } + ], + "name": "safeMintBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address[]", + "name": "tos", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + } + ], + "internalType": "struct ImmutableERC721Base.TransferRequest", + "name": "tr", + "type": "tuple" + } + ], + "name": "safeTransferFromBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "baseURI_", + "type": "string" + } + ], + "name": "setBaseURI", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_contractURI", + "type": "string" + } + ], + "name": "setContractURI", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint96", + "name": "feeNumerator", + "type": "uint96" + } + ], + "name": "setDefaultRoyaltyReceiver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint96", + "name": "feeNumerator", + "type": "uint96" + } + ], + "name": "setNFTRoyaltyReceiver", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "tokenIds", + "type": "uint256[]" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint96", + "name": "feeNumerator", + "type": "uint96" + } + ], + "name": "setNFTRoyaltyReceiverBatch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "tokenURI", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x610160806040523462000aab576200516f803803809162000021828562000ab0565b83398101906101008183031262000aab576200003d8162000ad4565b60208201516001600160401b03811162000aab57836200005f91840162000b0e565b60408301519091906001600160401b03811162000aab57846200008491850162000b0e565b60608401519093906001600160401b03811162000aab5785620000a991830162000b0e565b608082015190956001600160401b03821162000aab57620000cc91830162000b0e565b93620000db60a0830162000ad4565b9260e0620000ec60c0850162000ad4565b930151946001600160601b038616860362000aab5760408051939084016001600160401b03811185821017620006315760405260018452603160f81b602085015281516001600160401b0381116200063157600354600181811c9116801562000aa0575b60208210146200061057601f811162000a3a575b50806020601f8211600114620009b057600091620009a4575b508160011b916000199060031b1c1916176003555b8051906001600160401b038211620006315760045490600182811c9216801562000999575b6020831014620006105781601f84931162000927575b50602090601f831160011462000898576000926200088c575b50508160011b916000199060031b1c1916176004555b620002078162000b69565b61012052620002168362000d11565b6101405260208151910120918260e0526020815191012080610100524660a052604051927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020850152604084015260608301524660808301523060a083015260a082528160c081011060018060401b0360c084011117620006315760c080830160409081528351602094850120608052309091526001600160a01b0390911660008181526000805160206200514f83398151915290935291205462000311919060ff161562000837575b6000805260026020527fac33ff75c19e70fe83507db0d683fd3465c996598dc972688b7ace676c89077b62000e68565b506127106001600160601b03841611620007df576001600160a01b038116156200079a57604080519081018082116001600160401b03909111176200063157604081810181526001600160a01b039283168083526001600160601b0386166020938401526001600160a01b031960a09690961b861617600c55516301ffc9a760e01b81526305a3b80960e01b60048201529290911692919081602481865afa9081156200078e5760009162000745575b50156200073357600054604080516001600160a01b0383168152602081018590527f3edc37a14cc8047c7c8a3f354311efe86c14848efd4e3765a3e1e57eea04ea769190a1161760005581516001600160401b0381116200063157600f54600181811c9116801562000728575b60208210146200061057601f8111620006be575b50602092601f821160011462000653579281929360009262000647575b50508160011b916000199060031b1c191617600f555b80516001600160401b0381116200063157600e54600181811c9116801562000626575b60208210146200061057601f8111620005a6575b50602091601f82116001146200053c5791819260009262000530575b50508160011b916000199060031b1c191617600e555b604051614259908162000ef6823960805181613cc4015260a05181613d7f015260c05181613c8e015260e05181613d1301526101005181613d3901526101205181611758015261014051816117810152f35b015190503880620004c8565b601f19821692600e60005260206000209160005b8581106200058d5750836001951062000573575b505050811b01600e55620004de565b015160001960f88460031b161c1916905538808062000564565b9192602060018192868501518155019401920162000550565b600e6000527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd601f830160051c8101916020841062000605575b601f0160051c01905b818110620005f85750620004ac565b60008155600101620005e9565b9091508190620005e0565b634e487b7160e01b600052602260045260246000fd5b90607f169062000498565b634e487b7160e01b600052604160045260246000fd5b0151905038806200045f565b601f19821693600f60005260206000209160005b868110620006a557508360019596106200068b575b505050811b01600f5562000475565b015160001960f88460031b161c191690553880806200067c565b9192602060018192868501518155019401920162000667565b600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802601f830160051c810191602084106200071d575b601f0160051c01905b81811062000710575062000442565b6000815560010162000701565b9091508190620006f8565b90607f16906200042e565b60405163d6f93fb760e01b8152600490fd5b6020813d60201162000785575b81620007616020938362000ab0565b810103126200078157519081151582036200077e575038620003c1565b80fd5b5080fd5b3d915062000752565b6040513d6000823e3d90fd5b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b60008181526000805160206200514f83398151915260205260408120805460ff19166001179055339082907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4620002e1565b015190503880620001e6565b6004600090815293507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b91905b601f19841685106200090b576001945083601f19811610620008f1575b505050811b01600455620001fc565b015160001960f88460031b161c19169055388080620008e2565b81810151835560209485019460019093019290910190620008c5565b60046000529091507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f840160051c81016020851062000991575b90849392915b601f830160051c8201811062000981575050620001cd565b6000815585945060010162000969565b508062000963565b91607f1691620001b7565b9050830151386200017d565b6003600090815292507fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b905b601f198316841062000a21576001935082601f1981161062000a07575b5050811b0160035562000192565b85015160001960f88460031b161c191690553880620009f9565b85810151825560209384019360019092019101620009dc565b60036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b601f830160051c81016020841062000a98575b601f830160051c8201811062000a8b57505062000164565b6000815560010162000a73565b508062000a73565b90607f169062000150565b600080fd5b601f909101601f19168101906001600160401b038211908210176200063157604052565b51906001600160a01b038216820362000aab57565b60005b83811062000afd5750506000910152565b818101518382015260200162000aec565b81601f8201121562000aab5780516001600160401b03811162000631576040519262000b45601f8301601f19166020018562000ab0565b8184526020828401011162000aab5762000b66916020808501910162000ae9565b90565b80516020908181101562000be75750601f82511162000ba5578082519201519080831062000b9657501790565b82600019910360031b1b161790565b60449062000bd99260405193849263305a27a960e01b84528060048501528251928391826024870152868601910162000ae9565b601f01601f19168101030190fd5b906001600160401b0382116200063157600954926001938481811c9116801562000d06575b838210146200061057601f811162000ccc575b5081601f841160011462000c60575092829391839260009462000c54575b50501b916000199060031b1c19161760095560ff90565b01519250388062000c3d565b919083601f198116600960005284600020946000905b8883831062000cb1575050501062000c97575b505050811b0160095560ff90565b015160001960f88460031b161c1916905538808062000c89565b85870151885590960195948501948793509081019062000c76565b600960005284601f84600020920160051c820191601f860160051c015b82811062000cf957505062000c1f565b6000815501859062000ce9565b90607f169062000c0c565b80516020908181101562000d3e5750601f82511162000ba5578082519201519080831062000b9657501790565b906001600160401b0382116200063157600a54926001938481811c9116801562000e5d575b838210146200061057601f811162000e23575b5081601f841160011462000db7575092829391839260009462000dab575b50501b916000199060031b1c191617600a5560ff90565b01519250388062000d94565b919083601f198116600a60005284600020946000905b8883831062000e08575050501062000dee575b505050811b01600a5560ff90565b015160001960f88460031b161c1916905538808062000de0565b85870151885590960195948501948793509081019062000dcd565b600a60005284601f84600020920160051c820191601f860160051c015b82811062000e5057505062000d76565b6000815501859062000e40565b90607f169062000d63565b9190600183016000908282528060205260408220541560001462000eef578454946801000000000000000086101562000edb576001860180825586101562000ec757836040949596828552602085200155549382526020522055600190565b634e487b7160e01b83526032600452602483fd5b634e487b7160e01b83526041600452602483fd5b5092505056fe6080604052600436101561001257600080fd5b60003560e01c80628ad9461461032c57806301ffc9a71461032757806306fdde0314610322578063081812fc1461031d578063095ea7b314610318578063141a468c1461031357806318160ddd146102dc578063234af0461461030e57806323b872dd14610309578063248a9ca31461030457806329326f29146102ff5780632a55205a146102fa5780632f2ff15d146102f557806331ae450b146102f05780633644e515146102eb57806336568abe146102e65780633dd1eb61146102e15780633e769acd146102a55780633eaaf86b146102dc57806340c10f19146102d757806342842e0e146102d257806342966c68146102cd578063439aed34146102c857806355f804b3146102c35780636352211e146102be57806369e2f0fb146102b95780636c0360eb146102b457806370a08231146102af578063745a41bc146102aa57806374f16a81146102a557806384b0196e146102a0578063885e7a081461029b5780639010d07c1461029657806391d1485414610291578063938e3d7b1461028c57806395d89b41146102875780639e2641a3146102825780639f15d7001461027d578063a144819414610278578063a217fddf14610273578063a22cb4651461026e578063a701281614610269578063b88d4fde14610264578063c87b56dd1461025f578063ca15c8731461025a578063d539139314610255578063d547741f14610250578063e4623c1b1461024b578063e8a3d485146102465763e985e9c51461024157600080fd5b612254565b6121ad565b612175565b612133565b612109565b6120dd565b611ef6565b611ea0565b611e27565b611cc3565b611c9d565b611c3c565b611c13565b611b4f565b611aa8565b6119aa565b611954565b611926565b611835565b61173d565b610fdf565b6116ef565b61162f565b61155b565b611380565b611362565b611276565b611114565b6110cc565b6110a4565b611065565b61077d565b610ea9565b610e13565b610df0565b610d48565b610c12565b610b70565b610b47565b610b18565b6108f5565b6107f9565b610751565b610679565b610638565b610557565b610418565b346104015760031960203682011261040157600435906001600160401b038211610401576060826004019183360301126104015760448201602461037082846126f7565b949050019261037f84846126f7565b919050036103ef57813560005b61039683856126f7565b90508110156103ed576103e8906103ac83610668565b6103e36103c3826103bd89896126f7565b906125b1565b356103cd81610668565b6103db836103bd888a6126f7565b3590856131d3565b6122dd565b61038c565b005b60405163359a1bc360e01b8152600490fd5b600080fd5b6001600160e01b031981160361040157565b346104015760203660031901126104015761046660043561043881610406565b63ffffffff60e01b1663152a902d60e11b811490811561046a575b5060405190151581529081906020820190565b0390f35b635604e22560e01b811491508115610484575b5038610453565b6380ac58cd60e01b8114915081156104ea575b81156104a5575b503861047d565b635a05180f60e01b8114915081156104bf575b503861049e565b637965db0b60e01b8114915081156104d9575b50386104b8565b6301ffc9a760e01b149050386104d2565b635b5e139f60e01b81149150610497565b60005b83811061050e5750506000910152565b81810151838201526020016104fe565b90602091610537815180928185528580860191016104fb565b601f01601f1916010190565b90602061055492818152019061051e565b90565b346104015760008060031936011261063557604051908060035461057a8161148f565b8085529160019180831690811561060b57506001146105b0575b610466856105a4818703826111b9565b60405191829182610543565b9250600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8284106105f35750505081016020016105a482610466610594565b805460208587018101919091529093019281016105d8565b869550610466969350602092506105a494915060ff191682840152151560051b8201019293610594565b80fd5b34610401576020366003190112610401576020610656600435612f21565b6040516001600160a01b039091168152f35b6001600160a01b0381160361040157565b346104015760403660031901126104015760043561069681610668565b6024356106a281612e8c565b916001600160a01b038084169082168114610702576103ed936106cf9133149081156106d4575b50612eaf565b612845565b6001600160a01b0316600090815260086020908152604080832033845290915290205460ff169050386106c9565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b3461040157602036600319011261040157600435600052600b6020526020604060002054604051908152f35b34610401576000366003190112610401576020601054604051908152f35b9181601f84011215610401578235916001600160401b038311610401576020808501948460051b01011161040157565b602060031982011261040157600435906001600160401b038211610401576107f59160040161079b565b9091565b3461040157610807366107cb565b61080f612b25565b6000905b80821061081c57005b6108278282856126d5565b80359361083385610668565b6001600160a01b038516156108b75760208201929060005b61085585856126f7565b9050811015610888576108839061086b88610668565b6103e361087c826103bd89896126f7565b3589612ad0565b61084b565b50945092906108ac6103e3916108a46108b195601054926126f7565b919050612ac3565b601055565b90610813565b6040516331c3e52960e11b8152600490fd5b6060906003190112610401576004356108e181610668565b906024356108ee81610668565b9060443590565b3461040157610903366108c9565b9091610917610912833361341b565b613019565b3233141580610aae575b610a9657803b151580610a23575b610a0057823b151580610970575b61094b57916103ed9261307b565b604051632a67242160e11b81526001600160a01b0384166004820152602490fd5b0390fd5b5060005461098e906001600160a01b03165b6001600160a01b031690565b6040516305a3b80960e01b81526001600160a01b038516600482015290602090829060249082905afa9081156109fb576000916109cd575b501561093d565b6109ee915060203d81116109f4575b6109e681836111b9565b810190612824565b386109c6565b503d6109dc565b612839565b60405163f934453160e01b81526001600160a01b03919091166004820152602490fd5b50600054610a39906001600160a01b0316610982565b6040516305a3b80960e01b81526001600160a01b038316600482015290602090829060249082905afa9081156109fb57600091610a78575b501561092f565b610a90915060203d81116109f4576109e681836111b9565b38610a71565b60405163937db65f60e01b8152336004820152602490fd5b50600054610ac4906001600160a01b0316610982565b6040516305a3b80960e01b815233600482015290602090829060249082905afa9081156109fb57600091610afa575b5015610921565b610b12915060203d81116109f4576109e681836111b9565b38610af3565b346104015760203660031901126104015760043560005260016020526020600160406000200154604051908152f35b34610401576000366003190112610401576000546040516001600160a01b039091168152602090f35b3461040157604036600319011261040157600435600052600d602052604060002060405190610b9e82611163565b546001600160a01b0380821680845260a09290921c60208401529015610c02575b610be3610bdb6001600160601b0360208501511660243561371c565b612710900490565b915160408051929091166001600160a01b031682526020820192909252f35b9050610c0c6136f6565b90610bbf565b3461040157604036600319011261040157600435610c93602435610c3581610668565b610c8e6000938085526001602052610c536001604087200154612cc4565b8085526001602090815260408087206001600160a01b0386166000908152925290205460ff1615610c97576000526002602052604060002090565b613f75565b5080f35b8085526001602090815260408087206001600160a01b038616600090815292529020805460ff19166001179055336001600160a01b038416827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8880a46000526002602052604060002090565b6020908160408183019282815285518094520193019160005b828110610d2b575050505090565b83516001600160a01b031685529381019392810192600101610d1d565b3461040157600080600319360112610635578080526002602081815260409081842054610d74816122b0565b93610d81845195866111b9565b818552601f19610d90836122b0565b013684870137855b828110610dac578451806104668882610d04565b868052818452610dbe8186892061410b565b908651811015610deb576001600160a01b03909116600582901b8701850152610de6906122dd565b610d98565b6122ec565b34610401576000366003190112610401576020610e0b613c8b565b604051908152f35b3461040157604036600319011261040157602435610e3081610668565b336001600160a01b03821603610e4c576103ed90600435612d8c565b60405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608490fd5b3461040157602036600319011261040157600435610ec681610668565b610ece612bf5565b6a4d494e5445525f524f4c4560a81b600081815260016020527f795b5b5b1e8ae2497a426c9e5c94335503b5b2288643072b7dfc82c82389a944549092610c93929091610f1a90612cc4565b8084526001602090815260408086206001600160a01b0385166000908152925290205460ff1615610f84575b506a4d494e5445525f524f4c4560a81b60005260026020527f0618c8fed606ec4a30f6cd86f9ce0ac7f989fe139779c636004b642ae6c4dfc8613f75565b8084526001602081815260408087206001600160a01b03861660008181529190935220805460ff191690921790915533917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8680a438610f46565b3461040157610fed366107cb565b906000905b828210610ffb57005b6110068284836126d5565b803593602082019260005b61101b85856126f7565b905081101561104e576110499061103188610668565b6103e3611042826103bd89896126f7565b3589612692565b611011565b50945092905061105e91506122dd565b9091610ff2565b34610401576040366003190112610401576103ed60043561108581610668565b61108d612b25565b6110986010546122dd565b6010556024359061296b565b34610401576103ed6110b5366108c9565b90604051926110c384611183565b600084526131e6565b34610401576020366003190112610401576103ed6004356125ce565b604435906001600160601b038216820361040157565b602435906001600160601b038216820361040157565b34610401576060366003190112610401576103ed60243561113481610668565b61113c6110e8565b90611145612b25565b60043561378e565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b0382111761117e57604052565b61114d565b602081019081106001600160401b0382111761117e57604052565b60c081019081106001600160401b0382111761117e57604052565b90601f801991011681019081106001600160401b0382111761117e57604052565b604051906111e782611163565b565b6001600160401b03811161117e57601f01601f191660200190565b929192611210826111e9565b9161121e60405193846111b9565b829481845281830111610401578281602093846000960137010152565b602060031982011261040157600435906001600160401b03821161040157806023830112156104015781602461055493600401359101611204565b34610401576112843661123b565b61128c612bf5565b80516001600160401b03811161117e576112b0816112ab600f5461148f565b612754565b602080601f83116001146112ed575081926000926112e2575b5050600019600383901b1c191660019190911b17600f55005b0151905038806112c9565b90601f1983169361130e600f60005260008051602061420483398151915290565b926000905b86821061134a5750508360019510611331575b505050811b01600f55005b015160001960f88460031b161c19169055388080611326565b80600185968294968601518155019501930190611313565b34610401576020366003190112610401576020610656600435612e8c565b346104015760203660031901126104015760043561139d81610668565b6113a5612bf5565b6a4d494e5445525f524f4c4560a81b600081815260016020527f795b5b5b1e8ae2497a426c9e5c94335503b5b2288643072b7dfc82c82389a944549092610c939290916113f190612cc4565b8084526001602090815260408086206001600160a01b0385166000908152925290205460ff16611438575b83526002602052604083206001600160a01b0390911690614056565b8084526001602090815260408086206001600160a01b03851660008181529190935220805460ff191690553390827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8780a461141c565b90600182811c921680156114bf575b60208310146114a957565b634e487b7160e01b600052602260045260246000fd5b91607f169161149e565b600f54600092916114d98261148f565b8082529160019081811690811561153e57506001146114f757505050565b91929350600f600052600080516020614204833981519152916000925b84841061152657505060209250010190565b80546020858501810191909152909301928101611514565b915050602093945060ff929192191683830152151560051b010190565b3461040157600080600319360112610635576040519080600f5461157e8161148f565b8085529160019180831690811561160557506001146115bc575b610466856115a8818703826111b9565b60405191829160208352602083019061051e565b9250600f83526000805160206142048339815191525b8284106115ed5750505081016020016115a882610466611598565b805460208587018101919091529093019281016115d2565b869550610466969350602092506115a894915060ff191682840152151560051b8201019293611598565b346104015760203660031901126104015760043561164c81610668565b6001600160a01b0316801561167d576000526006602052610466604060002054604051918291829190602083019252565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608490fd5b9080601f830112156104015781602061055493359101611204565b346104015760803660031901126104015760043561170c81610668565b606435906001600160401b0382116104015761172f6103ed9236906004016116d4565b906044359060243590612325565b3461040157600080600319360112610635576117e79061177c7f0000000000000000000000000000000000000000000000000000000000000000613dcb565b6117a57f0000000000000000000000000000000000000000000000000000000000000000613ec0565b91604051916117b383611183565b818352604051948594600f60f81b86526117d960209360e08589015260e088019061051e565b90868203604088015261051e565b904660608601523060808601528260a086015284820360c08601528080855193848152019401925b82811061181e57505050500390f35b83518552869550938101939281019260010161180f565b346104015760403660031901126104015760043561185281610668565b61185a6110fe565b90611863612bf5565b61187a6127106001600160601b038416111561372f565b6001600160a01b038116156118e1576118ba6103ed926118aa61189b6111da565b6001600160a01b039094168452565b6001600160601b03166020830152565b805160209091015160a01b6001600160a01b0319166001600160a01b039190911617600c55565b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b346104015760403660031901126104015760043560005260026020526020610656602435604060002061410b565b3461040157604036600319011261040157602060ff61199e60243561197881610668565b6004356000526001845260406000209060018060a01b0316600052602052604060002090565b54166040519015158152f35b34610401576119b83661123b565b6119c0612bf5565b80516001600160401b03811161117e576119e4816119df600e5461148f565b6127b3565b602080601f8311600114611a2157508192600092611a16575b5050600019600383901b1c191660019190911b17600e55005b0151905038806119fd565b90601f19831693611a54600e6000527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd90565b926000905b868210611a905750508360019510611a77575b505050811b01600e55005b015160001960f88460031b161c19169055388080611a6c565b80600185968294968601518155019501930190611a59565b3461040157600080600319360112610635576040519080600454611acb8161148f565b8085529160019180831690811561060b5750600114611af457610466856105a4818703826111b9565b9250600483527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b828410611b375750505081016020016105a482610466610594565b80546020858701810191909152909301928101611b1c565b3461040157611b5d366107cb565b90611b66612b25565b6000905b828210611b7357005b611b7e8284836126d5565b928335611b8a81610668565b6001600160a01b0316156108b757601054916020850192611bab84876126f7565b90508101809111611c0e5760105560005b611bc684876126f7565b9050811015611bf957611bf4906103e3611bdf8861272c565b611bed836103bd898c6126f7565b359061296b565b611bbc565b50935091611c0791506122dd565b9091611b6a565b6122c7565b34610401576040366003190112610401576103ed600435611c3381610668565b60243590612692565b34610401576040366003190112610401576103ed611c98600435611c5f81610668565b602435611c6a612b25565b611c756010546122dd565b60105560405191611c8583611183565b60008352611c93828261296b565b6135f9565b6133fb565b3461040157600036600319011261040157602060405160008152f35b8015150361040157565b3461040157604036600319011261040157600435611ce081610668565b602435611cec81611cb9565b333b151580611dbd575b611da557813b151580611d32575b611d11576103ed91612f5f565b6040516341b8d58160e11b81526001600160a01b0383166004820152602490fd5b50600054611d48906001600160a01b0316610982565b6040516305a3b80960e01b81526001600160a01b038416600482015290602090829060249082905afa9081156109fb57600091611d87575b5015611d04565b611d9f915060203d81116109f4576109e681836111b9565b38611d80565b60405163f6fa4cbd60e01b8152336004820152602490fd5b50600054611dd3906001600160a01b0316610982565b6040516305a3b80960e01b815233600482015290602090829060249082905afa9081156109fb57600091611e09575b5015611cf6565b611e21915060203d81116109f4576109e681836111b9565b38611e02565b34610401576060366003190112610401576004356001600160401b03811161040157611e5790369060040161079b565b9060243590611e6582610668565b611e6d6110e8565b611e75612b25565b60005b848110611e8157005b806103e38386611e95611e9b958a896125b1565b3561378e565b611e78565b3461040157608036600319011261040157600435611ebd81610668565b602435611ec981610668565b606435916001600160401b03831161040157611eec6103ed9336906004016116d4565b91604435916131e6565b3461040157602036600319011261040157600435600081815260056020526040902054611f2d906001600160a01b03161515612e40565b604051611f4481611f3d816114c9565b03826111b9565b8051600090156120c35750600091807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000081818110156120b5575b50506d04ee2d6d415b85acef8100000000808310156120a6575b50662386f26fc1000080831015612097575b506305f5e10080831015612088575b5061271080831015612079575b506064821015612069575b600a8092101561205f575b600190816021611fe8828801613893565b96870101905b612029575b505050506105a46120159161201b610466946040519485936020850190612d75565b90612d75565b03601f1981018352826111b9565b600019019083906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a83530491821561205a57919082611fee565b611ff3565b9260010192611fd7565b9290606460029104910192611fcc565b60049194920491019238611fc1565b60089194920491019238611fb4565b60109194920491019238611fa5565b60209194920491019238611f93565b604095500491503880611f79565b604051610466935091506120d682611183565b81526105a4565b346104015760203660031901126104015760043560005260026020526020604060002054604051908152f35b34610401576000366003190112610401576040516a4d494e5445525f524f4c4560a81b8152602090f35b34610401576040366003190112610401576103ed60243560043561215682610668565b806000526001602052612170600160406000200154612cc4565b612d8c565b3461040157612183366107cb565b9060005b82811061219057005b806103e36121a26121a89386866125b1565b356125ce565b612187565b3461040157600080600319360112610635576040519080600e546121d08161148f565b8085529160019180831690811561160557506001146121f957610466856115a8818703826111b9565b9250600e83527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd5b82841061223c5750505081016020016115a882610466611598565b80546020858701810191909152909301928101612221565b3461040157604036600319011261040157602060ff61199e60043561227881610668565b6024359061228582610668565b60018060a01b03166000526008845260406000209060018060a01b0316600052602052604060002090565b6001600160401b03811161117e5760051b60200190565b634e487b7160e01b600052601160045260246000fd5b6000198114611c0e5760010190565b634e487b7160e01b600052603260045260246000fd5b602081519101519060208110612316575090565b6000199060200360031b1b1690565b9290914281106123d55761233a9083856123e7565b9061234e818361234986612e8c565b612522565b6123ca5782908051604081146000146123b25750612392928161238761237c61238161237c61238d9661416a565b612302565b926141b4565b91613be0565b6124bb565b156123a0576111e791612845565b604051638baa579f60e01b8152600490fd5b9091506041036123a05761238d839161239293613a57565b50506111e791612845565b60405163068568f360e21b8152600490fd5b916040519060208201660a0cae4dad2e8560cb1b81527f61646472657373207370656e6465722c75696e7432353620746f6b656e49642c60278401527f75696e74323536206e6f6e63652c75696e7432353620646561646c696e65290060478401526046835260808301928084106001600160401b0385111761117e57610554956101209285604052825190209580600052600b6020526040600020549160a0840197885260018060a01b031660c084015260e0830152610100820152015260a081526124b38161119e565b519020613da5565b6001600160a01b03811615159190826124d357505090565b610554925061341b565b3d15612508573d906124ee826111e9565b916124fc60405193846111b9565b82523d6000602084013e565b606090565b90816020910312610401575161055481610406565b6000919290829160405161255a8161201b6020820194630b135d3f60e11b998a8752602484015260406044840152606483019061051e565b51915afa6125666124dd565b90806125a6575b612579575b5050600090565b61259463ffffffff60e01b916020808251830101910161250d565b16146125a1573880612572565b600190565b50602081511461256d565b9190811015610deb5760051b0190565b8015611c0e576000190190565b6125db610912823361341b565b6125e481612e8c565b50600160ff60406125f484612e8c565b84600080928282526007602052848220906001600160601b0360a01b91828154169055878060a01b03169081835260066020528583206000198154019055612646846000526005602052604060002090565b9081541690557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a48460081c815260116020522092161b81541790556111e76108ac6010546125c1565b6001600160a01b03806126a484612e8c565b16911681036126b757506111e7906125ce565b6044925060405191634fefd56160e01b835260048301526024820152fd5b9190811015610deb5760051b81013590603e1981360301821215610401570190565b903590601e198136030182121561040157018035906001600160401b03821161040157602001918160051b3603831361040157565b3561055481610668565b916127509183549060031b91821b91600019901b19161790565b9055565b601f8111612760575050565b600090600f8252600080516020614204833981519152906020601f850160051c830194106127a9575b601f0160051c01915b82811061279e57505050565b818155600101612792565b9092508290612789565b601f81116127bf575050565b600090600e82527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd906020601f850160051c8301941061281a575b601f0160051c01915b82811061280f57505050565b818155600101612803565b90925082906127fa565b90816020910312610401575161055481611cb9565b6040513d6000823e3d90fd5b9190333b151580612901575b611da557823b15158061288e575b61286d576111e79192613539565b6040516341b8d58160e11b81526001600160a01b0384166004820152602490fd5b506000546128a4906001600160a01b0316610982565b6040516305a3b80960e01b81526001600160a01b038516600482015290602090829060249082905afa9081156109fb576000916128e3575b501561285f565b6128fb915060203d81116109f4576109e681836111b9565b386128dc565b50600054612917906001600160a01b0316610982565b6040516305a3b80960e01b815233600482015290602090829060249082905afa9081156109fb5760009161294d575b5015612851565b612965915060203d81116109f4576109e681836111b9565b38612946565b61298e8260ff6001918060081c6000526011602052161b60406000205416151590565b612aaa576001600160a01b038116908115612a6657600083815260056020526040902054612a3e91906129ca906001600160a01b031615613493565b6000848152600560205260409020546129ec906001600160a01b031615613493565b6001600160a01b038116600090815260066020526040902060018154019055612a1f846000526005602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b60007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4565b606460405162461bcd60e51b815260206004820152602060248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b6040516305dcda1160e51b815260048101839052602490fd5b91908201809211611c0e57565b90612af48160ff6001918060081c6000526011602052161b60406000205416151590565b612b0d576111e791611c989160405191611c8583611183565b602490604051906305dcda1160e51b82526004820152fd5b3360009081527f795b5b5b1e8ae2497a426c9e5c94335503b5b2288643072b7dfc82c82389a943602052604090205460ff1615612b5e57565b61096c6048612bdd612b6f3361393e565b61201b612b7a6139d8565b6040519485937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000006020860152612bba8151809260206037890191016104fb565b84017001034b99036b4b9b9b4b733903937b6329607d1b60378201520190612d75565b60405162461bcd60e51b815291829160048301610543565b3360009081527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460019060ff1615612c325750565b612c3b3361393e565b6000612c45613868565b926030612c51856138c5565b536078612c5d856138d2565b536041905b808211612c805761096c6048612bdd8661201b89612b7a89156138f3565b9091600f8116906010821015610deb57612cbe916f181899199a1a9b1b9c1cb0b131b232b360811b901a612cb485886138e2565b5360041c926125c1565b90612c62565b60008181526001602081815260408084203385529091529091205490919060ff1615612cee575050565b612cf73361393e565b90612d00613868565b926030612d0c856138c5565b536078612d18856138d2565b536041905b808211612d3b5761096c6048612bdd8661201b89612b7a89156138f3565b9091600f8116906010821015610deb57612d6f916f181899199a1a9b1b9c1cb0b131b232b360811b901a612cb485886138e2565b90612d1d565b90612d88602092828151948592016104fb565b0190565b906040612dde92600090808252600160205260ff612dbe858585209060018060a01b0316600052602052604060002090565b5416612de1575b81526002602052206001600160a01b0390911690614056565b50565b808252600160209081528383206001600160a01b0386166000908152915260409020805460ff19169055336001600160a01b038516827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a4612dc5565b15612e4757565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b6000908152600560205260409020546001600160a01b0316610554811515612e40565b15612eb657565b60405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608490fd5b600081815260056020526040902054612f44906001600160a01b03161515612e40565b6000908152600760205260409020546001600160a01b031690565b6001600160a01b0381169190338314612fd4573360009081526008602090815260408083206001600160a01b039094168352929052209015159060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3565b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b1561302057565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b6130b99083600052600b602052604060002061309781546122dd565b90556130a284612e8c565b6001600160a01b03828116939091821684146134df565b83169283156131825761312061315b926130df856130d96109828a612e8c565b146134df565b6131066130f6886000526007602052604060002090565b80546001600160a01b0319169055565b6001600160a01b0316600090815260066020526040902090565b80546000190190556001600160a01b038116600090815260066020526040902060018154019055612a1f856000526005602052604060002090565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b90916111e792604051926110c384611183565b6131f3610912843361341b565b323314158061333e575b610a9657803b1515806132cb575b610a0057813b151580613258575b61323757918183613232836111e79795611c989761307b565b6136ba565b604051632a67242160e11b81526001600160a01b0383166004820152602490fd5b5060005461326e906001600160a01b0316610982565b6040516305a3b80960e01b81526001600160a01b038416600482015290602090829060249082905afa9081156109fb576000916132ad575b5015613219565b6132c5915060203d81116109f4576109e681836111b9565b386132a6565b506000546132e1906001600160a01b0316610982565b6040516305a3b80960e01b81526001600160a01b038316600482015290602090829060249082905afa9081156109fb57600091613320575b501561320b565b613338915060203d81116109f4576109e681836111b9565b38613319565b50600054613354906001600160a01b0316610982565b6040516305a3b80960e01b815233600482015290602090829060249082905afa9081156109fb5760009161338a575b50156131fd565b6133a2915060203d81116109f4576109e681836111b9565b38613383565b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b1561340257565b60405162461bcd60e51b81528061096c600482016133a8565b6001600160a01b038061342d84612e8c565b169281831692848414948515613463575b5050831561344d575b50505090565b61345991929350612f21565b1614388080613447565b60009081526008602090815260408083206001600160a01b03949094168352929052205460ff169350388061343e565b1561349a57565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b156134e657565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b600082815260076020526040902080546001600160a01b0319166001600160a01b0383161790556001600160a01b038061357284612e8c565b169116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4565b610554939260809260018060a01b03168252600060208301526040820152816060820152019061051e565b6001600160a01b0391821681529116602082015260408101919091526080606082018190526105549291019061051e565b909190803b156136b25761362b602091600093604051948580948193630a85bd0160e11b998a8452336004850161359d565b03926001600160a01b03165af160009181613682575b506136745761364e6124dd565b8051908161366f5760405162461bcd60e51b81528061096c600482016133a8565b602001fd5b6001600160e01b0319161490565b6136a491925060203d81116136ab575b61369c81836111b9565b81019061250d565b9038613641565b503d613692565b505050600190565b92909190823b156136ed5761362b926020926000604051809681958294630a85bd0160e11b9a8b855233600486016135c8565b50505050600190565b6040519061370382611163565b600c546001600160a01b038116835260a01c6020830152565b81810292918115918404141715611c0e57565b1561373657565b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b916001600160601b03166137a661271082111561372f565b6001600160a01b0391821692831561380a57604051936137c585611163565b845260208085019283526000918252600d9052604090209251835491519083166001600160a01b03166001600160a01b03199283161790921660a09290921b16179055565b60405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606490fd5b6040519061385c82611163565b60208083523683820137565b60405190608082018281106001600160401b0382111761117e57604052604282526060366020840137565b9061389d826111e9565b6138aa60405191826111b9565b82815280926138bb601f19916111e9565b0190602036910137565b805115610deb5760200190565b805160011015610deb5760210190565b908151811015610deb570160200190565b156138fa57565b606460405162461bcd60e51b815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b60405190606082018281106001600160401b0382111761117e57604052602a825260403660208401376030613972836138c5565b53607861397e836138d2565b536029905b60018211613996576105549150156138f3565b600f8116906010821015610deb576139d2916f181899199a1a9b1b9c1cb0b131b232b360811b901a6139c884866138e2565b5360041c916125c1565b90613983565b6a4d494e5445525f524f4c4560a81b6139ef613868565b9060306139fb836138c5565b536078613a07836138d2565b536041905b60018211613a1f576105549150156138f3565b600f8116906010821015610deb57613a51916f181899199a1a9b1b9c1cb0b131b232b360811b901a6139c884866138e2565b90613a0c565b61055491613a6491613bac565b919091613a8c565b60051115613a7657565b634e487b7160e01b600052602160045260246000fd5b613a9581613a6c565b80613a9d5750565b613aa681613a6c565b60018103613af35760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b613afc81613a6c565b60028103613b495760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b80613b55600392613a6c565b14613b5c57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b906041815114600014613bd6576107f5916020820151906060604084015193015160001a90613c09565b5050600090600290565b91908160ff1c90601b8201809211611c0e5761055493613a64936001600160ff1b03169260ff16905b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311613c7f5791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156109fb5781516001600160a01b03811615613c79579190565b50600190565b50505050600090600390565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161480613d7c575b15613ce6577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a08152613d768161119e565b51902090565b507f00000000000000000000000000000000000000000000000000000000000000004614613cbd565b604290613db0613c8b565b906040519161190160f01b8352600283015260228201522090565b60ff8114613e055760ff811690601f8211613df357613de861384f565b918252602082015290565b604051632cd44ac360e21b8152600490fd5b50604051600954816000613e188361148f565b80835292600190818116908115613e9e5750600114613e3f575b50610554925003826111b9565b6009600090815291507f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af5b848310613e835750610554935050810160200138613e32565b81935090816020925483858901015201910190918492613e6a565b90506020925061055494915060ff191682840152151560051b82010138613e32565b60ff8114613edd5760ff811690601f8211613df357613de861384f565b50604051600a54816000613ef08361148f565b80835292600190818116908115613e9e5750600114613f165750610554925003826111b9565b600a600090815291507fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a85b848310613f5a5750610554935050810160200138613e32565b81935090816020925483858901015201910190918492613f41565b610554916001600160a01b031690613fa0565b8054821015610deb5760005260206000200190600090565b600181019082600052816020526040600020541560001461400e5780546801000000000000000081101561117e57613ff9613fe2826001879401855584613f88565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b505050600090565b805490811561404057600019918201916140308383613f88565b909182549160031b1b1916905555565b634e487b7160e01b600052603160045260246000fd5b6001810191806000528260205260406000205492831515600014614102576000199284840190858211611c0e578054948501948511611c0e5760009585836140aa946140b998036140bf575b505050614016565b90600052602052604060002090565b55600190565b6140e96140e3916140d36140f99487613f88565b90549060031b1c92839187613f88565b90612736565b8590600052602052604060002090565b553880806140a2565b50505050600090565b9061411591613f88565b905460039190911b1c6001600160a01b031690565b1561413157565b60405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606490fd5b60209061417a828251101561412a565b604051918083019181604085019101905b8084106141a35750508252601f01601f191660405290565b81518452928201929082019061418b565b6141c260608251101561412a565b60405190602090818301916040606085019201915b8084106141f25750505060408252601f801991011660405290565b8251845292810192918101916141d756fe8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802a2646970667358221220b0d7e5994c9fab21ddf9da45501a787d67e2f387de8f629b504c33331ecb647964736f6c63430008130033a6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49", + "deployedBytecode": "0x6080604052600436101561001257600080fd5b60003560e01c80628ad9461461032c57806301ffc9a71461032757806306fdde0314610322578063081812fc1461031d578063095ea7b314610318578063141a468c1461031357806318160ddd146102dc578063234af0461461030e57806323b872dd14610309578063248a9ca31461030457806329326f29146102ff5780632a55205a146102fa5780632f2ff15d146102f557806331ae450b146102f05780633644e515146102eb57806336568abe146102e65780633dd1eb61146102e15780633e769acd146102a55780633eaaf86b146102dc57806340c10f19146102d757806342842e0e146102d257806342966c68146102cd578063439aed34146102c857806355f804b3146102c35780636352211e146102be57806369e2f0fb146102b95780636c0360eb146102b457806370a08231146102af578063745a41bc146102aa57806374f16a81146102a557806384b0196e146102a0578063885e7a081461029b5780639010d07c1461029657806391d1485414610291578063938e3d7b1461028c57806395d89b41146102875780639e2641a3146102825780639f15d7001461027d578063a144819414610278578063a217fddf14610273578063a22cb4651461026e578063a701281614610269578063b88d4fde14610264578063c87b56dd1461025f578063ca15c8731461025a578063d539139314610255578063d547741f14610250578063e4623c1b1461024b578063e8a3d485146102465763e985e9c51461024157600080fd5b612254565b6121ad565b612175565b612133565b612109565b6120dd565b611ef6565b611ea0565b611e27565b611cc3565b611c9d565b611c3c565b611c13565b611b4f565b611aa8565b6119aa565b611954565b611926565b611835565b61173d565b610fdf565b6116ef565b61162f565b61155b565b611380565b611362565b611276565b611114565b6110cc565b6110a4565b611065565b61077d565b610ea9565b610e13565b610df0565b610d48565b610c12565b610b70565b610b47565b610b18565b6108f5565b6107f9565b610751565b610679565b610638565b610557565b610418565b346104015760031960203682011261040157600435906001600160401b038211610401576060826004019183360301126104015760448201602461037082846126f7565b949050019261037f84846126f7565b919050036103ef57813560005b61039683856126f7565b90508110156103ed576103e8906103ac83610668565b6103e36103c3826103bd89896126f7565b906125b1565b356103cd81610668565b6103db836103bd888a6126f7565b3590856131d3565b6122dd565b61038c565b005b60405163359a1bc360e01b8152600490fd5b600080fd5b6001600160e01b031981160361040157565b346104015760203660031901126104015761046660043561043881610406565b63ffffffff60e01b1663152a902d60e11b811490811561046a575b5060405190151581529081906020820190565b0390f35b635604e22560e01b811491508115610484575b5038610453565b6380ac58cd60e01b8114915081156104ea575b81156104a5575b503861047d565b635a05180f60e01b8114915081156104bf575b503861049e565b637965db0b60e01b8114915081156104d9575b50386104b8565b6301ffc9a760e01b149050386104d2565b635b5e139f60e01b81149150610497565b60005b83811061050e5750506000910152565b81810151838201526020016104fe565b90602091610537815180928185528580860191016104fb565b601f01601f1916010190565b90602061055492818152019061051e565b90565b346104015760008060031936011261063557604051908060035461057a8161148f565b8085529160019180831690811561060b57506001146105b0575b610466856105a4818703826111b9565b60405191829182610543565b9250600383527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8284106105f35750505081016020016105a482610466610594565b805460208587018101919091529093019281016105d8565b869550610466969350602092506105a494915060ff191682840152151560051b8201019293610594565b80fd5b34610401576020366003190112610401576020610656600435612f21565b6040516001600160a01b039091168152f35b6001600160a01b0381160361040157565b346104015760403660031901126104015760043561069681610668565b6024356106a281612e8c565b916001600160a01b038084169082168114610702576103ed936106cf9133149081156106d4575b50612eaf565b612845565b6001600160a01b0316600090815260086020908152604080832033845290915290205460ff169050386106c9565b60405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608490fd5b3461040157602036600319011261040157600435600052600b6020526020604060002054604051908152f35b34610401576000366003190112610401576020601054604051908152f35b9181601f84011215610401578235916001600160401b038311610401576020808501948460051b01011161040157565b602060031982011261040157600435906001600160401b038211610401576107f59160040161079b565b9091565b3461040157610807366107cb565b61080f612b25565b6000905b80821061081c57005b6108278282856126d5565b80359361083385610668565b6001600160a01b038516156108b75760208201929060005b61085585856126f7565b9050811015610888576108839061086b88610668565b6103e361087c826103bd89896126f7565b3589612ad0565b61084b565b50945092906108ac6103e3916108a46108b195601054926126f7565b919050612ac3565b601055565b90610813565b6040516331c3e52960e11b8152600490fd5b6060906003190112610401576004356108e181610668565b906024356108ee81610668565b9060443590565b3461040157610903366108c9565b9091610917610912833361341b565b613019565b3233141580610aae575b610a9657803b151580610a23575b610a0057823b151580610970575b61094b57916103ed9261307b565b604051632a67242160e11b81526001600160a01b0384166004820152602490fd5b0390fd5b5060005461098e906001600160a01b03165b6001600160a01b031690565b6040516305a3b80960e01b81526001600160a01b038516600482015290602090829060249082905afa9081156109fb576000916109cd575b501561093d565b6109ee915060203d81116109f4575b6109e681836111b9565b810190612824565b386109c6565b503d6109dc565b612839565b60405163f934453160e01b81526001600160a01b03919091166004820152602490fd5b50600054610a39906001600160a01b0316610982565b6040516305a3b80960e01b81526001600160a01b038316600482015290602090829060249082905afa9081156109fb57600091610a78575b501561092f565b610a90915060203d81116109f4576109e681836111b9565b38610a71565b60405163937db65f60e01b8152336004820152602490fd5b50600054610ac4906001600160a01b0316610982565b6040516305a3b80960e01b815233600482015290602090829060249082905afa9081156109fb57600091610afa575b5015610921565b610b12915060203d81116109f4576109e681836111b9565b38610af3565b346104015760203660031901126104015760043560005260016020526020600160406000200154604051908152f35b34610401576000366003190112610401576000546040516001600160a01b039091168152602090f35b3461040157604036600319011261040157600435600052600d602052604060002060405190610b9e82611163565b546001600160a01b0380821680845260a09290921c60208401529015610c02575b610be3610bdb6001600160601b0360208501511660243561371c565b612710900490565b915160408051929091166001600160a01b031682526020820192909252f35b9050610c0c6136f6565b90610bbf565b3461040157604036600319011261040157600435610c93602435610c3581610668565b610c8e6000938085526001602052610c536001604087200154612cc4565b8085526001602090815260408087206001600160a01b0386166000908152925290205460ff1615610c97576000526002602052604060002090565b613f75565b5080f35b8085526001602090815260408087206001600160a01b038616600090815292529020805460ff19166001179055336001600160a01b038416827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8880a46000526002602052604060002090565b6020908160408183019282815285518094520193019160005b828110610d2b575050505090565b83516001600160a01b031685529381019392810192600101610d1d565b3461040157600080600319360112610635578080526002602081815260409081842054610d74816122b0565b93610d81845195866111b9565b818552601f19610d90836122b0565b013684870137855b828110610dac578451806104668882610d04565b868052818452610dbe8186892061410b565b908651811015610deb576001600160a01b03909116600582901b8701850152610de6906122dd565b610d98565b6122ec565b34610401576000366003190112610401576020610e0b613c8b565b604051908152f35b3461040157604036600319011261040157602435610e3081610668565b336001600160a01b03821603610e4c576103ed90600435612d8c565b60405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608490fd5b3461040157602036600319011261040157600435610ec681610668565b610ece612bf5565b6a4d494e5445525f524f4c4560a81b600081815260016020527f795b5b5b1e8ae2497a426c9e5c94335503b5b2288643072b7dfc82c82389a944549092610c93929091610f1a90612cc4565b8084526001602090815260408086206001600160a01b0385166000908152925290205460ff1615610f84575b506a4d494e5445525f524f4c4560a81b60005260026020527f0618c8fed606ec4a30f6cd86f9ce0ac7f989fe139779c636004b642ae6c4dfc8613f75565b8084526001602081815260408087206001600160a01b03861660008181529190935220805460ff191690921790915533917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8680a438610f46565b3461040157610fed366107cb565b906000905b828210610ffb57005b6110068284836126d5565b803593602082019260005b61101b85856126f7565b905081101561104e576110499061103188610668565b6103e3611042826103bd89896126f7565b3589612692565b611011565b50945092905061105e91506122dd565b9091610ff2565b34610401576040366003190112610401576103ed60043561108581610668565b61108d612b25565b6110986010546122dd565b6010556024359061296b565b34610401576103ed6110b5366108c9565b90604051926110c384611183565b600084526131e6565b34610401576020366003190112610401576103ed6004356125ce565b604435906001600160601b038216820361040157565b602435906001600160601b038216820361040157565b34610401576060366003190112610401576103ed60243561113481610668565b61113c6110e8565b90611145612b25565b60043561378e565b634e487b7160e01b600052604160045260246000fd5b604081019081106001600160401b0382111761117e57604052565b61114d565b602081019081106001600160401b0382111761117e57604052565b60c081019081106001600160401b0382111761117e57604052565b90601f801991011681019081106001600160401b0382111761117e57604052565b604051906111e782611163565b565b6001600160401b03811161117e57601f01601f191660200190565b929192611210826111e9565b9161121e60405193846111b9565b829481845281830111610401578281602093846000960137010152565b602060031982011261040157600435906001600160401b03821161040157806023830112156104015781602461055493600401359101611204565b34610401576112843661123b565b61128c612bf5565b80516001600160401b03811161117e576112b0816112ab600f5461148f565b612754565b602080601f83116001146112ed575081926000926112e2575b5050600019600383901b1c191660019190911b17600f55005b0151905038806112c9565b90601f1983169361130e600f60005260008051602061420483398151915290565b926000905b86821061134a5750508360019510611331575b505050811b01600f55005b015160001960f88460031b161c19169055388080611326565b80600185968294968601518155019501930190611313565b34610401576020366003190112610401576020610656600435612e8c565b346104015760203660031901126104015760043561139d81610668565b6113a5612bf5565b6a4d494e5445525f524f4c4560a81b600081815260016020527f795b5b5b1e8ae2497a426c9e5c94335503b5b2288643072b7dfc82c82389a944549092610c939290916113f190612cc4565b8084526001602090815260408086206001600160a01b0385166000908152925290205460ff16611438575b83526002602052604083206001600160a01b0390911690614056565b8084526001602090815260408086206001600160a01b03851660008181529190935220805460ff191690553390827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8780a461141c565b90600182811c921680156114bf575b60208310146114a957565b634e487b7160e01b600052602260045260246000fd5b91607f169161149e565b600f54600092916114d98261148f565b8082529160019081811690811561153e57506001146114f757505050565b91929350600f600052600080516020614204833981519152916000925b84841061152657505060209250010190565b80546020858501810191909152909301928101611514565b915050602093945060ff929192191683830152151560051b010190565b3461040157600080600319360112610635576040519080600f5461157e8161148f565b8085529160019180831690811561160557506001146115bc575b610466856115a8818703826111b9565b60405191829160208352602083019061051e565b9250600f83526000805160206142048339815191525b8284106115ed5750505081016020016115a882610466611598565b805460208587018101919091529093019281016115d2565b869550610466969350602092506115a894915060ff191682840152151560051b8201019293611598565b346104015760203660031901126104015760043561164c81610668565b6001600160a01b0316801561167d576000526006602052610466604060002054604051918291829190602083019252565b60405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608490fd5b9080601f830112156104015781602061055493359101611204565b346104015760803660031901126104015760043561170c81610668565b606435906001600160401b0382116104015761172f6103ed9236906004016116d4565b906044359060243590612325565b3461040157600080600319360112610635576117e79061177c7f0000000000000000000000000000000000000000000000000000000000000000613dcb565b6117a57f0000000000000000000000000000000000000000000000000000000000000000613ec0565b91604051916117b383611183565b818352604051948594600f60f81b86526117d960209360e08589015260e088019061051e565b90868203604088015261051e565b904660608601523060808601528260a086015284820360c08601528080855193848152019401925b82811061181e57505050500390f35b83518552869550938101939281019260010161180f565b346104015760403660031901126104015760043561185281610668565b61185a6110fe565b90611863612bf5565b61187a6127106001600160601b038416111561372f565b6001600160a01b038116156118e1576118ba6103ed926118aa61189b6111da565b6001600160a01b039094168452565b6001600160601b03166020830152565b805160209091015160a01b6001600160a01b0319166001600160a01b039190911617600c55565b60405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606490fd5b346104015760403660031901126104015760043560005260026020526020610656602435604060002061410b565b3461040157604036600319011261040157602060ff61199e60243561197881610668565b6004356000526001845260406000209060018060a01b0316600052602052604060002090565b54166040519015158152f35b34610401576119b83661123b565b6119c0612bf5565b80516001600160401b03811161117e576119e4816119df600e5461148f565b6127b3565b602080601f8311600114611a2157508192600092611a16575b5050600019600383901b1c191660019190911b17600e55005b0151905038806119fd565b90601f19831693611a54600e6000527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd90565b926000905b868210611a905750508360019510611a77575b505050811b01600e55005b015160001960f88460031b161c19169055388080611a6c565b80600185968294968601518155019501930190611a59565b3461040157600080600319360112610635576040519080600454611acb8161148f565b8085529160019180831690811561060b5750600114611af457610466856105a4818703826111b9565b9250600483527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b828410611b375750505081016020016105a482610466610594565b80546020858701810191909152909301928101611b1c565b3461040157611b5d366107cb565b90611b66612b25565b6000905b828210611b7357005b611b7e8284836126d5565b928335611b8a81610668565b6001600160a01b0316156108b757601054916020850192611bab84876126f7565b90508101809111611c0e5760105560005b611bc684876126f7565b9050811015611bf957611bf4906103e3611bdf8861272c565b611bed836103bd898c6126f7565b359061296b565b611bbc565b50935091611c0791506122dd565b9091611b6a565b6122c7565b34610401576040366003190112610401576103ed600435611c3381610668565b60243590612692565b34610401576040366003190112610401576103ed611c98600435611c5f81610668565b602435611c6a612b25565b611c756010546122dd565b60105560405191611c8583611183565b60008352611c93828261296b565b6135f9565b6133fb565b3461040157600036600319011261040157602060405160008152f35b8015150361040157565b3461040157604036600319011261040157600435611ce081610668565b602435611cec81611cb9565b333b151580611dbd575b611da557813b151580611d32575b611d11576103ed91612f5f565b6040516341b8d58160e11b81526001600160a01b0383166004820152602490fd5b50600054611d48906001600160a01b0316610982565b6040516305a3b80960e01b81526001600160a01b038416600482015290602090829060249082905afa9081156109fb57600091611d87575b5015611d04565b611d9f915060203d81116109f4576109e681836111b9565b38611d80565b60405163f6fa4cbd60e01b8152336004820152602490fd5b50600054611dd3906001600160a01b0316610982565b6040516305a3b80960e01b815233600482015290602090829060249082905afa9081156109fb57600091611e09575b5015611cf6565b611e21915060203d81116109f4576109e681836111b9565b38611e02565b34610401576060366003190112610401576004356001600160401b03811161040157611e5790369060040161079b565b9060243590611e6582610668565b611e6d6110e8565b611e75612b25565b60005b848110611e8157005b806103e38386611e95611e9b958a896125b1565b3561378e565b611e78565b3461040157608036600319011261040157600435611ebd81610668565b602435611ec981610668565b606435916001600160401b03831161040157611eec6103ed9336906004016116d4565b91604435916131e6565b3461040157602036600319011261040157600435600081815260056020526040902054611f2d906001600160a01b03161515612e40565b604051611f4481611f3d816114c9565b03826111b9565b8051600090156120c35750600091807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000081818110156120b5575b50506d04ee2d6d415b85acef8100000000808310156120a6575b50662386f26fc1000080831015612097575b506305f5e10080831015612088575b5061271080831015612079575b506064821015612069575b600a8092101561205f575b600190816021611fe8828801613893565b96870101905b612029575b505050506105a46120159161201b610466946040519485936020850190612d75565b90612d75565b03601f1981018352826111b9565b600019019083906f181899199a1a9b1b9c1cb0b131b232b360811b8282061a83530491821561205a57919082611fee565b611ff3565b9260010192611fd7565b9290606460029104910192611fcc565b60049194920491019238611fc1565b60089194920491019238611fb4565b60109194920491019238611fa5565b60209194920491019238611f93565b604095500491503880611f79565b604051610466935091506120d682611183565b81526105a4565b346104015760203660031901126104015760043560005260026020526020604060002054604051908152f35b34610401576000366003190112610401576040516a4d494e5445525f524f4c4560a81b8152602090f35b34610401576040366003190112610401576103ed60243560043561215682610668565b806000526001602052612170600160406000200154612cc4565b612d8c565b3461040157612183366107cb565b9060005b82811061219057005b806103e36121a26121a89386866125b1565b356125ce565b612187565b3461040157600080600319360112610635576040519080600e546121d08161148f565b8085529160019180831690811561160557506001146121f957610466856115a8818703826111b9565b9250600e83527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd5b82841061223c5750505081016020016115a882610466611598565b80546020858701810191909152909301928101612221565b3461040157604036600319011261040157602060ff61199e60043561227881610668565b6024359061228582610668565b60018060a01b03166000526008845260406000209060018060a01b0316600052602052604060002090565b6001600160401b03811161117e5760051b60200190565b634e487b7160e01b600052601160045260246000fd5b6000198114611c0e5760010190565b634e487b7160e01b600052603260045260246000fd5b602081519101519060208110612316575090565b6000199060200360031b1b1690565b9290914281106123d55761233a9083856123e7565b9061234e818361234986612e8c565b612522565b6123ca5782908051604081146000146123b25750612392928161238761237c61238161237c61238d9661416a565b612302565b926141b4565b91613be0565b6124bb565b156123a0576111e791612845565b604051638baa579f60e01b8152600490fd5b9091506041036123a05761238d839161239293613a57565b50506111e791612845565b60405163068568f360e21b8152600490fd5b916040519060208201660a0cae4dad2e8560cb1b81527f61646472657373207370656e6465722c75696e7432353620746f6b656e49642c60278401527f75696e74323536206e6f6e63652c75696e7432353620646561646c696e65290060478401526046835260808301928084106001600160401b0385111761117e57610554956101209285604052825190209580600052600b6020526040600020549160a0840197885260018060a01b031660c084015260e0830152610100820152015260a081526124b38161119e565b519020613da5565b6001600160a01b03811615159190826124d357505090565b610554925061341b565b3d15612508573d906124ee826111e9565b916124fc60405193846111b9565b82523d6000602084013e565b606090565b90816020910312610401575161055481610406565b6000919290829160405161255a8161201b6020820194630b135d3f60e11b998a8752602484015260406044840152606483019061051e565b51915afa6125666124dd565b90806125a6575b612579575b5050600090565b61259463ffffffff60e01b916020808251830101910161250d565b16146125a1573880612572565b600190565b50602081511461256d565b9190811015610deb5760051b0190565b8015611c0e576000190190565b6125db610912823361341b565b6125e481612e8c565b50600160ff60406125f484612e8c565b84600080928282526007602052848220906001600160601b0360a01b91828154169055878060a01b03169081835260066020528583206000198154019055612646846000526005602052604060002090565b9081541690557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a48460081c815260116020522092161b81541790556111e76108ac6010546125c1565b6001600160a01b03806126a484612e8c565b16911681036126b757506111e7906125ce565b6044925060405191634fefd56160e01b835260048301526024820152fd5b9190811015610deb5760051b81013590603e1981360301821215610401570190565b903590601e198136030182121561040157018035906001600160401b03821161040157602001918160051b3603831361040157565b3561055481610668565b916127509183549060031b91821b91600019901b19161790565b9055565b601f8111612760575050565b600090600f8252600080516020614204833981519152906020601f850160051c830194106127a9575b601f0160051c01915b82811061279e57505050565b818155600101612792565b9092508290612789565b601f81116127bf575050565b600090600e82527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd906020601f850160051c8301941061281a575b601f0160051c01915b82811061280f57505050565b818155600101612803565b90925082906127fa565b90816020910312610401575161055481611cb9565b6040513d6000823e3d90fd5b9190333b151580612901575b611da557823b15158061288e575b61286d576111e79192613539565b6040516341b8d58160e11b81526001600160a01b0384166004820152602490fd5b506000546128a4906001600160a01b0316610982565b6040516305a3b80960e01b81526001600160a01b038516600482015290602090829060249082905afa9081156109fb576000916128e3575b501561285f565b6128fb915060203d81116109f4576109e681836111b9565b386128dc565b50600054612917906001600160a01b0316610982565b6040516305a3b80960e01b815233600482015290602090829060249082905afa9081156109fb5760009161294d575b5015612851565b612965915060203d81116109f4576109e681836111b9565b38612946565b61298e8260ff6001918060081c6000526011602052161b60406000205416151590565b612aaa576001600160a01b038116908115612a6657600083815260056020526040902054612a3e91906129ca906001600160a01b031615613493565b6000848152600560205260409020546129ec906001600160a01b031615613493565b6001600160a01b038116600090815260066020526040902060018154019055612a1f846000526005602052604060002090565b80546001600160a01b0319166001600160a01b03909216919091179055565b60007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4565b606460405162461bcd60e51b815260206004820152602060248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152fd5b6040516305dcda1160e51b815260048101839052602490fd5b91908201809211611c0e57565b90612af48160ff6001918060081c6000526011602052161b60406000205416151590565b612b0d576111e791611c989160405191611c8583611183565b602490604051906305dcda1160e51b82526004820152fd5b3360009081527f795b5b5b1e8ae2497a426c9e5c94335503b5b2288643072b7dfc82c82389a943602052604090205460ff1615612b5e57565b61096c6048612bdd612b6f3361393e565b61201b612b7a6139d8565b6040519485937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000006020860152612bba8151809260206037890191016104fb565b84017001034b99036b4b9b9b4b733903937b6329607d1b60378201520190612d75565b60405162461bcd60e51b815291829160048301610543565b3360009081527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460019060ff1615612c325750565b612c3b3361393e565b6000612c45613868565b926030612c51856138c5565b536078612c5d856138d2565b536041905b808211612c805761096c6048612bdd8661201b89612b7a89156138f3565b9091600f8116906010821015610deb57612cbe916f181899199a1a9b1b9c1cb0b131b232b360811b901a612cb485886138e2565b5360041c926125c1565b90612c62565b60008181526001602081815260408084203385529091529091205490919060ff1615612cee575050565b612cf73361393e565b90612d00613868565b926030612d0c856138c5565b536078612d18856138d2565b536041905b808211612d3b5761096c6048612bdd8661201b89612b7a89156138f3565b9091600f8116906010821015610deb57612d6f916f181899199a1a9b1b9c1cb0b131b232b360811b901a612cb485886138e2565b90612d1d565b90612d88602092828151948592016104fb565b0190565b906040612dde92600090808252600160205260ff612dbe858585209060018060a01b0316600052602052604060002090565b5416612de1575b81526002602052206001600160a01b0390911690614056565b50565b808252600160209081528383206001600160a01b0386166000908152915260409020805460ff19169055336001600160a01b038516827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a4612dc5565b15612e4757565b60405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606490fd5b6000908152600560205260409020546001600160a01b0316610554811515612e40565b15612eb657565b60405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608490fd5b600081815260056020526040902054612f44906001600160a01b03161515612e40565b6000908152600760205260409020546001600160a01b031690565b6001600160a01b0381169190338314612fd4573360009081526008602090815260408083206001600160a01b039094168352929052209015159060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3565b60405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606490fd5b1561302057565b60405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608490fd5b6130b99083600052600b602052604060002061309781546122dd565b90556130a284612e8c565b6001600160a01b03828116939091821684146134df565b83169283156131825761312061315b926130df856130d96109828a612e8c565b146134df565b6131066130f6886000526007602052604060002090565b80546001600160a01b0319169055565b6001600160a01b0316600090815260066020526040902090565b80546000190190556001600160a01b038116600090815260066020526040902060018154019055612a1f856000526005602052604060002090565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b60405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b90916111e792604051926110c384611183565b6131f3610912843361341b565b323314158061333e575b610a9657803b1515806132cb575b610a0057813b151580613258575b61323757918183613232836111e79795611c989761307b565b6136ba565b604051632a67242160e11b81526001600160a01b0383166004820152602490fd5b5060005461326e906001600160a01b0316610982565b6040516305a3b80960e01b81526001600160a01b038416600482015290602090829060249082905afa9081156109fb576000916132ad575b5015613219565b6132c5915060203d81116109f4576109e681836111b9565b386132a6565b506000546132e1906001600160a01b0316610982565b6040516305a3b80960e01b81526001600160a01b038316600482015290602090829060249082905afa9081156109fb57600091613320575b501561320b565b613338915060203d81116109f4576109e681836111b9565b38613319565b50600054613354906001600160a01b0316610982565b6040516305a3b80960e01b815233600482015290602090829060249082905afa9081156109fb5760009161338a575b50156131fd565b6133a2915060203d81116109f4576109e681836111b9565b38613383565b60809060208152603260208201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b60608201520190565b1561340257565b60405162461bcd60e51b81528061096c600482016133a8565b6001600160a01b038061342d84612e8c565b169281831692848414948515613463575b5050831561344d575b50505090565b61345991929350612f21565b1614388080613447565b60009081526008602090815260408083206001600160a01b03949094168352929052205460ff169350388061343e565b1561349a57565b60405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606490fd5b156134e657565b60405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608490fd5b600082815260076020526040902080546001600160a01b0319166001600160a01b0383161790556001600160a01b038061357284612e8c565b169116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600080a4565b610554939260809260018060a01b03168252600060208301526040820152816060820152019061051e565b6001600160a01b0391821681529116602082015260408101919091526080606082018190526105549291019061051e565b909190803b156136b25761362b602091600093604051948580948193630a85bd0160e11b998a8452336004850161359d565b03926001600160a01b03165af160009181613682575b506136745761364e6124dd565b8051908161366f5760405162461bcd60e51b81528061096c600482016133a8565b602001fd5b6001600160e01b0319161490565b6136a491925060203d81116136ab575b61369c81836111b9565b81019061250d565b9038613641565b503d613692565b505050600190565b92909190823b156136ed5761362b926020926000604051809681958294630a85bd0160e11b9a8b855233600486016135c8565b50505050600190565b6040519061370382611163565b600c546001600160a01b038116835260a01c6020830152565b81810292918115918404141715611c0e57565b1561373657565b60405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608490fd5b916001600160601b03166137a661271082111561372f565b6001600160a01b0391821692831561380a57604051936137c585611163565b845260208085019283526000918252600d9052604090209251835491519083166001600160a01b03166001600160a01b03199283161790921660a09290921b16179055565b60405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606490fd5b6040519061385c82611163565b60208083523683820137565b60405190608082018281106001600160401b0382111761117e57604052604282526060366020840137565b9061389d826111e9565b6138aa60405191826111b9565b82815280926138bb601f19916111e9565b0190602036910137565b805115610deb5760200190565b805160011015610deb5760210190565b908151811015610deb570160200190565b156138fa57565b606460405162461bcd60e51b815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b60405190606082018281106001600160401b0382111761117e57604052602a825260403660208401376030613972836138c5565b53607861397e836138d2565b536029905b60018211613996576105549150156138f3565b600f8116906010821015610deb576139d2916f181899199a1a9b1b9c1cb0b131b232b360811b901a6139c884866138e2565b5360041c916125c1565b90613983565b6a4d494e5445525f524f4c4560a81b6139ef613868565b9060306139fb836138c5565b536078613a07836138d2565b536041905b60018211613a1f576105549150156138f3565b600f8116906010821015610deb57613a51916f181899199a1a9b1b9c1cb0b131b232b360811b901a6139c884866138e2565b90613a0c565b61055491613a6491613bac565b919091613a8c565b60051115613a7657565b634e487b7160e01b600052602160045260246000fd5b613a9581613a6c565b80613a9d5750565b613aa681613a6c565b60018103613af35760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b613afc81613a6c565b60028103613b495760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b80613b55600392613a6c565b14613b5c57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b906041815114600014613bd6576107f5916020820151906060604084015193015160001a90613c09565b5050600090600290565b91908160ff1c90601b8201809211611c0e5761055493613a64936001600160ff1b03169260ff16905b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311613c7f5791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa156109fb5781516001600160a01b03811615613c79579190565b50600190565b50505050600090600390565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161480613d7c575b15613ce6577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a08152613d768161119e565b51902090565b507f00000000000000000000000000000000000000000000000000000000000000004614613cbd565b604290613db0613c8b565b906040519161190160f01b8352600283015260228201522090565b60ff8114613e055760ff811690601f8211613df357613de861384f565b918252602082015290565b604051632cd44ac360e21b8152600490fd5b50604051600954816000613e188361148f565b80835292600190818116908115613e9e5750600114613e3f575b50610554925003826111b9565b6009600090815291507f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af5b848310613e835750610554935050810160200138613e32565b81935090816020925483858901015201910190918492613e6a565b90506020925061055494915060ff191682840152151560051b82010138613e32565b60ff8114613edd5760ff811690601f8211613df357613de861384f565b50604051600a54816000613ef08361148f565b80835292600190818116908115613e9e5750600114613f165750610554925003826111b9565b600a600090815291507fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a85b848310613f5a5750610554935050810160200138613e32565b81935090816020925483858901015201910190918492613f41565b610554916001600160a01b031690613fa0565b8054821015610deb5760005260206000200190600090565b600181019082600052816020526040600020541560001461400e5780546801000000000000000081101561117e57613ff9613fe2826001879401855584613f88565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b505050600090565b805490811561404057600019918201916140308383613f88565b909182549160031b1b1916905555565b634e487b7160e01b600052603160045260246000fd5b6001810191806000528260205260406000205492831515600014614102576000199284840190858211611c0e578054948501948511611c0e5760009585836140aa946140b998036140bf575b505050614016565b90600052602052604060002090565b55600190565b6140e96140e3916140d36140f99487613f88565b90549060031b1c92839187613f88565b90612736565b8590600052602052604060002090565b553880806140a2565b50505050600090565b9061411591613f88565b905460039190911b1c6001600160a01b031690565b1561413157565b60405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606490fd5b60209061417a828251101561412a565b604051918083019181604085019101905b8084106141a35750508252601f01601f191660405290565b81518452928201929082019061418b565b6141c260608251101561412a565b60405190602090818301916040606085019201915b8084106141f25750505060408252601f801991011660405290565b8251845292810192918101916141d756fe8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802a2646970667358221220b0d7e5994c9fab21ddf9da45501a787d67e2f387de8f629b504c33331ecb647964736f6c63430008130033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/build/contracts/ImmutableERC20MinterBurnerPermit.json b/build/contracts/ImmutableERC20MinterBurnerPermit.json new file mode 100644 index 0000000..2cbe0ae --- /dev/null +++ b/build/contracts/ImmutableERC20MinterBurnerPermit.json @@ -0,0 +1,836 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ImmutableERC20MinterBurnerPermit", + "sourceName": "@imtbl/contracts/contracts/token/erc20/preset/ImmutableERC20MinterBurnerPermit.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_roleAdmin", + "type": "address" + }, + { + "internalType": "address", + "name": "_minterAdmin", + "type": "address" + }, + { + "internalType": "address", + "name": "_hubOwner", + "type": "address" + }, + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + }, + { + "internalType": "uint256", + "name": "_maxTokenSupply", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "InvalidShortString", + "type": "error" + }, + { + "inputs": [], + "name": "RenounceOwnershipNotAllowed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "StringTooLong", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "previousAdminRole", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "newAdminRole", + "type": "bytes32" + } + ], + "name": "RoleAdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "RoleRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DEFAULT_ADMIN_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "HUB_OWNER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "MINTER_ROLE", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "cap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAdmins", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleAdmin", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getRoleMember", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + } + ], + "name": "getRoleMemberCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "grantMinterRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "grantRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasRole", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "renounceRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "revokeMinterRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "role", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6101808060405234620007255762002e2780380380916200002182856200072a565b833981019060c08183031262000725576200003c816200074e565b916200004b602083016200074e565b62000059604084016200074e565b60608401516001600160401b0381116200072557836200007b91860162000788565b60808501519093906001600160401b038111620007255760a091620000a291870162000788565b94015160408051969193919087016001600160401b0381118882101762000496576040526001938488526020880196603160f81b8852865160018060401b03811162000496576003548781811c911680156200071a575b6020821014620005f957601f8111620006ad575b50806020601f821160011462000626576000916200061a575b5081881b916000199060031b1c1916176003555b8051906001600160401b0382116200049657600454908782811c921680156200060f575b6020831014620005f95781601f84931162000585575b50602090601f8311600114620004fd57600092620004f1575b5050600019600383901b1c191690861b176004555b8015620004ac57608052620001b785620007e3565b93610140948552620001c98862000988565b95610160968752602081519101209661010098888a5251902093610120978589524660c0526040519560208701917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8352604088015260608701524660808701523060a087015260a0865260c086019580871060018060401b038811176200049657604096875251902060a0523060e0526001600160a01b0392831660008181527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b60205295909520546200037c956009926200032f929091620002e19160ff161562000456575b60008052600a6020527f13da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e362000adf565b506d4855425f4f574e45525f524f4c4560901b80600052836020528560406000209216918260005260205260ff604060002054161562000416575b600052600a602052604060002062000adf565b506a4d494e5445525f524f4c4560a81b92836000528160205260406000209416938460005260205260ff6040600020541615620003d5575b5050600052600a602052604060002062000adf565b506040519261229a948562000b6d86396080518581816109be0152610eba015260a05185611e2a015260c05185611ef6015260e05185611df401525184611e7901525183611e9f015251826106d0015251816106fa0152f35b8260005260205260406000208360005260205260406000209060ff1982541617905533828260008051602062002e07833981519152600080a4388062000367565b806000528360205260406000208260005260205260406000208560ff1982541617905533828260008051602062002e07833981519152600080a46200031c565b600080528460205260406000208160005260205260406000208660ff198254161790553381600060008051602062002e078339815191528180a4620002b1565b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b815260206004820152601560248201527f45524332304361707065643a20636170206973203000000000000000000000006044820152606490fd5b0151905038806200018d565b600460009081528994507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b929190601f198516905b8181106200056c5750841162000552575b505050811b01600455620001a2565b015160001960f88460031b161c1916905538808062000543565b8284015185558b96909401936020938401930162000532565b60046000529091507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f840160051c810160208510620005f1575b9089859493925b601f840160051c83018110620005e15750505062000174565b600081558695508b9101620005c8565b5080620005c1565b634e487b7160e01b600052602260045260246000fd5b91607f16916200015e565b90508801513862000126565b600360009081528993507fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9190601f198416905b8c8282106200069557505083116200067b575b5050811b016003556200013a565b8a015160001960f88460031b161c1916905538806200066d565b83015184558b9590930192602092830192016200065a565b60036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b601f830160051c810191602084106200070f575b601f0160051c019088905b828110620007025750506200010d565b60008155018890620006f2565b9091508190620006e7565b90607f1690620000f9565b600080fd5b601f909101601f19168101906001600160401b038211908210176200049657604052565b51906001600160a01b03821682036200072557565b60005b838110620007775750506000910152565b818101518382015260200162000766565b81601f82011215620007255780516001600160401b038111620004965760405192620007bf601f8301601f1916602001856200072a565b818452602082840101116200072557620007e0916020808501910162000763565b90565b8051602091908281101562000863575090601f8251116200082157808251920151908083106200081257501790565b82600019910360031b1b161790565b604490620008559260405193849263305a27a960e01b84528060048501528251928391826024870152868601910162000763565b601f01601f19168101030190fd5b6001600160401b03811162000496576005928354926001938481811c911680156200097d575b83821014620005f957601f811162000946575b5081601f8411600114620008dc5750928293918392600094620008d0575b50501b916000199060031b1c191617905560ff90565b015192503880620008ba565b919083601f1981168760005284600020946000905b888383106200092b575050501062000911575b505050811b01905560ff90565b015160001960f88460031b161c1916905538808062000904565b858701518855909601959485019487935090810190620008f1565b8560005284601f846000209201871c820191601f8601881c015b828110620009705750506200089c565b6000815501859062000960565b90607f169062000889565b805160209081811015620009b55750601f8251116200082157808251920151908083106200081257501790565b906001600160401b0382116200049657600654926001938481811c9116801562000ad4575b83821014620005f957601f811162000a9a575b5081601f841160011462000a2e575092829391839260009462000a22575b50501b916000199060031b1c19161760065560ff90565b01519250388062000a0b565b919083601f198116600660005284600020946000905b8883831062000a7f575050501062000a65575b505050811b0160065560ff90565b015160001960f88460031b161c1916905538808062000a57565b85870151885590960195948501948793509081019062000a44565b600660005284601f84600020920160051c820191601f860160051c015b82811062000ac7575050620009ed565b6000815501859062000ab7565b90607f1690620009da565b9190600183016000908282528060205260408220541560001462000b66578454946801000000000000000086101562000b52576001860180825586101562000b3e57836040949596828552602085200155549382526020522055600190565b634e487b7160e01b83526032600452602483fd5b634e487b7160e01b83526041600452602483fd5b5092505056fe608060408181526004918236101561001657600080fd5b600092833560e01c91826301ffc9a7146111d75750816306fdde0314611104578163095ea7b3146110da57816318160ddd146110bb57816323b872dd1461107e578163248a9ca3146110535781632f2ff15d14611016578163313ce56714610ffa57816331ae450b14610edd578163355274ea14610ea25781633644e51514610e7e57816336568abe14610da15781633950935114610d515781633dd1eb6114610c8557816340c10f191461095f57816342966c681461094157816369e2f0fb1461087557816370a082311461083e57816379cc67901461080e5781637ecebe00146107d657816384b0196e146106b85781639010d07c1461067757816391d148541461063057816395d89b4114610545578163a217fddf1461052a578163a457c2d714610482578163a9059cbb14610451578163ba795d1814610425578163ca15c873146103fd578163d505accf14610247578163d53913931461021e578163d547741f146101db575063dd62ed3e1461019057600080fd5b346101d757806003193601126101d757806020926101ac61128c565b6101b46112a7565b6001600160a01b0391821683526001865283832091168252845220549051908152f35b5080fd5b9190503461021a578060031936011261021a57610217913561021260016102006112a7565b93838752600960205286200154611512565b61161d565b80f35b8280fd5b5050346101d757816003193601126101d757516a4d494e5445525f524f4c4560a81b8152602090f35b839150346101d75760e03660031901126101d75761026361128c565b61026b6112a7565b906044359260643560843560ff811681036103f9578142116103b65760018060a01b0390818516928389526007602052898920908154916001830190558a519060208201927f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98452868d840152858a1660608401528a608084015260a083015260c082015260c0815260e0810181811067ffffffffffffffff8211176103a3578b5251902061034e9161034691610320611df1565b908c519161190160f01b83526002830152602282015260c43591604260a4359220611d62565b919091611c48565b16036103605750610217939450611871565b606490602087519162461bcd60e51b8352820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152fd5b634e487b7160e01b8b526041875260248bfd5b875162461bcd60e51b8152602081850152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606490fd5b8680fd5b90503461021a57602036600319011261021a576020928291358152600a845220549051908152f35b5050346101d757816003193601126101d757516d4855425f4f574e45525f524f4c4560901b8152602090f35b5050346101d757806003193601126101d75760209061047b61047161128c565b6024359033611703565b5160018152f35b9050823461052757826003193601126105275761049d61128c565b918360243592338152600160205281812060018060a01b03861682526020522054908282106104d65760208561047b8585038733611871565b608490602086519162461bcd60e51b8352820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152fd5b80fd5b5050346101d757816003193601126101d75751908152602090f35b9190503461021a578260031936011261021a5780519183815490610568826116a6565b8086529260019280841690811561060557506001146105a9575b6105a58686610593828b038361130b565b51918291602083526020830190611267565b0390f35b815294507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b8286106105ed575050506105938260206105a5958201019438610582565b805460208787018101919091529095019481016105cf565b90506105a597508693506020925061059394915060ff191682840152151560051b8201019438610582565b90503461021a578160031936011261021a578160209360ff926106516112a7565b90358252600986528282206001600160a01b039091168252855220549151911615158152f35b90503461021a578160031936011261021a576020926106a291358152600a84528260243591206120d2565b905491519160018060a01b039160031b1c168152f35b9190503461021a578260031936011261021a576106f47f0000000000000000000000000000000000000000000000000000000000000000611f1c565b9261071e7f0000000000000000000000000000000000000000000000000000000000000000612018565b908251926020928385019585871067ffffffffffffffff8811176107c35750928061077983889661076c998b9996528686528151998a99600f60f81b8b5260e0868c015260e08b0190611267565b91898303908a0152611267565b924660608801523060808801528460a088015286840360c088015251928381520193925b8281106107ac57505050500390f35b83518552869550938101939281019260010161079d565b634e487b7160e01b845260419052602483fd5b5050346101d75760203660031901126101d75760209181906001600160a01b036107fe61128c565b1681526007845220549051908152f35b5050346101d7573660031901126105275761021761082a61128c565b60243590610839823383611973565b611a0b565b5050346101d75760203660031901126101d75760209181906001600160a01b0361086661128c565b16815280845220549051908152f35b5050346101d75760208060031936011261021a576108f791600a61089761128c565b926108a0611345565b6a4d494e5445525f524f4c4560a81b80875260098252838720600101546108c690611512565b808752600982528387206001600160a01b039095168088529482528387205460ff166108fb575b8652528320612174565b5080f35b808752600982528387208588528252838720805460ff191690553385827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8a80a46108ed565b8390346101d75760203660031901126101d757610217903533611a0b565b90503461021a578160031936011261021a5761097961128c565b6024928335916a4d494e5445525f524f4c4560a81b9384875260209460098652838820338952865260ff848920541615610ac15750600254916109bc85846116e0565b7f000000000000000000000000000000000000000000000000000000000000000010610a7f576001600160a01b0316958615610a3d57505091859391610a23827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef956116e0565b60025585855284835280852082815401905551908152a380f35b835162461bcd60e51b8152918201869052601f908201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b835162461bcd60e51b81528083018790526019818901527f45524332304361707065643a20636170206578636565646564000000000000006044820152606490fd5b90868487938a610ad033611b39565b91835190610add826112ef565b60428252878201926060368537825115610c735760308453825190600191821015610c615790607860218501536041915b818311610bf857505050610bb8576048610bb495938593610b9c93610b8d975197889376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8d860152610b648d8251928391603789019101611244565b8401917001034b99036b4b9b9b4b733903937b6329607d1b603784015251809386840190611244565b0103602881018652018461130b565b5194859462461bcd60e51b8652850152830190611267565b0390fd5b60648688878188519362461bcd60e51b85528401528201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f81166010811015610c4f576f181899199a1a9b1b9c1cb0b131b232b360811b901a610c288587611b12565b53891c928015610c3d57600019019190610b0e565b634e487b7160e01b825260118a528882fd5b634e487b7160e01b835260328b528983fd5b634e487b7160e01b8152603289528790fd5b634e487b7160e01b8152603288528690fd5b5050346101d75760208060031936011261021a576108f791600a610ca761128c565b92610cb0611345565b6a4d494e5445525f524f4c4560a81b8087526009825283872060010154610cd690611512565b808752600982528387206001600160a01b039095168088529482528387205460ff1615610d08575b86525283206120ea565b808752600982528387208588528252838720805460ff191660011790553385827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8a80a4610cfe565b5050346101d757806003193601126101d75761047b602092610d9a610d7461128c565b338352600186528483206001600160a01b038216845286529184902054602435906116e0565b9033611871565b839150346101d757826003193601126101d7578035610dbe6112a7565b91818452600a6020526001858520541480610e5c575b610e4e57336001600160a01b03841603610df35750906102179161161d565b608490602086519162461bcd60e51b8352820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152fd5b84516396c553eb60e01b8152fd5b506d4855425f4f574e45525f524f4c4560901b821480610dd457508115610dd4565b5050346101d757816003193601126101d757602090610e9b611df1565b9051908152f35b5050346101d757816003193601126101d757602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b839150346101d757816003193601126101d7579190808052600a9060209382855283822054610f0b8161132d565b91610f188651938461130b565b818352610f248261132d565b8388019590601f1901368737845b838110610f81575050505083519485948186019282875251809352850193925b828110610f6157505050500390f35b83516001600160a01b031685528695509381019392810192600101610f52565b8580959798999652818652610f98818a87206120d2565b90548851831015610fe75760039190911b1c6001600160a01b0316600582901b88018701526000198114610fd457600101979695939497610f32565b634e487b7160e01b855260118352602485fd5b634e487b7160e01b875260328552602487fd5b5050346101d757816003193601126101d7576020905160128152f35b9190503461021a578060031936011261021a576108f7913590600a6110396112a7565b9280865260209060098252610cd660018589200154611512565b90503461021a57602036600319011261021a5781602093600192358152600985522001549051908152f35b5050346101d75760603660031901126101d75760209061047b61109f61128c565b6110a76112a7565b604435916110b6833383611973565b611703565b5050346101d757816003193601126101d7576020906002549051908152f35b5050346101d757806003193601126101d75760209061047b6110fa61128c565b6024359033611871565b5050346101d757816003193601126101d75780519082600354611126816116a6565b808552916001918083169081156111af5750600114611152575b505050610593826105a594038361130b565b9450600385527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b828610611197575050506105938260206105a59582010194611140565b8054602087870181019190915290950194810161117a565b6105a597508693506020925061059394915060ff191682840152151560051b82010194611140565b84913461021a57602036600319011261021a573563ffffffff60e01b811680910361021a5760209250635a05180f60e01b8114908115611219575b5015158152f35b637965db0b60e01b811491508115611233575b5083611212565b6301ffc9a760e01b1490508361122c565b60005b8381106112575750506000910152565b8181015183820152602001611247565b9060209161128081518092818552858086019101611244565b601f01601f1916010190565b600435906001600160a01b03821682036112a257565b600080fd5b602435906001600160a01b03821682036112a257565b6040810190811067ffffffffffffffff8211176112d957604052565b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff8211176112d957604052565b90601f8019910116810190811067ffffffffffffffff8211176112d957604052565b67ffffffffffffffff81116112d95760051b60200190565b3360009081527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b602090815260408083205490929060ff161561138757505050565b61139033611b39565b908084519061139e826112ef565b604282528482019260603685378251156114fe57603084538251906001918210156114fe5790607860218501536041915b8183116114905750505061144e576048610bb493869361143293611423985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a860152610b64815180928c603789019101611244565b0103602881018752018561130b565b5192839262461bcd60e51b845260048401526024830190611267565b60648486519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f811660108110156114ea576f181899199a1a9b1b9c1cb0b131b232b360811b901a6114c08587611b12565b5360041c9280156114d6576000190191906113cf565b634e487b7160e01b82526011600452602482fd5b634e487b7160e01b83526032600452602483fd5b634e487b7160e01b81526032600452602490fd5b60009080825260209060098252604092838120338252835260ff84822054161561153c5750505050565b61154533611b39565b91845190611552826112ef565b604282528482019260603685378251156114fe57603084538251906001918210156114fe5790607860218501536041915b8183116115d75750505061144e576048610bb493869361143293611423985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a860152610b64815180928c603789019101611244565b909192600f811660108110156114ea576f181899199a1a9b1b9c1cb0b131b232b360811b901a6116078587611b12565b5360041c9280156114d657600019019190611583565b90604061165b9260009080825260096020528282209360018060a01b03169384835260205260ff838320541661165e575b8152600a60205220612174565b50565b808252600960205282822084835260205282822060ff1981541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a461164e565b90600182811c921680156116d6575b60208310146116c057565b634e487b7160e01b600052602260045260246000fd5b91607f16916116b5565b919082018092116116ed57565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0390811691821561181e57169182156117cd5760008281528060205260408120549180831061177957604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef958760209652828652038282205586815220818154019055604051908152a3565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6001600160a01b0390811691821561192257169182156118d25760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b9060018060a01b03808316600052600160205260406000209082166000526020526040600020549260001984036119ab575b50505050565b8084106119c6576119bd930391611871565b388080806119a5565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b6001600160a01b03168015611ac357600091818352826020526040832054818110611a7357817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef926020928587528684520360408620558060025403600255604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608490fd5b908151811015611b23570160200190565b634e487b7160e01b600052603260045260246000fd5b604051906060820182811067ffffffffffffffff8211176112d957604052602a8252602082016040368237825115611b2357603090538151600190811015611b2357607860218401536029905b808211611bda575050611b965790565b606460405162461bcd60e51b815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f81166010811015611c33576f181899199a1a9b1b9c1cb0b131b232b360811b901a611c098486611b12565b5360041c918015611c1e576000190190611b86565b60246000634e487b7160e01b81526011600452fd5b60246000634e487b7160e01b81526032600452fd5b6005811015611d4c5780611c595750565b60018103611ca65760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b60028103611cf35760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b600314611cfc57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311611de55791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa15611dd85781516001600160a01b03811615611dd2579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161480611ef3575b15611e4c577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a0815260c0810181811067ffffffffffffffff8211176112d95760405251902090565b507f00000000000000000000000000000000000000000000000000000000000000004614611e23565b60ff8114611f5a5760ff811690601f8211611f485760405191611f3e836112bd565b8252602082015290565b604051632cd44ac360e21b8152600490fd5b50604051600554816000611f6d836116a6565b80835292600190818116908115611ff65750600114611f97575b50611f949250038261130b565b90565b6005600090815291507f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05b848310611fdb5750611f94935050810160200138611f87565b81935090816020925483858901015201910190918492611fc2565b905060209250611f9494915060ff191682840152151560051b82010138611f87565b60ff811461203a5760ff811690601f8211611f485760405191611f3e836112bd565b5060405160065481600061204d836116a6565b80835292600190818116908115611ff657506001146120735750611f949250038261130b565b6006600090815291507ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f5b8483106120b75750611f94935050810160200138611f87565b8193509081602092548385890101520191019091849261209e565b8054821015611b235760005260206000200190600090565b9190600183016000908282528060205260408220541560001461216e578454946801000000000000000086101561215a578361214a612133886001604098999a018555846120d2565b819391549060031b91821b91600019901b19161790565b9055549382526020522055600190565b634e487b7160e01b83526041600452602483fd5b50925050565b9060018201906000928184528260205260408420549081151560001461225d57600019918083018181116122495782549084820191821161223557808203612200575b505050805480156121ec578201916121cf83836120d2565b909182549160031b1b191690555582526020526040812055600190565b634e487b7160e01b86526031600452602486fd5b61222061221061213393866120d2565b90549060031b1c928392866120d2565b905586528460205260408620553880806121b7565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b87526011600452602487fd5b505050509056fea264697066735822122006096c4ab3f00bea96e7b5f44f3d4bb43d08d4820f0d29637c93b23c1b30f75764736f6c634300081300332f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", + "deployedBytecode": "0x608060408181526004918236101561001657600080fd5b600092833560e01c91826301ffc9a7146111d75750816306fdde0314611104578163095ea7b3146110da57816318160ddd146110bb57816323b872dd1461107e578163248a9ca3146110535781632f2ff15d14611016578163313ce56714610ffa57816331ae450b14610edd578163355274ea14610ea25781633644e51514610e7e57816336568abe14610da15781633950935114610d515781633dd1eb6114610c8557816340c10f191461095f57816342966c681461094157816369e2f0fb1461087557816370a082311461083e57816379cc67901461080e5781637ecebe00146107d657816384b0196e146106b85781639010d07c1461067757816391d148541461063057816395d89b4114610545578163a217fddf1461052a578163a457c2d714610482578163a9059cbb14610451578163ba795d1814610425578163ca15c873146103fd578163d505accf14610247578163d53913931461021e578163d547741f146101db575063dd62ed3e1461019057600080fd5b346101d757806003193601126101d757806020926101ac61128c565b6101b46112a7565b6001600160a01b0391821683526001865283832091168252845220549051908152f35b5080fd5b9190503461021a578060031936011261021a57610217913561021260016102006112a7565b93838752600960205286200154611512565b61161d565b80f35b8280fd5b5050346101d757816003193601126101d757516a4d494e5445525f524f4c4560a81b8152602090f35b839150346101d75760e03660031901126101d75761026361128c565b61026b6112a7565b906044359260643560843560ff811681036103f9578142116103b65760018060a01b0390818516928389526007602052898920908154916001830190558a519060208201927f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98452868d840152858a1660608401528a608084015260a083015260c082015260c0815260e0810181811067ffffffffffffffff8211176103a3578b5251902061034e9161034691610320611df1565b908c519161190160f01b83526002830152602282015260c43591604260a4359220611d62565b919091611c48565b16036103605750610217939450611871565b606490602087519162461bcd60e51b8352820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152fd5b634e487b7160e01b8b526041875260248bfd5b875162461bcd60e51b8152602081850152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606490fd5b8680fd5b90503461021a57602036600319011261021a576020928291358152600a845220549051908152f35b5050346101d757816003193601126101d757516d4855425f4f574e45525f524f4c4560901b8152602090f35b5050346101d757806003193601126101d75760209061047b61047161128c565b6024359033611703565b5160018152f35b9050823461052757826003193601126105275761049d61128c565b918360243592338152600160205281812060018060a01b03861682526020522054908282106104d65760208561047b8585038733611871565b608490602086519162461bcd60e51b8352820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152fd5b80fd5b5050346101d757816003193601126101d75751908152602090f35b9190503461021a578260031936011261021a5780519183815490610568826116a6565b8086529260019280841690811561060557506001146105a9575b6105a58686610593828b038361130b565b51918291602083526020830190611267565b0390f35b815294507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b8286106105ed575050506105938260206105a5958201019438610582565b805460208787018101919091529095019481016105cf565b90506105a597508693506020925061059394915060ff191682840152151560051b8201019438610582565b90503461021a578160031936011261021a578160209360ff926106516112a7565b90358252600986528282206001600160a01b039091168252855220549151911615158152f35b90503461021a578160031936011261021a576020926106a291358152600a84528260243591206120d2565b905491519160018060a01b039160031b1c168152f35b9190503461021a578260031936011261021a576106f47f0000000000000000000000000000000000000000000000000000000000000000611f1c565b9261071e7f0000000000000000000000000000000000000000000000000000000000000000612018565b908251926020928385019585871067ffffffffffffffff8811176107c35750928061077983889661076c998b9996528686528151998a99600f60f81b8b5260e0868c015260e08b0190611267565b91898303908a0152611267565b924660608801523060808801528460a088015286840360c088015251928381520193925b8281106107ac57505050500390f35b83518552869550938101939281019260010161079d565b634e487b7160e01b845260419052602483fd5b5050346101d75760203660031901126101d75760209181906001600160a01b036107fe61128c565b1681526007845220549051908152f35b5050346101d7573660031901126105275761021761082a61128c565b60243590610839823383611973565b611a0b565b5050346101d75760203660031901126101d75760209181906001600160a01b0361086661128c565b16815280845220549051908152f35b5050346101d75760208060031936011261021a576108f791600a61089761128c565b926108a0611345565b6a4d494e5445525f524f4c4560a81b80875260098252838720600101546108c690611512565b808752600982528387206001600160a01b039095168088529482528387205460ff166108fb575b8652528320612174565b5080f35b808752600982528387208588528252838720805460ff191690553385827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8a80a46108ed565b8390346101d75760203660031901126101d757610217903533611a0b565b90503461021a578160031936011261021a5761097961128c565b6024928335916a4d494e5445525f524f4c4560a81b9384875260209460098652838820338952865260ff848920541615610ac15750600254916109bc85846116e0565b7f000000000000000000000000000000000000000000000000000000000000000010610a7f576001600160a01b0316958615610a3d57505091859391610a23827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef956116e0565b60025585855284835280852082815401905551908152a380f35b835162461bcd60e51b8152918201869052601f908201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606490fd5b835162461bcd60e51b81528083018790526019818901527f45524332304361707065643a20636170206578636565646564000000000000006044820152606490fd5b90868487938a610ad033611b39565b91835190610add826112ef565b60428252878201926060368537825115610c735760308453825190600191821015610c615790607860218501536041915b818311610bf857505050610bb8576048610bb495938593610b9c93610b8d975197889376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8d860152610b648d8251928391603789019101611244565b8401917001034b99036b4b9b9b4b733903937b6329607d1b603784015251809386840190611244565b0103602881018652018461130b565b5194859462461bcd60e51b8652850152830190611267565b0390fd5b60648688878188519362461bcd60e51b85528401528201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f81166010811015610c4f576f181899199a1a9b1b9c1cb0b131b232b360811b901a610c288587611b12565b53891c928015610c3d57600019019190610b0e565b634e487b7160e01b825260118a528882fd5b634e487b7160e01b835260328b528983fd5b634e487b7160e01b8152603289528790fd5b634e487b7160e01b8152603288528690fd5b5050346101d75760208060031936011261021a576108f791600a610ca761128c565b92610cb0611345565b6a4d494e5445525f524f4c4560a81b8087526009825283872060010154610cd690611512565b808752600982528387206001600160a01b039095168088529482528387205460ff1615610d08575b86525283206120ea565b808752600982528387208588528252838720805460ff191660011790553385827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8a80a4610cfe565b5050346101d757806003193601126101d75761047b602092610d9a610d7461128c565b338352600186528483206001600160a01b038216845286529184902054602435906116e0565b9033611871565b839150346101d757826003193601126101d7578035610dbe6112a7565b91818452600a6020526001858520541480610e5c575b610e4e57336001600160a01b03841603610df35750906102179161161d565b608490602086519162461bcd60e51b8352820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152fd5b84516396c553eb60e01b8152fd5b506d4855425f4f574e45525f524f4c4560901b821480610dd457508115610dd4565b5050346101d757816003193601126101d757602090610e9b611df1565b9051908152f35b5050346101d757816003193601126101d757602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b839150346101d757816003193601126101d7579190808052600a9060209382855283822054610f0b8161132d565b91610f188651938461130b565b818352610f248261132d565b8388019590601f1901368737845b838110610f81575050505083519485948186019282875251809352850193925b828110610f6157505050500390f35b83516001600160a01b031685528695509381019392810192600101610f52565b8580959798999652818652610f98818a87206120d2565b90548851831015610fe75760039190911b1c6001600160a01b0316600582901b88018701526000198114610fd457600101979695939497610f32565b634e487b7160e01b855260118352602485fd5b634e487b7160e01b875260328552602487fd5b5050346101d757816003193601126101d7576020905160128152f35b9190503461021a578060031936011261021a576108f7913590600a6110396112a7565b9280865260209060098252610cd660018589200154611512565b90503461021a57602036600319011261021a5781602093600192358152600985522001549051908152f35b5050346101d75760603660031901126101d75760209061047b61109f61128c565b6110a76112a7565b604435916110b6833383611973565b611703565b5050346101d757816003193601126101d7576020906002549051908152f35b5050346101d757806003193601126101d75760209061047b6110fa61128c565b6024359033611871565b5050346101d757816003193601126101d75780519082600354611126816116a6565b808552916001918083169081156111af5750600114611152575b505050610593826105a594038361130b565b9450600385527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b828610611197575050506105938260206105a59582010194611140565b8054602087870181019190915290950194810161117a565b6105a597508693506020925061059394915060ff191682840152151560051b82010194611140565b84913461021a57602036600319011261021a573563ffffffff60e01b811680910361021a5760209250635a05180f60e01b8114908115611219575b5015158152f35b637965db0b60e01b811491508115611233575b5083611212565b6301ffc9a760e01b1490508361122c565b60005b8381106112575750506000910152565b8181015183820152602001611247565b9060209161128081518092818552858086019101611244565b601f01601f1916010190565b600435906001600160a01b03821682036112a257565b600080fd5b602435906001600160a01b03821682036112a257565b6040810190811067ffffffffffffffff8211176112d957604052565b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff8211176112d957604052565b90601f8019910116810190811067ffffffffffffffff8211176112d957604052565b67ffffffffffffffff81116112d95760051b60200190565b3360009081527fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b602090815260408083205490929060ff161561138757505050565b61139033611b39565b908084519061139e826112ef565b604282528482019260603685378251156114fe57603084538251906001918210156114fe5790607860218501536041915b8183116114905750505061144e576048610bb493869361143293611423985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a860152610b64815180928c603789019101611244565b0103602881018752018561130b565b5192839262461bcd60e51b845260048401526024830190611267565b60648486519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f811660108110156114ea576f181899199a1a9b1b9c1cb0b131b232b360811b901a6114c08587611b12565b5360041c9280156114d6576000190191906113cf565b634e487b7160e01b82526011600452602482fd5b634e487b7160e01b83526032600452602483fd5b634e487b7160e01b81526032600452602490fd5b60009080825260209060098252604092838120338252835260ff84822054161561153c5750505050565b61154533611b39565b91845190611552826112ef565b604282528482019260603685378251156114fe57603084538251906001918210156114fe5790607860218501536041915b8183116115d75750505061144e576048610bb493869361143293611423985198899376020b1b1b2b9b9a1b7b73a3937b61d1030b1b1b7bab73a1604d1b8a860152610b64815180928c603789019101611244565b909192600f811660108110156114ea576f181899199a1a9b1b9c1cb0b131b232b360811b901a6116078587611b12565b5360041c9280156114d657600019019190611583565b90604061165b9260009080825260096020528282209360018060a01b03169384835260205260ff838320541661165e575b8152600a60205220612174565b50565b808252600960205282822084835260205282822060ff1981541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a461164e565b90600182811c921680156116d6575b60208310146116c057565b634e487b7160e01b600052602260045260246000fd5b91607f16916116b5565b919082018092116116ed57565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0390811691821561181e57169182156117cd5760008281528060205260408120549180831061177957604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef958760209652828652038282205586815220818154019055604051908152a3565b60405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b60405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b6001600160a01b0390811691821561192257169182156118d25760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608490fd5b60405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608490fd5b9060018060a01b03808316600052600160205260406000209082166000526020526040600020549260001984036119ab575b50505050565b8084106119c6576119bd930391611871565b388080806119a5565b60405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606490fd5b6001600160a01b03168015611ac357600091818352826020526040832054818110611a7357817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef926020928587528684520360408620558060025403600255604051908152a3565b60405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608490fd5b60405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608490fd5b908151811015611b23570160200190565b634e487b7160e01b600052603260045260246000fd5b604051906060820182811067ffffffffffffffff8211176112d957604052602a8252602082016040368237825115611b2357603090538151600190811015611b2357607860218401536029905b808211611bda575050611b965790565b606460405162461bcd60e51b815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f81166010811015611c33576f181899199a1a9b1b9c1cb0b131b232b360811b901a611c098486611b12565b5360041c918015611c1e576000190190611b86565b60246000634e487b7160e01b81526011600452fd5b60246000634e487b7160e01b81526032600452fd5b6005811015611d4c5780611c595750565b60018103611ca65760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b60028103611cf35760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b600314611cfc57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311611de55791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa15611dd85781516001600160a01b03811615611dd2579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600390565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161480611ef3575b15611e4c577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a0815260c0810181811067ffffffffffffffff8211176112d95760405251902090565b507f00000000000000000000000000000000000000000000000000000000000000004614611e23565b60ff8114611f5a5760ff811690601f8211611f485760405191611f3e836112bd565b8252602082015290565b604051632cd44ac360e21b8152600490fd5b50604051600554816000611f6d836116a6565b80835292600190818116908115611ff65750600114611f97575b50611f949250038261130b565b90565b6005600090815291507f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05b848310611fdb5750611f94935050810160200138611f87565b81935090816020925483858901015201910190918492611fc2565b905060209250611f9494915060ff191682840152151560051b82010138611f87565b60ff811461203a5760ff811690601f8211611f485760405191611f3e836112bd565b5060405160065481600061204d836116a6565b80835292600190818116908115611ff657506001146120735750611f949250038261130b565b6006600090815291507ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f5b8483106120b75750611f94935050810160200138611f87565b8193509081602092548385890101520191019091849261209e565b8054821015611b235760005260206000200190600090565b9190600183016000908282528060205260408220541560001461216e578454946801000000000000000086101561215a578361214a612133886001604098999a018555846120d2565b819391549060031b91821b91600019901b19161790565b9055549382526020522055600190565b634e487b7160e01b83526041600452602483fd5b50925050565b9060018201906000928184528260205260408420549081151560001461225d57600019918083018181116122495782549084820191821161223557808203612200575b505050805480156121ec578201916121cf83836120d2565b909182549160031b1b191690555582526020526040812055600190565b634e487b7160e01b86526031600452602486fd5b61222061221061213393866120d2565b90549060031b1c928392866120d2565b905586528460205260408620553880806121b7565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b87526011600452602487fd5b505050509056fea264697066735822122006096c4ab3f00bea96e7b5f44f3d4bb43d08d4820f0d29637c93b23c1b30f75764736f6c63430008130033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/build/contracts/NFTClaimStage2.json b/build/contracts/NFTClaimStage2.json new file mode 100644 index 0000000..d512982 --- /dev/null +++ b/build/contracts/NFTClaimStage2.json @@ -0,0 +1,492 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "NFTClaimStage2", + "sourceName": "contracts/activity/NFTClaimStage2.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_nftAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_verifier", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "parse1MaxSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSupply", + "type": "uint256" + }, + { + "internalType": "address", + "name": "currency", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "feeToAddress", + "type": "address" + } + ], + "internalType": "struct NFTClaimStage2.MintConfig", + "name": "_mintConfig", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "parse1MaxSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSupply", + "type": "uint256" + }, + { + "internalType": "address", + "name": "currency", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "feeToAddress", + "type": "address" + } + ], + "indexed": false, + "internalType": "struct NFTClaimStage2.MintConfig", + "name": "config", + "type": "tuple" + } + ], + "name": "MintConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "nftAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + } + ], + "name": "NFTClaimed", + "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": "uint256", + "name": "_parse", + "type": "uint256" + } + ], + "name": "ParseUpdated", + "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": "signer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "checkSigner", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "claim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "_ids", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "_tokenAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_contract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "getMessageHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "mintConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "parse1MaxSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSupply", + "type": "uint256" + }, + { + "internalType": "address", + "name": "currency", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "feeToAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mintParse", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nftAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "parse1Count", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "parse1MaxSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSupply", + "type": "uint256" + }, + { + "internalType": "address", + "name": "currency", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "feeToAddress", + "type": "address" + } + ], + "internalType": "struct NFTClaimStage2.MintConfig", + "name": "config", + "type": "tuple" + } + ], + "name": "updateMintConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_mintParse", + "type": "uint256" + } + ], + "name": "updateMintParse", + "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" + } + ], + "bytecode": "0x60e034620001ad576001600160401b0390601f6200132138819003918201601f191683019291848411838510176200019757808392604095865283398101039060e08212620001ad576200005381620001b2565b9060a06200006460208301620001b2565b93603f190112620001ad5783519460a08601908111868210176200019757845283810151855260608101519160208601928352620000a560808301620001b2565b858701908152620000c560c060a08501519460608a0195865201620001b2565b93608088019485526000549760018060a01b03199733898b1617600055519860018060a01b039788958692833391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a360016002556000600355466080523060a05260c05216886004541617600455516005555160065551168460075416176007555160085551169060095416176009556111599081620001c882396080518181816104af0152610b20015260a05181818161020601526104d2015260c0518181816104850152610a930152f35b634e487b7160e01b600052604160045260246000fd5b600080fd5b51906001600160a01b0382168203620001ad5756fe6040608081526004908136101561001557600080fd5b600091823560e01c80630c8e867f14610b625780632352a4bc14610b435780632b437d4814610b085780632b7ac3f314610ae157806334eafb1114610ac25780635bf8633a14610a7e5780636170141e146109b75780636d04319414610958578063715018a6146108fe5780638d633d9a146103b25780638da5cb5b1461038a57806397fc007c146102d1578063a1d891f014610254578063d2fb3b5314610235578063da28b527146101f1578063e7cc7244146101a15763f2fde38b146100dc57600080fd5b3461019d57602036600319011261019d576100f5610bca565b906100fe610cc6565b6001600160a01b0391821692831561014b57505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b5050346101ed57816003193601126101ed5760a0906005549060065490600180851b03908160075416906008549260095416938151958652602086015284015260608301526080820152f35b5080fd5b5050346101ed57816003193601126101ed57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5050346101ed57816003193601126101ed576020906003549051908152f35b5091346102ce5760e03660031901126102ce5761026f610bca565b92602435916001600160a01b03831683036102ce576044359067ffffffffffffffff82116102ce5750916102ac602095926102c794369101610c5f565b916102b5610baf565b9060c4359360a4359360643592610db2565b9051908152f35b80fd5b503461019d57602036600319011261019d576102eb610bca565b6102f3610cc6565b6001600160a01b031691821561033b575080546001600160a01b031916821790557fd24015cc99cc1700cafca3042840a1d8ac1e3964fd2e0e37ea29c654056ee3278280a280f35b906020608492519162461bcd60e51b8352820152602360248201527f4e4654436c61696d65723a20616464726573732063616e206e6f74206265207a60448201526265726f60e81b6064820152fd5b5050346101ed57816003193601126101ed57905490516001600160a01b039091168152602090f35b503461019d57608036600319011261019d5767ffffffffffffffff9181358381116108fa576103e49036908401610c5f565b91602480356064918235928784116108f657366023850112156108f65783850135948886116108f25782850194838736920101116108f25760028054146108b3576002805560035498891561087357885194851561081c5760019a8b036107c557610454600554600a5490610d1e565b8611610776575b6008548681029080820488149015171561076457811061071557918b979593916104f9999795938b7f00000000000000000000000000000000000000000000000000000000000000009460449c8d928335907f000000000000000000000000000000000000000000000000000000000000000090867f0000000000000000000000000000000000000000000000000000000000000000918b33610db2565b85546001600160a01b03949161051d91861690610517368f8f610c18565b91610eb3565b8360075416918460095416918d519485936323b872dd60e01b8552338a8601528b8501528301528160209e8f945af180156106ce576106da575b509089969594938e9b93928c91169b5b8d87831061064c575050505050505061058281600b54610d7a565b600b558860035414610637575b5060ff84518483823783818681018c815203019020541615610614575b50505090815191818084019181855286518093528401950191875b87838210610602575050505050807ff1a869817733568a4d9fdcfb9d02c2e19967dfa6635304703a7f6881b42853119133940390a360025580f35b845188529682019693820193016105c7565b8284519384928337810188815203019020805460ff1916861790553882816105ac565b61064390600a54610d7a565b600a553861058f565b829394959697989950916106609192610d50565b518c3b156101ed578c8683928d519485938492632851206560e21b8452338b8501528c8401525af180156106ce576106ab575b5061069d90610d41565b90899695949392918e610567565b8281116106bc57895261069d610693565b634e487b7160e01b8f5260418452858ffd5b8f8b51903d90823e3d90fd5b8a81813d831161070e575b6106ef8183610be0565b8101031261070a5751801515036107065738610557565b8d80fd5b8e80fd5b503d6106e5565b885162461bcd60e51b81526020818501526025818701527f4e4654436c61696d65723a20696e73756666696369656e7420746f6b656e20616044820152641b5bdd5b9d60da1b81860152608490fd5b634e487b7160e01b8d5260118452858dfd5b885162461bcd60e51b81526020818501526025818701527f4e4654436c61696d65723a206578636565642070617273652031206d617820736044820152647570706c7960d81b81860152608490fd5b6107d4600654600b5490610d1e565b86111561045b575050601d83602089519362461bcd60e51b85528401528201527f4e4654436c61696d65723a20657863656564206d617820737570706c790000006044820152fd5b885162461bcd60e51b8152602081850152602d818701527f4e4654436c61696d65723a20696473206c656e677468206d757374206265206760448201526c0726561746572207468616e203609c1b81860152608490fd5b50601e83602089519362461bcd60e51b85528401528201527f4e4654436c61696d65723a206e6f7420626567696e206f7220656e64656400006044820152fd5b601f83602089519362461bcd60e51b85528401528201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152fd5b8980fd5b8880fd5b8480fd5b83346102ce57806003193601126102ce57610917610cc6565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b8382346101ed5760603660031901126101ed57610973610bca565b60443567ffffffffffffffff81116109b357366023820112156109b3576109b0928160246109a693369301359101610c18565b9060243590610eb3565b80f35b8380fd5b503461019d5760a036600319011261019d576109d1610cc6565b3560058190556024356006819055916001600160a01b03604435818116939290849003610a7a576bffffffffffffffffffffffff60a01b93808560075416176007556064359182600855608435968488168098036108f6577fde378c2c4aad676b12eb56e70a7f6f7778724a466508402b6c49de56dc11ffb89760a0976009541617600955815195865260208601528401526060830152610a70610baf565b166080820152a180f35b8580fd5b5050346101ed57816003193601126101ed57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5050346101ed57816003193601126101ed57602090600b549051908152f35b503461019d578260031936011261019d575490516001600160a01b03909116815260209150f35b5050346101ed57816003193601126101ed57602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b5050346101ed57816003193601126101ed57602090600a549051908152f35b503461019d57602036600319011261019d577f5ca814e8750431ce4d53faa6b24fbf00f6b53f5918a00ab430c0473ba6263424916020913590610ba3610cc6565b8160035551908152a180f35b608435906001600160a01b0382168203610bc557565b600080fd5b600435906001600160a01b0382168203610bc557565b90601f8019910116810190811067ffffffffffffffff821117610c0257604052565b634e487b7160e01b600052604160045260246000fd5b92919267ffffffffffffffff8211610c025760405191610c42601f8201601f191660200184610be0565b829481845281830111610bc5578281602093846000960137010152565b9080601f83011215610bc55781359067ffffffffffffffff8211610c02578160051b60405193602093610c9485840187610be0565b85528380860192820101928311610bc5578301905b828210610cb7575050505090565b81358152908301908301610ca9565b6000546001600160a01b03163303610cda57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b91908203918211610d2b57565b634e487b7160e01b600052601160045260246000fd5b6000198114610d2b5760010190565b8051821015610d645760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b91908201809211610d2b57565b9081519160005b838110610d9f575050016000815290565b8060208092840101518185015201610d8e565b969590929193946040928351966bffffffffffffffffffffffff1991826060978160209d8a1b168d8c0152881b1660348a01526048890152851b166068870152607c860152609c850152609c845260c084019367ffffffffffffffff9481811086821117610c0257825260009384915b8151861015610ea257610e358683610d50565b518451908a8201528981528481019181831089841117610e8e578291610e70610e6a610e8293610e88968a528a840190610d87565b82610d87565b03605f1981018352603f190182610be0565b95610d41565b94610e22565b634e487b7160e01b85526041600452602485fd5b969795505050505050815191012090565b90610ef592610eed917f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c60002061105c565b929092610f42565b6001600160a01b03908116911603610f0957565b60405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606490fd5b60058110156110465780610f535750565b60018103610fa05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b60028103610fed5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b600314610ff657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b90604181511460001461108a57611086916020820151906060604084015193015160001a90611094565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116111175791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa1561110a5781516001600160a01b03811615611104579190565b50600190565b50604051903d90823e3d90fd5b5050505060009060039056fea264697066735822122081889ddc0c5fc274d1bb327097bf318b9488a8bb95b074b314f1ae08a81d00dd64736f6c63430008130033", + "deployedBytecode": "0x6040608081526004908136101561001557600080fd5b600091823560e01c80630c8e867f14610b625780632352a4bc14610b435780632b437d4814610b085780632b7ac3f314610ae157806334eafb1114610ac25780635bf8633a14610a7e5780636170141e146109b75780636d04319414610958578063715018a6146108fe5780638d633d9a146103b25780638da5cb5b1461038a57806397fc007c146102d1578063a1d891f014610254578063d2fb3b5314610235578063da28b527146101f1578063e7cc7244146101a15763f2fde38b146100dc57600080fd5b3461019d57602036600319011261019d576100f5610bca565b906100fe610cc6565b6001600160a01b0391821692831561014b57505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b5050346101ed57816003193601126101ed5760a0906005549060065490600180851b03908160075416906008549260095416938151958652602086015284015260608301526080820152f35b5080fd5b5050346101ed57816003193601126101ed57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5050346101ed57816003193601126101ed576020906003549051908152f35b5091346102ce5760e03660031901126102ce5761026f610bca565b92602435916001600160a01b03831683036102ce576044359067ffffffffffffffff82116102ce5750916102ac602095926102c794369101610c5f565b916102b5610baf565b9060c4359360a4359360643592610db2565b9051908152f35b80fd5b503461019d57602036600319011261019d576102eb610bca565b6102f3610cc6565b6001600160a01b031691821561033b575080546001600160a01b031916821790557fd24015cc99cc1700cafca3042840a1d8ac1e3964fd2e0e37ea29c654056ee3278280a280f35b906020608492519162461bcd60e51b8352820152602360248201527f4e4654436c61696d65723a20616464726573732063616e206e6f74206265207a60448201526265726f60e81b6064820152fd5b5050346101ed57816003193601126101ed57905490516001600160a01b039091168152602090f35b503461019d57608036600319011261019d5767ffffffffffffffff9181358381116108fa576103e49036908401610c5f565b91602480356064918235928784116108f657366023850112156108f65783850135948886116108f25782850194838736920101116108f25760028054146108b3576002805560035498891561087357885194851561081c5760019a8b036107c557610454600554600a5490610d1e565b8611610776575b6008548681029080820488149015171561076457811061071557918b979593916104f9999795938b7f00000000000000000000000000000000000000000000000000000000000000009460449c8d928335907f000000000000000000000000000000000000000000000000000000000000000090867f0000000000000000000000000000000000000000000000000000000000000000918b33610db2565b85546001600160a01b03949161051d91861690610517368f8f610c18565b91610eb3565b8360075416918460095416918d519485936323b872dd60e01b8552338a8601528b8501528301528160209e8f945af180156106ce576106da575b509089969594938e9b93928c91169b5b8d87831061064c575050505050505061058281600b54610d7a565b600b558860035414610637575b5060ff84518483823783818681018c815203019020541615610614575b50505090815191818084019181855286518093528401950191875b87838210610602575050505050807ff1a869817733568a4d9fdcfb9d02c2e19967dfa6635304703a7f6881b42853119133940390a360025580f35b845188529682019693820193016105c7565b8284519384928337810188815203019020805460ff1916861790553882816105ac565b61064390600a54610d7a565b600a553861058f565b829394959697989950916106609192610d50565b518c3b156101ed578c8683928d519485938492632851206560e21b8452338b8501528c8401525af180156106ce576106ab575b5061069d90610d41565b90899695949392918e610567565b8281116106bc57895261069d610693565b634e487b7160e01b8f5260418452858ffd5b8f8b51903d90823e3d90fd5b8a81813d831161070e575b6106ef8183610be0565b8101031261070a5751801515036107065738610557565b8d80fd5b8e80fd5b503d6106e5565b885162461bcd60e51b81526020818501526025818701527f4e4654436c61696d65723a20696e73756666696369656e7420746f6b656e20616044820152641b5bdd5b9d60da1b81860152608490fd5b634e487b7160e01b8d5260118452858dfd5b885162461bcd60e51b81526020818501526025818701527f4e4654436c61696d65723a206578636565642070617273652031206d617820736044820152647570706c7960d81b81860152608490fd5b6107d4600654600b5490610d1e565b86111561045b575050601d83602089519362461bcd60e51b85528401528201527f4e4654436c61696d65723a20657863656564206d617820737570706c790000006044820152fd5b885162461bcd60e51b8152602081850152602d818701527f4e4654436c61696d65723a20696473206c656e677468206d757374206265206760448201526c0726561746572207468616e203609c1b81860152608490fd5b50601e83602089519362461bcd60e51b85528401528201527f4e4654436c61696d65723a206e6f7420626567696e206f7220656e64656400006044820152fd5b601f83602089519362461bcd60e51b85528401528201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152fd5b8980fd5b8880fd5b8480fd5b83346102ce57806003193601126102ce57610917610cc6565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b8382346101ed5760603660031901126101ed57610973610bca565b60443567ffffffffffffffff81116109b357366023820112156109b3576109b0928160246109a693369301359101610c18565b9060243590610eb3565b80f35b8380fd5b503461019d5760a036600319011261019d576109d1610cc6565b3560058190556024356006819055916001600160a01b03604435818116939290849003610a7a576bffffffffffffffffffffffff60a01b93808560075416176007556064359182600855608435968488168098036108f6577fde378c2c4aad676b12eb56e70a7f6f7778724a466508402b6c49de56dc11ffb89760a0976009541617600955815195865260208601528401526060830152610a70610baf565b166080820152a180f35b8580fd5b5050346101ed57816003193601126101ed57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5050346101ed57816003193601126101ed57602090600b549051908152f35b503461019d578260031936011261019d575490516001600160a01b03909116815260209150f35b5050346101ed57816003193601126101ed57602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b5050346101ed57816003193601126101ed57602090600a549051908152f35b503461019d57602036600319011261019d577f5ca814e8750431ce4d53faa6b24fbf00f6b53f5918a00ab430c0473ba6263424916020913590610ba3610cc6565b8160035551908152a180f35b608435906001600160a01b0382168203610bc557565b600080fd5b600435906001600160a01b0382168203610bc557565b90601f8019910116810190811067ffffffffffffffff821117610c0257604052565b634e487b7160e01b600052604160045260246000fd5b92919267ffffffffffffffff8211610c025760405191610c42601f8201601f191660200184610be0565b829481845281830111610bc5578281602093846000960137010152565b9080601f83011215610bc55781359067ffffffffffffffff8211610c02578160051b60405193602093610c9485840187610be0565b85528380860192820101928311610bc5578301905b828210610cb7575050505090565b81358152908301908301610ca9565b6000546001600160a01b03163303610cda57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b91908203918211610d2b57565b634e487b7160e01b600052601160045260246000fd5b6000198114610d2b5760010190565b8051821015610d645760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b91908201809211610d2b57565b9081519160005b838110610d9f575050016000815290565b8060208092840101518185015201610d8e565b969590929193946040928351966bffffffffffffffffffffffff1991826060978160209d8a1b168d8c0152881b1660348a01526048890152851b166068870152607c860152609c850152609c845260c084019367ffffffffffffffff9481811086821117610c0257825260009384915b8151861015610ea257610e358683610d50565b518451908a8201528981528481019181831089841117610e8e578291610e70610e6a610e8293610e88968a528a840190610d87565b82610d87565b03605f1981018352603f190182610be0565b95610d41565b94610e22565b634e487b7160e01b85526041600452602485fd5b969795505050505050815191012090565b90610ef592610eed917f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c60002061105c565b929092610f42565b6001600160a01b03908116911603610f0957565b60405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606490fd5b60058110156110465780610f535750565b60018103610fa05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b60028103610fed5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b600314610ff657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b90604181511460001461108a57611086916020820151906060604084015193015160001a90611094565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116111175791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa1561110a5781516001600160a01b03811615611104579190565b50600190565b50604051903d90823e3d90fd5b5050505060009060039056fea264697066735822122081889ddc0c5fc274d1bb327097bf318b9488a8bb95b074b314f1ae08a81d00dd64736f6c63430008130033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/config/config_imtbl_test.js b/config/config_imtbl_test.js new file mode 100644 index 0000000..6e76012 --- /dev/null +++ b/config/config_imtbl_test.js @@ -0,0 +1,41 @@ +const market = { + feeToAddress: "0x50A8e60041A206AcaA5F844a1104896224be6F39", + mallFeeAddress: "0x50A8e60041A206AcaA5F844a1104896224be6F39", + paymentTokens: [ + "0x514609B71340E149Cb81A80A953D07A7Fe41bd4F", // USDT + ], +}; + +const admins = { + admin: "0x50A8e60041A206AcaA5F844a1104896224be6F39", + proposers: [ + "0x50A8e60041A206AcaA5F844a1104896224be6F39", + "0x746338765a8FbDD1c5aB61bfb92CD6D960C3C662", + ], + confirmers: ["0x50A8e60041A206AcaA5F844a1104896224be6F39"], + executors: [ + "0x50A8e60041A206AcaA5F844a1104896224be6F39", + "0x746338765a8FbDD1c5aB61bfb92CD6D960C3C662", + "0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b", + ], +}; + +const token = { + baseTokenURI: "https://market.cebg.games/api/nft/info/", + contractURI: 'https://market.cebg.games/api/nft/info/', + royaltyReceiver: '0x5Ab03Aa79Ab91B7420b5CFF134a4188388888888', + royaltyFee: 5, +}; + +const imtbl = { + operatorAllowlist: '0x6b969FD89dE634d8DE3271EbE97734FEFfcd58eE' +} + +var config = { + market, + admins, + token, + imtbl, +}; + +module.exports = config; diff --git a/contracts/activity/NFTClaimStage2.sol b/contracts/activity/NFTClaimStage2.sol index 2a27bbc..3588d17 100644 --- a/contracts/activity/NFTClaimStage2.sol +++ b/contracts/activity/NFTClaimStage2.sol @@ -1,99 +1,125 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.23; +pragma solidity 0.8.19; import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; +import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {HasSignature} from "../core/HasSignature.sol"; /** * Contract for the activity of NFT claim stage 2. */ interface IClaimAbleNFT { - function safeMint( - address to - ) external returns (uint256); + function safeMint(address to, uint256 tokenID) external; } -contract NFTClaimStage2 is HasSignature, ReentrancyGuard{ - uint256 private immutable _CACHED_CHAIN_ID; - address private immutable _CACHED_THIS; - address public immutable nftAddress; - address public verifier; +contract NFTClaimStage2 is HasSignature, ReentrancyGuard { + struct MintConfig { + uint256 parse1MaxSupply; // max supply for phase1 + uint256 maxSupply; // max supply for phase2 + address currency; // token address which user must pay to mint + uint256 mintPrice; // in wei + address feeToAddress; // wallet address to receive mint fee + } + // parse: 0: not open or end, 1: phase1, 2: phase2 + uint256 public mintParse = 0; - bool public isPaused = false; - - mapping(address user => uint256 status) public claimHistory; + uint256 public immutable _CACHED_CHAIN_ID; + address public immutable _CACHED_THIS; + address public immutable nftAddress; - event NFTClaimed( - address indexed nftAddress, - address indexed to, - uint256 tokenId, - uint256 nonce - ); + address public verifier; + MintConfig public mintConfig; + uint256 public parse1Count; + uint256 public totalCount; - event StateUpdated(bool isPaused); - event VerifierUpdated(address indexed verifier); + event NFTClaimed(address indexed nftAddress, address indexed to, uint256[] ids); - constructor(address _nftAddress) { - _CACHED_CHAIN_ID = block.chainid; - _CACHED_THIS = address(this); - nftAddress = _nftAddress; - } + event ParseUpdated(uint256 _parse); + event MintConfigUpdated(MintConfig config); + event VerifierUpdated(address indexed verifier); - modifier whenNotPaused() { - require(!isPaused, "NFTClaimer: paused"); - _; - } + constructor(address _nftAddress, address _verifier, MintConfig memory _mintConfig) { + _CACHED_CHAIN_ID = block.chainid; + _CACHED_THIS = address(this); + nftAddress = _nftAddress; + verifier = _verifier; + mintConfig = _mintConfig; + } - function updatePaused(bool _isPaused) external onlyOwner { - isPaused = _isPaused; - emit StateUpdated(_isPaused); - } - - /** - * @dev update verifier address - */ - function updateVerifier(address _verifier) external onlyOwner { - require(_verifier != address(0), "NFTClaimer: address can not be zero"); - verifier = _verifier; - emit VerifierUpdated(_verifier); - } + modifier whenNotPaused() { + require(mintParse > 0, "NFTClaimer: not begin or ended"); + _; + } - /** - * @dev claim NFT - * Get whitelist signature from a third-party service, then call this method to claim NFT - * @param saltNonce nonce - * @param signature signature - */ - function claim( - uint256 saltNonce, - bytes calldata signature - ) external nonReentrant whenNotPaused { - address to = _msgSender(); - require(claimHistory[to] == 0, "NFTClaimer: already claimed"); - bytes32 criteriaMessageHash = getMessageHash( - to, - nftAddress, - saltNonce - ); - checkSigner(verifier, criteriaMessageHash, signature); - uint256 tokenId = IClaimAbleNFT(nftAddress).safeMint(to); - claimHistory[to] = tokenId; - _useSignature(signature); - emit NFTClaimed(nftAddress, to, tokenId, saltNonce); - } + function updateMintParse(uint256 _mintParse) external onlyOwner { + mintParse = _mintParse; + emit ParseUpdated(_mintParse); + } - function getMessageHash( - address _to, - address _address, - uint256 _saltNonce - ) public view returns (bytes32) { - bytes memory encoded = abi.encodePacked( - _to, - _address, - _CACHED_CHAIN_ID, - _CACHED_THIS, - _saltNonce - ); - return keccak256(encoded); - } + function updateMintConfig(MintConfig calldata config) external onlyOwner { + mintConfig = config; + emit MintConfigUpdated(config); + } + + /** + * @dev update verifier address + */ + function updateVerifier(address _verifier) external onlyOwner { + require(_verifier != address(0), "NFTClaimer: address can not be zero"); + verifier = _verifier; + emit VerifierUpdated(_verifier); + } + + /** + * @dev claim NFT + * Get whitelist signature from a third-party service, then call this method to claim NFT + * @param saltNonce nonce + * @param signature signature + */ + function claim( + uint256[] memory ids, + uint256 tokenAmount, + uint256 saltNonce, + bytes calldata signature + ) external nonReentrant whenNotPaused { + // get current parse; + uint256 count = ids.length; + require(count > 0, "NFTClaimer: ids length must be greater than 0"); + if (mintParse == 1) { + require(count <= mintConfig.parse1MaxSupply - parse1Count, "NFTClaimer: exceed parse 1 max supply"); + } else { + require(count <= mintConfig.maxSupply - totalCount, "NFTClaimer: exceed max supply"); + } + require(tokenAmount >= mintConfig.mintPrice * count, "NFTClaimer: insufficient token amount"); + address to = _msgSender(); + bytes32 criteriaMessageHash = getMessageHash(to, nftAddress, ids, tokenAmount, _CACHED_THIS, _CACHED_CHAIN_ID, saltNonce); + checkSigner(verifier, criteriaMessageHash, signature); + IERC20(mintConfig.currency).transferFrom(to, mintConfig.feeToAddress, tokenAmount); + for (uint256 i = 0; i < count; ++i) { + IClaimAbleNFT(nftAddress).safeMint(to, ids[i]); + } + // require(count > 2, "run to here"); + totalCount += count; + if (mintParse == 1) { + parse1Count += count; + } + _useSignature(signature); + emit NFTClaimed(nftAddress, to, ids); + } + + function getMessageHash( + address _to, + address _address, + uint256[] memory _ids, + uint256 _tokenAmount, + address _contract, + uint256 _chainId, + uint256 _saltNonce + ) public pure returns (bytes32) { + bytes memory encoded = abi.encodePacked(_to, _address, _tokenAmount, _contract, _chainId, _saltNonce); + for (uint256 i = 0; i < _ids.length; ++i) { + encoded = bytes.concat(encoded, abi.encodePacked(_ids[i])); + } + return keccak256(encoded); + } } diff --git a/contracts/core/HasSignature.sol b/contracts/core/HasSignature.sol index 09090c9..0f7b01d 100644 --- a/contracts/core/HasSignature.sol +++ b/contracts/core/HasSignature.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.23; +pragma solidity 0.8.19; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; @@ -14,13 +14,13 @@ contract HasSignature is Ownable { bytes32 ethSignedMessageHash = ECDSA.toEthSignedMessageHash(hash); address recovered = ECDSA.recover(ethSignedMessageHash, signature); - require(recovered == signer, "[BE] invalid signature"); + require(recovered == signer, "invalid signature"); } modifier signatureValid(bytes calldata signature) { require( !_usedSignatures[signature], - "[BE] signature used. please send another transaction with new signature" + "signature used. please send another transaction with new signature" ); _; } diff --git a/contracts/game/NFTLock.sol b/contracts/game/NFTLock.sol new file mode 100644 index 0000000..f2e8823 --- /dev/null +++ b/contracts/game/NFTLock.sol @@ -0,0 +1,125 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.19; +import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; +import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; +import {EnumerableSet} from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; +import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; +contract NFTLock is AccessControl, ERC721Holder { + using EnumerableSet for EnumerableSet.UintSet; + + mapping(address => mapping(uint256 => address)) lockedOriginal; + mapping(address => mapping(address => EnumerableSet.UintSet)) lockedRecords; + mapping(address => bool) supportNftList; + bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE"); + bytes32 public constant UNLOCK_ROLE = keccak256("UNLOCK_ROLE"); + bytes32 public constant RELEASE_ROLE = keccak256("RELEASE_ROLE"); + + event Lock(address indexed nft, address indexed user, uint256 indexed tokenId); + event UnLock(address indexed nft, address indexed user, uint256 indexed tokenId); + event BatchLock(address indexed nft, address indexed user, uint256[] tokenId); + event Release(address indexed nft, uint256[] tokenIds, string serverId); + + constructor() { + _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); + _setupRole(OPERATOR_ROLE, msg.sender); + _setupRole(UNLOCK_ROLE, msg.sender); + _setupRole(RELEASE_ROLE, msg.sender); + } + + function lock(address nft, uint256 tokenId) external { + require(supportNftList[nft], "can't lock this nft"); + IERC721(nft).transferFrom(msg.sender, address(this), tokenId); + lockedOriginal[nft][tokenId] = msg.sender; + lockedRecords[nft][msg.sender].add(tokenId); + emit Lock(nft, msg.sender, tokenId); + } + + function unlock(address nft, address to, uint256 tokenId) external onlyUnlocker { + IERC721(nft).transferFrom(address(this), to, tokenId); + lockedRecords[nft][lockedOriginal[nft][tokenId]].remove(tokenId); + delete lockedOriginal[nft][tokenId]; + emit UnLock(nft, to, tokenId); + } + + function batchLock(address nft, uint256[] calldata tokenIds) external { + require(tokenIds.length <= 100, "tokenIds too many"); + for (uint256 i = 0; i < tokenIds.length; i++) { + IERC721(nft).transferFrom(msg.sender, address(this), tokenIds[i]); + lockedOriginal[nft][tokenIds[i]] = msg.sender; + lockedRecords[nft][msg.sender].add(tokenIds[i]); + } + emit BatchLock(nft, msg.sender, tokenIds); + } + + function release(address nft, uint256[] calldata tokenIds, string calldata serverId) external onlyReleaser { + require(tokenIds.length <= 100, "tokenIds too many"); + for (uint256 i = 0; i < tokenIds.length; i++) { + IERC721(nft).transferFrom(msg.sender, address(this), tokenIds[i]); + lockedRecords[nft][msg.sender].add(tokenIds[i]); + } + emit Release(nft, tokenIds, serverId); + } + + function originalOwner(address token, uint256 tokenId) public view returns (address) { + return lockedOriginal[token][tokenId]; + } + + function lockedNum(address token, address user) public view returns (uint256) { + return lockedRecords[token][user].length(); + } + + function lockedNft(address token, address user) public view returns (uint256[] memory) { + return lockedRecords[token][user].values(); + } + + /** ------set------- **/ + function setOperatorRole(address to) external { + grantRole(OPERATOR_ROLE, to); + } + + function removeOperatorRole(address to) external { + revokeRole(OPERATOR_ROLE, to); + } + + function setReleaseRole(address to) external { + grantRole(RELEASE_ROLE, to); + } + + function removeReleaseRole(address to) external { + revokeRole(RELEASE_ROLE, to); + } + + function setUnlockRole(address to) external { + grantRole(UNLOCK_ROLE, to); + } + + function removeUnlockRole(address to) external { + revokeRole(UNLOCK_ROLE, to); + } + + function addSupportNftList(address[] calldata nftList) external onlyOperator { + for (uint256 i = 0; i < nftList.length; i++) { + supportNftList[nftList[i]] = true; + } + } + function removeSupportNft(address nftAddress) external onlyOperator { + require(supportNftList[nftAddress], "can't remove"); + delete supportNftList[nftAddress]; + } + + /** ------modifier------- **/ + modifier onlyOperator() { + require(hasRole(OPERATOR_ROLE, msg.sender), "not operator role"); + _; + } + + modifier onlyUnlocker() { + require(hasRole(UNLOCK_ROLE, msg.sender), "not unlocker role"); + _; + } + + modifier onlyReleaser() { + require(hasRole(RELEASE_ROLE, msg.sender), "not releaser role"); + _; + } +} diff --git a/contracts/test/OperatorAllowlist.sol b/contracts/test/OperatorAllowlist.sol new file mode 100644 index 0000000..ed89dd2 --- /dev/null +++ b/contracts/test/OperatorAllowlist.sol @@ -0,0 +1,178 @@ +// Copyright Immutable Pty Ltd 2018 - 2023 +// SPDX-License-Identifier: Apache 2.0 +pragma solidity 0.8.19; + +// Access Control +import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol"; + +// Introspection +import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; + +// Interfaces +import {IOperatorAllowlist} from "@imtbl/contracts/contracts/allowlist/IOperatorAllowlist.sol"; + +// Interface to retrieve the implemention stored inside the Proxy contract +interface IProxy { + // Returns the current implementation address used by the proxy contract + // solhint-disable-next-line func-name-mixedcase + function PROXY_getImplementation() external view returns (address); +} + +/* + OperatorAllowlist is an implementation of a Allowlist registry, storing addresses and bytecode + which are allowed to be approved operators and execute transfers of interfacing token contracts (e.g. ERC721/ERC1155). + The registry will be a deployed contract that tokens may interface with and point to. + OperatorAllowlist is not designed to be upgradeable or extended. +*/ + +contract OperatorAllowlist is ERC165, AccessControl, IOperatorAllowlist { + /// ===== State Variables ===== + + /// @notice Only REGISTRAR_ROLE can invoke white listing registration and removal + bytes32 public constant REGISTRAR_ROLE = bytes32("REGISTRAR_ROLE"); + + /// @notice Mapping of Allowlisted addresses + mapping(address aContract => bool allowed) private addressAllowlist; + + /// @notice Mapping of Allowlisted implementation addresses + mapping(address impl => bool allowed) private addressImplementationAllowlist; + + /// @notice Mapping of Allowlisted bytecodes + mapping(bytes32 bytecodeHash => bool allowed) private bytecodeAllowlist; + + /// ===== Events ===== + + /// @notice Emitted when a target address is added or removed from the Allowlist + event AddressAllowlistChanged(address indexed target, bool added); + + /// @notice Emitted when a target smart contract wallet is added or removed from the Allowlist + event WalletAllowlistChanged(bytes32 indexed targetBytes, address indexed targetAddress, bool added); + + /// ===== Constructor ===== + + /** + * @notice Grants `DEFAULT_ADMIN_ROLE` to the supplied `admin` address + * @param admin the address to grant `DEFAULT_ADMIN_ROLE` to + */ + constructor(address admin) { + _grantRole(DEFAULT_ADMIN_ROLE, admin); + } + + /// ===== External functions ===== + + /** + * @notice Add a target address to Allowlist + * @param addressTargets the addresses to be added to the allowlist + */ + function addAddressToAllowlist(address[] calldata addressTargets) external onlyRole(REGISTRAR_ROLE) { + for (uint256 i; i < addressTargets.length; i++) { + addressAllowlist[addressTargets[i]] = true; + emit AddressAllowlistChanged(addressTargets[i], true); + } + } + + /** + * @notice Remove a target address from Allowlist + * @param addressTargets the addresses to be removed from the allowlist + */ + function removeAddressFromAllowlist(address[] calldata addressTargets) external onlyRole(REGISTRAR_ROLE) { + for (uint256 i; i < addressTargets.length; i++) { + delete addressAllowlist[addressTargets[i]]; + emit AddressAllowlistChanged(addressTargets[i], false); + } + } + + /** + * @notice Add a smart contract wallet to the Allowlist. + * This will allowlist the proxy and implementation contract pair. + * First, the bytecode of the proxy is added to the bytecode allowlist. + * Second, the implementation address stored in the proxy is stored in the + * implementation address allowlist. + * @param walletAddr the wallet address to be added to the allowlist + */ + function addWalletToAllowlist(address walletAddr) external onlyRole(REGISTRAR_ROLE) { + // get bytecode of wallet + bytes32 codeHash; + // solhint-disable-next-line no-inline-assembly + assembly { + codeHash := extcodehash(walletAddr) + } + bytecodeAllowlist[codeHash] = true; + // get address of wallet module + address impl = IProxy(walletAddr).PROXY_getImplementation(); + addressImplementationAllowlist[impl] = true; + + emit WalletAllowlistChanged(codeHash, walletAddr, true); + } + + /** + * @notice Remove a smart contract wallet from the Allowlist + * This will remove the proxy bytecode hash and implementation contract address pair from the allowlist + * @param walletAddr the wallet address to be removed from the allowlist + */ + function removeWalletFromAllowlist(address walletAddr) external onlyRole(REGISTRAR_ROLE) { + // get bytecode of wallet + bytes32 codeHash; + // solhint-disable-next-line no-inline-assembly + assembly { + codeHash := extcodehash(walletAddr) + } + delete bytecodeAllowlist[codeHash]; + // get address of wallet module + address impl = IProxy(walletAddr).PROXY_getImplementation(); + delete addressImplementationAllowlist[impl]; + + emit WalletAllowlistChanged(codeHash, walletAddr, false); + } + + /** + * @notice Allows admin to grant `user` `REGISTRAR_ROLE` role + * @param user the address that `REGISTRAR_ROLE` will be granted to + */ + function grantRegistrarRole(address user) external onlyRole(DEFAULT_ADMIN_ROLE) { + grantRole(REGISTRAR_ROLE, user); + } + + /** + * @notice Allows admin to revoke `REGISTRAR_ROLE` role from `user` + * @param user the address that `REGISTRAR_ROLE` will be revoked from + */ + function revokeRegistrarRole(address user) external onlyRole(DEFAULT_ADMIN_ROLE) { + revokeRole(REGISTRAR_ROLE, user); + } + + /// ===== View functions ===== + + /** + * @notice Returns true if an address is Allowlisted, false otherwise + * @param target the address that will be checked for presence in the allowlist + */ + function isAllowlisted(address target) external view override returns (bool) { + if (addressAllowlist[target]) { + return true; + } + + // Check if caller is a Allowlisted smart contract wallet + bytes32 codeHash; + // solhint-disable-next-line no-inline-assembly + assembly { + codeHash := extcodehash(target) + } + if (bytecodeAllowlist[codeHash]) { + // If wallet proxy bytecode is approved, check addr of implementation contract + address impl = IProxy(target).PROXY_getImplementation(); + + return addressImplementationAllowlist[impl]; + } + + return false; + } + + /** + * @notice ERC-165 interface support + * @param interfaceId The interface identifier, which is a 4-byte selector. + */ + function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, AccessControl) returns (bool) { + return interfaceId == type(IOperatorAllowlist).interfaceId || super.supportsInterface(interfaceId); + } +} diff --git a/contracts/tokens/erc721/CFNFTGame.sol b/contracts/tokens/erc721/CFNFTGame.sol index c5484fb..194c6f5 100644 --- a/contracts/tokens/erc721/CFNFTGame.sol +++ b/contracts/tokens/erc721/CFNFTGame.sol @@ -1,8 +1,7 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.23; +pragma solidity 0.8.19; -// import {ImmutableERC721Base} from "@imtbl/contracts/token/erc721/abstract/ImmutableERC721Base.sol"; -import {ImmutableERC721MintByID} from "@imtbl/contracts/token/erc721/preset/ImmutableERC721MintByID.sol"; +import {ImmutableERC721MintByID} from "@imtbl/contracts/contracts/token/erc721/preset/ImmutableERC721MintByID.sol"; contract CFNFTGame is ImmutableERC721MintByID{ /** diff --git a/contracts/utils/TimeChecker.sol b/contracts/utils/TimeChecker.sol index 3df4068..d0cf9a4 100644 --- a/contracts/utils/TimeChecker.sol +++ b/contracts/utils/TimeChecker.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.23; +pragma solidity 0.8.19; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; contract TimeChecker is Ownable { diff --git a/deploy/1_deploy_nft.ts b/deploy/1_deploy_nft.ts new file mode 100644 index 0000000..fd01d9a --- /dev/null +++ b/deploy/1_deploy_nft.ts @@ -0,0 +1,35 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; +import { updateArray } from "../scripts/utils" + +const deployNFTForGame: DeployFunction = + async function (hre: HardhatRuntimeEnvironment) { + const provider = hre.ethers.provider; + const from = await (await provider.getSigner()).getAddress(); + const config = require(`../config/config_${hre.network.name}`); + console.log(config); + const owner = from; + const name = "CFHero"; + const symbol = "CFH"; + // testnet: 0x6b969FD89dE634d8DE3271EbE97734FEFfcd58eE + // mainnet: 0x5F5EBa8133f68ea22D712b0926e2803E78D89221 + const { operatorAllowlist } = config.imtbl; + const { royaltyReceiver, feeNumerator, baseURI, contractURI } = config.token; + const ret = await hre.deployments.deploy("CFNFTGame", { + from, + args: [owner, name, symbol, baseURI, contractURI, operatorAllowlist, royaltyReceiver, feeNumerator], + log: true, + }); + console.log("==CFNFTGame addr=", ret.address); + updateArray({ + name: "CFHero", + type: "erc721", + json: "assets/contracts/CFNFTGame.json", + address: ret.address, + network: hre.network.name, + }); + }; + + deployNFTForGame.tags = ["CFNFTGame"]; + +export default deployNFTForGame; diff --git a/deploy/1_deploy_nftclaimer.ts b/deploy/1_deploy_nftclaimer.ts deleted file mode 100644 index f524bf7..0000000 --- a/deploy/1_deploy_nftclaimer.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { DeployFunction } from "hardhat-deploy/types"; -import { ethers } from "hardhat"; - - -const deployNFTClaim: DeployFunction = - async function (hre: HardhatRuntimeEnvironment) { - const provider = ethers.provider; - const from = await (await provider.getSigner()).getAddress(); - - console.log(from); - const ret = await hre.deployments.deploy("NFTClaimStage2", { - from, - args: [], - log: true, - }); - console.log("==NFTClaimStage2 addr=", ret.address); - }; - - deployNFTClaim.tags = ["NFTClaimStage2"]; - -export default deployNFTClaim; diff --git a/deploy/2_deploy_nft.ts b/deploy/2_deploy_nft.ts deleted file mode 100644 index 21c53e8..0000000 --- a/deploy/2_deploy_nft.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { DeployFunction } from "hardhat-deploy/types"; -import { ethers } from "hardhat"; - - -const deployNFTForGame: DeployFunction = - async function (hre: HardhatRuntimeEnvironment) { - const provider = ethers.provider; - const from = await (await provider.getSigner()).getAddress(); - - console.log(from); - const ret = await hre.deployments.deploy("CFNFTGame", { - from, - args: [], - log: true, - }); - console.log("==CFNFTGame addr=", ret.address); - }; - - deployNFTForGame.tags = ["CFNFTGame"]; - -export default deployNFTForGame; diff --git a/deploy/2_deploy_nftclaimer.ts b/deploy/2_deploy_nftclaimer.ts new file mode 100644 index 0000000..44923f3 --- /dev/null +++ b/deploy/2_deploy_nftclaimer.ts @@ -0,0 +1,38 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; +import { updateArray } from "../scripts/utils" + + +const deployNFTClaim: DeployFunction = + async function (hre: HardhatRuntimeEnvironment) { + const provider = hre.ethers.provider; + const from = await (await provider.getSigner()).getAddress(); + + console.log(from); + const nftAddress = '0xaa34B79A0Ab433eaC900fB3CB9f191F5Cd27501D'; + const verifier = '0x5Ab03Aa79Ab91B7420b5CFF134a4188388888888' + const mintConfig = [ + 1000, + 2000, + '0xaa34B79A0Ab433eaC900fB3CB9f191F5Cd27501D', + 100, + '0x5Ab03Aa79Ab91B7420b5CFF134a4188388888888' + ] + const ret = await hre.deployments.deploy("NFTClaimStage2", { + from, + args: [nftAddress, verifier, mintConfig], + log: true, + }); + console.log("==NFTClaimStage2 addr=", ret.address); + updateArray({ + name: "NFTClaimStage2", + type: "logic", + json: "assets/contracts/NFTClaimStage2.json", + address: ret.address, + network: hre.network.name, + }); + }; + + deployNFTClaim.tags = ["NFTClaimStage2"]; + +export default deployNFTClaim; diff --git a/deploy/3_1_deploy_test_tokon.ts b/deploy/3_1_deploy_test_tokon.ts new file mode 100644 index 0000000..5b69ecc --- /dev/null +++ b/deploy/3_1_deploy_test_tokon.ts @@ -0,0 +1,30 @@ +import { HardhatRuntimeEnvironment } from "hardhat/types"; +import { DeployFunction } from "hardhat-deploy/types"; +import { updateArray } from "../scripts/utils" + +const deployNFTForGame: DeployFunction = + async function (hre: HardhatRuntimeEnvironment) { + const provider = hre.ethers.provider; + const from = await (await provider.getSigner()).getAddress(); + const config = require(`../config/config_${hre.network.name}`); + const owner = from; + const name = "Test Token"; + const symbol = "TETH"; + const ret = await hre.deployments.deploy("ImmutableERC20MinterBurnerPermit", { + from, + args: [owner, owner, owner, name, symbol, '10000000000000000000000000'], + log: true, + }); + console.log("==ImmutableERC20MinterBurnerPermit addr=", ret.address); + updateArray({ + name: "TestToken", + type: "erc20", + json: "assets/contracts/ImmutableERC20MinterBurnerPermit.json", + address: ret.address, + network: hre.network.name, + }); + }; + + deployNFTForGame.tags = ["TestToken"]; + +export default deployNFTForGame; diff --git a/deployments/imtbl_test/NFTClaimStage2.json b/deployments/imtbl_test/NFTClaimStage2.json new file mode 100644 index 0000000..3a737e4 --- /dev/null +++ b/deployments/imtbl_test/NFTClaimStage2.json @@ -0,0 +1,707 @@ +{ + "address": "0xf45702180314187a3549FEDac3B78349b47ca6A0", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_nftAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "_verifier", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "parse1MaxSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSupply", + "type": "uint256" + }, + { + "internalType": "address", + "name": "currency", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "feeToAddress", + "type": "address" + } + ], + "internalType": "struct NFTClaimStage2.MintConfig", + "name": "_mintConfig", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "parse1MaxSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSupply", + "type": "uint256" + }, + { + "internalType": "address", + "name": "currency", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "feeToAddress", + "type": "address" + } + ], + "indexed": false, + "internalType": "struct NFTClaimStage2.MintConfig", + "name": "config", + "type": "tuple" + } + ], + "name": "MintConfigUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "nftAddress", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + } + ], + "name": "NFTClaimed", + "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": "uint256", + "name": "_parse", + "type": "uint256" + } + ], + "name": "ParseUpdated", + "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": "signer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "checkSigner", + "outputs": [], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "ids", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "tokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "saltNonce", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "claim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "_ids", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "_tokenAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "_contract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_chainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_saltNonce", + "type": "uint256" + } + ], + "name": "getMessageHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "mintConfig", + "outputs": [ + { + "internalType": "uint256", + "name": "parse1MaxSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSupply", + "type": "uint256" + }, + { + "internalType": "address", + "name": "currency", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "feeToAddress", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "mintParse", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nftAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "parse1Count", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "parse1MaxSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxSupply", + "type": "uint256" + }, + { + "internalType": "address", + "name": "currency", + "type": "address" + }, + { + "internalType": "uint256", + "name": "mintPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "feeToAddress", + "type": "address" + } + ], + "internalType": "struct NFTClaimStage2.MintConfig", + "name": "config", + "type": "tuple" + } + ], + "name": "updateMintConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_mintParse", + "type": "uint256" + } + ], + "name": "updateMintParse", + "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": "0xea03f21dadb9169c0fbfded92459c644a3ae9e046165e552167486826d79f019", + "receipt": { + "to": null, + "from": "0x50A8e60041A206AcaA5F844a1104896224be6F39", + "contractAddress": "0xf45702180314187a3549FEDac3B78349b47ca6A0", + "transactionIndex": 0, + "gasUsed": "1200979", + "logsBloom": "0x00000000000000000000000000100000000000000000000000800000000800000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000020000000000000000000000000000000000000020000000000000000000000000000", + "blockHash": "0x5bda0e7ce87f77b2dbe72c2dacff7354bb4ac101a9995fc34d438e8e873fed56", + "transactionHash": "0xea03f21dadb9169c0fbfded92459c644a3ae9e046165e552167486826d79f019", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 9037735, + "transactionHash": "0xea03f21dadb9169c0fbfded92459c644a3ae9e046165e552167486826d79f019", + "address": "0xf45702180314187a3549FEDac3B78349b47ca6A0", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000050a8e60041a206acaa5f844a1104896224be6f39" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x5bda0e7ce87f77b2dbe72c2dacff7354bb4ac101a9995fc34d438e8e873fed56" + } + ], + "blockNumber": 9037735, + "cumulativeGasUsed": "1200979", + "status": 1, + "byzantium": true + }, + "args": [ + "0xaa34B79A0Ab433eaC900fB3CB9f191F5Cd27501D", + "0x5Ab03Aa79Ab91B7420b5CFF134a4188388888888", + [ + 1000, + 2000, + "0xaa34B79A0Ab433eaC900fB3CB9f191F5Cd27501D", + 100, + "0x5Ab03Aa79Ab91B7420b5CFF134a4188388888888" + ] + ], + "numDeployments": 1, + "solcInputHash": "83285a095786820eb6eda6277c7f120a", + "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_nftAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_verifier\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"parse1MaxSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSupply\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"currency\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"mintPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToAddress\",\"type\":\"address\"}],\"internalType\":\"struct NFTClaimStage2.MintConfig\",\"name\":\"_mintConfig\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"parse1MaxSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSupply\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"currency\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"mintPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToAddress\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"struct NFTClaimStage2.MintConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"MintConfigUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"nftAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"NFTClaimed\",\"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\":\"uint256\",\"name\":\"_parse\",\"type\":\"uint256\"}],\"name\":\"ParseUpdated\",\"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\":\"signer\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"checkSigner\",\"outputs\":[],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"tokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"saltNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_address\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"_ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256\",\"name\":\"_tokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_contract\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_saltNonce\",\"type\":\"uint256\"}],\"name\":\"getMessageHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mintConfig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"parse1MaxSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSupply\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"currency\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"mintPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"mintParse\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nftAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"parse1Count\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"parse1MaxSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxSupply\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"currency\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"mintPrice\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"feeToAddress\",\"type\":\"address\"}],\"internalType\":\"struct NFTClaimStage2.MintConfig\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"updateMintConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_mintParse\",\"type\":\"uint256\"}],\"name\":\"updateMintParse\",\"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\":{\"kind\":\"dev\",\"methods\":{\"claim(uint256[],uint256,uint256,bytes)\":{\"details\":\"claim NFT Get whitelist signature from a third-party service, then call this method to claim NFT\",\"params\":{\"saltNonce\":\"nonce\",\"signature\":\"signature\"}},\"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.\"},\"updateVerifier(address)\":{\"details\":\"update verifier address\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/activity/NFTClaimStage2.sol\":\"NFTClaimStage2\"},\"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/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuard {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n constructor() {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0xa535a5df777d44e945dd24aa43a11e44b024140fc340ad0dfe42acf4002aade1\",\"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/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\"},\"contracts/activity/NFTClaimStage2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {ReentrancyGuard} from \\\"@openzeppelin/contracts/security/ReentrancyGuard.sol\\\";\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {HasSignature} from \\\"../core/HasSignature.sol\\\";\\n\\n/**\\n * Contract for the activity of NFT claim stage 2.\\n */\\ninterface IClaimAbleNFT {\\n function safeMint(address to, uint256 tokenID) external;\\n}\\n\\ncontract NFTClaimStage2 is HasSignature, ReentrancyGuard {\\n struct MintConfig {\\n uint256 parse1MaxSupply; // max supply for phase1\\n uint256 maxSupply; // max supply for phase2\\n address currency; // token address which user must pay to mint\\n uint256 mintPrice; // in wei\\n address feeToAddress; // wallet address to receive mint fee\\n }\\n // parse: 0: not open or end, 1: phase1, 2: phase2\\n uint256 public mintParse = 0;\\n\\n uint256 public immutable _CACHED_CHAIN_ID;\\n address public immutable _CACHED_THIS;\\n address public immutable nftAddress;\\n\\n address public verifier;\\n MintConfig public mintConfig;\\n uint256 public parse1Count;\\n uint256 public totalCount;\\n\\n event NFTClaimed(address indexed nftAddress, address indexed to, uint256[] ids);\\n\\n event ParseUpdated(uint256 _parse);\\n event MintConfigUpdated(MintConfig config);\\n event VerifierUpdated(address indexed verifier);\\n\\n constructor(address _nftAddress, address _verifier, MintConfig memory _mintConfig) {\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_THIS = address(this);\\n nftAddress = _nftAddress;\\n verifier = _verifier;\\n mintConfig = _mintConfig;\\n }\\n\\n modifier whenNotPaused() {\\n require(mintParse > 0, \\\"NFTClaimer: not begin or ended\\\");\\n _;\\n }\\n\\n function updateMintParse(uint256 _mintParse) external onlyOwner {\\n mintParse = _mintParse;\\n emit ParseUpdated(_mintParse);\\n }\\n\\n function updateMintConfig(MintConfig calldata config) external onlyOwner {\\n mintConfig = config;\\n emit MintConfigUpdated(config);\\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 /**\\n * @dev claim NFT\\n * Get whitelist signature from a third-party service, then call this method to claim NFT\\n * @param saltNonce nonce\\n * @param signature signature\\n */\\n function claim(\\n uint256[] memory ids,\\n uint256 tokenAmount,\\n uint256 saltNonce,\\n bytes calldata signature\\n ) external nonReentrant whenNotPaused {\\n // get current parse;\\n uint256 count = ids.length;\\n require(count > 0, \\\"NFTClaimer: ids length must be greater than 0\\\");\\n if (mintParse == 1) {\\n require(count <= mintConfig.parse1MaxSupply - parse1Count, \\\"NFTClaimer: exceed parse 1 max supply\\\");\\n } else {\\n require(count <= mintConfig.maxSupply - totalCount, \\\"NFTClaimer: exceed max supply\\\");\\n }\\n require(tokenAmount >= mintConfig.mintPrice * count, \\\"NFTClaimer: insufficient token amount\\\");\\n address to = _msgSender();\\n bytes32 criteriaMessageHash = getMessageHash(to, nftAddress, ids, tokenAmount, _CACHED_THIS, _CACHED_CHAIN_ID, saltNonce);\\n checkSigner(verifier, criteriaMessageHash, signature);\\n IERC20(mintConfig.currency).transferFrom(to, mintConfig.feeToAddress, tokenAmount);\\n for (uint256 i = 0; i < count; ++i) {\\n IClaimAbleNFT(nftAddress).safeMint(to, ids[i]);\\n }\\n // require(count > 2, \\\"run to here\\\");\\n totalCount += count;\\n if (mintParse == 1) {\\n parse1Count += count;\\n }\\n _useSignature(signature);\\n emit NFTClaimed(nftAddress, to, ids);\\n }\\n\\n function getMessageHash(\\n address _to,\\n address _address,\\n uint256[] memory _ids,\\n uint256 _tokenAmount,\\n address _contract,\\n uint256 _chainId,\\n uint256 _saltNonce\\n ) public pure returns (bytes32) {\\n bytes memory encoded = abi.encodePacked(_to, _address, _tokenAmount, _contract, _chainId, _saltNonce);\\n for (uint256 i = 0; i < _ids.length; ++i) {\\n encoded = bytes.concat(encoded, abi.encodePacked(_ids[i]));\\n }\\n return keccak256(encoded);\\n }\\n}\\n\",\"keccak256\":\"0xdd0caf9f3633dfff1217e0e08adb0524cca73f86ef1d5f6af18efb4798a9125f\",\"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\"}},\"version\":1}", + "bytecode": "0x60e034620001ad576001600160401b0390601f6200132138819003918201601f191683019291848411838510176200019757808392604095865283398101039060e08212620001ad576200005381620001b2565b9060a06200006460208301620001b2565b93603f190112620001ad5783519460a08601908111868210176200019757845283810151855260608101519160208601928352620000a560808301620001b2565b858701908152620000c560c060a08501519460608a0195865201620001b2565b93608088019485526000549760018060a01b03199733898b1617600055519860018060a01b039788958692833391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a360016002556000600355466080523060a05260c05216886004541617600455516005555160065551168460075416176007555160085551169060095416176009556111599081620001c882396080518181816104af0152610b20015260a05181818161020601526104d2015260c0518181816104850152610a930152f35b634e487b7160e01b600052604160045260246000fd5b600080fd5b51906001600160a01b0382168203620001ad5756fe6040608081526004908136101561001557600080fd5b600091823560e01c80630c8e867f14610b625780632352a4bc14610b435780632b437d4814610b085780632b7ac3f314610ae157806334eafb1114610ac25780635bf8633a14610a7e5780636170141e146109b75780636d04319414610958578063715018a6146108fe5780638d633d9a146103b25780638da5cb5b1461038a57806397fc007c146102d1578063a1d891f014610254578063d2fb3b5314610235578063da28b527146101f1578063e7cc7244146101a15763f2fde38b146100dc57600080fd5b3461019d57602036600319011261019d576100f5610bca565b906100fe610cc6565b6001600160a01b0391821692831561014b57505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b5050346101ed57816003193601126101ed5760a0906005549060065490600180851b03908160075416906008549260095416938151958652602086015284015260608301526080820152f35b5080fd5b5050346101ed57816003193601126101ed57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5050346101ed57816003193601126101ed576020906003549051908152f35b5091346102ce5760e03660031901126102ce5761026f610bca565b92602435916001600160a01b03831683036102ce576044359067ffffffffffffffff82116102ce5750916102ac602095926102c794369101610c5f565b916102b5610baf565b9060c4359360a4359360643592610db2565b9051908152f35b80fd5b503461019d57602036600319011261019d576102eb610bca565b6102f3610cc6565b6001600160a01b031691821561033b575080546001600160a01b031916821790557fd24015cc99cc1700cafca3042840a1d8ac1e3964fd2e0e37ea29c654056ee3278280a280f35b906020608492519162461bcd60e51b8352820152602360248201527f4e4654436c61696d65723a20616464726573732063616e206e6f74206265207a60448201526265726f60e81b6064820152fd5b5050346101ed57816003193601126101ed57905490516001600160a01b039091168152602090f35b503461019d57608036600319011261019d5767ffffffffffffffff9181358381116108fa576103e49036908401610c5f565b91602480356064918235928784116108f657366023850112156108f65783850135948886116108f25782850194838736920101116108f25760028054146108b3576002805560035498891561087357885194851561081c5760019a8b036107c557610454600554600a5490610d1e565b8611610776575b6008548681029080820488149015171561076457811061071557918b979593916104f9999795938b7f00000000000000000000000000000000000000000000000000000000000000009460449c8d928335907f000000000000000000000000000000000000000000000000000000000000000090867f0000000000000000000000000000000000000000000000000000000000000000918b33610db2565b85546001600160a01b03949161051d91861690610517368f8f610c18565b91610eb3565b8360075416918460095416918d519485936323b872dd60e01b8552338a8601528b8501528301528160209e8f945af180156106ce576106da575b509089969594938e9b93928c91169b5b8d87831061064c575050505050505061058281600b54610d7a565b600b558860035414610637575b5060ff84518483823783818681018c815203019020541615610614575b50505090815191818084019181855286518093528401950191875b87838210610602575050505050807ff1a869817733568a4d9fdcfb9d02c2e19967dfa6635304703a7f6881b42853119133940390a360025580f35b845188529682019693820193016105c7565b8284519384928337810188815203019020805460ff1916861790553882816105ac565b61064390600a54610d7a565b600a553861058f565b829394959697989950916106609192610d50565b518c3b156101ed578c8683928d519485938492632851206560e21b8452338b8501528c8401525af180156106ce576106ab575b5061069d90610d41565b90899695949392918e610567565b8281116106bc57895261069d610693565b634e487b7160e01b8f5260418452858ffd5b8f8b51903d90823e3d90fd5b8a81813d831161070e575b6106ef8183610be0565b8101031261070a5751801515036107065738610557565b8d80fd5b8e80fd5b503d6106e5565b885162461bcd60e51b81526020818501526025818701527f4e4654436c61696d65723a20696e73756666696369656e7420746f6b656e20616044820152641b5bdd5b9d60da1b81860152608490fd5b634e487b7160e01b8d5260118452858dfd5b885162461bcd60e51b81526020818501526025818701527f4e4654436c61696d65723a206578636565642070617273652031206d617820736044820152647570706c7960d81b81860152608490fd5b6107d4600654600b5490610d1e565b86111561045b575050601d83602089519362461bcd60e51b85528401528201527f4e4654436c61696d65723a20657863656564206d617820737570706c790000006044820152fd5b885162461bcd60e51b8152602081850152602d818701527f4e4654436c61696d65723a20696473206c656e677468206d757374206265206760448201526c0726561746572207468616e203609c1b81860152608490fd5b50601e83602089519362461bcd60e51b85528401528201527f4e4654436c61696d65723a206e6f7420626567696e206f7220656e64656400006044820152fd5b601f83602089519362461bcd60e51b85528401528201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152fd5b8980fd5b8880fd5b8480fd5b83346102ce57806003193601126102ce57610917610cc6565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b8382346101ed5760603660031901126101ed57610973610bca565b60443567ffffffffffffffff81116109b357366023820112156109b3576109b0928160246109a693369301359101610c18565b9060243590610eb3565b80f35b8380fd5b503461019d5760a036600319011261019d576109d1610cc6565b3560058190556024356006819055916001600160a01b03604435818116939290849003610a7a576bffffffffffffffffffffffff60a01b93808560075416176007556064359182600855608435968488168098036108f6577fde378c2c4aad676b12eb56e70a7f6f7778724a466508402b6c49de56dc11ffb89760a0976009541617600955815195865260208601528401526060830152610a70610baf565b166080820152a180f35b8580fd5b5050346101ed57816003193601126101ed57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5050346101ed57816003193601126101ed57602090600b549051908152f35b503461019d578260031936011261019d575490516001600160a01b03909116815260209150f35b5050346101ed57816003193601126101ed57602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b5050346101ed57816003193601126101ed57602090600a549051908152f35b503461019d57602036600319011261019d577f5ca814e8750431ce4d53faa6b24fbf00f6b53f5918a00ab430c0473ba6263424916020913590610ba3610cc6565b8160035551908152a180f35b608435906001600160a01b0382168203610bc557565b600080fd5b600435906001600160a01b0382168203610bc557565b90601f8019910116810190811067ffffffffffffffff821117610c0257604052565b634e487b7160e01b600052604160045260246000fd5b92919267ffffffffffffffff8211610c025760405191610c42601f8201601f191660200184610be0565b829481845281830111610bc5578281602093846000960137010152565b9080601f83011215610bc55781359067ffffffffffffffff8211610c02578160051b60405193602093610c9485840187610be0565b85528380860192820101928311610bc5578301905b828210610cb7575050505090565b81358152908301908301610ca9565b6000546001600160a01b03163303610cda57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b91908203918211610d2b57565b634e487b7160e01b600052601160045260246000fd5b6000198114610d2b5760010190565b8051821015610d645760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b91908201809211610d2b57565b9081519160005b838110610d9f575050016000815290565b8060208092840101518185015201610d8e565b969590929193946040928351966bffffffffffffffffffffffff1991826060978160209d8a1b168d8c0152881b1660348a01526048890152851b166068870152607c860152609c850152609c845260c084019367ffffffffffffffff9481811086821117610c0257825260009384915b8151861015610ea257610e358683610d50565b518451908a8201528981528481019181831089841117610e8e578291610e70610e6a610e8293610e88968a528a840190610d87565b82610d87565b03605f1981018352603f190182610be0565b95610d41565b94610e22565b634e487b7160e01b85526041600452602485fd5b969795505050505050815191012090565b90610ef592610eed917f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c60002061105c565b929092610f42565b6001600160a01b03908116911603610f0957565b60405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606490fd5b60058110156110465780610f535750565b60018103610fa05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b60028103610fed5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b600314610ff657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b90604181511460001461108a57611086916020820151906060604084015193015160001a90611094565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116111175791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa1561110a5781516001600160a01b03811615611104579190565b50600190565b50604051903d90823e3d90fd5b5050505060009060039056fea264697066735822122081889ddc0c5fc274d1bb327097bf318b9488a8bb95b074b314f1ae08a81d00dd64736f6c63430008130033", + "deployedBytecode": "0x6040608081526004908136101561001557600080fd5b600091823560e01c80630c8e867f14610b625780632352a4bc14610b435780632b437d4814610b085780632b7ac3f314610ae157806334eafb1114610ac25780635bf8633a14610a7e5780636170141e146109b75780636d04319414610958578063715018a6146108fe5780638d633d9a146103b25780638da5cb5b1461038a57806397fc007c146102d1578063a1d891f014610254578063d2fb3b5314610235578063da28b527146101f1578063e7cc7244146101a15763f2fde38b146100dc57600080fd5b3461019d57602036600319011261019d576100f5610bca565b906100fe610cc6565b6001600160a01b0391821692831561014b57505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b5050346101ed57816003193601126101ed5760a0906005549060065490600180851b03908160075416906008549260095416938151958652602086015284015260608301526080820152f35b5080fd5b5050346101ed57816003193601126101ed57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5050346101ed57816003193601126101ed576020906003549051908152f35b5091346102ce5760e03660031901126102ce5761026f610bca565b92602435916001600160a01b03831683036102ce576044359067ffffffffffffffff82116102ce5750916102ac602095926102c794369101610c5f565b916102b5610baf565b9060c4359360a4359360643592610db2565b9051908152f35b80fd5b503461019d57602036600319011261019d576102eb610bca565b6102f3610cc6565b6001600160a01b031691821561033b575080546001600160a01b031916821790557fd24015cc99cc1700cafca3042840a1d8ac1e3964fd2e0e37ea29c654056ee3278280a280f35b906020608492519162461bcd60e51b8352820152602360248201527f4e4654436c61696d65723a20616464726573732063616e206e6f74206265207a60448201526265726f60e81b6064820152fd5b5050346101ed57816003193601126101ed57905490516001600160a01b039091168152602090f35b503461019d57608036600319011261019d5767ffffffffffffffff9181358381116108fa576103e49036908401610c5f565b91602480356064918235928784116108f657366023850112156108f65783850135948886116108f25782850194838736920101116108f25760028054146108b3576002805560035498891561087357885194851561081c5760019a8b036107c557610454600554600a5490610d1e565b8611610776575b6008548681029080820488149015171561076457811061071557918b979593916104f9999795938b7f00000000000000000000000000000000000000000000000000000000000000009460449c8d928335907f000000000000000000000000000000000000000000000000000000000000000090867f0000000000000000000000000000000000000000000000000000000000000000918b33610db2565b85546001600160a01b03949161051d91861690610517368f8f610c18565b91610eb3565b8360075416918460095416918d519485936323b872dd60e01b8552338a8601528b8501528301528160209e8f945af180156106ce576106da575b509089969594938e9b93928c91169b5b8d87831061064c575050505050505061058281600b54610d7a565b600b558860035414610637575b5060ff84518483823783818681018c815203019020541615610614575b50505090815191818084019181855286518093528401950191875b87838210610602575050505050807ff1a869817733568a4d9fdcfb9d02c2e19967dfa6635304703a7f6881b42853119133940390a360025580f35b845188529682019693820193016105c7565b8284519384928337810188815203019020805460ff1916861790553882816105ac565b61064390600a54610d7a565b600a553861058f565b829394959697989950916106609192610d50565b518c3b156101ed578c8683928d519485938492632851206560e21b8452338b8501528c8401525af180156106ce576106ab575b5061069d90610d41565b90899695949392918e610567565b8281116106bc57895261069d610693565b634e487b7160e01b8f5260418452858ffd5b8f8b51903d90823e3d90fd5b8a81813d831161070e575b6106ef8183610be0565b8101031261070a5751801515036107065738610557565b8d80fd5b8e80fd5b503d6106e5565b885162461bcd60e51b81526020818501526025818701527f4e4654436c61696d65723a20696e73756666696369656e7420746f6b656e20616044820152641b5bdd5b9d60da1b81860152608490fd5b634e487b7160e01b8d5260118452858dfd5b885162461bcd60e51b81526020818501526025818701527f4e4654436c61696d65723a206578636565642070617273652031206d617820736044820152647570706c7960d81b81860152608490fd5b6107d4600654600b5490610d1e565b86111561045b575050601d83602089519362461bcd60e51b85528401528201527f4e4654436c61696d65723a20657863656564206d617820737570706c790000006044820152fd5b885162461bcd60e51b8152602081850152602d818701527f4e4654436c61696d65723a20696473206c656e677468206d757374206265206760448201526c0726561746572207468616e203609c1b81860152608490fd5b50601e83602089519362461bcd60e51b85528401528201527f4e4654436c61696d65723a206e6f7420626567696e206f7220656e64656400006044820152fd5b601f83602089519362461bcd60e51b85528401528201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152fd5b8980fd5b8880fd5b8480fd5b83346102ce57806003193601126102ce57610917610cc6565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b8382346101ed5760603660031901126101ed57610973610bca565b60443567ffffffffffffffff81116109b357366023820112156109b3576109b0928160246109a693369301359101610c18565b9060243590610eb3565b80f35b8380fd5b503461019d5760a036600319011261019d576109d1610cc6565b3560058190556024356006819055916001600160a01b03604435818116939290849003610a7a576bffffffffffffffffffffffff60a01b93808560075416176007556064359182600855608435968488168098036108f6577fde378c2c4aad676b12eb56e70a7f6f7778724a466508402b6c49de56dc11ffb89760a0976009541617600955815195865260208601528401526060830152610a70610baf565b166080820152a180f35b8580fd5b5050346101ed57816003193601126101ed57517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5050346101ed57816003193601126101ed57602090600b549051908152f35b503461019d578260031936011261019d575490516001600160a01b03909116815260209150f35b5050346101ed57816003193601126101ed57602090517f00000000000000000000000000000000000000000000000000000000000000008152f35b5050346101ed57816003193601126101ed57602090600a549051908152f35b503461019d57602036600319011261019d577f5ca814e8750431ce4d53faa6b24fbf00f6b53f5918a00ab430c0473ba6263424916020913590610ba3610cc6565b8160035551908152a180f35b608435906001600160a01b0382168203610bc557565b600080fd5b600435906001600160a01b0382168203610bc557565b90601f8019910116810190811067ffffffffffffffff821117610c0257604052565b634e487b7160e01b600052604160045260246000fd5b92919267ffffffffffffffff8211610c025760405191610c42601f8201601f191660200184610be0565b829481845281830111610bc5578281602093846000960137010152565b9080601f83011215610bc55781359067ffffffffffffffff8211610c02578160051b60405193602093610c9485840187610be0565b85528380860192820101928311610bc5578301905b828210610cb7575050505090565b81358152908301908301610ca9565b6000546001600160a01b03163303610cda57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b91908203918211610d2b57565b634e487b7160e01b600052601160045260246000fd5b6000198114610d2b5760010190565b8051821015610d645760209160051b010190565b634e487b7160e01b600052603260045260246000fd5b91908201809211610d2b57565b9081519160005b838110610d9f575050016000815290565b8060208092840101518185015201610d8e565b969590929193946040928351966bffffffffffffffffffffffff1991826060978160209d8a1b168d8c0152881b1660348a01526048890152851b166068870152607c860152609c850152609c845260c084019367ffffffffffffffff9481811086821117610c0257825260009384915b8151861015610ea257610e358683610d50565b518451908a8201528981528481019181831089841117610e8e578291610e70610e6a610e8293610e88968a528a840190610d87565b82610d87565b03605f1981018352603f190182610be0565b95610d41565b94610e22565b634e487b7160e01b85526041600452602485fd5b969795505050505050815191012090565b90610ef592610eed917f19457468657265756d205369676e6564204d6573736167653a0a333200000000600052601c52603c60002061105c565b929092610f42565b6001600160a01b03908116911603610f0957565b60405162461bcd60e51b8152602060048201526011602482015270696e76616c6964207369676e617475726560781b6044820152606490fd5b60058110156110465780610f535750565b60018103610fa05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b60028103610fed5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b600314610ff657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b90604181511460001461108a57611086916020820151906060604084015193015160001a90611094565b9091565b5050600090600290565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116111175791608094939160ff602094604051948552168484015260408301526060820152600093849182805260015afa1561110a5781516001600160a01b03811615611104579190565b50600190565b50604051903d90823e3d90fd5b5050505060009060039056fea264697066735822122081889ddc0c5fc274d1bb327097bf318b9488a8bb95b074b314f1ae08a81d00dd64736f6c63430008130033", + "devdoc": { + "kind": "dev", + "methods": { + "claim(uint256[],uint256,uint256,bytes)": { + "details": "claim NFT Get whitelist signature from a third-party service, then call this method to claim NFT", + "params": { + "saltNonce": "nonce", + "signature": "signature" + } + }, + "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." + }, + "updateVerifier(address)": { + "details": "update verifier address" + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7, + "contract": "contracts/activity/NFTClaimStage2.sol:NFTClaimStage2", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 2251, + "contract": "contracts/activity/NFTClaimStage2.sol:NFTClaimStage2", + "label": "_usedSignatures", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_bytes_memory_ptr,t_bool)" + }, + { + "astId": 123, + "contract": "contracts/activity/NFTClaimStage2.sol:NFTClaimStage2", + "label": "_status", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 1886, + "contract": "contracts/activity/NFTClaimStage2.sol:NFTClaimStage2", + "label": "mintParse", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 1894, + "contract": "contracts/activity/NFTClaimStage2.sol:NFTClaimStage2", + "label": "verifier", + "offset": 0, + "slot": "4", + "type": "t_address" + }, + { + "astId": 1897, + "contract": "contracts/activity/NFTClaimStage2.sol:NFTClaimStage2", + "label": "mintConfig", + "offset": 0, + "slot": "5", + "type": "t_struct(MintConfig)1883_storage" + }, + { + "astId": 1899, + "contract": "contracts/activity/NFTClaimStage2.sol:NFTClaimStage2", + "label": "parse1Count", + "offset": 0, + "slot": "10", + "type": "t_uint256" + }, + { + "astId": 1901, + "contract": "contracts/activity/NFTClaimStage2.sol:NFTClaimStage2", + "label": "totalCount", + "offset": 0, + "slot": "11", + "type": "t_uint256" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes_memory_ptr": { + "encoding": "bytes", + "label": "bytes", + "numberOfBytes": "32" + }, + "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_struct(MintConfig)1883_storage": { + "encoding": "inplace", + "label": "struct NFTClaimStage2.MintConfig", + "members": [ + { + "astId": 1874, + "contract": "contracts/activity/NFTClaimStage2.sol:NFTClaimStage2", + "label": "parse1MaxSupply", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 1876, + "contract": "contracts/activity/NFTClaimStage2.sol:NFTClaimStage2", + "label": "maxSupply", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 1878, + "contract": "contracts/activity/NFTClaimStage2.sol:NFTClaimStage2", + "label": "currency", + "offset": 0, + "slot": "2", + "type": "t_address" + }, + { + "astId": 1880, + "contract": "contracts/activity/NFTClaimStage2.sol:NFTClaimStage2", + "label": "mintPrice", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 1882, + "contract": "contracts/activity/NFTClaimStage2.sol:NFTClaimStage2", + "label": "feeToAddress", + "offset": 0, + "slot": "4", + "type": "t_address" + } + ], + "numberOfBytes": "160" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/deployments/imtbl_test/TreasureHunt.json b/deployments/imtbl_test/TreasureHunt.json deleted file mode 100644 index f46073a..0000000 --- a/deployments/imtbl_test/TreasureHunt.json +++ /dev/null @@ -1,694 +0,0 @@ -{ - "address": "0xB469331cEC98E52b7Eab07dFB586253bE232BBF7", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "action", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "ActionEvent", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "DurationUpdated", - "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": "bool", - "name": "isPaused", - "type": "bool" - } - ], - "name": "StateUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - } - ], - "name": "VerifierUpdated", - "type": "event" - }, - { - "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": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "checkinHistory", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "claimTaskHistory", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "taskId", - "type": "uint256" - } - ], - "name": "claimTaskReward", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "dailyCheckin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "duration", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "boxId", - "type": "uint256" - } - ], - "name": "enhanceBox", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "enhanceHistory", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "step", - "type": "uint256" - } - ], - "name": "explore", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "exploreHistory", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "actionType", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "val", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "signTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "saltNonce", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "generalAction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_type", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_val", - "type": "uint256" - }, - { - "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": [], - "name": "isPaused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "minDuration", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "boxId", - "type": "uint256" - } - ], - "name": "openBox", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "openBoxHistory", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "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" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "valNew", - "type": "uint256" - } - ], - "name": "updateDuation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "_isPaused", - "type": "bool" - } - ], - "name": "updatePaused", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_verifier", - "type": "address" - } - ], - "name": "updateVerifier", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x420f3992f84d40f300eb00ac68b0015c7119b3c59b1351d72115ba5db02b99b6", - "receipt": { - "to": null, - "from": "0x50A8e60041A206AcaA5F844a1104896224be6F39", - "contractAddress": "0xB469331cEC98E52b7Eab07dFB586253bE232BBF7", - "transactionIndex": 0, - "gasUsed": "1394013", - "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000080000000000000000000000000000080000000000020000000000000000000000000000000000000020000000000000000000000000000", - "blockHash": "0x058eb866ed7168aa8f6773aade133bda5ed284dc94f98b256a2a2651540a0e0b", - "transactionHash": "0x420f3992f84d40f300eb00ac68b0015c7119b3c59b1351d72115ba5db02b99b6", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 8909541, - "transactionHash": "0x420f3992f84d40f300eb00ac68b0015c7119b3c59b1351d72115ba5db02b99b6", - "address": "0xB469331cEC98E52b7Eab07dFB586253bE232BBF7", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000050a8e60041a206acaa5f844a1104896224be6f39" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0x058eb866ed7168aa8f6773aade133bda5ed284dc94f98b256a2a2651540a0e0b" - } - ], - "blockNumber": 8909541, - "cumulativeGasUsed": "1394013", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 1, - "solcInputHash": "5bb31bf450538abe4300b257a34b7688", - "metadata": "{\"compiler\":{\"version\":\"0.8.23+commit.f704f362\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"action\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"ActionEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"duration\",\"type\":\"uint256\"}],\"name\":\"DurationUpdated\",\"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\":\"bool\",\"name\":\"isPaused\",\"type\":\"bool\"}],\"name\":\"StateUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"verifier\",\"type\":\"address\"}],\"name\":\"VerifierUpdated\",\"type\":\"event\"},{\"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\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"checkinHistory\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"claimTaskHistory\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"taskId\",\"type\":\"uint256\"}],\"name\":\"claimTaskReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"dailyCheckin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"duration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"boxId\",\"type\":\"uint256\"}],\"name\":\"enhanceBox\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"enhanceHistory\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"step\",\"type\":\"uint256\"}],\"name\":\"explore\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"exploreHistory\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"actionType\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"val\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"signTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"saltNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"generalAction\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_user\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_type\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_val\",\"type\":\"uint256\"},{\"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\":[],\"name\":\"isPaused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"minDuration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"boxId\",\"type\":\"uint256\"}],\"name\":\"openBox\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"openBoxHistory\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"valNew\",\"type\":\"uint256\"}],\"name\":\"updateDuation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_isPaused\",\"type\":\"bool\"}],\"name\":\"updatePaused\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_verifier\",\"type\":\"address\"}],\"name\":\"updateVerifier\",\"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.\"},\"updateDuation(uint256)\":{\"details\":\"Change duration value\"},\"updateVerifier(address)\":{\"details\":\"update verifier address\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/activity/TreasureHunt.sol\":\"TreasureHunt\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"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/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuard {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n constructor() {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0xa535a5df777d44e945dd24aa43a11e44b024140fc340ad0dfe42acf4002aade1\",\"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\"},\"contracts/activity/TreasureHunt.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\nimport \\\"@openzeppelin/contracts/security/ReentrancyGuard.sol\\\";\\nimport \\\"../core/HasSignature.sol\\\";\\nimport \\\"../utils/TimeChecker.sol\\\";\\n\\n\\ncontract TreasureHunt is HasSignature, ReentrancyGuard, TimeChecker{\\n mapping(address => mapping(uint256 => uint256)) public checkinHistory;\\n mapping(address => mapping(uint256 => uint256)) public exploreHistory;\\n mapping(address => mapping(uint256 => uint256)) public enhanceHistory;\\n mapping(address => mapping(uint256 => uint256)) public claimTaskHistory;\\n mapping(address => mapping(uint256 => uint256)) public openBoxHistory;\\n uint256 private immutable _CACHED_CHAIN_ID;\\n address private immutable _CACHED_THIS;\\n address private verifier;\\n\\n bool public isPaused = false;\\n\\n event ActionEvent(\\n address indexed user,\\n uint256 indexed action,\\n uint256 value\\n );\\n\\n event StateUpdated(bool isPaused);\\n event VerifierUpdated(address indexed verifier);\\n\\n constructor() {\\n _CACHED_CHAIN_ID = block.chainid;\\n _CACHED_THIS = address(this);\\n }\\n\\n modifier whenNotPaused() {\\n require(!isPaused, \\\"TreasureHunt: paused\\\");\\n _;\\n }\\n\\n function updatePaused(bool _isPaused) external onlyOwner {\\n isPaused = _isPaused;\\n emit StateUpdated(_isPaused);\\n }\\n\\n /**\\n * @dev update verifier address\\n */\\n function updateVerifier(address _verifier) external onlyOwner {\\n require(_verifier != address(0), \\\"TreasureHunt: address can not be zero\\\");\\n verifier = _verifier;\\n emit VerifierUpdated(_verifier);\\n }\\n \\n // daily checkin\\n function dailyCheckin() external whenNotPaused {\\n address user = _msgSender();\\n uint256 day = block.timestamp / 1 days;\\n require(checkinHistory[user][day] == 0, \\\"TreasureHunt: already checked in\\\");\\n checkinHistory[user][day] = 1;\\n emit ActionEvent(user, 1, day);\\n }\\n\\n // explore\\n function explore(\\n uint256 step\\n ) external whenNotPaused {\\n address user = _msgSender();\\n exploreHistory[user][step] = 1;\\n emit ActionEvent(user, 2, step);\\n } \\n\\n // enhance box\\n function enhanceBox(\\n uint256 boxId\\n ) external whenNotPaused {\\n address user = _msgSender();\\n require(enhanceHistory[user][boxId] == 0, \\\"TreasureHunt: already enhanced\\\");\\n enhanceHistory[user][boxId] = 1;\\n emit ActionEvent(user, 3, boxId);\\n } \\n\\n // open box\\n function openBox(\\n uint256 boxId\\n ) external whenNotPaused {\\n address user = _msgSender();\\n require(openBoxHistory[user][boxId] == 0, \\\"TreasureHunt: already opened\\\");\\n openBoxHistory[user][boxId] = 1;\\n emit ActionEvent(user, 4, boxId);\\n }\\n\\n // claim task reward\\n function claimTaskReward(\\n uint256 taskId\\n ) external whenNotPaused{\\n address user = _msgSender();\\n require(claimTaskHistory[user][taskId] == 0, \\\"TreasureHunt: already claimed\\\");\\n claimTaskHistory[user][taskId] = 1;\\n emit ActionEvent(user, 5, taskId);\\n } \\n\\n function generalAction(\\n uint256 actionType,\\n uint256 val,\\n uint256 signTime,\\n uint256 saltNonce,\\n bytes calldata signature\\n ) external nonReentrant whenNotPaused timeValid(signTime){\\n address user = _msgSender();\\n bytes32 criteriaMessageHash = getMessageHash(\\n user,\\n actionType,\\n val,\\n _CACHED_THIS,\\n _CACHED_CHAIN_ID,\\n signTime,\\n saltNonce\\n );\\n checkSigner(verifier, criteriaMessageHash, signature);\\n if (actionType == 1) {\\n require(checkinHistory[user][val] == 0, \\\"TreasureHunt: already checked in\\\");\\n checkinHistory[user][val] = 1;\\n } else if (actionType == 2) {\\n require(exploreHistory[user][val] == 0, \\\"TreasureHunt: already explored\\\");\\n exploreHistory[user][val] = 1;\\n } else if (actionType == 3) {\\n require(enhanceHistory[user][val] == 0, \\\"TreasureHunt: already enhanced\\\");\\n enhanceHistory[user][val] = 1;\\n } else if (actionType == 4) {\\n require(openBoxHistory[user][val] == 0, \\\"TreasureHunt: already opened\\\");\\n openBoxHistory[user][val] = 1;\\n } else if (actionType == 5) {\\n require(claimTaskHistory[user][val] == 0, \\\"TreasureHunt: already claimed\\\");\\n claimTaskHistory[user][val] = 1;\\n } else {\\n revert(\\\"TreasureHunt: invalid action type\\\");\\n }\\n emit ActionEvent(user, actionType, val);\\n }\\n\\n function getMessageHash(\\n address _user,\\n uint256 _type,\\n uint256 _val,\\n address _contract,\\n uint256 _chainId,\\n uint256 _signTime,\\n uint256 _saltNonce\\n ) public pure returns (bytes32) {\\n bytes memory encoded = abi.encodePacked(\\n _user,\\n _type,\\n _val,\\n _contract,\\n _chainId,\\n _signTime,\\n _saltNonce\\n );\\n return keccak256(encoded);\\n }\\n}\\n\",\"keccak256\":\"0xc387335e0711f99c0fc1d209a962dea7ad3b864f9b2e23c6fdc876c8f572f13a\",\"license\":\"MIT\"},\"contracts/core/HasSignature.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract HasSignature is Ownable {\\n mapping(bytes => bool) 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, \\\"[BE] invalid signature\\\");\\n }\\n\\n modifier signatureValid(bytes calldata signature) {\\n require(\\n !_usedSignatures[signature],\\n \\\"[BE] 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\":\"0xe410e5e9618cc905cd9b9c9b32effe0fc8c79ea1e160c741b1ae957609539ff3\",\"license\":\"MIT\"},\"contracts/utils/TimeChecker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.23;\\nimport \\\"@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() {\\n duration = 1 days;\\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\":\"0x13b6969e995d149240a00b1f33c54ad3323a6a7436e614fcb8d69251a58bba46\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60c0604052600a805460ff60a01b1916905534801561001d57600080fd5b5061002733610046565b600160025562015180600355610708600455466080523060a052610096565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60805160a05161168c6100bb6000396000610ad501526000610af6015261168c6000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c80637f9d3096116100b8578063b187bd261161007c578063b187bd26146102d5578063b1e5e2b7146102f9578063d869bb291461030c578063d8edeb1b14610337578063ecd8f7d01461033f578063f2fde38b1461035257600080fd5b80637f9d30961461023e57806386cd4926146102515780638da5cb5b1461027c57806397fc007c146102975780639b68ea4c146102aa57600080fd5b806344a17e061161010a57806344a17e06146101c95780634902f7e0146101dc57806356715761146102075780636457e389146102105780636d04319414610223578063715018a61461023657600080fd5b806308cdc2a8146101475780630fb5a6b41461015c57806323a5ea5e14610178578063360282751461018b5780634052a9c7146101b6575b600080fd5b61015a610155366004611332565b610365565b005b61016560035481565b6040519081526020015b60405180910390f35b610165610186366004611377565b6103c5565b6101656101993660046113d8565b600660209081526000928352604080842090915290825290205481565b61015a6101c4366004611402565b610431565b61015a6101d7366004611402565b61051b565b6101656101ea3660046113d8565b600860209081526000928352604080842090915290825290205481565b61016560045481565b61015a61021e366004611402565b6105f4565b61015a610231366004611431565b61065d565b61015a6106fa565b61015a61024c366004611402565b61070e565b61016561025f3660046113d8565b600560209081526000928352604080842090915290825290205481565b6000546040516001600160a01b03909116815260200161016f565b61015a6102a53660046114fc565b61078f565b6101656102b83660046113d8565b600760209081526000928352604080842090915290825290205481565b600a546102e990600160a01b900460ff1681565b604051901515815260200161016f565b61015a610307366004611402565b610845565b61016561031a3660046113d8565b600960209081526000928352604080842090915290825290205481565b61015a61091e565b61015a61034d366004611517565b610a14565b61015a6103603660046114fc565b610f3f565b61036d610fb8565b600a8054821515600160a01b0260ff60a01b199091161790556040517ff68abf2856351c34b7411fb655395a774171d6db77a50753df30a69f17b7a217906103ba90831515815260200190565b60405180910390a150565b604080516bffffffffffffffffffffffff196060998a1b8116602080840191909152603483019990995260548201979097529490971b9094166074840152608883019190915260a882015260c8808201929092528351808203909201825260e801909252815191012090565b600a54600160a01b900460ff16156104645760405162461bcd60e51b815260040161045b906115af565b60405180910390fd5b336000818152600860209081526040808320858452909152902054156104cc5760405162461bcd60e51b815260206004820152601d60248201527f547265617375726548756e743a20616c726561647920636c61696d6564000000604482015260640161045b565b6001600160a01b03811660008181526008602090815260408083208684528252918290206001905590518481526005929160008051602061163783398151915291015b60405180910390a35050565b600a54600160a01b900460ff16156105455760405162461bcd60e51b815260040161045b906115af565b336000818152600760209081526040808320858452909152902054156105ad5760405162461bcd60e51b815260206004820152601e60248201527f547265617375726548756e743a20616c726561647920656e68616e6365640000604482015260640161045b565b6001600160a01b038116600081815260076020908152604080832086845282529182902060019055905184815260039291600080516020611637833981519152910161050f565b600a54600160a01b900460ff161561061e5760405162461bcd60e51b815260040161045b906115af565b3360008181526006602090815260408083208584528252918290206001905590518381526002918391600080516020611637833981519152910161050f565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c839052603c8120906106978284611012565b9050846001600160a01b0316816001600160a01b0316146106f35760405162461bcd60e51b81526020600482015260166024820152755b42455d20696e76616c6964207369676e617475726560501b604482015260640161045b565b5050505050565b610702610fb8565b61070c6000611038565b565b610716610fb8565b600454811161075c5760405162461bcd60e51b8152602060048201526012602482015271191d5c985d1a5bdb881d1bdbc81cda1bdc9d60721b604482015260640161045b565b600381905560405181907f91abcc2d6823e3a3f11d31b208dd3065d2c6a791f1c7c9fe96a42ce12897eac590600090a250565b610797610fb8565b6001600160a01b0381166107fb5760405162461bcd60e51b815260206004820152602560248201527f547265617375726548756e743a20616464726573732063616e206e6f74206265604482015264207a65726f60d81b606482015260840161045b565b600a80546001600160a01b0319166001600160a01b0383169081179091556040517fd24015cc99cc1700cafca3042840a1d8ac1e3964fd2e0e37ea29c654056ee32790600090a250565b600a54600160a01b900460ff161561086f5760405162461bcd60e51b815260040161045b906115af565b336000818152600960209081526040808320858452909152902054156108d75760405162461bcd60e51b815260206004820152601c60248201527f547265617375726548756e743a20616c7265616479206f70656e656400000000604482015260640161045b565b6001600160a01b038116600081815260096020908152604080832086845282529182902060019055905184815260049291600080516020611637833981519152910161050f565b600a54600160a01b900460ff16156109485760405162461bcd60e51b815260040161045b906115af565b33600061095862015180426115dd565b6001600160a01b0383166000908152600560209081526040808320848452909152902054909150156109cc5760405162461bcd60e51b815260206004820181905260248201527f547265617375726548756e743a20616c726561647920636865636b656420696e604482015260640161045b565b6001600160a01b03821660008181526005602090815260408083208584528252918290206001908190559151848152919291600080516020611637833981519152910161050f565b610a1c611088565b600a54600160a01b900460ff1615610a465760405162461bcd60e51b815260040161045b906115af565b834260035482610a5691906115ff565b1015610aca5760405162461bcd60e51b815260206004820152603b60248201527f657870697265642c20706c656173652073656e6420616e6f746865722074726160448201527f6e73616374696f6e2077697468206e6577207369676e61747572650000000000606482015260840161045b565b336000610b1c828a8a7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008c8c6103c5565b600a54604080516020601f8901819004810282018101909252878152929350610b6d926001600160a01b03909216918491899089908190840183828082843760009201919091525061065d92505050565b88600103610c12576001600160a01b03821660009081526005602090815260408083208b845290915290205415610be65760405162461bcd60e51b815260206004820181905260248201527f547265617375726548756e743a20616c726561647920636865636b656420696e604482015260640161045b565b6001600160a01b03821660009081526005602090815260408083208b8452909152902060019055610ef8565b88600203610cb7576001600160a01b03821660009081526006602090815260408083208b845290915290205415610c8b5760405162461bcd60e51b815260206004820152601e60248201527f547265617375726548756e743a20616c7265616479206578706c6f7265640000604482015260640161045b565b6001600160a01b03821660009081526006602090815260408083208b8452909152902060019055610ef8565b88600303610d5c576001600160a01b03821660009081526007602090815260408083208b845290915290205415610d305760405162461bcd60e51b815260206004820152601e60248201527f547265617375726548756e743a20616c726561647920656e68616e6365640000604482015260640161045b565b6001600160a01b03821660009081526007602090815260408083208b8452909152902060019055610ef8565b88600403610e01576001600160a01b03821660009081526009602090815260408083208b845290915290205415610dd55760405162461bcd60e51b815260206004820152601c60248201527f547265617375726548756e743a20616c7265616479206f70656e656400000000604482015260640161045b565b6001600160a01b03821660009081526009602090815260408083208b8452909152902060019055610ef8565b88600503610ea6576001600160a01b03821660009081526008602090815260408083208b845290915290205415610e7a5760405162461bcd60e51b815260206004820152601d60248201527f547265617375726548756e743a20616c726561647920636c61696d6564000000604482015260640161045b565b6001600160a01b03821660009081526008602090815260408083208b8452909152902060019055610ef8565b60405162461bcd60e51b815260206004820152602160248201527f547265617375726548756e743a20696e76616c696420616374696f6e207479706044820152606560f81b606482015260840161045b565b88826001600160a01b03166000805160206116378339815191528a604051610f2291815260200190565b60405180910390a3505050610f376001600255565b505050505050565b610f47610fb8565b6001600160a01b038116610fac5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161045b565b610fb581611038565b50565b6000546001600160a01b0316331461070c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045b565b600080600061102185856110df565b9150915061102e81611124565b5090505b92915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60028054036110d95760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161045b565b60028055565b60008082516041036111155760208301516040840151606085015160001a6111098782858561126e565b9450945050505061111d565b506000905060025b9250929050565b600081600481111561113857611138611620565b036111405750565b600181600481111561115457611154611620565b036111a15760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161045b565b60028160048111156111b5576111b5611620565b036112025760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161045b565b600381600481111561121657611216611620565b03610fb55760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161045b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156112a55750600090506003611329565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156112f9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661132257600060019250925050611329565b9150600090505b94509492505050565b60006020828403121561134457600080fd5b8135801515811461135457600080fd5b9392505050565b80356001600160a01b038116811461137257600080fd5b919050565b600080600080600080600060e0888a03121561139257600080fd5b61139b8861135b565b965060208801359550604088013594506113b76060890161135b565b9699959850939660808101359560a0820135955060c0909101359350915050565b600080604083850312156113eb57600080fd5b6113f48361135b565b946020939093013593505050565b60006020828403121561141457600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561144657600080fd5b61144f8461135b565b925060208401359150604084013567ffffffffffffffff8082111561147357600080fd5b818601915086601f83011261148757600080fd5b8135818111156114995761149961141b565b604051601f8201601f19908116603f011681019083821181831017156114c1576114c161141b565b816040528281528960208487010111156114da57600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561150e57600080fd5b6113548261135b565b60008060008060008060a0878903121561153057600080fd5b86359550602087013594506040870135935060608701359250608087013567ffffffffffffffff8082111561156457600080fd5b818901915089601f83011261157857600080fd5b81358181111561158757600080fd5b8a602082850101111561159957600080fd5b6020830194508093505050509295509295509295565b602080825260149082015273151c99585cdd5c99521d5b9d0e881c185d5cd95960621b604082015260600190565b6000826115fa57634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561103257634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fdfe31ee9d1c9d3111fbd70a8cefbec63f11d7ebb1783e6a7d8ca82409e345094ff5a2646970667358221220233f78717ff06e435081e5a87248d52bf154e7e09f6da767acf0a22cafd0dfa464736f6c63430008170033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101425760003560e01c80637f9d3096116100b8578063b187bd261161007c578063b187bd26146102d5578063b1e5e2b7146102f9578063d869bb291461030c578063d8edeb1b14610337578063ecd8f7d01461033f578063f2fde38b1461035257600080fd5b80637f9d30961461023e57806386cd4926146102515780638da5cb5b1461027c57806397fc007c146102975780639b68ea4c146102aa57600080fd5b806344a17e061161010a57806344a17e06146101c95780634902f7e0146101dc57806356715761146102075780636457e389146102105780636d04319414610223578063715018a61461023657600080fd5b806308cdc2a8146101475780630fb5a6b41461015c57806323a5ea5e14610178578063360282751461018b5780634052a9c7146101b6575b600080fd5b61015a610155366004611332565b610365565b005b61016560035481565b6040519081526020015b60405180910390f35b610165610186366004611377565b6103c5565b6101656101993660046113d8565b600660209081526000928352604080842090915290825290205481565b61015a6101c4366004611402565b610431565b61015a6101d7366004611402565b61051b565b6101656101ea3660046113d8565b600860209081526000928352604080842090915290825290205481565b61016560045481565b61015a61021e366004611402565b6105f4565b61015a610231366004611431565b61065d565b61015a6106fa565b61015a61024c366004611402565b61070e565b61016561025f3660046113d8565b600560209081526000928352604080842090915290825290205481565b6000546040516001600160a01b03909116815260200161016f565b61015a6102a53660046114fc565b61078f565b6101656102b83660046113d8565b600760209081526000928352604080842090915290825290205481565b600a546102e990600160a01b900460ff1681565b604051901515815260200161016f565b61015a610307366004611402565b610845565b61016561031a3660046113d8565b600960209081526000928352604080842090915290825290205481565b61015a61091e565b61015a61034d366004611517565b610a14565b61015a6103603660046114fc565b610f3f565b61036d610fb8565b600a8054821515600160a01b0260ff60a01b199091161790556040517ff68abf2856351c34b7411fb655395a774171d6db77a50753df30a69f17b7a217906103ba90831515815260200190565b60405180910390a150565b604080516bffffffffffffffffffffffff196060998a1b8116602080840191909152603483019990995260548201979097529490971b9094166074840152608883019190915260a882015260c8808201929092528351808203909201825260e801909252815191012090565b600a54600160a01b900460ff16156104645760405162461bcd60e51b815260040161045b906115af565b60405180910390fd5b336000818152600860209081526040808320858452909152902054156104cc5760405162461bcd60e51b815260206004820152601d60248201527f547265617375726548756e743a20616c726561647920636c61696d6564000000604482015260640161045b565b6001600160a01b03811660008181526008602090815260408083208684528252918290206001905590518481526005929160008051602061163783398151915291015b60405180910390a35050565b600a54600160a01b900460ff16156105455760405162461bcd60e51b815260040161045b906115af565b336000818152600760209081526040808320858452909152902054156105ad5760405162461bcd60e51b815260206004820152601e60248201527f547265617375726548756e743a20616c726561647920656e68616e6365640000604482015260640161045b565b6001600160a01b038116600081815260076020908152604080832086845282529182902060019055905184815260039291600080516020611637833981519152910161050f565b600a54600160a01b900460ff161561061e5760405162461bcd60e51b815260040161045b906115af565b3360008181526006602090815260408083208584528252918290206001905590518381526002918391600080516020611637833981519152910161050f565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c839052603c8120906106978284611012565b9050846001600160a01b0316816001600160a01b0316146106f35760405162461bcd60e51b81526020600482015260166024820152755b42455d20696e76616c6964207369676e617475726560501b604482015260640161045b565b5050505050565b610702610fb8565b61070c6000611038565b565b610716610fb8565b600454811161075c5760405162461bcd60e51b8152602060048201526012602482015271191d5c985d1a5bdb881d1bdbc81cda1bdc9d60721b604482015260640161045b565b600381905560405181907f91abcc2d6823e3a3f11d31b208dd3065d2c6a791f1c7c9fe96a42ce12897eac590600090a250565b610797610fb8565b6001600160a01b0381166107fb5760405162461bcd60e51b815260206004820152602560248201527f547265617375726548756e743a20616464726573732063616e206e6f74206265604482015264207a65726f60d81b606482015260840161045b565b600a80546001600160a01b0319166001600160a01b0383169081179091556040517fd24015cc99cc1700cafca3042840a1d8ac1e3964fd2e0e37ea29c654056ee32790600090a250565b600a54600160a01b900460ff161561086f5760405162461bcd60e51b815260040161045b906115af565b336000818152600960209081526040808320858452909152902054156108d75760405162461bcd60e51b815260206004820152601c60248201527f547265617375726548756e743a20616c7265616479206f70656e656400000000604482015260640161045b565b6001600160a01b038116600081815260096020908152604080832086845282529182902060019055905184815260049291600080516020611637833981519152910161050f565b600a54600160a01b900460ff16156109485760405162461bcd60e51b815260040161045b906115af565b33600061095862015180426115dd565b6001600160a01b0383166000908152600560209081526040808320848452909152902054909150156109cc5760405162461bcd60e51b815260206004820181905260248201527f547265617375726548756e743a20616c726561647920636865636b656420696e604482015260640161045b565b6001600160a01b03821660008181526005602090815260408083208584528252918290206001908190559151848152919291600080516020611637833981519152910161050f565b610a1c611088565b600a54600160a01b900460ff1615610a465760405162461bcd60e51b815260040161045b906115af565b834260035482610a5691906115ff565b1015610aca5760405162461bcd60e51b815260206004820152603b60248201527f657870697265642c20706c656173652073656e6420616e6f746865722074726160448201527f6e73616374696f6e2077697468206e6577207369676e61747572650000000000606482015260840161045b565b336000610b1c828a8a7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000008c8c6103c5565b600a54604080516020601f8901819004810282018101909252878152929350610b6d926001600160a01b03909216918491899089908190840183828082843760009201919091525061065d92505050565b88600103610c12576001600160a01b03821660009081526005602090815260408083208b845290915290205415610be65760405162461bcd60e51b815260206004820181905260248201527f547265617375726548756e743a20616c726561647920636865636b656420696e604482015260640161045b565b6001600160a01b03821660009081526005602090815260408083208b8452909152902060019055610ef8565b88600203610cb7576001600160a01b03821660009081526006602090815260408083208b845290915290205415610c8b5760405162461bcd60e51b815260206004820152601e60248201527f547265617375726548756e743a20616c7265616479206578706c6f7265640000604482015260640161045b565b6001600160a01b03821660009081526006602090815260408083208b8452909152902060019055610ef8565b88600303610d5c576001600160a01b03821660009081526007602090815260408083208b845290915290205415610d305760405162461bcd60e51b815260206004820152601e60248201527f547265617375726548756e743a20616c726561647920656e68616e6365640000604482015260640161045b565b6001600160a01b03821660009081526007602090815260408083208b8452909152902060019055610ef8565b88600403610e01576001600160a01b03821660009081526009602090815260408083208b845290915290205415610dd55760405162461bcd60e51b815260206004820152601c60248201527f547265617375726548756e743a20616c7265616479206f70656e656400000000604482015260640161045b565b6001600160a01b03821660009081526009602090815260408083208b8452909152902060019055610ef8565b88600503610ea6576001600160a01b03821660009081526008602090815260408083208b845290915290205415610e7a5760405162461bcd60e51b815260206004820152601d60248201527f547265617375726548756e743a20616c726561647920636c61696d6564000000604482015260640161045b565b6001600160a01b03821660009081526008602090815260408083208b8452909152902060019055610ef8565b60405162461bcd60e51b815260206004820152602160248201527f547265617375726548756e743a20696e76616c696420616374696f6e207479706044820152606560f81b606482015260840161045b565b88826001600160a01b03166000805160206116378339815191528a604051610f2291815260200190565b60405180910390a3505050610f376001600255565b505050505050565b610f47610fb8565b6001600160a01b038116610fac5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161045b565b610fb581611038565b50565b6000546001600160a01b0316331461070c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045b565b600080600061102185856110df565b9150915061102e81611124565b5090505b92915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60028054036110d95760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161045b565b60028055565b60008082516041036111155760208301516040840151606085015160001a6111098782858561126e565b9450945050505061111d565b506000905060025b9250929050565b600081600481111561113857611138611620565b036111405750565b600181600481111561115457611154611620565b036111a15760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161045b565b60028160048111156111b5576111b5611620565b036112025760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161045b565b600381600481111561121657611216611620565b03610fb55760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161045b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156112a55750600090506003611329565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156112f9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661132257600060019250925050611329565b9150600090505b94509492505050565b60006020828403121561134457600080fd5b8135801515811461135457600080fd5b9392505050565b80356001600160a01b038116811461137257600080fd5b919050565b600080600080600080600060e0888a03121561139257600080fd5b61139b8861135b565b965060208801359550604088013594506113b76060890161135b565b9699959850939660808101359560a0820135955060c0909101359350915050565b600080604083850312156113eb57600080fd5b6113f48361135b565b946020939093013593505050565b60006020828403121561141457600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561144657600080fd5b61144f8461135b565b925060208401359150604084013567ffffffffffffffff8082111561147357600080fd5b818601915086601f83011261148757600080fd5b8135818111156114995761149961141b565b604051601f8201601f19908116603f011681019083821181831017156114c1576114c161141b565b816040528281528960208487010111156114da57600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b60006020828403121561150e57600080fd5b6113548261135b565b60008060008060008060a0878903121561153057600080fd5b86359550602087013594506040870135935060608701359250608087013567ffffffffffffffff8082111561156457600080fd5b818901915089601f83011261157857600080fd5b81358181111561158757600080fd5b8a602082850101111561159957600080fd5b6020830194508093505050509295509295509295565b602080825260149082015273151c99585cdd5c99521d5b9d0e881c185d5cd95960621b604082015260600190565b6000826115fa57634e487b7160e01b600052601260045260246000fd5b500490565b8082018082111561103257634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fdfe31ee9d1c9d3111fbd70a8cefbec63f11d7ebb1783e6a7d8ca82409e345094ff5a2646970667358221220233f78717ff06e435081e5a87248d52bf154e7e09f6da767acf0a22cafd0dfa464736f6c63430008170033", - "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." - }, - "updateDuation(uint256)": { - "details": "Change duration value" - }, - "updateVerifier(address)": { - "details": "update verifier address" - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 7, - "contract": "contracts/activity/TreasureHunt.sol:TreasureHunt", - "label": "_owner", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 2394, - "contract": "contracts/activity/TreasureHunt.sol:TreasureHunt", - "label": "_usedSignatures", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes_memory_ptr,t_bool)" - }, - { - "astId": 123, - "contract": "contracts/activity/TreasureHunt.sol:TreasureHunt", - "label": "_status", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 2466, - "contract": "contracts/activity/TreasureHunt.sol:TreasureHunt", - "label": "duration", - "offset": 0, - "slot": "3", - "type": "t_uint256" - }, - { - "astId": 2468, - "contract": "contracts/activity/TreasureHunt.sol:TreasureHunt", - "label": "minDuration", - "offset": 0, - "slot": "4", - "type": "t_uint256" - }, - { - "astId": 1869, - "contract": "contracts/activity/TreasureHunt.sol:TreasureHunt", - "label": "checkinHistory", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" - }, - { - "astId": 1875, - "contract": "contracts/activity/TreasureHunt.sol:TreasureHunt", - "label": "exploreHistory", - "offset": 0, - "slot": "6", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" - }, - { - "astId": 1881, - "contract": "contracts/activity/TreasureHunt.sol:TreasureHunt", - "label": "enhanceHistory", - "offset": 0, - "slot": "7", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" - }, - { - "astId": 1887, - "contract": "contracts/activity/TreasureHunt.sol:TreasureHunt", - "label": "claimTaskHistory", - "offset": 0, - "slot": "8", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" - }, - { - "astId": 1893, - "contract": "contracts/activity/TreasureHunt.sol:TreasureHunt", - "label": "openBoxHistory", - "offset": 0, - "slot": "9", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" - }, - { - "astId": 1899, - "contract": "contracts/activity/TreasureHunt.sol:TreasureHunt", - "label": "verifier", - "offset": 0, - "slot": "10", - "type": "t_address" - }, - { - "astId": 1902, - "contract": "contracts/activity/TreasureHunt.sol:TreasureHunt", - "label": "isPaused", - "offset": 20, - "slot": "10", - "type": "t_bool" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes_memory_ptr": { - "encoding": "bytes", - "label": "bytes", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_mapping(t_uint256,t_uint256))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(uint256 => uint256))", - "numberOfBytes": "32", - "value": "t_mapping(t_uint256,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_uint256)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => 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/solcInputs/5bb31bf450538abe4300b257a34b7688.json b/deployments/imtbl_test/solcInputs/83285a095786820eb6eda6277c7f120a.json similarity index 80% rename from deployments/imtbl_test/solcInputs/5bb31bf450538abe4300b257a34b7688.json rename to deployments/imtbl_test/solcInputs/83285a095786820eb6eda6277c7f120a.json index 2923f7e..9170564 100644 --- a/deployments/imtbl_test/solcInputs/5bb31bf450538abe4300b257a34b7688.json +++ b/deployments/imtbl_test/solcInputs/83285a095786820eb6eda6277c7f120a.json @@ -7,6 +7,9 @@ "@openzeppelin/contracts/security/ReentrancyGuard.sol": { "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Contract module that helps prevent reentrant calls to a function.\n *\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\n * available, which can be applied to functions to make sure there are no nested\n * (reentrant) calls to them.\n *\n * Note that because there is a single `nonReentrant` guard, functions marked as\n * `nonReentrant` may not call one another. This can be worked around by making\n * those functions `private`, and then adding `external` `nonReentrant` entry\n * points to them.\n *\n * TIP: If you would like to learn more about reentrancy and alternative ways\n * to protect against it, check out our blog post\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\n */\nabstract contract ReentrancyGuard {\n // Booleans are more expensive than uint256 or any type that takes up a full\n // word because each write operation emits an extra SLOAD to first read the\n // slot's contents, replace the bits taken up by the boolean, and then write\n // back. This is the compiler's defense against contract upgrades and\n // pointer aliasing, and it cannot be disabled.\n\n // The values being non-zero value makes deployment a bit more expensive,\n // but in exchange the refund on every call to nonReentrant will be lower in\n // amount. Since refunds are capped to a percentage of the total\n // transaction's gas, it is best to keep them low in cases like this one, to\n // increase the likelihood of the full refund coming into effect.\n uint256 private constant _NOT_ENTERED = 1;\n uint256 private constant _ENTERED = 2;\n\n uint256 private _status;\n\n constructor() {\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Prevents a contract from calling itself, directly or indirectly.\n * Calling a `nonReentrant` function from another `nonReentrant`\n * function is not supported. It is possible to prevent this from happening\n * by making the `nonReentrant` function external, and making it call a\n * `private` function that does the actual work.\n */\n modifier nonReentrant() {\n _nonReentrantBefore();\n _;\n _nonReentrantAfter();\n }\n\n function _nonReentrantBefore() private {\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\n require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n // Any calls to nonReentrant after this point will fail\n _status = _ENTERED;\n }\n\n function _nonReentrantAfter() private {\n // By storing the original value once again, a refund is triggered (see\n // https://eips.ethereum.org/EIPS/eip-2200)\n _status = _NOT_ENTERED;\n }\n\n /**\n * @dev Returns true if the reentrancy guard is currently set to \"entered\", which indicates there is a\n * `nonReentrant` function in the call stack.\n */\n function _reentrancyGuardEntered() internal view returns (bool) {\n return _status == _ENTERED;\n }\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/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" }, @@ -22,17 +25,11 @@ "@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" }, - "contracts/activity/TreasureHunt.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\nimport \"@openzeppelin/contracts/security/ReentrancyGuard.sol\";\nimport \"../core/HasSignature.sol\";\nimport \"../utils/TimeChecker.sol\";\n\n\ncontract TreasureHunt is HasSignature, ReentrancyGuard, TimeChecker{\n mapping(address => mapping(uint256 => uint256)) public checkinHistory;\n mapping(address => mapping(uint256 => uint256)) public exploreHistory;\n mapping(address => mapping(uint256 => uint256)) public enhanceHistory;\n mapping(address => mapping(uint256 => uint256)) public claimTaskHistory;\n mapping(address => mapping(uint256 => uint256)) public openBoxHistory;\n uint256 private immutable _CACHED_CHAIN_ID;\n address private immutable _CACHED_THIS;\n address private verifier;\n\n bool public isPaused = false;\n\n event ActionEvent(\n address indexed user,\n uint256 indexed action,\n uint256 value\n );\n\n event StateUpdated(bool isPaused);\n event VerifierUpdated(address indexed verifier);\n\n constructor() {\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_THIS = address(this);\n }\n\n modifier whenNotPaused() {\n require(!isPaused, \"TreasureHunt: paused\");\n _;\n }\n\n function updatePaused(bool _isPaused) external onlyOwner {\n isPaused = _isPaused;\n emit StateUpdated(_isPaused);\n }\n\n /**\n * @dev update verifier address\n */\n function updateVerifier(address _verifier) external onlyOwner {\n require(_verifier != address(0), \"TreasureHunt: address can not be zero\");\n verifier = _verifier;\n emit VerifierUpdated(_verifier);\n }\n \n // daily checkin\n function dailyCheckin() external whenNotPaused {\n address user = _msgSender();\n uint256 day = block.timestamp / 1 days;\n require(checkinHistory[user][day] == 0, \"TreasureHunt: already checked in\");\n checkinHistory[user][day] = 1;\n emit ActionEvent(user, 1, day);\n }\n\n // explore\n function explore(\n uint256 step\n ) external whenNotPaused {\n address user = _msgSender();\n exploreHistory[user][step] = 1;\n emit ActionEvent(user, 2, step);\n } \n\n // enhance box\n function enhanceBox(\n uint256 boxId\n ) external whenNotPaused {\n address user = _msgSender();\n require(enhanceHistory[user][boxId] == 0, \"TreasureHunt: already enhanced\");\n enhanceHistory[user][boxId] = 1;\n emit ActionEvent(user, 3, boxId);\n } \n\n // open box\n function openBox(\n uint256 boxId\n ) external whenNotPaused {\n address user = _msgSender();\n require(openBoxHistory[user][boxId] == 0, \"TreasureHunt: already opened\");\n openBoxHistory[user][boxId] = 1;\n emit ActionEvent(user, 4, boxId);\n }\n\n // claim task reward\n function claimTaskReward(\n uint256 taskId\n ) external whenNotPaused{\n address user = _msgSender();\n require(claimTaskHistory[user][taskId] == 0, \"TreasureHunt: already claimed\");\n claimTaskHistory[user][taskId] = 1;\n emit ActionEvent(user, 5, taskId);\n } \n\n function generalAction(\n uint256 actionType,\n uint256 val,\n uint256 signTime,\n uint256 saltNonce,\n bytes calldata signature\n ) external nonReentrant whenNotPaused timeValid(signTime){\n address user = _msgSender();\n bytes32 criteriaMessageHash = getMessageHash(\n user,\n actionType,\n val,\n _CACHED_THIS,\n _CACHED_CHAIN_ID,\n signTime,\n saltNonce\n );\n checkSigner(verifier, criteriaMessageHash, signature);\n if (actionType == 1) {\n require(checkinHistory[user][val] == 0, \"TreasureHunt: already checked in\");\n checkinHistory[user][val] = 1;\n } else if (actionType == 2) {\n require(exploreHistory[user][val] == 0, \"TreasureHunt: already explored\");\n exploreHistory[user][val] = 1;\n } else if (actionType == 3) {\n require(enhanceHistory[user][val] == 0, \"TreasureHunt: already enhanced\");\n enhanceHistory[user][val] = 1;\n } else if (actionType == 4) {\n require(openBoxHistory[user][val] == 0, \"TreasureHunt: already opened\");\n openBoxHistory[user][val] = 1;\n } else if (actionType == 5) {\n require(claimTaskHistory[user][val] == 0, \"TreasureHunt: already claimed\");\n claimTaskHistory[user][val] = 1;\n } else {\n revert(\"TreasureHunt: invalid action type\");\n }\n emit ActionEvent(user, actionType, val);\n }\n\n function getMessageHash(\n address _user,\n uint256 _type,\n uint256 _val,\n address _contract,\n uint256 _chainId,\n uint256 _signTime,\n uint256 _saltNonce\n ) public pure returns (bytes32) {\n bytes memory encoded = abi.encodePacked(\n _user,\n _type,\n _val,\n _contract,\n _chainId,\n _signTime,\n _saltNonce\n );\n return keccak256(encoded);\n }\n}\n" + "contracts/activity/NFTClaimStage2.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.19;\n\nimport {ReentrancyGuard} from \"@openzeppelin/contracts/security/ReentrancyGuard.sol\";\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport {HasSignature} from \"../core/HasSignature.sol\";\n\n/**\n * Contract for the activity of NFT claim stage 2.\n */\ninterface IClaimAbleNFT {\n function safeMint(address to, uint256 tokenID) external;\n}\n\ncontract NFTClaimStage2 is HasSignature, ReentrancyGuard {\n struct MintConfig {\n uint256 parse1MaxSupply; // max supply for phase1\n uint256 maxSupply; // max supply for phase2\n address currency; // token address which user must pay to mint\n uint256 mintPrice; // in wei\n address feeToAddress; // wallet address to receive mint fee\n }\n // parse: 0: not open or end, 1: phase1, 2: phase2\n uint256 public mintParse = 0;\n\n uint256 public immutable _CACHED_CHAIN_ID;\n address public immutable _CACHED_THIS;\n address public immutable nftAddress;\n\n address public verifier;\n MintConfig public mintConfig;\n uint256 public parse1Count;\n uint256 public totalCount;\n\n event NFTClaimed(address indexed nftAddress, address indexed to, uint256[] ids);\n\n event ParseUpdated(uint256 _parse);\n event MintConfigUpdated(MintConfig config);\n event VerifierUpdated(address indexed verifier);\n\n constructor(address _nftAddress, address _verifier, MintConfig memory _mintConfig) {\n _CACHED_CHAIN_ID = block.chainid;\n _CACHED_THIS = address(this);\n nftAddress = _nftAddress;\n verifier = _verifier;\n mintConfig = _mintConfig;\n }\n\n modifier whenNotPaused() {\n require(mintParse > 0, \"NFTClaimer: not begin or ended\");\n _;\n }\n\n function updateMintParse(uint256 _mintParse) external onlyOwner {\n mintParse = _mintParse;\n emit ParseUpdated(_mintParse);\n }\n\n function updateMintConfig(MintConfig calldata config) external onlyOwner {\n mintConfig = config;\n emit MintConfigUpdated(config);\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 /**\n * @dev claim NFT\n * Get whitelist signature from a third-party service, then call this method to claim NFT\n * @param saltNonce nonce\n * @param signature signature\n */\n function claim(\n uint256[] memory ids,\n uint256 tokenAmount,\n uint256 saltNonce,\n bytes calldata signature\n ) external nonReentrant whenNotPaused {\n // get current parse;\n uint256 count = ids.length;\n require(count > 0, \"NFTClaimer: ids length must be greater than 0\");\n if (mintParse == 1) {\n require(count <= mintConfig.parse1MaxSupply - parse1Count, \"NFTClaimer: exceed parse 1 max supply\");\n } else {\n require(count <= mintConfig.maxSupply - totalCount, \"NFTClaimer: exceed max supply\");\n }\n require(tokenAmount >= mintConfig.mintPrice * count, \"NFTClaimer: insufficient token amount\");\n address to = _msgSender();\n bytes32 criteriaMessageHash = getMessageHash(to, nftAddress, ids, tokenAmount, _CACHED_THIS, _CACHED_CHAIN_ID, saltNonce);\n checkSigner(verifier, criteriaMessageHash, signature);\n IERC20(mintConfig.currency).transferFrom(to, mintConfig.feeToAddress, tokenAmount);\n for (uint256 i = 0; i < count; ++i) {\n IClaimAbleNFT(nftAddress).safeMint(to, ids[i]);\n }\n // require(count > 2, \"run to here\");\n totalCount += count;\n if (mintParse == 1) {\n parse1Count += count;\n }\n _useSignature(signature);\n emit NFTClaimed(nftAddress, to, ids);\n }\n\n function getMessageHash(\n address _to,\n address _address,\n uint256[] memory _ids,\n uint256 _tokenAmount,\n address _contract,\n uint256 _chainId,\n uint256 _saltNonce\n ) public pure returns (bytes32) {\n bytes memory encoded = abi.encodePacked(_to, _address, _tokenAmount, _contract, _chainId, _saltNonce);\n for (uint256 i = 0; i < _ids.length; ++i) {\n encoded = bytes.concat(encoded, abi.encodePacked(_ids[i]));\n }\n return keccak256(encoded);\n }\n}\n" }, "contracts/core/HasSignature.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\n\ncontract HasSignature is Ownable {\n mapping(bytes => bool) 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, \"[BE] invalid signature\");\n }\n\n modifier signatureValid(bytes calldata signature) {\n require(\n !_usedSignatures[signature],\n \"[BE] 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/Lock.sol": { - "content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity 0.8.23;\n\n// Uncomment this line to use console.log\n// import \"hardhat/console.sol\";\n\ncontract Lock {\n uint public unlockTime;\n address payable public owner;\n\n event Withdrawal(uint amount, uint when);\n\n constructor(uint _unlockTime) payable {\n require(\n block.timestamp < _unlockTime,\n \"Unlock time should be in the future\"\n );\n\n unlockTime = _unlockTime;\n owner = payable(msg.sender);\n }\n\n function withdraw() public {\n // Uncomment this line, and the import of \"hardhat/console.sol\", to print a log in your terminal\n // console.log(\"Unlock time is %o and block timestamp is %o\", unlockTime, block.timestamp);\n\n require(block.timestamp >= unlockTime, \"You can't withdraw yet\");\n require(msg.sender == owner, \"You aren't the owner\");\n\n emit Withdrawal(address(this).balance, block.timestamp);\n\n owner.transfer(address(this).balance);\n }\n}\n" - }, - "contracts/utils/TimeChecker.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.23;\nimport \"@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() {\n duration = 1 days;\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" + "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" } }, "settings": { @@ -40,7 +37,7 @@ "enabled": true, "runs": 200 }, - "evmVersion": "paris", + "viaIR": true, "outputSelection": { "*": { "*": [ diff --git a/hardhat.config.ts b/hardhat.config.ts index 0a69278..248a155 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -8,15 +8,6 @@ dotenv.config(); const config: HardhatUserConfig = { solidity: { compilers: [ - { - version: "0.8.23", - settings: { - optimizer: { - enabled: true, - runs: 200, - }, - }, - }, { version: "0.8.19", settings: { @@ -24,6 +15,7 @@ const config: HardhatUserConfig = { enabled: true, runs: 200, }, + viaIR: true, }, }, { diff --git a/out/imtbl_test_dev.json b/out/imtbl_test_dev.json new file mode 100644 index 0000000..0360031 --- /dev/null +++ b/out/imtbl_test_dev.json @@ -0,0 +1,20 @@ +[ + { + "name": "CFHero", + "type": "erc721", + "json": "assets/contracts/CFNFTGame.json", + "address": "0xaa34B79A0Ab433eaC900fB3CB9f191F5Cd27501D" + }, + { + "name": "TestToken", + "type": "erc20", + "json": "assets/contracts/ImmutableERC20MinterBurnerPermit.json", + "address": "0xFd42bfb03212dA7e1A4608a44d7658641D99CF34" + }, + { + "name": "NFTClaimStage2", + "type": "logic", + "json": "assets/contracts/NFTClaimStage2.json", + "address": "0xf45702180314187a3549FEDac3B78349b47ca6A0" + } +] \ No newline at end of file diff --git a/package.json b/package.json index 833371c..1d439be 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,12 @@ "main": "index.js", "scripts": { "test": "hardhat test", - "compile": "hardhat compile", + "compile": "hardhat compile --show-stack-traces", "clean": "hardhat clean", "deploy": "hardhat deploy --network imtbl_test", "deploy:nftclaim": "hardhat deploy --tags NFTClaimStage2 --network imtbl_test --reset", + "deploy:nft": "hardhat deploy --tags CFNFTGame --network imtbl_test --reset", + "deploy:testtoken": "hardhat deploy --tags TestToken --network imtbl_test --reset", "solhint": "solhint --config ./.solhint.json" }, "author": "", @@ -34,6 +36,7 @@ "chai": "^4.2.0", "dotenv": "^16.4.5", "ethers": "^6.12.1", + "fs-jetpack": "^5.1.0", "hardhat": "^2.22.4", "hardhat-deploy": "^0.12.4", "hardhat-deploy-ethers": "^0.4.2", diff --git a/scripts/utils.ts b/scripts/utils.ts new file mode 100644 index 0000000..0fa1fe0 --- /dev/null +++ b/scripts/utils.ts @@ -0,0 +1,29 @@ + +import { read, write } from "fs-jetpack"; + +export const updateArray = ({ name, type, json, address, network }: { name: string, type: string, json: string, address: string, network: string }) => { + let env = process.env.NODE_ENV || "dev"; + const filename = `./out/${network}_${env}.json`; + let cfgs = read(filename, "json"); + cfgs = cfgs || []; + if (cfgs.find((item: any) => item.name === name)) { + cfgs.splice( + cfgs.findIndex((item: any) => item.name === name), + 1, + ); + } + cfgs.push({ + name, + type, + json, + address, + }); + write(filename, cfgs); + return cfgs; +}; + +export const loadData = function ({ network }: { network: string }) { + let env = process.env.NODE_ENV || "dev"; + const filename = `./out/${network}_${env}.json`; + return read(filename, "json"); +}; diff --git a/test/testNFTClaim.ts b/test/testNFTClaim.ts new file mode 100644 index 0000000..ec049bf --- /dev/null +++ b/test/testNFTClaim.ts @@ -0,0 +1,260 @@ +import { expect } from 'chai' +import hre from "hardhat"; +import { + getBytes, + solidityPackedKeccak256, +} from 'ethers' +import { + loadFixture, +} from "@nomicfoundation/hardhat-toolbox/network-helpers"; + +describe('NFTClaimStage2', function() { + async function deployOneContract() { + // Contracts are deployed using the first signer/account by default + const [owner, otherAccount] = await hre.ethers.getSigners(); + const verifier = owner.address; + const OperatorAllowlist = await hre.ethers.getContractFactory("OperatorAllowlist"); + const operatorAllowlist = await OperatorAllowlist.deploy(owner.address); + const CFFT = await hre.ethers.getContractFactory("ImmutableERC20MinterBurnerPermit"); + const ft = await CFFT.deploy(owner.address, owner.address, owner.address, "test usdc", "usdc", '100000000000000000000000000'); + await ft.grantMinterRole(owner.address); + await ft.mint(otherAccount.address, '1000'); + const CFNFTGame = await hre.ethers.getContractFactory("CFNFTGame"); + const nft = await CFNFTGame.deploy(owner.address, 'name', 'symbol', 'baseURI', 'contractURI', operatorAllowlist.target, owner.address, 5); + const nftAddress = nft.target; + const NFTClaimStage2 = await hre.ethers.getContractFactory("NFTClaimStage2"); + const mintConfig = [ + 1000, + 2000, + ft.target, + 100, + owner.address + ] + const nftClaimer = await NFTClaimStage2.deploy( nftAddress, verifier, mintConfig); + await nft.grantMinterRole(nftClaimer.target) + const chainId = hre.network.config.chainId + return { nftClaimer, owner, otherAccount, verifier, nftAddress, ft, nft, chainId }; + } + describe("Deployment", function () { + it('should deploy NFTClaimStage2', async function() { + const { nftClaimer } = await loadFixture(deployOneContract); + expect((await nftClaimer.mintConfig()).mintPrice).to.equal(100); + }); + it('should deploy NFTClaimStage2 with the correct verifier', async function() { + const { nftClaimer, verifier } = await loadFixture(deployOneContract); + expect(await nftClaimer.verifier()).to.equal(verifier); + }); + it('should deploy NFTClaimStage2 with the correct NFT address', async function() { + const { nftClaimer, nftAddress } = await loadFixture(deployOneContract); + expect(await nftClaimer.nftAddress()).to.equal(nftAddress); + }); + }) + + describe("update settings", function () { + it('should update mintConfig', async function() { + const { nftClaimer } = await loadFixture(deployOneContract); + const mintConfig = [ + 1000, + 2000, + '0xaa34B79A0Ab433eaC900fB3CB9f191F5Cd27501D', + 200, + '0x5Ab03Aa79Ab91B7420b5CFF134a4188388888888' + ] + await nftClaimer.updateMintConfig(mintConfig); + expect((await nftClaimer.mintConfig()).mintPrice).to.equal(200); + }); + it('should update verifier', async function() { + const { nftClaimer, otherAccount } = await loadFixture(deployOneContract); + await nftClaimer.updateVerifier(otherAccount.address); + expect(await nftClaimer.verifier()).to.equal(otherAccount.address); + }); + it('should update parse', async function() { + const { nftClaimer } = await loadFixture(deployOneContract); + await nftClaimer.updateMintParse(1); + expect(await nftClaimer.mintParse()).to.equal(1); + }); + }); + describe("claim", function () { + it('should claim NFT', async function() { + const { nftClaimer, owner, otherAccount, ft, nft, chainId } = await loadFixture(deployOneContract); + await nftClaimer.updateMintParse(1); + const price = 100 + //use ft.connect() to send a transaction from another account + // @ts-ignore + await ft.connect(otherAccount).approve(nftClaimer.target, price) + const nonce = (Math.random() * 1000) | 0; + const ids = ['1002'] + let localMsgHash = solidityPackedKeccak256(["address", "address", "uint256", "address", "uint256", "uint256", ...ids.map(() => "uint256")], + [otherAccount.address, nft.target, price, nftClaimer.target, chainId, nonce, ...ids]); + + const contractMsgHash = await nftClaimer.getMessageHash( + otherAccount.address, nft.target, ids, price, nftClaimer.target, chainId, nonce + ) + expect(localMsgHash).equal(contractMsgHash); + + expect(await nftClaimer.verifier()).equal(owner.address); + expect(await nftClaimer.nftAddress()).equal(nft.target); + const signature = await owner.signMessage(getBytes(contractMsgHash)); + // @ts-ignore + await nftClaimer.connect(otherAccount).claim(ids, price, nonce, signature); + expect(await nft.balanceOf(otherAccount.address)).to.equal(1); + expect(await nftClaimer.totalCount()).to.equal(1); + }); + it('should claim NFTS', async function() { + const { nftClaimer, owner, otherAccount, ft, nft, chainId } = await loadFixture(deployOneContract); + await nftClaimer.updateMintParse(1); + const price = 100 + const ids = ['1002', '1003', '1004'] + const tokenAmount = price * ids.length + // @ts-ignore + await ft.connect(otherAccount).approve(nftClaimer.target, tokenAmount) + const nonce = (Math.random() * 1000) | 0; + let localMsgHash = solidityPackedKeccak256(["address", "address", "uint256", "address", "uint256", "uint256", ...ids.map(() => "uint256")], + [otherAccount.address, nft.target, tokenAmount, nftClaimer.target, chainId, nonce, ...ids]); + const signature = await owner.signMessage(getBytes(localMsgHash)); + // @ts-ignore + await nftClaimer.connect(otherAccount).claim(ids, tokenAmount, nonce, signature); + expect(await nft.balanceOf(otherAccount.address)).to.equal(ids.length); + expect(await ft.balanceOf(owner.address)).to.equal(tokenAmount) + }); + it('should revert claim NFT if the signature error', async function() { + const { nftClaimer, owner, otherAccount, ft, nft, chainId } = await loadFixture(deployOneContract); + await nftClaimer.updateMintParse(1); + const price = 100 + // @ts-ignore + await ft.connect(otherAccount).approve(nftClaimer.target, price) + const nonce = (Math.random() * 1000) | 0; + const ids = ['1002'] + let localMsgHash = solidityPackedKeccak256(["address", "address", "uint256", "address", "uint256", "uint256", ...ids.map(() => "uint256")], + [otherAccount.address, nft.target, price, nftClaimer.target, chainId, nonce, ...ids]); + const signature = await owner.signMessage(getBytes(localMsgHash)); + const nonce2 = (Math.random() * 1000) | 0; + // @ts-ignore + await expect(nftClaimer.connect(otherAccount).claim(ids, price, nonce2, signature)).to.be.revertedWith( + "invalid signature" + ); + }); + it('should revert claim NFT if the balance not enough', async function() { + const { nftClaimer, owner, otherAccount, ft, nft, chainId } = await loadFixture(deployOneContract); + await nftClaimer.updateMintParse(1); + const price = 1001 + const mintConfig = [ + 1000, + 2000, + ft.target, + price, + owner.address + ] + await nftClaimer.updateMintConfig(mintConfig); + // @ts-ignore + await ft.connect(otherAccount).approve(nftClaimer.target, price) + const nonce = (Math.random() * 1000) | 0; + const ids = ['1002'] + let localMsgHash = solidityPackedKeccak256(["address", "address", "uint256", "address", "uint256", "uint256", ...ids.map(() => "uint256")], + [otherAccount.address, nft.target, price, nftClaimer.target, chainId, nonce, ...ids]); + const signature = await owner.signMessage(getBytes(localMsgHash)); + // @ts-ignore + await expect(nftClaimer.connect(otherAccount).claim(ids, price, nonce, signature)).to.be.revertedWith( + "ERC20: transfer amount exceeds balance" + ); + }); + it('should revert claim NFT if allowance not enough', async function() { + const { nftClaimer, owner, otherAccount, ft, nft, chainId } = await loadFixture(deployOneContract); + await nftClaimer.updateMintParse(1); + const price = 100 + // @ts-ignore + await ft.connect(otherAccount).approve(nftClaimer.target, price - 1) + const nonce = (Math.random() * 1000) | 0; + const ids = ['1002'] + let localMsgHash = solidityPackedKeccak256(["address", "address", "uint256", "address", "uint256", "uint256", ...ids.map(() => "uint256")], + [otherAccount.address, nft.target, price, nftClaimer.target, chainId, nonce, ...ids]); + const signature = await owner.signMessage(getBytes(localMsgHash)); + // @ts-ignore + await expect(nftClaimer.connect(otherAccount).claim(ids, price, nonce, signature)).to.be.revertedWith( + "ERC20: insufficient allowance" + ); + }); + it('should revert claim NFT if the price not correct', async function() { + const { nftClaimer, owner, otherAccount, ft, nft, chainId } = await loadFixture(deployOneContract); + await nftClaimer.updateMintParse(1); + const price = 99 + // @ts-ignore + await ft.connect(otherAccount).approve(nftClaimer.target, price) + const nonce = (Math.random() * 1000) | 0; + const ids = ['1002'] + let localMsgHash = solidityPackedKeccak256(["address", "address", "uint256", "address", "uint256", "uint256", ...ids.map(() => "uint256")], + [otherAccount.address, nft.target, price, nftClaimer.target, chainId, nonce, ...ids]); + const signature = await owner.signMessage(getBytes(localMsgHash)); + // @ts-ignore + await expect(nftClaimer.connect(otherAccount).claim(ids, price, nonce, signature)).to.be.revertedWith( + "NFTClaimer: insufficient token amount" + ); + }); + it('should revert claim NFT if the activity not open', async function() { + const { nftClaimer, owner, otherAccount, ft, nft, chainId } = await loadFixture(deployOneContract); + await nftClaimer.updateMintParse(0); + const price = 100 + // @ts-ignore + await ft.connect(otherAccount).approve(nftClaimer.target, price) + const nonce = (Math.random() * 1000) | 0; + const ids = ['1002'] + let localMsgHash = solidityPackedKeccak256(["address", "address", "uint256", "address", "uint256", "uint256", ...ids.map(() => "uint256")], + [otherAccount.address, nft.target, price, nftClaimer.target, chainId, nonce, ...ids]); + const signature = await owner.signMessage(getBytes(localMsgHash)); + // @ts-ignore + await expect(nftClaimer.connect(otherAccount).claim(ids, price, nonce, signature)).to.be.revertedWith( + "NFTClaimer: not begin or ended" + ); + }); + it('should revert claim NFT if the exceed parse1 max num', async function() { + const { nftClaimer, owner, otherAccount, ft, nft, chainId } = await loadFixture(deployOneContract); + await nftClaimer.updateMintParse(1); + const price = 100 + const mintConfig = [ + 1, + 2000, + ft.target, + price, + owner.address + ] + await nftClaimer.updateMintConfig(mintConfig); + const ids = ['1002', '1003'] + // @ts-ignore + await ft.connect(otherAccount).approve(nftClaimer.target, price * ids.length) + const nonce = (Math.random() * 1000) | 0; + + let localMsgHash = solidityPackedKeccak256(["address", "address", "uint256", "address", "uint256", "uint256", ...ids.map(() => "uint256")], + [otherAccount.address, nft.target, price * ids.length, nftClaimer.target, chainId, nonce, ...ids]); + const signature = await owner.signMessage(getBytes(localMsgHash)); + // @ts-ignore + await expect(nftClaimer.connect(otherAccount).claim(ids, price, nonce, signature)).to.be.revertedWith( + "NFTClaimer: exceed parse 1 max supply" + ); + }); + it('should revert claim NFT if the exceed total num', async function() { + const { nftClaimer, owner, otherAccount, ft, nft, chainId } = await loadFixture(deployOneContract); + await nftClaimer.updateMintParse(2); + const price = 100 + const mintConfig = [ + 1000, + 1, + ft.target, + price, + owner.address + ] + await nftClaimer.updateMintConfig(mintConfig); + const ids = ['1002', '1003'] + // @ts-ignore + await ft.connect(otherAccount).approve(nftClaimer.target, price * ids.length) + const nonce = (Math.random() * 1000) | 0; + + let localMsgHash = solidityPackedKeccak256(["address", "address", "uint256", "address", "uint256", "uint256", ...ids.map(() => "uint256")], + [otherAccount.address, nft.target, price * ids.length, nftClaimer.target, chainId, nonce, ...ids]); + const signature = await owner.signMessage(getBytes(localMsgHash)); + // @ts-ignore + await expect(nftClaimer.connect(otherAccount).claim(ids, price, nonce, signature)).to.be.revertedWith( + "NFTClaimer: exceed max supply" + ); + }); + }); +}) \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 01aa5ed..7c0c207 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2420,6 +2420,13 @@ fs-extra@^9.1.0: jsonfile "^6.0.1" universalify "^2.0.0" +fs-jetpack@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/fs-jetpack/-/fs-jetpack-5.1.0.tgz#dcd34d709b69007c9dc2420a6f2b9e8f986cff0d" + integrity sha512-Xn4fDhLydXkuzepZVsr02jakLlmoARPy+YWIclo4kh0GyNGUHnTqeH/w/qIsVn50dFxtp8otPL2t/HcPJBbxUA== + dependencies: + minimatch "^5.1.0" + fs-readdir-recursive@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" @@ -3228,7 +3235,7 @@ minimatch@5.0.1: dependencies: brace-expansion "^2.0.1" -minimatch@^5.0.1: +minimatch@^5.0.1, minimatch@^5.1.0: version "5.1.6" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==